Average Error: 31.5 → 11.7
Time: 10.3s
Precision: binary64
Cost: 13968
\[\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(y \cdot -4\right)\\ t_1 := \mathsf{fma}\left(2 \cdot \left(\mathsf{hypot}\left(1, \frac{y}{x}\right) + -1\right), -8, 1\right)\\ t_2 := x \cdot x + y \cdot \left(y \cdot 4\right)\\ \mathbf{if}\;x \leq -6.722913512595512 \cdot 10^{+84}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -3.0490240838541806 \cdot 10^{-142}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, x, t_0\right)}{t_2}\\ \mathbf{elif}\;x \leq 1.4438477659231532 \cdot 10^{-164}:\\ \;\;\;\;{\left(\sqrt[3]{-1 + \frac{\frac{x}{y}}{\frac{y}{x}} \cdot 0.25}\right)}^{3}\\ \mathbf{elif}\;x \leq 1.274894519557101 \cdot 10^{+113}:\\ \;\;\;\;\frac{x \cdot x + t_0}{t_2}\\ \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 (* y (* y -4.0)))
        (t_1 (fma (* 2.0 (+ (hypot 1.0 (/ y x)) -1.0)) -8.0 1.0))
        (t_2 (+ (* x x) (* y (* y 4.0)))))
   (if (<= x -6.722913512595512e+84)
     t_1
     (if (<= x -3.0490240838541806e-142)
       (/ (fma x x t_0) t_2)
       (if (<= x 1.4438477659231532e-164)
         (pow (cbrt (+ -1.0 (* (/ (/ x y) (/ y x)) 0.25))) 3.0)
         (if (<= x 1.274894519557101e+113) (/ (+ (* x x) t_0) t_2) 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 = y * (y * -4.0);
	double t_1 = fma((2.0 * (hypot(1.0, (y / x)) + -1.0)), -8.0, 1.0);
	double t_2 = (x * x) + (y * (y * 4.0));
	double tmp;
	if (x <= -6.722913512595512e+84) {
		tmp = t_1;
	} else if (x <= -3.0490240838541806e-142) {
		tmp = fma(x, x, t_0) / t_2;
	} else if (x <= 1.4438477659231532e-164) {
		tmp = pow(cbrt((-1.0 + (((x / y) / (y / x)) * 0.25))), 3.0);
	} else if (x <= 1.274894519557101e+113) {
		tmp = ((x * x) + t_0) / t_2;
	} 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(y * Float64(y * -4.0))
	t_1 = fma(Float64(2.0 * Float64(hypot(1.0, Float64(y / x)) + -1.0)), -8.0, 1.0)
	t_2 = Float64(Float64(x * x) + Float64(y * Float64(y * 4.0)))
	tmp = 0.0
	if (x <= -6.722913512595512e+84)
		tmp = t_1;
	elseif (x <= -3.0490240838541806e-142)
		tmp = Float64(fma(x, x, t_0) / t_2);
	elseif (x <= 1.4438477659231532e-164)
		tmp = cbrt(Float64(-1.0 + Float64(Float64(Float64(x / y) / Float64(y / x)) * 0.25))) ^ 3.0;
	elseif (x <= 1.274894519557101e+113)
		tmp = Float64(Float64(Float64(x * x) + t_0) / t_2);
	else
		tmp = t_1;
	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[(y * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * N[(N[Sqrt[1.0 ^ 2 + N[(y / x), $MachinePrecision] ^ 2], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] * -8.0 + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * x), $MachinePrecision] + N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.722913512595512e+84], t$95$1, If[LessEqual[x, -3.0490240838541806e-142], N[(N[(x * x + t$95$0), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[x, 1.4438477659231532e-164], N[Power[N[Power[N[(-1.0 + N[(N[(N[(x / y), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision], If[LessEqual[x, 1.274894519557101e+113], N[(N[(N[(x * x), $MachinePrecision] + t$95$0), $MachinePrecision] / t$95$2), $MachinePrecision], 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 := y \cdot \left(y \cdot -4\right)\\
t_1 := \mathsf{fma}\left(2 \cdot \left(\mathsf{hypot}\left(1, \frac{y}{x}\right) + -1\right), -8, 1\right)\\
t_2 := x \cdot x + y \cdot \left(y \cdot 4\right)\\
\mathbf{if}\;x \leq -6.722913512595512 \cdot 10^{+84}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -3.0490240838541806 \cdot 10^{-142}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, x, t_0\right)}{t_2}\\

\mathbf{elif}\;x \leq 1.4438477659231532 \cdot 10^{-164}:\\
\;\;\;\;{\left(\sqrt[3]{-1 + \frac{\frac{x}{y}}{\frac{y}{x}} \cdot 0.25}\right)}^{3}\\

\mathbf{elif}\;x \leq 1.274894519557101 \cdot 10^{+113}:\\
\;\;\;\;\frac{x \cdot x + t_0}{t_2}\\

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


\end{array}

Error

Target

Original31.5
Target31.2
Herbie11.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 x < -6.7229135125955123e84 or 1.2748945195571011e113 < x

    1. Initial program 51.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.4

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{x} \cdot \frac{y}{x}, -8, 1\right)} \]
      Proof
      (fma.f64 (*.f64 (/.f64 y x) (/.f64 y x)) -8 1): 0 points increase in error, 0 points decrease in error
      (fma.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 y y) (*.f64 x x))) -8 1): 59 points increase in error, 8 points decrease in error
      (fma.f64 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 y 2)) (*.f64 x x)) -8 1): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 (pow.f64 y 2) (Rewrite<= unpow2_binary64 (pow.f64 x 2))) -8 1): 0 points increase in error, 0 points decrease in error
      (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (/.f64 (pow.f64 y 2) (pow.f64 x 2)) -8) 1)): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= *-commutative_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, 1 points decrease in error
    4. Applied egg-rr10.5

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 + {\left(\frac{y}{x}\right)}^{2}\right) - 1}, -8, 1\right) \]
    5. Applied egg-rr10.5

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{hypot}\left(1, \frac{y}{x}\right) + 1\right) \cdot \left(\mathsf{hypot}\left(1, \frac{y}{x}\right) - 1\right)}, -8, 1\right) \]
    6. Taylor expanded in y around 0 10.3

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

    if -6.7229135125955123e84 < x < -3.0490240838541806e-142

    1. Initial program 15.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 0 15.9

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

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot \left(y \cdot -4\right)\right)}}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
      Proof
      (fma.f64 x x (*.f64 y (*.f64 y -4))): 0 points increase in error, 0 points decrease in error
      (fma.f64 x x (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 y y) -4))): 0 points increase in error, 2 points decrease in error
      (fma.f64 x x (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 y 2)) -4)): 0 points increase in error, 0 points decrease in error
      (fma.f64 x x (Rewrite<= *-commutative_binary64 (*.f64 -4 (pow.f64 y 2)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= fma-def_binary64 (+.f64 (*.f64 x x) (*.f64 -4 (pow.f64 y 2)))): 1 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= unpow2_binary64 (pow.f64 x 2)) (*.f64 -4 (pow.f64 y 2))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -4 (pow.f64 y 2)) (pow.f64 x 2))): 0 points increase in error, 0 points decrease in error

    if -3.0490240838541806e-142 < x < 1.44384776592315325e-164

    1. Initial program 29.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 0 31.0

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

      \[\leadsto \frac{\color{blue}{y \cdot \left(y \cdot -4\right)}}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
      Proof
      (*.f64 y (*.f64 y -4)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 y y) -4)): 2 points increase in error, 3 points decrease in error
      (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 y 2)) -4): 0 points increase in error, 0 points decrease in error
      (Rewrite<= *-commutative_binary64 (*.f64 -4 (pow.f64 y 2))): 0 points increase in error, 0 points decrease in error
    4. Taylor expanded in y around inf 14.1

      \[\leadsto \color{blue}{0.25 \cdot \frac{{x}^{2}}{{y}^{2}} - 1} \]
    5. Simplified6.9

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{y}, 0.25 \cdot \frac{x}{y}, -1\right)} \]
      Proof
      (fma.f64 (/.f64 x y) (*.f64 1/4 (/.f64 x y)) -1): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 x y) (Rewrite=> *-commutative_binary64 (*.f64 (/.f64 x y) 1/4)) -1): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 x y) (*.f64 (/.f64 x y) 1/4) (Rewrite<= metadata-eval (neg.f64 1))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 (/.f64 x y) (*.f64 (/.f64 x y) 1/4)) 1)): 0 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (/.f64 x y) (/.f64 x y)) 1/4)) 1): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 x x) (*.f64 y y))) 1/4) 1): 59 points increase in error, 6 points decrease in error
      (-.f64 (*.f64 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 x 2)) (*.f64 y y)) 1/4) 1): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 (pow.f64 x 2) (Rewrite<= unpow2_binary64 (pow.f64 y 2))) 1/4) 1): 0 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= *-commutative_binary64 (*.f64 1/4 (/.f64 (pow.f64 x 2) (pow.f64 y 2)))) 1): 0 points increase in error, 0 points decrease in error
    6. Applied egg-rr6.9

      \[\leadsto \color{blue}{{\left(\sqrt[3]{-1 + {\left(\frac{x}{y}\right)}^{2} \cdot 0.25}\right)}^{3}} \]
    7. Applied egg-rr6.9

      \[\leadsto {\left(\sqrt[3]{-1 + \color{blue}{\frac{\frac{x}{y}}{\frac{y}{x}}} \cdot 0.25}\right)}^{3} \]

    if 1.44384776592315325e-164 < x < 1.2748945195571011e113

    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} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification11.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.722913512595512 \cdot 10^{+84}:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \left(\mathsf{hypot}\left(1, \frac{y}{x}\right) + -1\right), -8, 1\right)\\ \mathbf{elif}\;x \leq -3.0490240838541806 \cdot 10^{-142}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, x, y \cdot \left(y \cdot -4\right)\right)}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\ \mathbf{elif}\;x \leq 1.4438477659231532 \cdot 10^{-164}:\\ \;\;\;\;{\left(\sqrt[3]{-1 + \frac{\frac{x}{y}}{\frac{y}{x}} \cdot 0.25}\right)}^{3}\\ \mathbf{elif}\;x \leq 1.274894519557101 \cdot 10^{+113}:\\ \;\;\;\;\frac{x \cdot x + y \cdot \left(y \cdot -4\right)}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \left(\mathsf{hypot}\left(1, \frac{y}{x}\right) + -1\right), -8, 1\right)\\ \end{array} \]

Alternatives

Alternative 1
Error11.7
Cost13968
\[\begin{array}{l} t_0 := y \cdot \left(y \cdot -4\right)\\ t_1 := \mathsf{fma}\left(2 \cdot \left(\mathsf{hypot}\left(1, \frac{y}{x}\right) + -1\right), -8, 1\right)\\ t_2 := x \cdot x + y \cdot \left(y \cdot 4\right)\\ \mathbf{if}\;x \leq -6.722913512595512 \cdot 10^{+84}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -3.0490240838541806 \cdot 10^{-142}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, x, t_0\right)}{t_2}\\ \mathbf{elif}\;x \leq 1.4438477659231532 \cdot 10^{-164}:\\ \;\;\;\;-1 + 0.25 \cdot \left(-1 + \left(1 + {\left(\frac{x}{y}\right)}^{2}\right)\right)\\ \mathbf{elif}\;x \leq 1.274894519557101 \cdot 10^{+113}:\\ \;\;\;\;\frac{x \cdot x + t_0}{t_2}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error11.7
Cost7752
\[\begin{array}{l} t_0 := y \cdot \left(y \cdot -4\right)\\ t_1 := x \cdot x + y \cdot \left(y \cdot 4\right)\\ t_2 := \mathsf{fma}\left(\frac{y}{x} \cdot \frac{y}{x}, -8, 1\right)\\ \mathbf{if}\;x \leq -1.068835693690945 \cdot 10^{+99}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -3.0490240838541806 \cdot 10^{-142}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, x, t_0\right)}{t_1}\\ \mathbf{elif}\;x \leq 1.4438477659231532 \cdot 10^{-164}:\\ \;\;\;\;-1 + 0.25 \cdot \left(-1 + \left(1 + {\left(\frac{x}{y}\right)}^{2}\right)\right)\\ \mathbf{elif}\;x \leq 1.274894519557101 \cdot 10^{+113}:\\ \;\;\;\;\frac{x \cdot x + t_0}{t_1}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error11.7
Cost7564
\[\begin{array}{l} t_0 := \mathsf{fma}\left(\frac{y}{x} \cdot \frac{y}{x}, -8, 1\right)\\ 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 -1.068835693690945 \cdot 10^{+99}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -3.0490240838541806 \cdot 10^{-142}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.4438477659231532 \cdot 10^{-164}:\\ \;\;\;\;-1 + 0.25 \cdot \left(-1 + \left(1 + {\left(\frac{x}{y}\right)}^{2}\right)\right)\\ \mathbf{elif}\;x \leq 1.274894519557101 \cdot 10^{+113}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error11.7
Cost7504
\[\begin{array}{l} t_0 := \mathsf{fma}\left(\frac{y}{x} \cdot \frac{y}{x}, -8, 1\right)\\ 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 -1.068835693690945 \cdot 10^{+99}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -3.0490240838541806 \cdot 10^{-142}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.4438477659231532 \cdot 10^{-164}:\\ \;\;\;\;-1 + \frac{\frac{x}{y}}{\frac{y}{x}} \cdot 0.25\\ \mathbf{elif}\;x \leq 1.274894519557101 \cdot 10^{+113}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error12.0
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)}\\ \mathbf{if}\;x \leq -6.722913512595512 \cdot 10^{+84}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq -3.0490240838541806 \cdot 10^{-142}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.4438477659231532 \cdot 10^{-164}:\\ \;\;\;\;-1 + \frac{\frac{x}{y}}{\frac{y}{x}} \cdot 0.25\\ \mathbf{elif}\;x \leq 1.274894519557101 \cdot 10^{+113}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 6
Error15.8
Cost968
\[\begin{array}{l} \mathbf{if}\;x \leq -1.4644764275040515 \cdot 10^{-47}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 814213646699086.8:\\ \;\;\;\;-1 + \frac{\frac{x}{y}}{\frac{y}{x}} \cdot 0.25\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 7
Error15.8
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -8.372512622836507 \cdot 10^{-17}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 2.2765472490108987 \cdot 10^{-8}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 8
Error31.4
Cost64
\[-1 \]

Error

Reproduce

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