Average Error: 31.4 → 12.7
Time: 10.0s
Precision: binary64
Cost: 7440
\[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
\[\begin{array}{l} t_0 := \frac{x \cdot x + y \cdot \left(y \cdot -4\right)}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\ t_1 := x \cdot \left(\frac{x}{y} \cdot \frac{0.5}{y}\right) + -1\\ \mathbf{if}\;y \leq -2.4436323698919533 \cdot 10^{+147}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.6867040915893832 \cdot 10^{+100}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq -6.7933713157284745 \cdot 10^{-109}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 2.5810994404034106 \cdot 10^{-80}:\\ \;\;\;\;1 + -8 \cdot {\left(\frac{x}{y}\right)}^{-2}\\ \mathbf{elif}\;y \leq 5.433502616953344 \cdot 10^{+91}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
(FPCore (x y)
 :precision binary64
 (/ (- (* x x) (* (* y 4.0) y)) (+ (* x x) (* (* y 4.0) y))))
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ (+ (* x x) (* y (* y -4.0))) (+ (* x x) (* y (* y 4.0)))))
        (t_1 (+ (* x (* (/ x y) (/ 0.5 y))) -1.0)))
   (if (<= y -2.4436323698919533e+147)
     t_1
     (if (<= y -1.6867040915893832e+100)
       1.0
       (if (<= y -6.7933713157284745e-109)
         t_0
         (if (<= y 2.5810994404034106e-80)
           (+ 1.0 (* -8.0 (pow (/ x y) -2.0)))
           (if (<= y 5.433502616953344e+91) t_0 t_1)))))))
double code(double x, double y) {
	return ((x * x) - ((y * 4.0) * y)) / ((x * x) + ((y * 4.0) * y));
}
double code(double x, double y) {
	double t_0 = ((x * x) + (y * (y * -4.0))) / ((x * x) + (y * (y * 4.0)));
	double t_1 = (x * ((x / y) * (0.5 / y))) + -1.0;
	double tmp;
	if (y <= -2.4436323698919533e+147) {
		tmp = t_1;
	} else if (y <= -1.6867040915893832e+100) {
		tmp = 1.0;
	} else if (y <= -6.7933713157284745e-109) {
		tmp = t_0;
	} else if (y <= 2.5810994404034106e-80) {
		tmp = 1.0 + (-8.0 * pow((x / y), -2.0));
	} else if (y <= 5.433502616953344e+91) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((x * x) - ((y * 4.0d0) * y)) / ((x * x) + ((y * 4.0d0) * y))
end function
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = ((x * x) + (y * (y * (-4.0d0)))) / ((x * x) + (y * (y * 4.0d0)))
    t_1 = (x * ((x / y) * (0.5d0 / y))) + (-1.0d0)
    if (y <= (-2.4436323698919533d+147)) then
        tmp = t_1
    else if (y <= (-1.6867040915893832d+100)) then
        tmp = 1.0d0
    else if (y <= (-6.7933713157284745d-109)) then
        tmp = t_0
    else if (y <= 2.5810994404034106d-80) then
        tmp = 1.0d0 + ((-8.0d0) * ((x / y) ** (-2.0d0)))
    else if (y <= 5.433502616953344d+91) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y) {
	return ((x * x) - ((y * 4.0) * y)) / ((x * x) + ((y * 4.0) * y));
}
public static double code(double x, double y) {
	double t_0 = ((x * x) + (y * (y * -4.0))) / ((x * x) + (y * (y * 4.0)));
	double t_1 = (x * ((x / y) * (0.5 / y))) + -1.0;
	double tmp;
	if (y <= -2.4436323698919533e+147) {
		tmp = t_1;
	} else if (y <= -1.6867040915893832e+100) {
		tmp = 1.0;
	} else if (y <= -6.7933713157284745e-109) {
		tmp = t_0;
	} else if (y <= 2.5810994404034106e-80) {
		tmp = 1.0 + (-8.0 * Math.pow((x / y), -2.0));
	} else if (y <= 5.433502616953344e+91) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y):
	return ((x * x) - ((y * 4.0) * y)) / ((x * x) + ((y * 4.0) * y))
def code(x, y):
	t_0 = ((x * x) + (y * (y * -4.0))) / ((x * x) + (y * (y * 4.0)))
	t_1 = (x * ((x / y) * (0.5 / y))) + -1.0
	tmp = 0
	if y <= -2.4436323698919533e+147:
		tmp = t_1
	elif y <= -1.6867040915893832e+100:
		tmp = 1.0
	elif y <= -6.7933713157284745e-109:
		tmp = t_0
	elif y <= 2.5810994404034106e-80:
		tmp = 1.0 + (-8.0 * math.pow((x / y), -2.0))
	elif y <= 5.433502616953344e+91:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y)
	return Float64(Float64(Float64(x * x) - Float64(Float64(y * 4.0) * y)) / Float64(Float64(x * x) + Float64(Float64(y * 4.0) * y)))
end
function code(x, y)
	t_0 = Float64(Float64(Float64(x * x) + Float64(y * Float64(y * -4.0))) / Float64(Float64(x * x) + Float64(y * Float64(y * 4.0))))
	t_1 = Float64(Float64(x * Float64(Float64(x / y) * Float64(0.5 / y))) + -1.0)
	tmp = 0.0
	if (y <= -2.4436323698919533e+147)
		tmp = t_1;
	elseif (y <= -1.6867040915893832e+100)
		tmp = 1.0;
	elseif (y <= -6.7933713157284745e-109)
		tmp = t_0;
	elseif (y <= 2.5810994404034106e-80)
		tmp = Float64(1.0 + Float64(-8.0 * (Float64(x / y) ^ -2.0)));
	elseif (y <= 5.433502616953344e+91)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp = code(x, y)
	tmp = ((x * x) - ((y * 4.0) * y)) / ((x * x) + ((y * 4.0) * y));
end
function tmp_2 = code(x, y)
	t_0 = ((x * x) + (y * (y * -4.0))) / ((x * x) + (y * (y * 4.0)));
	t_1 = (x * ((x / y) * (0.5 / y))) + -1.0;
	tmp = 0.0;
	if (y <= -2.4436323698919533e+147)
		tmp = t_1;
	elseif (y <= -1.6867040915893832e+100)
		tmp = 1.0;
	elseif (y <= -6.7933713157284745e-109)
		tmp = t_0;
	elseif (y <= 2.5810994404034106e-80)
		tmp = 1.0 + (-8.0 * ((x / y) ^ -2.0));
	elseif (y <= 5.433502616953344e+91)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_] := N[(N[(N[(x * x), $MachinePrecision] - N[(N[(y * 4.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / N[(N[(x * x), $MachinePrecision] + N[(N[(y * 4.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := Block[{t$95$0 = N[(N[(N[(x * x), $MachinePrecision] + N[(y * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x * x), $MachinePrecision] + N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * N[(N[(x / y), $MachinePrecision] * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]}, If[LessEqual[y, -2.4436323698919533e+147], t$95$1, If[LessEqual[y, -1.6867040915893832e+100], 1.0, If[LessEqual[y, -6.7933713157284745e-109], t$95$0, If[LessEqual[y, 2.5810994404034106e-80], N[(1.0 + N[(-8.0 * N[Power[N[(x / y), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.433502616953344e+91], t$95$0, t$95$1]]]]]]]
\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}
\begin{array}{l}
t_0 := \frac{x \cdot x + y \cdot \left(y \cdot -4\right)}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\
t_1 := x \cdot \left(\frac{x}{y} \cdot \frac{0.5}{y}\right) + -1\\
\mathbf{if}\;y \leq -2.4436323698919533 \cdot 10^{+147}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -1.6867040915893832 \cdot 10^{+100}:\\
\;\;\;\;1\\

\mathbf{elif}\;y \leq -6.7933713157284745 \cdot 10^{-109}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 2.5810994404034106 \cdot 10^{-80}:\\
\;\;\;\;1 + -8 \cdot {\left(\frac{x}{y}\right)}^{-2}\\

\mathbf{elif}\;y \leq 5.433502616953344 \cdot 10^{+91}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original31.4
Target31.1
Herbie12.7
\[\begin{array}{l} \mathbf{if}\;\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} < 0.9743233849626781:\\ \;\;\;\;\frac{x \cdot x}{x \cdot x + \left(y \cdot y\right) \cdot 4} - \frac{\left(y \cdot y\right) \cdot 4}{x \cdot x + \left(y \cdot y\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{x}{\sqrt{x \cdot x + \left(y \cdot y\right) \cdot 4}}\right)}^{2} - \frac{\left(y \cdot y\right) \cdot 4}{x \cdot x + \left(y \cdot y\right) \cdot 4}\\ \end{array} \]

Derivation

  1. Split input into 4 regimes
  2. if y < -2.4436323698919533e147 or 5.43350261695334392e91 < y

    1. Initial program 55.8

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Taylor expanded in x around 0 16.9

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2}}{{y}^{2}} - 1} \]
    3. Simplified9.9

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{\frac{y}{x}}, \frac{0.5}{y}, -1\right)} \]
      Proof
      (fma.f64 (/.f64 x (/.f64 y x)) (/.f64 1/2 y) -1): 0 points increase in error, 0 points decrease in error
      (fma.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 x x) y)) (/.f64 1/2 y) -1): 34 points increase in error, 13 points decrease in error
      (fma.f64 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 x 2)) y) (/.f64 1/2 y) -1): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 (pow.f64 x 2) y) (/.f64 1/2 y) (Rewrite<= metadata-eval (neg.f64 1))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 (/.f64 (pow.f64 x 2) y) (/.f64 1/2 y)) 1)): 0 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 (pow.f64 x 2) 1/2) (*.f64 y y))) 1): 36 points increase in error, 7 points decrease in error
      (-.f64 (/.f64 (*.f64 (pow.f64 x 2) 1/2) (Rewrite<= unpow2_binary64 (pow.f64 y 2))) 1): 0 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= associate-*l/_binary64 (*.f64 (/.f64 (pow.f64 x 2) (pow.f64 y 2)) 1/2)) 1): 0 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= *-commutative_binary64 (*.f64 1/2 (/.f64 (pow.f64 x 2) (pow.f64 y 2)))) 1): 0 points increase in error, 0 points decrease in error
    4. Applied egg-rr9.7

      \[\leadsto \color{blue}{x \cdot \left(\frac{x}{y} \cdot \frac{0.5}{y}\right) + -1} \]

    if -2.4436323698919533e147 < y < -1.68670409158938323e100

    1. Initial program 16.5

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Taylor expanded in x around inf 44.3

      \[\leadsto \color{blue}{1} \]

    if -1.68670409158938323e100 < y < -6.7933713157284745e-109 or 2.58109944040341064e-80 < y < 5.43350261695334392e91

    1. Initial program 14.7

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]

    if -6.7933713157284745e-109 < y < 2.58109944040341064e-80

    1. Initial program 26.3

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Taylor expanded in x around inf 15.7

      \[\leadsto \color{blue}{\left(1 + -4 \cdot \frac{{y}^{2}}{{x}^{2}}\right) - 4 \cdot \frac{{y}^{2}}{{x}^{2}}} \]
    3. Simplified10.3

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-8}{x}, \frac{y}{\frac{x}{y}}, 1\right)} \]
      Proof
      (fma.f64 (/.f64 -8 x) (/.f64 y (/.f64 x y)) 1): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 -8 x) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y y) x)) 1): 30 points increase in error, 3 points decrease in error
      (fma.f64 (/.f64 -8 x) (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 y 2)) x) 1): 0 points increase in error, 0 points decrease in error
      (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (/.f64 -8 x) (/.f64 (pow.f64 y 2) x)) 1)): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 -8 (pow.f64 y 2)) (*.f64 x x))) 1): 29 points increase in error, 4 points decrease in error
      (+.f64 (/.f64 (*.f64 -8 (pow.f64 y 2)) (Rewrite<= unpow2_binary64 (pow.f64 x 2))) 1): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= associate-*r/_binary64 (*.f64 -8 (/.f64 (pow.f64 y 2) (pow.f64 x 2)))) 1): 0 points increase in error, 0 points decrease in error
      (Rewrite=> +-commutative_binary64 (+.f64 1 (*.f64 -8 (/.f64 (pow.f64 y 2) (pow.f64 x 2))))): 0 points increase in error, 0 points decrease in error
      (+.f64 1 (Rewrite=> *-commutative_binary64 (*.f64 (/.f64 (pow.f64 y 2) (pow.f64 x 2)) -8))): 0 points increase in error, 0 points decrease in error
      (+.f64 1 (*.f64 (/.f64 (pow.f64 y 2) (pow.f64 x 2)) (Rewrite<= metadata-eval (-.f64 -4 4)))): 0 points increase in error, 0 points decrease in error
      (+.f64 1 (Rewrite<= distribute-rgt-out--_binary64 (-.f64 (*.f64 -4 (/.f64 (pow.f64 y 2) (pow.f64 x 2))) (*.f64 4 (/.f64 (pow.f64 y 2) (pow.f64 x 2)))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 1 (*.f64 -4 (/.f64 (pow.f64 y 2) (pow.f64 x 2)))) (*.f64 4 (/.f64 (pow.f64 y 2) (pow.f64 x 2))))): 0 points increase in error, 0 points decrease in error
    4. Applied egg-rr10.3

      \[\leadsto \color{blue}{-8 \cdot {\left(\frac{x}{y}\right)}^{-2} + 1} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification12.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.4436323698919533 \cdot 10^{+147}:\\ \;\;\;\;x \cdot \left(\frac{x}{y} \cdot \frac{0.5}{y}\right) + -1\\ \mathbf{elif}\;y \leq -1.6867040915893832 \cdot 10^{+100}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq -6.7933713157284745 \cdot 10^{-109}:\\ \;\;\;\;\frac{x \cdot x + y \cdot \left(y \cdot -4\right)}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\ \mathbf{elif}\;y \leq 2.5810994404034106 \cdot 10^{-80}:\\ \;\;\;\;1 + -8 \cdot {\left(\frac{x}{y}\right)}^{-2}\\ \mathbf{elif}\;y \leq 5.433502616953344 \cdot 10^{+91}:\\ \;\;\;\;\frac{x \cdot x + y \cdot \left(y \cdot -4\right)}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{x}{y} \cdot \frac{0.5}{y}\right) + -1\\ \end{array} \]

Alternatives

Alternative 1
Error12.7
Cost1876
\[\begin{array}{l} t_0 := \frac{x \cdot x + y \cdot \left(y \cdot -4\right)}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\ t_1 := x \cdot \left(\frac{x}{y} \cdot \frac{0.5}{y}\right) + -1\\ \mathbf{if}\;y \leq -2.4436323698919533 \cdot 10^{+147}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.6867040915893832 \cdot 10^{+100}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq -6.7933713157284745 \cdot 10^{-109}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 2.5810994404034106 \cdot 10^{-80}:\\ \;\;\;\;1 + -8 \cdot \left(-1 + \left(1 + \frac{y}{x} \cdot \frac{y}{x}\right)\right)\\ \mathbf{elif}\;y \leq 5.433502616953344 \cdot 10^{+91}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error16.2
Cost1488
\[\begin{array}{l} t_0 := x \cdot \left(\frac{x}{y} \cdot \frac{0.5}{y}\right) + -1\\ \mathbf{if}\;y \leq -2.4436323698919533 \cdot 10^{+147}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -1.6867040915893832 \cdot 10^{+100}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq -3.2399546771058804 \cdot 10^{-36}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.6898551015484493 \cdot 10^{-21}:\\ \;\;\;\;1 + -8 \cdot \left(-1 + \left(1 + \frac{y}{x} \cdot \frac{y}{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error16.8
Cost1232
\[\begin{array}{l} t_0 := 1 + y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right)\\ \mathbf{if}\;y \leq -2.4436323698919533 \cdot 10^{+147}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq -2.4919007748653635 \cdot 10^{+77}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -3.2399546771058804 \cdot 10^{-36}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq 1.0120801136950827 \cdot 10^{-5}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \]
Alternative 4
Error16.2
Cost1232
\[\begin{array}{l} t_0 := x \cdot \left(\frac{x}{y} \cdot \frac{0.5}{y}\right) + -1\\ \mathbf{if}\;y \leq -2.4436323698919533 \cdot 10^{+147}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -1.6867040915893832 \cdot 10^{+100}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq -3.2399546771058804 \cdot 10^{-36}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.6898551015484493 \cdot 10^{-21}:\\ \;\;\;\;1 + y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error18.0
Cost592
\[\begin{array}{l} \mathbf{if}\;y \leq -6.598343687093046 \cdot 10^{+186}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq -3.4564699090800135 \cdot 10^{+78}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq -3.2399546771058804 \cdot 10^{-36}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq 1.0120801136950827 \cdot 10^{-5}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \]
Alternative 6
Error32.2
Cost64
\[-1 \]

Error

Reproduce

herbie shell --seed 2022313 
(FPCore (x y)
  :name "Diagrams.TwoD.Arc:arcBetween from diagrams-lib-1.3.0.3"
  :precision binary64

  :herbie-target
  (if (< (/ (- (* x x) (* (* y 4.0) y)) (+ (* x x) (* (* y 4.0) y))) 0.9743233849626781) (- (/ (* x x) (+ (* x x) (* (* y y) 4.0))) (/ (* (* y y) 4.0) (+ (* x x) (* (* y y) 4.0)))) (- (pow (/ x (sqrt (+ (* x x) (* (* y y) 4.0)))) 2.0) (/ (* (* y y) 4.0) (+ (* x x) (* (* y y) 4.0)))))

  (/ (- (* x x) (* (* y 4.0) y)) (+ (* x x) (* (* y 4.0) y))))