Hi, do not use x^2 but instead, use x**2, in Ruby the ^ operator is a binary xor. See the operator list for Ruby...
Ruby - Operators
Ruby - Operators - Ruby supports a rich set of operators, as you'd expect from a modern language. Most operators are actually method calls. For example, a + b is interpreted as a.+(b), where the + method in the object referred to by variable a is called with b as its argument.
(www.tutorialspoint.com)
Try this formula...
((x-y)**2)/20