Average Error: 30.9 → 13.3
Time: 11.6s
Precision: binary64
Cost: 7884
\[\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 := y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right) + 1\\ t_1 := x \cdot x + y \cdot \left(y \cdot -4\right)\\ \mathbf{if}\;x \leq -6.52149901714685 \cdot 10^{+76}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -1.65619803553909 \cdot 10^{+20}:\\ \;\;\;\;x \cdot \left(\frac{x}{y} \cdot \frac{0.5}{y}\right) + -1\\ \mathbf{elif}\;x \leq -6.083711632496062 \cdot 10^{-117}:\\ \;\;\;\;\frac{t_1}{\mathsf{fma}\left(y \cdot 4, y, x \cdot x\right)}\\ \mathbf{elif}\;x \leq 2.154926067516473 \cdot 10^{-167}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{\frac{y}{x}}, \frac{0.5}{y}, -1\right)\\ \mathbf{elif}\;x \leq 3.4827611715710376 \cdot 10^{+86}:\\ \;\;\;\;\frac{t_1}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \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 (+ (* y (* -8.0 (/ (/ y x) x))) 1.0))
        (t_1 (+ (* x x) (* y (* y -4.0)))))
   (if (<= x -6.52149901714685e+76)
     t_0
     (if (<= x -1.65619803553909e+20)
       (+ (* x (* (/ x y) (/ 0.5 y))) -1.0)
       (if (<= x -6.083711632496062e-117)
         (/ t_1 (fma (* y 4.0) y (* x x)))
         (if (<= x 2.154926067516473e-167)
           (fma (/ x (/ y x)) (/ 0.5 y) -1.0)
           (if (<= x 3.4827611715710376e+86)
             (/ t_1 (+ (* x x) (* y (* y 4.0))))
             t_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 = (y * (-8.0 * ((y / x) / x))) + 1.0;
	double t_1 = (x * x) + (y * (y * -4.0));
	double tmp;
	if (x <= -6.52149901714685e+76) {
		tmp = t_0;
	} else if (x <= -1.65619803553909e+20) {
		tmp = (x * ((x / y) * (0.5 / y))) + -1.0;
	} else if (x <= -6.083711632496062e-117) {
		tmp = t_1 / fma((y * 4.0), y, (x * x));
	} else if (x <= 2.154926067516473e-167) {
		tmp = fma((x / (y / x)), (0.5 / y), -1.0);
	} else if (x <= 3.4827611715710376e+86) {
		tmp = t_1 / ((x * x) + (y * (y * 4.0)));
	} else {
		tmp = t_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(y * Float64(-8.0 * Float64(Float64(y / x) / x))) + 1.0)
	t_1 = Float64(Float64(x * x) + Float64(y * Float64(y * -4.0)))
	tmp = 0.0
	if (x <= -6.52149901714685e+76)
		tmp = t_0;
	elseif (x <= -1.65619803553909e+20)
		tmp = Float64(Float64(x * Float64(Float64(x / y) * Float64(0.5 / y))) + -1.0);
	elseif (x <= -6.083711632496062e-117)
		tmp = Float64(t_1 / fma(Float64(y * 4.0), y, Float64(x * x)));
	elseif (x <= 2.154926067516473e-167)
		tmp = fma(Float64(x / Float64(y / x)), Float64(0.5 / y), -1.0);
	elseif (x <= 3.4827611715710376e+86)
		tmp = Float64(t_1 / Float64(Float64(x * x) + Float64(y * Float64(y * 4.0))));
	else
		tmp = t_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[(y * N[(-8.0 * N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] + N[(y * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.52149901714685e+76], t$95$0, If[LessEqual[x, -1.65619803553909e+20], N[(N[(x * N[(N[(x / y), $MachinePrecision] * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[x, -6.083711632496062e-117], N[(t$95$1 / N[(N[(y * 4.0), $MachinePrecision] * y + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.154926067516473e-167], N[(N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision] * N[(0.5 / y), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[x, 3.4827611715710376e+86], N[(t$95$1 / N[(N[(x * x), $MachinePrecision] + N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]
\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 := y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right) + 1\\
t_1 := x \cdot x + y \cdot \left(y \cdot -4\right)\\
\mathbf{if}\;x \leq -6.52149901714685 \cdot 10^{+76}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x \leq -1.65619803553909 \cdot 10^{+20}:\\
\;\;\;\;x \cdot \left(\frac{x}{y} \cdot \frac{0.5}{y}\right) + -1\\

\mathbf{elif}\;x \leq -6.083711632496062 \cdot 10^{-117}:\\
\;\;\;\;\frac{t_1}{\mathsf{fma}\left(y \cdot 4, y, x \cdot x\right)}\\

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

\mathbf{elif}\;x \leq 3.4827611715710376 \cdot 10^{+86}:\\
\;\;\;\;\frac{t_1}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}

Error

Target

Original30.9
Target30.6
Herbie13.3
\[\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 5 regimes
  2. if x < -6.5214990171468495e76 or 3.48276117157103756e86 < x

    1. Initial program 48.9

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

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

      \[\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): 25 points increase in error, 6 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)): 1 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, 3 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-rr12.0

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

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

      \[\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, 9 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))): 26 points increase in error, 14 points decrease in error
      (/.f64 (Rewrite<= associate-*r*_binary64 (*.f64 -8 (*.f64 y y))) (pow.f64 x 2)): 0 points increase in error, 1 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 -6.5214990171468495e76 < x < -165619803553909015000

    1. Initial program 16.2

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

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

      \[\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): 23 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): 23 points increase in error, 4 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-rr35.1

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

    if -165619803553909015000 < x < -6.08371163249606206e-117

    1. Initial program 15.7

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Applied egg-rr15.7

      \[\leadsto \frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{\color{blue}{\mathsf{fma}\left(y \cdot 4, y, x \cdot x\right)}} \]

    if -6.08371163249606206e-117 < x < 2.15492606751647298e-167

    1. Initial program 27.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 0 14.8

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

      \[\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): 23 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): 23 points increase in error, 4 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 2.15492606751647298e-167 < x < 3.48276117157103756e86

    1. Initial program 16.0

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification13.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.52149901714685 \cdot 10^{+76}:\\ \;\;\;\;y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right) + 1\\ \mathbf{elif}\;x \leq -1.65619803553909 \cdot 10^{+20}:\\ \;\;\;\;x \cdot \left(\frac{x}{y} \cdot \frac{0.5}{y}\right) + -1\\ \mathbf{elif}\;x \leq -6.083711632496062 \cdot 10^{-117}:\\ \;\;\;\;\frac{x \cdot x + y \cdot \left(y \cdot -4\right)}{\mathsf{fma}\left(y \cdot 4, y, x \cdot x\right)}\\ \mathbf{elif}\;x \leq 2.154926067516473 \cdot 10^{-167}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{\frac{y}{x}}, \frac{0.5}{y}, -1\right)\\ \mathbf{elif}\;x \leq 3.4827611715710376 \cdot 10^{+86}:\\ \;\;\;\;\frac{x \cdot x + y \cdot \left(y \cdot -4\right)}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right) + 1\\ \end{array} \]

Alternatives

Alternative 1
Error13.3
Cost7504
\[\begin{array}{l} t_0 := y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right) + 1\\ t_1 := \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 -6.52149901714685 \cdot 10^{+76}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -1.65619803553909 \cdot 10^{+20}:\\ \;\;\;\;x \cdot \left(\frac{x}{y} \cdot \frac{0.5}{y}\right) + -1\\ \mathbf{elif}\;x \leq -6.083711632496062 \cdot 10^{-117}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2.154926067516473 \cdot 10^{-167}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{\frac{y}{x}}, \frac{0.5}{y}, -1\right)\\ \mathbf{elif}\;x \leq 3.4827611715710376 \cdot 10^{+86}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error13.4
Cost1876
\[\begin{array}{l} t_0 := x \cdot \left(\frac{x}{y} \cdot \frac{0.5}{y}\right) + -1\\ t_1 := y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right) + 1\\ t_2 := \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 -6.52149901714685 \cdot 10^{+76}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -1.65619803553909 \cdot 10^{+20}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -6.083711632496062 \cdot 10^{-117}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 1.2484043387818578 \cdot 10^{-168}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 3.4827611715710376 \cdot 10^{+86}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error16.7
Cost1868
\[\begin{array}{l} t_0 := y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right) + 1\\ t_1 := y \cdot \left(y \cdot 4\right)\\ t_2 := x \cdot \left(\frac{x}{y} \cdot \frac{0.5}{y}\right) + -1\\ \mathbf{if}\;t_1 \leq 2 \cdot 10^{-182}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{-6}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+51}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 4
Error16.8
Cost968
\[\begin{array}{l} \mathbf{if}\;y \leq -8.687789938179922 \cdot 10^{-75}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq 5.10778309235106 \cdot 10^{-92}:\\ \;\;\;\;y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right) + 1\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \]
Alternative 5
Error17.0
Cost328
\[\begin{array}{l} \mathbf{if}\;y \leq -8.687789938179922 \cdot 10^{-75}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq 5.10778309235106 \cdot 10^{-92}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \]
Alternative 6
Error32.2
Cost64
\[1 \]

Error

Reproduce

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