?

Average Accuracy: 50.0% → 78.9%
Time: 14.4s
Precision: binary64
Cost: 84484

?

\[\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 := x \cdot x + y \cdot \left(y \cdot -4\right)\\ t_1 := y \cdot \left(y \cdot 4\right)\\ \mathbf{if}\;t_1 \leq 5 \cdot 10^{-309}:\\ \;\;\;\;\mathsf{fma}\left(-8, {\left({\left(\frac{\sqrt[3]{{\left(\sqrt[3]{y}\right)}^{2}}}{\frac{{\left({\left(\sqrt[3]{x}\right)}^{2}\right)}^{0.3333333333333333} \cdot \sqrt[3]{\sqrt[3]{x}}}{\sqrt[3]{\sqrt[3]{y}}}}\right)}^{2}\right)}^{3}, 1\right)\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+117}:\\ \;\;\;\;\frac{t_0}{t_1 + x \cdot x}\\ \mathbf{elif}\;t_1 \leq 10^{+161}:\\ \;\;\;\;1 + -8 \cdot \left(y \cdot \frac{\frac{y}{x}}{x}\right)\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+196}:\\ \;\;\;\;\frac{t_0}{\mathsf{fma}\left(x, x, t_1\right)}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+237}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{x}{y \cdot 4} + -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 x) (* y (* y -4.0)))) (t_1 (* y (* y 4.0))))
   (if (<= t_1 5e-309)
     (fma
      -8.0
      (pow
       (pow
        (/
         (cbrt (pow (cbrt y) 2.0))
         (/
          (* (pow (pow (cbrt x) 2.0) 0.3333333333333333) (cbrt (cbrt x)))
          (cbrt (cbrt y))))
        2.0)
       3.0)
      1.0)
     (if (<= t_1 5e+117)
       (/ t_0 (+ t_1 (* x x)))
       (if (<= t_1 1e+161)
         (+ 1.0 (* -8.0 (* y (/ (/ y x) x))))
         (if (<= t_1 2e+196)
           (/ t_0 (fma x x t_1))
           (if (<= t_1 5e+237) 1.0 (+ (* (/ x y) (/ x (* y 4.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 * x) + (y * (y * -4.0));
	double t_1 = y * (y * 4.0);
	double tmp;
	if (t_1 <= 5e-309) {
		tmp = fma(-8.0, pow(pow((cbrt(pow(cbrt(y), 2.0)) / ((pow(pow(cbrt(x), 2.0), 0.3333333333333333) * cbrt(cbrt(x))) / cbrt(cbrt(y)))), 2.0), 3.0), 1.0);
	} else if (t_1 <= 5e+117) {
		tmp = t_0 / (t_1 + (x * x));
	} else if (t_1 <= 1e+161) {
		tmp = 1.0 + (-8.0 * (y * ((y / x) / x)));
	} else if (t_1 <= 2e+196) {
		tmp = t_0 / fma(x, x, t_1);
	} else if (t_1 <= 5e+237) {
		tmp = 1.0;
	} else {
		tmp = ((x / y) * (x / (y * 4.0))) + -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 * x) + Float64(y * Float64(y * -4.0)))
	t_1 = Float64(y * Float64(y * 4.0))
	tmp = 0.0
	if (t_1 <= 5e-309)
		tmp = fma(-8.0, ((Float64(cbrt((cbrt(y) ^ 2.0)) / Float64(Float64(((cbrt(x) ^ 2.0) ^ 0.3333333333333333) * cbrt(cbrt(x))) / cbrt(cbrt(y)))) ^ 2.0) ^ 3.0), 1.0);
	elseif (t_1 <= 5e+117)
		tmp = Float64(t_0 / Float64(t_1 + Float64(x * x)));
	elseif (t_1 <= 1e+161)
		tmp = Float64(1.0 + Float64(-8.0 * Float64(y * Float64(Float64(y / x) / x))));
	elseif (t_1 <= 2e+196)
		tmp = Float64(t_0 / fma(x, x, t_1));
	elseif (t_1 <= 5e+237)
		tmp = 1.0;
	else
		tmp = Float64(Float64(Float64(x / y) * Float64(x / Float64(y * 4.0))) + -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 * x), $MachinePrecision] + N[(y * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-309], N[(-8.0 * N[Power[N[Power[N[(N[Power[N[Power[N[Power[y, 1/3], $MachinePrecision], 2.0], $MachinePrecision], 1/3], $MachinePrecision] / N[(N[(N[Power[N[Power[N[Power[x, 1/3], $MachinePrecision], 2.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision] * N[Power[N[Power[x, 1/3], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] / N[Power[N[Power[y, 1/3], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], 3.0], $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[t$95$1, 5e+117], N[(t$95$0 / N[(t$95$1 + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+161], N[(1.0 + N[(-8.0 * N[(y * N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+196], N[(t$95$0 / N[(x * x + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+237], 1.0, N[(N[(N[(x / y), $MachinePrecision] * N[(x / N[(y * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -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 := x \cdot x + y \cdot \left(y \cdot -4\right)\\
t_1 := y \cdot \left(y \cdot 4\right)\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{-309}:\\
\;\;\;\;\mathsf{fma}\left(-8, {\left({\left(\frac{\sqrt[3]{{\left(\sqrt[3]{y}\right)}^{2}}}{\frac{{\left({\left(\sqrt[3]{x}\right)}^{2}\right)}^{0.3333333333333333} \cdot \sqrt[3]{\sqrt[3]{x}}}{\sqrt[3]{\sqrt[3]{y}}}}\right)}^{2}\right)}^{3}, 1\right)\\

\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+117}:\\
\;\;\;\;\frac{t_0}{t_1 + x \cdot x}\\

\mathbf{elif}\;t_1 \leq 10^{+161}:\\
\;\;\;\;1 + -8 \cdot \left(y \cdot \frac{\frac{y}{x}}{x}\right)\\

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+196}:\\
\;\;\;\;\frac{t_0}{\mathsf{fma}\left(x, x, t_1\right)}\\

\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+237}:\\
\;\;\;\;1\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y \cdot 4} + -1\\


\end{array}

Error?

Target

Original50.0%
Target50.5%
Herbie78.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 6 regimes
  2. if (*.f64 (*.f64 y 4) y) < 4.9999999999999995e-309

    1. Initial program 51.9%

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

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

      [Start]51.9

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

      *-commutative [=>]51.9

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

      fma-def [=>]51.9

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

      *-commutative [=>]51.9

      \[ \frac{x \cdot x - y \cdot \left(y \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 76.7%

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

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

      [Start]76.7

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

      associate--l+ [=>]76.7

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

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

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

      metadata-eval [=>]76.7

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

      *-commutative [<=]76.7

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

      +-commutative [<=]76.7

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

      fma-def [=>]76.7

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

      unpow2 [=>]76.7

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

      unpow2 [=>]76.7

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

      times-frac [=>]89.4

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

      \[\leadsto \mathsf{fma}\left(-8, \color{blue}{{\left({\left(\sqrt[3]{\frac{y}{x}}\right)}^{2}\right)}^{3}}, 1\right) \]
    6. Applied egg-rr89.4%

      \[\leadsto \mathsf{fma}\left(-8, {\left({\color{blue}{\left(\frac{\sqrt[3]{{\left(\sqrt[3]{y}\right)}^{2}}}{\frac{\sqrt[3]{x}}{\sqrt[3]{\sqrt[3]{y}}}}\right)}}^{2}\right)}^{3}, 1\right) \]
    7. Applied egg-rr89.4%

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

    if 4.9999999999999995e-309 < (*.f64 (*.f64 y 4) y) < 4.99999999999999983e117

    1. Initial program 74.5%

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

    if 4.99999999999999983e117 < (*.f64 (*.f64 y 4) y) < 1e161

    1. Initial program 69.5%

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Simplified69.5%

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

      [Start]69.5

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

      *-commutative [=>]69.5

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

      fma-def [=>]69.5

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

      *-commutative [=>]69.5

      \[ \frac{x \cdot x - y \cdot \left(y \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 42.5%

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

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

      [Start]42.5

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

      associate--l+ [=>]42.6

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

      unpow2 [=>]42.6

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

      unpow2 [=>]42.6

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

      associate-*r/ [=>]42.6

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

      *-commutative [=>]42.6

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

      unpow2 [=>]42.6

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

      associate-*r* [<=]42.6

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

      unpow2 [=>]42.6

      \[ 1 + \left(-4 \cdot \frac{y \cdot y}{x \cdot x} - \frac{y \cdot \left(y \cdot 4\right)}{\color{blue}{x \cdot x}}\right) \]
    5. Taylor expanded in y around 0 42.6%

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

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

      [Start]42.6

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

      *-commutative [=>]42.6

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

      unpow2 [=>]42.6

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

      unpow2 [=>]42.6

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

      associate-*r/ [<=]42.6

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

      associate-/r* [=>]42.6

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

    if 1e161 < (*.f64 (*.f64 y 4) y) < 1.9999999999999999e196

    1. Initial program 73.8%

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Simplified73.8%

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

      [Start]73.8

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

      *-commutative [=>]73.8

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

      fma-def [=>]73.8

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

      *-commutative [=>]73.8

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

    if 1.9999999999999999e196 < (*.f64 (*.f64 y 4) y) < 5.0000000000000002e237

    1. Initial program 77.2%

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

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

      [Start]77.2

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

      *-commutative [=>]77.2

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

      fma-def [=>]77.2

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

      *-commutative [=>]77.2

      \[ \frac{x \cdot x - y \cdot \left(y \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 31.9%

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

    if 5.0000000000000002e237 < (*.f64 (*.f64 y 4) y)

    1. Initial program 13.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 13.4%

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

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

      [Start]13.4

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

      *-commutative [=>]13.4

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

      unpow2 [=>]13.4

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

      associate-*r* [<=]13.4

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

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y \cdot 4} - 1} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification78.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot \left(y \cdot 4\right) \leq 5 \cdot 10^{-309}:\\ \;\;\;\;\mathsf{fma}\left(-8, {\left({\left(\frac{\sqrt[3]{{\left(\sqrt[3]{y}\right)}^{2}}}{\frac{{\left({\left(\sqrt[3]{x}\right)}^{2}\right)}^{0.3333333333333333} \cdot \sqrt[3]{\sqrt[3]{x}}}{\sqrt[3]{\sqrt[3]{y}}}}\right)}^{2}\right)}^{3}, 1\right)\\ \mathbf{elif}\;y \cdot \left(y \cdot 4\right) \leq 5 \cdot 10^{+117}:\\ \;\;\;\;\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 10^{+161}:\\ \;\;\;\;1 + -8 \cdot \left(y \cdot \frac{\frac{y}{x}}{x}\right)\\ \mathbf{elif}\;y \cdot \left(y \cdot 4\right) \leq 2 \cdot 10^{+196}:\\ \;\;\;\;\frac{x \cdot x + y \cdot \left(y \cdot -4\right)}{\mathsf{fma}\left(x, x, y \cdot \left(y \cdot 4\right)\right)}\\ \mathbf{elif}\;y \cdot \left(y \cdot 4\right) \leq 5 \cdot 10^{+237}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{x}{y \cdot 4} + -1\\ \end{array} \]

Alternatives

Alternative 1
Accuracy78.9%
Cost71492
\[\begin{array}{l} t_0 := \sqrt[3]{\sqrt[3]{y}}\\ t_1 := y \cdot \left(y \cdot 4\right)\\ t_2 := x \cdot x + y \cdot \left(y \cdot -4\right)\\ \mathbf{if}\;t_1 \leq 5 \cdot 10^{-309}:\\ \;\;\;\;\mathsf{fma}\left(-8, {\left({\left(\frac{\sqrt[3]{{\left({t_0}^{3}\right)}^{2}}}{\frac{\sqrt[3]{x}}{t_0}}\right)}^{2}\right)}^{3}, 1\right)\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+117}:\\ \;\;\;\;\frac{t_2}{t_1 + x \cdot x}\\ \mathbf{elif}\;t_1 \leq 10^{+161}:\\ \;\;\;\;1 + -8 \cdot \left(y \cdot \frac{\frac{y}{x}}{x}\right)\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+196}:\\ \;\;\;\;\frac{t_2}{\mathsf{fma}\left(x, x, t_1\right)}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+237}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{x}{y \cdot 4} + -1\\ \end{array} \]
Alternative 2
Accuracy78.9%
Cost58820
\[\begin{array}{l} t_0 := \sqrt[3]{\sqrt[3]{y}}\\ t_1 := y \cdot \left(y \cdot 4\right)\\ t_2 := x \cdot x + y \cdot \left(y \cdot -4\right)\\ \mathbf{if}\;t_1 \leq 5 \cdot 10^{-309}:\\ \;\;\;\;1 + -8 \cdot {\left({\left(t_0 \cdot \frac{t_0 \cdot t_0}{\sqrt[3]{x}}\right)}^{2}\right)}^{3}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+117}:\\ \;\;\;\;\frac{t_2}{t_1 + x \cdot x}\\ \mathbf{elif}\;t_1 \leq 10^{+161}:\\ \;\;\;\;1 + -8 \cdot \left(y \cdot \frac{\frac{y}{x}}{x}\right)\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+196}:\\ \;\;\;\;\frac{t_2}{\mathsf{fma}\left(x, x, t_1\right)}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+237}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{x}{y \cdot 4} + -1\\ \end{array} \]
Alternative 3
Accuracy78.9%
Cost52356
\[\begin{array}{l} t_0 := y \cdot \left(y \cdot 4\right)\\ t_1 := x \cdot x + y \cdot \left(y \cdot -4\right)\\ \mathbf{if}\;t_0 \leq 5 \cdot 10^{-309}:\\ \;\;\;\;1 + -8 \cdot {\left({\left(\frac{\sqrt[3]{{\left(\sqrt[3]{y}\right)}^{2}}}{\frac{\sqrt[3]{x}}{\sqrt[3]{\sqrt[3]{y}}}}\right)}^{2}\right)}^{3}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+117}:\\ \;\;\;\;\frac{t_1}{t_0 + x \cdot x}\\ \mathbf{elif}\;t_0 \leq 10^{+161}:\\ \;\;\;\;1 + -8 \cdot \left(y \cdot \frac{\frac{y}{x}}{x}\right)\\ \mathbf{elif}\;t_0 \leq 2 \cdot 10^{+196}:\\ \;\;\;\;\frac{t_1}{\mathsf{fma}\left(x, x, t_0\right)}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+237}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{x}{y \cdot 4} + -1\\ \end{array} \]
Alternative 4
Accuracy78.8%
Cost20100
\[\begin{array}{l} t_0 := y \cdot \left(y \cdot 4\right)\\ t_1 := x \cdot x + y \cdot \left(y \cdot -4\right)\\ \mathbf{if}\;t_0 \leq 5 \cdot 10^{-309}:\\ \;\;\;\;1 + -8 \cdot \sqrt{{\left(\sqrt[3]{\frac{y}{x}}\right)}^{12}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+117}:\\ \;\;\;\;\frac{t_1}{t_0 + x \cdot x}\\ \mathbf{elif}\;t_0 \leq 10^{+161}:\\ \;\;\;\;1 + -8 \cdot \left(y \cdot \frac{\frac{y}{x}}{x}\right)\\ \mathbf{elif}\;t_0 \leq 2 \cdot 10^{+196}:\\ \;\;\;\;\frac{t_1}{\mathsf{fma}\left(x, x, t_0\right)}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+237}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{x}{y \cdot 4} + -1\\ \end{array} \]
Alternative 5
Accuracy78.8%
Cost9040
\[\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 := 1 + -8 \cdot \left(y \cdot \frac{\frac{y}{x}}{x}\right)\\ \mathbf{if}\;t_0 \leq 5 \cdot 10^{-309}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+117}:\\ \;\;\;\;\frac{t_1}{t_0 + x \cdot x}\\ \mathbf{elif}\;t_0 \leq 10^{+161}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_0 \leq 2 \cdot 10^{+196}:\\ \;\;\;\;\frac{t_1}{\mathsf{fma}\left(x, x, t_0\right)}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+237}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{x}{y \cdot 4} + -1\\ \end{array} \]
Alternative 6
Accuracy78.8%
Cost2768
\[\begin{array}{l} t_0 := 1 + -8 \cdot \left(y \cdot \frac{\frac{y}{x}}{x}\right)\\ 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 5 \cdot 10^{-309}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+117}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 10^{+161}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+196}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+237}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{x}{y \cdot 4} + -1\\ \end{array} \]
Alternative 7
Accuracy73.7%
Cost1869
\[\begin{array}{l} t_0 := y \cdot \left(y \cdot 4\right)\\ \mathbf{if}\;t_0 \leq 5 \cdot 10^{-14}:\\ \;\;\;\;1 + \frac{\frac{y \cdot -8}{x}}{\frac{x}{y}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+117} \lor \neg \left(t_0 \leq 5 \cdot 10^{+237}\right):\\ \;\;\;\;\frac{x}{y} \cdot \frac{x}{y \cdot 4} + -1\\ \mathbf{else}:\\ \;\;\;\;1 + -8 \cdot \left(y \cdot \frac{\frac{y}{x}}{x}\right)\\ \end{array} \]
Alternative 8
Accuracy74.5%
Cost1233
\[\begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{+26}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq 0.0009 \lor \neg \left(y \leq 3.2 \cdot 10^{+63}\right) \land y \leq 3 \cdot 10^{+118}:\\ \;\;\;\;1 + -8 \cdot \left(y \cdot \frac{\frac{y}{x}}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \]
Alternative 9
Accuracy74.7%
Cost1232
\[\begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{+27}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{-5}:\\ \;\;\;\;1 + \frac{\frac{y \cdot -8}{x}}{\frac{x}{y}}\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+61}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq 3 \cdot 10^{+118}:\\ \;\;\;\;1 + -8 \cdot \left(y \cdot \frac{\frac{y}{x}}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \]
Alternative 10
Accuracy74.1%
Cost592
\[\begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{+26}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq 2 \cdot 10^{-7}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 6 \cdot 10^{+58}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq 3 \cdot 10^{+118}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \]
Alternative 11
Accuracy49.9%
Cost64
\[-1 \]

Error

Reproduce?

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