?

Average Error: 31.5 → 13.0
Time: 10.6s
Precision: binary64
Cost: 27404

?

\[\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 := \frac{x \cdot x + y \cdot \left(y \cdot -4\right)}{t_0 + x \cdot x}\\ t_2 := \mathsf{fma}\left(2 \cdot \log \left(\mathsf{fma}\left(0.5, {\left(\frac{y}{x}\right)}^{2}, 1\right)\right), -8, 1\right)\\ \mathbf{if}\;t_0 \leq 10^{-312}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_0 \leq 4 \cdot 10^{-248}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_0 \leq 4 \cdot 10^{-40}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_0 \leq 2 \cdot 10^{+279}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{y} \cdot \frac{x}{y}, 0.5, -1\right)\\ \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 (/ (+ (* x x) (* y (* y -4.0))) (+ t_0 (* x x))))
        (t_2 (fma (* 2.0 (log (fma 0.5 (pow (/ y x) 2.0) 1.0))) -8.0 1.0)))
   (if (<= t_0 1e-312)
     t_2
     (if (<= t_0 4e-248)
       t_1
       (if (<= t_0 4e-40)
         t_2
         (if (<= t_0 2e+279) t_1 (fma (* (/ x y) (/ x y)) 0.5 -1.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 * (y * 4.0);
	double t_1 = ((x * x) + (y * (y * -4.0))) / (t_0 + (x * x));
	double t_2 = fma((2.0 * log(fma(0.5, pow((y / x), 2.0), 1.0))), -8.0, 1.0);
	double tmp;
	if (t_0 <= 1e-312) {
		tmp = t_2;
	} else if (t_0 <= 4e-248) {
		tmp = t_1;
	} else if (t_0 <= 4e-40) {
		tmp = t_2;
	} else if (t_0 <= 2e+279) {
		tmp = t_1;
	} else {
		tmp = fma(((x / y) * (x / y)), 0.5, -1.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(y * Float64(y * 4.0))
	t_1 = Float64(Float64(Float64(x * x) + Float64(y * Float64(y * -4.0))) / Float64(t_0 + Float64(x * x)))
	t_2 = fma(Float64(2.0 * log(fma(0.5, (Float64(y / x) ^ 2.0), 1.0))), -8.0, 1.0)
	tmp = 0.0
	if (t_0 <= 1e-312)
		tmp = t_2;
	elseif (t_0 <= 4e-248)
		tmp = t_1;
	elseif (t_0 <= 4e-40)
		tmp = t_2;
	elseif (t_0 <= 2e+279)
		tmp = t_1;
	else
		tmp = fma(Float64(Float64(x / y) * Float64(x / y)), 0.5, -1.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[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x * x), $MachinePrecision] + N[(y * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * N[Log[N[(0.5 * N[Power[N[(y / x), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * -8.0 + 1.0), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-312], t$95$2, If[LessEqual[t$95$0, 4e-248], t$95$1, If[LessEqual[t$95$0, 4e-40], t$95$2, If[LessEqual[t$95$0, 2e+279], t$95$1, N[(N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision] * 0.5 + -1.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 := y \cdot \left(y \cdot 4\right)\\
t_1 := \frac{x \cdot x + y \cdot \left(y \cdot -4\right)}{t_0 + x \cdot x}\\
t_2 := \mathsf{fma}\left(2 \cdot \log \left(\mathsf{fma}\left(0.5, {\left(\frac{y}{x}\right)}^{2}, 1\right)\right), -8, 1\right)\\
\mathbf{if}\;t_0 \leq 10^{-312}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_0 \leq 4 \cdot 10^{-248}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_0 \leq 4 \cdot 10^{-40}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+279}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{y} \cdot \frac{x}{y}, 0.5, -1\right)\\


\end{array}

Error?

Target

Original31.5
Target31.2
Herbie13.0
\[\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 3 regimes
  2. if (*.f64 (*.f64 y 4) y) < 9.9999999999847e-313 or 3.99999999999999992e-248 < (*.f64 (*.f64 y 4) y) < 3.9999999999999997e-40

    1. Initial program 24.8

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

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

      [Start]24.8

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

      fma-neg [=>]24.8

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

      *-commutative [=>]24.8

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

      associate-*r* [=>]25.0

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

      distribute-rgt-neg-in [=>]25.0

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

      metadata-eval [=>]25.0

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

      fma-def [=>]25.0

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

      *-commutative [=>]25.0

      \[ \frac{\mathsf{fma}\left(x, x, \left(y \cdot y\right) \cdot -4\right)}{\mathsf{fma}\left(x, x, \color{blue}{y \cdot \left(y \cdot 4\right)}\right)} \]
    3. Taylor expanded in x around inf 18.7

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

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

      [Start]18.7

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

      associate--l+ [=>]18.7

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

      +-commutative [=>]18.7

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

      distribute-rgt-out-- [=>]18.7

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

      metadata-eval [=>]18.7

      \[ \frac{{y}^{2}}{{x}^{2}} \cdot \color{blue}{-8} + 1 \]

      fma-def [=>]18.7

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

      unpow2 [=>]18.7

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

      unpow2 [=>]18.7

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

      times-frac [=>]14.3

      \[ \mathsf{fma}\left(\color{blue}{\frac{y}{x} \cdot \frac{y}{x}}, -8, 1\right) \]
    5. Applied egg-rr14.9

      \[\leadsto \mathsf{fma}\left(\color{blue}{\log \left(e^{{\left(\frac{y}{x}\right)}^{2}}\right)}, -8, 1\right) \]
    6. Applied egg-rr14.9

      \[\leadsto \mathsf{fma}\left(\color{blue}{\log \left(\sqrt{e^{{\left(\frac{y}{x}\right)}^{2}}}\right) + \log \left(\sqrt{e^{{\left(\frac{y}{x}\right)}^{2}}}\right)}, -8, 1\right) \]
    7. Simplified14.9

      \[\leadsto \mathsf{fma}\left(\color{blue}{2 \cdot \log \left(\sqrt{e^{{\left(\frac{y}{x}\right)}^{2}}}\right)}, -8, 1\right) \]
      Proof

      [Start]14.9

      \[ \mathsf{fma}\left(\log \left(\sqrt{e^{{\left(\frac{y}{x}\right)}^{2}}}\right) + \log \left(\sqrt{e^{{\left(\frac{y}{x}\right)}^{2}}}\right), -8, 1\right) \]

      count-2 [=>]14.9

      \[ \mathsf{fma}\left(\color{blue}{2 \cdot \log \left(\sqrt{e^{{\left(\frac{y}{x}\right)}^{2}}}\right)}, -8, 1\right) \]
    8. Taylor expanded in y around 0 18.4

      \[\leadsto \mathsf{fma}\left(2 \cdot \log \color{blue}{\left(1 + 0.5 \cdot \frac{{y}^{2}}{{x}^{2}}\right)}, -8, 1\right) \]
    9. Simplified13.5

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

      [Start]18.4

      \[ \mathsf{fma}\left(2 \cdot \log \left(1 + 0.5 \cdot \frac{{y}^{2}}{{x}^{2}}\right), -8, 1\right) \]

      +-commutative [=>]18.4

      \[ \mathsf{fma}\left(2 \cdot \log \color{blue}{\left(0.5 \cdot \frac{{y}^{2}}{{x}^{2}} + 1\right)}, -8, 1\right) \]

      unpow2 [=>]18.4

      \[ \mathsf{fma}\left(2 \cdot \log \left(0.5 \cdot \frac{\color{blue}{y \cdot y}}{{x}^{2}} + 1\right), -8, 1\right) \]

      unpow2 [=>]18.4

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

      times-frac [=>]13.5

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

      unpow2 [<=]13.5

      \[ \mathsf{fma}\left(2 \cdot \log \left(0.5 \cdot \color{blue}{{\left(\frac{y}{x}\right)}^{2}} + 1\right), -8, 1\right) \]

      fma-def [=>]13.5

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

    if 9.9999999999847e-313 < (*.f64 (*.f64 y 4) y) < 3.99999999999999992e-248 or 3.9999999999999997e-40 < (*.f64 (*.f64 y 4) y) < 2.00000000000000012e279

    1. Initial program 16.1

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

    if 2.00000000000000012e279 < (*.f64 (*.f64 y 4) y)

    1. Initial program 59.9

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

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

      [Start]59.9

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

      cancel-sign-sub-inv [=>]59.9

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

      +-commutative [=>]59.9

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

      *-commutative [=>]59.9

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

      fma-def [=>]59.9

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

      distribute-rgt-neg-in [=>]59.9

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

      metadata-eval [=>]59.9

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

      fma-def [=>]59.9

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

      *-commutative [=>]59.9

      \[ \frac{\mathsf{fma}\left(y, y \cdot -4, x \cdot x\right)}{\mathsf{fma}\left(x, x, \color{blue}{y \cdot \left(y \cdot 4\right)}\right)} \]
    3. Taylor expanded in y around inf 16.7

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

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

      [Start]16.7

      \[ 0.25 \cdot \frac{{x}^{2}}{{y}^{2}} - \left(-0.25 \cdot \frac{{x}^{2}}{{y}^{2}} + 1\right) \]

      associate--r+ [=>]16.7

      \[ \color{blue}{\left(0.25 \cdot \frac{{x}^{2}}{{y}^{2}} - -0.25 \cdot \frac{{x}^{2}}{{y}^{2}}\right) - 1} \]

      distribute-rgt-out-- [=>]16.7

      \[ \color{blue}{\frac{{x}^{2}}{{y}^{2}} \cdot \left(0.25 - -0.25\right)} - 1 \]

      metadata-eval [=>]16.7

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

      fma-neg [=>]16.7

      \[ \color{blue}{\mathsf{fma}\left(\frac{{x}^{2}}{{y}^{2}}, 0.5, -1\right)} \]

      unpow2 [=>]16.7

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

      unpow2 [=>]16.7

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

      times-frac [=>]8.5

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

      metadata-eval [=>]8.5

      \[ \mathsf{fma}\left(\frac{x}{y} \cdot \frac{x}{y}, 0.5, \color{blue}{-1}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification13.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot \left(y \cdot 4\right) \leq 10^{-312}:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \log \left(\mathsf{fma}\left(0.5, {\left(\frac{y}{x}\right)}^{2}, 1\right)\right), -8, 1\right)\\ \mathbf{elif}\;y \cdot \left(y \cdot 4\right) \leq 4 \cdot 10^{-248}:\\ \;\;\;\;\frac{x \cdot x + y \cdot \left(y \cdot -4\right)}{y \cdot \left(y \cdot 4\right) + x \cdot x}\\ \mathbf{elif}\;y \cdot \left(y \cdot 4\right) \leq 4 \cdot 10^{-40}:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \log \left(\mathsf{fma}\left(0.5, {\left(\frac{y}{x}\right)}^{2}, 1\right)\right), -8, 1\right)\\ \mathbf{elif}\;y \cdot \left(y \cdot 4\right) \leq 2 \cdot 10^{+279}:\\ \;\;\;\;\frac{x \cdot x + y \cdot \left(y \cdot -4\right)}{y \cdot \left(y \cdot 4\right) + x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{y} \cdot \frac{x}{y}, 0.5, -1\right)\\ \end{array} \]

Alternatives

Alternative 1
Error13.3
Cost8528
\[\begin{array}{l} t_0 := 1 + \frac{\frac{y \cdot -8}{x}}{\frac{x}{y}}\\ t_1 := y \cdot \left(y \cdot 4\right)\\ t_2 := \frac{x \cdot x + y \cdot \left(y \cdot -4\right)}{t_1 + x \cdot x}\\ \mathbf{if}\;t_1 \leq 10^{-312}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;t_1 \leq 4 \cdot 10^{-248}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 4 \cdot 10^{-40}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+279}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{y} \cdot \frac{x}{y}, 0.5, -1\right)\\ \end{array} \]
Alternative 2
Error13.3
Cost2768
\[\begin{array}{l} t_0 := 1 + \frac{\frac{y \cdot -8}{x}}{\frac{x}{y}}\\ t_1 := y \cdot \left(y \cdot 4\right)\\ t_2 := \frac{x \cdot x - t_1}{t_1 + x \cdot x}\\ \mathbf{if}\;t_1 \leq 10^{-312}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;t_1 \leq 4 \cdot 10^{-248}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 4 \cdot 10^{-40}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+279}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;-1 + \frac{x}{y} \cdot \frac{x}{y \cdot 4}\\ \end{array} \]
Alternative 3
Error16.2
Cost1233
\[\begin{array}{l} t_0 := -1 + \frac{x}{y} \cdot \frac{x}{y \cdot 4}\\ \mathbf{if}\;y \leq -4.3 \cdot 10^{+88}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -1.02 \cdot 10^{+61}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq -3.7 \cdot 10^{-20} \lor \neg \left(y \leq 1.3 \cdot 10^{-43}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{\frac{y \cdot -8}{x}}{\frac{x}{y}}\\ \end{array} \]
Alternative 4
Error16.5
Cost1232
\[\begin{array}{l} \mathbf{if}\;y \leq -4.3 \cdot 10^{+88}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq -2.6 \cdot 10^{+60}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq -2.45 \cdot 10^{-20}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{-47}:\\ \;\;\;\;1 + \frac{\frac{y \cdot -8}{x}}{\frac{x}{y}}\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \]
Alternative 5
Error16.7
Cost592
\[\begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{+88}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{+60}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq -2 \cdot 10^{-20}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq 10^{-45}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \]
Alternative 6
Error31.9
Cost64
\[-1 \]

Error

Reproduce?

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