Average Error: 32.0 → 12.9
Time: 10.3s
Precision: binary64
Cost: 26576
\[\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)}\\ \mathbf{if}\;x \leq -3.7505748457790156 \cdot 10^{+102}:\\ \;\;\;\;y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right) + 1\\ \mathbf{elif}\;x \leq -5.348786173424537 \cdot 10^{-67}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 3.6910028754933256 \cdot 10^{-85}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{\frac{y}{x}}, \frac{0.5}{y}, -1\right)\\ \mathbf{elif}\;x \leq 9.024619746559065 \cdot 10^{+116}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt[3]{\mathsf{fma}\left(-8, {\left(\frac{x}{y}\right)}^{-2}, 1\right)}\right)}^{3}\\ \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))))))
   (if (<= x -3.7505748457790156e+102)
     (+ (* y (* -8.0 (/ (/ y x) x))) 1.0)
     (if (<= x -5.348786173424537e-67)
       t_0
       (if (<= x 3.6910028754933256e-85)
         (fma (/ x (/ y x)) (/ 0.5 y) -1.0)
         (if (<= x 9.024619746559065e+116)
           t_0
           (pow (cbrt (fma -8.0 (pow (/ x y) -2.0) 1.0)) 3.0)))))))
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 tmp;
	if (x <= -3.7505748457790156e+102) {
		tmp = (y * (-8.0 * ((y / x) / x))) + 1.0;
	} else if (x <= -5.348786173424537e-67) {
		tmp = t_0;
	} else if (x <= 3.6910028754933256e-85) {
		tmp = fma((x / (y / x)), (0.5 / y), -1.0);
	} else if (x <= 9.024619746559065e+116) {
		tmp = t_0;
	} else {
		tmp = pow(cbrt(fma(-8.0, pow((x / y), -2.0), 1.0)), 3.0);
	}
	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))))
	tmp = 0.0
	if (x <= -3.7505748457790156e+102)
		tmp = Float64(Float64(y * Float64(-8.0 * Float64(Float64(y / x) / x))) + 1.0);
	elseif (x <= -5.348786173424537e-67)
		tmp = t_0;
	elseif (x <= 3.6910028754933256e-85)
		tmp = fma(Float64(x / Float64(y / x)), Float64(0.5 / y), -1.0);
	elseif (x <= 9.024619746559065e+116)
		tmp = t_0;
	else
		tmp = cbrt(fma(-8.0, (Float64(x / y) ^ -2.0), 1.0)) ^ 3.0;
	end
	return 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]}, If[LessEqual[x, -3.7505748457790156e+102], N[(N[(y * N[(-8.0 * N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[x, -5.348786173424537e-67], t$95$0, If[LessEqual[x, 3.6910028754933256e-85], N[(N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision] * N[(0.5 / y), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[x, 9.024619746559065e+116], t$95$0, N[Power[N[Power[N[(-8.0 * N[Power[N[(x / y), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]]]]]]
\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)}\\
\mathbf{if}\;x \leq -3.7505748457790156 \cdot 10^{+102}:\\
\;\;\;\;y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right) + 1\\

\mathbf{elif}\;x \leq -5.348786173424537 \cdot 10^{-67}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x \leq 3.6910028754933256 \cdot 10^{-85}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{\frac{y}{x}}, \frac{0.5}{y}, -1\right)\\

\mathbf{elif}\;x \leq 9.024619746559065 \cdot 10^{+116}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{\mathsf{fma}\left(-8, {\left(\frac{x}{y}\right)}^{-2}, 1\right)}\right)}^{3}\\


\end{array}

Error

Target

Original32.0
Target31.7
Herbie12.9
\[\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 x < -3.7505748457790156e102

    1. Initial program 51.7

      \[\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 16.7

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

      \[\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): 21 points increase in error, 5 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): 31 points increase in error, 6 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.4

      \[\leadsto \color{blue}{-8 \cdot {\left(\frac{x}{y}\right)}^{-2} + 1} \]
    5. Taylor expanded in x around 0 16.7

      \[\leadsto \color{blue}{-8 \cdot \frac{{y}^{2}}{{x}^{2}}} + 1 \]
    6. Simplified10.4

      \[\leadsto \color{blue}{y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right)} + 1 \]
      Proof
      (*.f64 y (*.f64 -8 (/.f64 (/.f64 y x) x))): 0 points increase in error, 0 points decrease in error
      (*.f64 y (*.f64 -8 (Rewrite<= associate-/r*_binary64 (/.f64 y (*.f64 x x))))): 28 points increase in error, 22 points decrease in error
      (*.f64 y (*.f64 -8 (/.f64 y (Rewrite<= unpow2_binary64 (pow.f64 x 2))))): 0 points increase in error, 0 points decrease in error
      (*.f64 y (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 -8 y) (pow.f64 x 2)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 (*.f64 -8 y) (pow.f64 x 2)) y)): 0 points increase in error, 0 points decrease in error
      (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 (*.f64 -8 y) y) (pow.f64 x 2))): 14 points increase in error, 20 points decrease in error
      (/.f64 (Rewrite<= associate-*r*_binary64 (*.f64 -8 (*.f64 y y))) (pow.f64 x 2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 -8 (Rewrite<= unpow2_binary64 (pow.f64 y 2))) (pow.f64 x 2)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*r/_binary64 (*.f64 -8 (/.f64 (pow.f64 y 2) (pow.f64 x 2)))): 0 points increase in error, 1 points decrease in error

    if -3.7505748457790156e102 < x < -5.34878617342453688e-67 or 3.6910028754933256e-85 < x < 9.0246197465590649e116

    1. Initial program 17.3

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

    if -5.34878617342453688e-67 < x < 3.6910028754933256e-85

    1. Initial program 25.6

      \[\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 17.2

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2}}{{y}^{2}} - 1} \]
    3. Simplified11.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): 27 points increase in error, 4 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): 30 points increase in error, 6 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

    if 9.0246197465590649e116 < x

    1. Initial program 53.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 inf 16.2

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

      \[\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): 21 points increase in error, 5 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): 31 points increase in error, 6 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-rr9.4

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(-8, {\left(\frac{x}{y}\right)}^{-2}, 1\right)}\right)}^{3}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification12.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.7505748457790156 \cdot 10^{+102}:\\ \;\;\;\;y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right) + 1\\ \mathbf{elif}\;x \leq -5.348786173424537 \cdot 10^{-67}:\\ \;\;\;\;\frac{x \cdot x + y \cdot \left(y \cdot -4\right)}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\ \mathbf{elif}\;x \leq 3.6910028754933256 \cdot 10^{-85}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{\frac{y}{x}}, \frac{0.5}{y}, -1\right)\\ \mathbf{elif}\;x \leq 9.024619746559065 \cdot 10^{+116}:\\ \;\;\;\;\frac{x \cdot x + y \cdot \left(y \cdot -4\right)}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt[3]{\mathsf{fma}\left(-8, {\left(\frac{x}{y}\right)}^{-2}, 1\right)}\right)}^{3}\\ \end{array} \]

Alternatives

Alternative 1
Error12.9
Cost7760
\[\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)}\\ \mathbf{if}\;x \leq -3.7505748457790156 \cdot 10^{+102}:\\ \;\;\;\;y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right) + 1\\ \mathbf{elif}\;x \leq -5.348786173424537 \cdot 10^{-67}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 3.6910028754933256 \cdot 10^{-85}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{\frac{y}{x}}, \frac{0.5}{y}, -1\right)\\ \mathbf{elif}\;x \leq 9.024619746559065 \cdot 10^{+116}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;-1 + \left(1 + \mathsf{fma}\left(-8, \frac{y}{x} \cdot \frac{y}{x}, 1\right)\right)\\ \end{array} \]
Alternative 2
Error12.9
Cost7372
\[\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 := y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right) + 1\\ \mathbf{if}\;x \leq -3.7505748457790156 \cdot 10^{+102}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -5.348786173424537 \cdot 10^{-67}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 3.6910028754933256 \cdot 10^{-85}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{\frac{y}{x}}, \frac{0.5}{y}, -1\right)\\ \mathbf{elif}\;x \leq 9.024619746559065 \cdot 10^{+116}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error12.9
Cost1744
\[\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 := y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right) + 1\\ \mathbf{if}\;x \leq -3.7505748457790156 \cdot 10^{+102}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -5.348786173424537 \cdot 10^{-67}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 3.6910028754933256 \cdot 10^{-85}:\\ \;\;\;\;-1 + x \cdot \left(\frac{0.5}{y} \cdot \frac{x}{y}\right)\\ \mathbf{elif}\;x \leq 9.024619746559065 \cdot 10^{+116}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error16.8
Cost1484
\[\begin{array}{l} \mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-153}:\\ \;\;\;\;-1 + x \cdot \left(\frac{0.5}{y} \cdot \frac{x}{y}\right)\\ \mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{-45}:\\ \;\;\;\;\frac{x \cdot x}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\ \mathbf{elif}\;x \cdot x \leq 10^{+17}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right) + 1\\ \end{array} \]
Alternative 5
Error17.2
Cost968
\[\begin{array}{l} t_0 := y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right) + 1\\ \mathbf{if}\;x \leq -5.348786173424537 \cdot 10^{-67}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.2082425181016389 \cdot 10^{+79}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error17.0
Cost968
\[\begin{array}{l} t_0 := y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right) + 1\\ \mathbf{if}\;x \leq -5.348786173424537 \cdot 10^{-67}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.2082425181016389 \cdot 10^{+79}:\\ \;\;\;\;-1 + x \cdot \left(\frac{0.5}{y} \cdot \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 7
Error17.5
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -5.348786173424537 \cdot 10^{-67}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.2082425181016389 \cdot 10^{+79}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 8
Error31.3
Cost64
\[1 \]

Error

Reproduce

herbie shell --seed 2022294 
(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))))