Average Error: 31.8 → 4.9
Time: 13.9s
Precision: binary64
Cost: 53708
\[\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}{\frac{1}{x} \cdot \left(y \cdot \left(y \cdot 4\right)\right) + \frac{1}{x} \cdot \left(x \cdot x\right)} - \frac{y}{y + \left(x \cdot x\right) \cdot \frac{0.25}{y}}\\ t_1 := \sqrt[3]{-1 + {\left(\frac{x}{y}\right)}^{4} \cdot 0.0625}\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq -1.65 \cdot 10^{-142}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{-182}:\\ \;\;\;\;\frac{t_1 \cdot t_1}{\frac{\mathsf{fma}\left({\left(\frac{x}{y}\right)}^{2}, 0.25, 1\right)}{t_1}}\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{+106}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;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 (+ (* (/ 1.0 x) (* y (* y 4.0))) (* (/ 1.0 x) (* x x))))
          (/ y (+ y (* (* x x) (/ 0.25 y))))))
        (t_1 (cbrt (+ -1.0 (* (pow (/ x y) 4.0) 0.0625)))))
   (if (<= x -1.35e+154)
     1.0
     (if (<= x -1.65e-142)
       t_0
       (if (<= x 4.4e-182)
         (/ (* t_1 t_1) (/ (fma (pow (/ x y) 2.0) 0.25 1.0) t_1))
         (if (<= x 6.2e+106) t_0 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 = (x / (((1.0 / x) * (y * (y * 4.0))) + ((1.0 / x) * (x * x)))) - (y / (y + ((x * x) * (0.25 / y))));
	double t_1 = cbrt((-1.0 + (pow((x / y), 4.0) * 0.0625)));
	double tmp;
	if (x <= -1.35e+154) {
		tmp = 1.0;
	} else if (x <= -1.65e-142) {
		tmp = t_0;
	} else if (x <= 4.4e-182) {
		tmp = (t_1 * t_1) / (fma(pow((x / y), 2.0), 0.25, 1.0) / t_1);
	} else if (x <= 6.2e+106) {
		tmp = t_0;
	} else {
		tmp = 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(Float64(x / Float64(Float64(Float64(1.0 / x) * Float64(y * Float64(y * 4.0))) + Float64(Float64(1.0 / x) * Float64(x * x)))) - Float64(y / Float64(y + Float64(Float64(x * x) * Float64(0.25 / y)))))
	t_1 = cbrt(Float64(-1.0 + Float64((Float64(x / y) ^ 4.0) * 0.0625)))
	tmp = 0.0
	if (x <= -1.35e+154)
		tmp = 1.0;
	elseif (x <= -1.65e-142)
		tmp = t_0;
	elseif (x <= 4.4e-182)
		tmp = Float64(Float64(t_1 * t_1) / Float64(fma((Float64(x / y) ^ 2.0), 0.25, 1.0) / t_1));
	elseif (x <= 6.2e+106)
		tmp = t_0;
	else
		tmp = 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[(N[(x / N[(N[(N[(1.0 / x), $MachinePrecision] * N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(y + N[(N[(x * x), $MachinePrecision] * N[(0.25 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(-1.0 + N[(N[Power[N[(x / y), $MachinePrecision], 4.0], $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[x, -1.35e+154], 1.0, If[LessEqual[x, -1.65e-142], t$95$0, If[LessEqual[x, 4.4e-182], N[(N[(t$95$1 * t$95$1), $MachinePrecision] / N[(N[(N[Power[N[(x / y), $MachinePrecision], 2.0], $MachinePrecision] * 0.25 + 1.0), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.2e+106], t$95$0, 1.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 := \frac{x}{\frac{1}{x} \cdot \left(y \cdot \left(y \cdot 4\right)\right) + \frac{1}{x} \cdot \left(x \cdot x\right)} - \frac{y}{y + \left(x \cdot x\right) \cdot \frac{0.25}{y}}\\
t_1 := \sqrt[3]{-1 + {\left(\frac{x}{y}\right)}^{4} \cdot 0.0625}\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;1\\

\mathbf{elif}\;x \leq -1.65 \cdot 10^{-142}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x \leq 4.4 \cdot 10^{-182}:\\
\;\;\;\;\frac{t_1 \cdot t_1}{\frac{\mathsf{fma}\left({\left(\frac{x}{y}\right)}^{2}, 0.25, 1\right)}{t_1}}\\

\mathbf{elif}\;x \leq 6.2 \cdot 10^{+106}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}

Error

Target

Original31.8
Target31.5
Herbie4.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 3 regimes
  2. if x < -1.35000000000000003e154 or 6.1999999999999999e106 < x

    1. Initial program 57.4

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

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

    if -1.35000000000000003e154 < x < -1.6499999999999998e-142 or 4.3999999999999999e-182 < x < 6.1999999999999999e106

    1. Initial program 16.4

      \[\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.9

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

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

      [Start]15.9

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

      sub-neg [<=]15.9

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

      associate-/l* [=>]16.1

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

      fma-udef [=>]16.1

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

      +-commutative [<=]16.1

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

      fma-udef [<=]16.1

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

      associate-*l/ [=>]16.5

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

      *-commutative [<=]16.5

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

      associate-/l* [=>]16.1

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

      fma-udef [=>]16.1

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

      +-commutative [<=]16.1

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

      fma-udef [<=]16.1

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

      \[\leadsto \frac{x}{\frac{\mathsf{fma}\left(y, y \cdot 4, x \cdot x\right)}{x}} - \frac{y}{\color{blue}{\frac{0.25}{y} \cdot \left(y \cdot \left(y \cdot 4\right)\right) + \frac{0.25}{y} \cdot \left(x \cdot x\right)}} \]
    5. Applied egg-rr16.2

      \[\leadsto \frac{x}{\color{blue}{\frac{1}{x} \cdot \left(y \cdot \left(y \cdot 4\right)\right) + \frac{1}{x} \cdot \left(x \cdot x\right)}} - \frac{y}{\frac{0.25}{y} \cdot \left(y \cdot \left(y \cdot 4\right)\right) + \frac{0.25}{y} \cdot \left(x \cdot x\right)} \]
    6. Taylor expanded in y around 0 0.8

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

    if -1.6499999999999998e-142 < x < 4.3999999999999999e-182

    1. Initial program 30.4

      \[\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.5

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

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

      [Start]31.5

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

      *-commutative [=>]31.5

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

      unpow2 [=>]31.5

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

      associate-*r* [<=]31.3

      \[ \frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{\color{blue}{y \cdot \left(y \cdot 4\right)}} \]
    4. Applied egg-rr7.5

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

      \[\leadsto \color{blue}{\left(\frac{{\left(\frac{x}{y}\right)}^{2}}{4} + 1\right) - 2} \]
    6. Applied egg-rr7.6

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq -1.65 \cdot 10^{-142}:\\ \;\;\;\;\frac{x}{\frac{1}{x} \cdot \left(y \cdot \left(y \cdot 4\right)\right) + \frac{1}{x} \cdot \left(x \cdot x\right)} - \frac{y}{y + \left(x \cdot x\right) \cdot \frac{0.25}{y}}\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{-182}:\\ \;\;\;\;\frac{\sqrt[3]{-1 + {\left(\frac{x}{y}\right)}^{4} \cdot 0.0625} \cdot \sqrt[3]{-1 + {\left(\frac{x}{y}\right)}^{4} \cdot 0.0625}}{\frac{\mathsf{fma}\left({\left(\frac{x}{y}\right)}^{2}, 0.25, 1\right)}{\sqrt[3]{-1 + {\left(\frac{x}{y}\right)}^{4} \cdot 0.0625}}}\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{+106}:\\ \;\;\;\;\frac{x}{\frac{1}{x} \cdot \left(y \cdot \left(y \cdot 4\right)\right) + \frac{1}{x} \cdot \left(x \cdot x\right)} - \frac{y}{y + \left(x \cdot x\right) \cdot \frac{0.25}{y}}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternatives

Alternative 1
Error4.9
Cost46284
\[\begin{array}{l} t_0 := \frac{x}{\frac{1}{x} \cdot \left(y \cdot \left(y \cdot 4\right)\right) + \frac{1}{x} \cdot \left(x \cdot x\right)} - \frac{y}{y + \left(x \cdot x\right) \cdot \frac{0.25}{y}}\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq -1.65 \cdot 10^{-142}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{-182}:\\ \;\;\;\;{\left({\left(\frac{\sqrt[3]{\mathsf{fma}\left({\left(\frac{x}{y}\right)}^{2}, 0.25, 1\right)}}{\sqrt[3]{-1 + {\left(\frac{x}{y}\right)}^{4} \cdot 0.0625}}\right)}^{3}\right)}^{-1}\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{+106}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 2
Error4.9
Cost27276
\[\begin{array}{l} t_0 := \mathsf{hypot}\left(1, \frac{\frac{x}{y}}{2}\right)\\ t_1 := \frac{x}{\frac{1}{x} \cdot \left(y \cdot \left(y \cdot 4\right)\right) + \frac{1}{x} \cdot \left(x \cdot x\right)} - \frac{y}{y + \left(x \cdot x\right) \cdot \frac{0.25}{y}}\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq -1.65 \cdot 10^{-142}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{-182}:\\ \;\;\;\;\frac{\mathsf{fma}\left({\left(\frac{x}{y}\right)}^{4}, 0.0625, -1\right)}{t_0 \cdot t_0}\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{+106}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 3
Error4.9
Cost20428
\[\begin{array}{l} t_0 := \frac{x}{\frac{1}{x} \cdot \left(y \cdot \left(y \cdot 4\right)\right) + \frac{1}{x} \cdot \left(x \cdot x\right)} - \frac{y}{y + \left(x \cdot x\right) \cdot \frac{0.25}{y}}\\ t_1 := \mathsf{hypot}\left(1, \frac{\frac{x}{y}}{2}\right)\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq -1.65 \cdot 10^{-142}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{-182}:\\ \;\;\;\;\mathsf{fma}\left(t_1, t_1, -2\right)\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{+106}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 4
Error14.5
Cost2768
\[\begin{array}{l} t_0 := y \cdot \left(y \cdot 4\right)\\ t_1 := \frac{x \cdot x - t_0}{x \cdot x + t_0}\\ \mathbf{if}\;t_0 \leq 10^{-216}:\\ \;\;\;\;1\\ \mathbf{elif}\;t_0 \leq 10^{-184}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_0 \leq 10^{-13}:\\ \;\;\;\;1\\ \mathbf{elif}\;t_0 \leq 4 \cdot 10^{+251}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_0 \leq 4 \cdot 10^{+282}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;-1 + \frac{x}{y} \cdot \frac{x}{y \cdot 4}\\ \end{array} \]
Alternative 5
Error4.9
Cost2512
\[\begin{array}{l} t_0 := \frac{x}{\frac{1}{x} \cdot \left(y \cdot \left(y \cdot 4\right)\right) + \frac{1}{x} \cdot \left(x \cdot x\right)} - \frac{y}{y + \left(x \cdot x\right) \cdot \frac{0.25}{y}}\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq -1.65 \cdot 10^{-142}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{-182}:\\ \;\;\;\;-2 + \left(1 + \frac{\frac{\frac{x}{\frac{y}{x}}}{y}}{4}\right)\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{+106}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 6
Error16.1
Cost1224
\[\begin{array}{l} t_0 := \frac{x}{y \cdot 2}\\ \mathbf{if}\;y \leq -2800000000:\\ \;\;\;\;-1 + \frac{x}{y} \cdot \frac{x}{y \cdot 4}\\ \mathbf{elif}\;y \leq 2.15 \cdot 10^{-27}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\left(-1 + t_0\right) \cdot \left(1 + t_0\right)\\ \end{array} \]
Alternative 7
Error16.0
Cost969
\[\begin{array}{l} \mathbf{if}\;y \leq -1950000000 \lor \neg \left(y \leq 7 \cdot 10^{-14}\right):\\ \;\;\;\;-1 + \frac{x}{y} \cdot \frac{x}{y \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 8
Error16.3
Cost328
\[\begin{array}{l} \mathbf{if}\;y \leq -4000000000:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-19}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \]
Alternative 9
Error32.4
Cost64
\[-1 \]

Error

Reproduce

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