?

Average Error: 32.2 → 4.3
Time: 15.4s
Precision: binary64
Cost: 2256

?

\[\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{y \cdot \left(y \cdot 4\right)}{y \cdot \left(y \cdot -4\right) - x \cdot x} - \frac{x}{\frac{y \cdot -4}{\frac{x}{y}} - x}\\ \mathbf{if}\;y \leq -6.6 \cdot 10^{+153}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{x}{y \cdot 4} + -1\\ \mathbf{elif}\;y \leq -1.2 \cdot 10^{-145}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-177}:\\ \;\;\;\;1 - \frac{y}{x} \cdot \frac{y \cdot 4}{x}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+139}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{\frac{y}{x}}}{y} \cdot 0.5 + -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)) (- (* y (* y -4.0)) (* x x)))
          (/ x (- (/ (* y -4.0) (/ x y)) x)))))
   (if (<= y -6.6e+153)
     (+ (* (/ x y) (/ x (* y 4.0))) -1.0)
     (if (<= y -1.2e-145)
       t_0
       (if (<= y 3.5e-177)
         (- 1.0 (* (/ y x) (/ (* y 4.0) x)))
         (if (<= y 1.05e+139) t_0 (+ (* (/ (/ 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)) / ((y * (y * -4.0)) - (x * x))) - (x / (((y * -4.0) / (x / y)) - x));
	double tmp;
	if (y <= -6.6e+153) {
		tmp = ((x / y) * (x / (y * 4.0))) + -1.0;
	} else if (y <= -1.2e-145) {
		tmp = t_0;
	} else if (y <= 3.5e-177) {
		tmp = 1.0 - ((y / x) * ((y * 4.0) / x));
	} else if (y <= 1.05e+139) {
		tmp = t_0;
	} else {
		tmp = (((x / (y / x)) / y) * 0.5) + -1.0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((x * x) - ((y * 4.0d0) * y)) / ((x * x) + ((y * 4.0d0) * y))
end function
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = ((y * (y * 4.0d0)) / ((y * (y * (-4.0d0))) - (x * x))) - (x / (((y * (-4.0d0)) / (x / y)) - x))
    if (y <= (-6.6d+153)) then
        tmp = ((x / y) * (x / (y * 4.0d0))) + (-1.0d0)
    else if (y <= (-1.2d-145)) then
        tmp = t_0
    else if (y <= 3.5d-177) then
        tmp = 1.0d0 - ((y / x) * ((y * 4.0d0) / x))
    else if (y <= 1.05d+139) then
        tmp = t_0
    else
        tmp = (((x / (y / x)) / y) * 0.5d0) + (-1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	return ((x * x) - ((y * 4.0) * y)) / ((x * x) + ((y * 4.0) * y));
}
public static double code(double x, double y) {
	double t_0 = ((y * (y * 4.0)) / ((y * (y * -4.0)) - (x * x))) - (x / (((y * -4.0) / (x / y)) - x));
	double tmp;
	if (y <= -6.6e+153) {
		tmp = ((x / y) * (x / (y * 4.0))) + -1.0;
	} else if (y <= -1.2e-145) {
		tmp = t_0;
	} else if (y <= 3.5e-177) {
		tmp = 1.0 - ((y / x) * ((y * 4.0) / x));
	} else if (y <= 1.05e+139) {
		tmp = t_0;
	} else {
		tmp = (((x / (y / x)) / y) * 0.5) + -1.0;
	}
	return tmp;
}
def code(x, y):
	return ((x * x) - ((y * 4.0) * y)) / ((x * x) + ((y * 4.0) * y))
def code(x, y):
	t_0 = ((y * (y * 4.0)) / ((y * (y * -4.0)) - (x * x))) - (x / (((y * -4.0) / (x / y)) - x))
	tmp = 0
	if y <= -6.6e+153:
		tmp = ((x / y) * (x / (y * 4.0))) + -1.0
	elif y <= -1.2e-145:
		tmp = t_0
	elif y <= 3.5e-177:
		tmp = 1.0 - ((y / x) * ((y * 4.0) / x))
	elif y <= 1.05e+139:
		tmp = t_0
	else:
		tmp = (((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(Float64(Float64(y * Float64(y * 4.0)) / Float64(Float64(y * Float64(y * -4.0)) - Float64(x * x))) - Float64(x / Float64(Float64(Float64(y * -4.0) / Float64(x / y)) - x)))
	tmp = 0.0
	if (y <= -6.6e+153)
		tmp = Float64(Float64(Float64(x / y) * Float64(x / Float64(y * 4.0))) + -1.0);
	elseif (y <= -1.2e-145)
		tmp = t_0;
	elseif (y <= 3.5e-177)
		tmp = Float64(1.0 - Float64(Float64(y / x) * Float64(Float64(y * 4.0) / x)));
	elseif (y <= 1.05e+139)
		tmp = t_0;
	else
		tmp = Float64(Float64(Float64(Float64(x / Float64(y / x)) / y) * 0.5) + -1.0);
	end
	return tmp
end
function tmp = code(x, y)
	tmp = ((x * x) - ((y * 4.0) * y)) / ((x * x) + ((y * 4.0) * y));
end
function tmp_2 = code(x, y)
	t_0 = ((y * (y * 4.0)) / ((y * (y * -4.0)) - (x * x))) - (x / (((y * -4.0) / (x / y)) - x));
	tmp = 0.0;
	if (y <= -6.6e+153)
		tmp = ((x / y) * (x / (y * 4.0))) + -1.0;
	elseif (y <= -1.2e-145)
		tmp = t_0;
	elseif (y <= 3.5e-177)
		tmp = 1.0 - ((y / x) * ((y * 4.0) / x));
	elseif (y <= 1.05e+139)
		tmp = t_0;
	else
		tmp = (((x / (y / x)) / y) * 0.5) + -1.0;
	end
	tmp_2 = 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[(N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision] / N[(N[(y * N[(y * -4.0), $MachinePrecision]), $MachinePrecision] - N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[(N[(N[(y * -4.0), $MachinePrecision] / N[(x / y), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.6e+153], N[(N[(N[(x / y), $MachinePrecision] * N[(x / N[(y * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[y, -1.2e-145], t$95$0, If[LessEqual[y, 3.5e-177], N[(1.0 - N[(N[(y / x), $MachinePrecision] * N[(N[(y * 4.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e+139], t$95$0, N[(N[(N[(N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] * 0.5), $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 := \frac{y \cdot \left(y \cdot 4\right)}{y \cdot \left(y \cdot -4\right) - x \cdot x} - \frac{x}{\frac{y \cdot -4}{\frac{x}{y}} - x}\\
\mathbf{if}\;y \leq -6.6 \cdot 10^{+153}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y \cdot 4} + -1\\

\mathbf{elif}\;y \leq -1.2 \cdot 10^{-145}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{-177}:\\
\;\;\;\;1 - \frac{y}{x} \cdot \frac{y \cdot 4}{x}\\

\mathbf{elif}\;y \leq 1.05 \cdot 10^{+139}:\\
\;\;\;\;t_0\\

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


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original32.2
Target31.9
Herbie4.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 4 regimes
  2. if y < -6.59999999999999989e153

    1. Initial program 64.0

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

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

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

      [Start]64.0

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

      *-commutative [=>]64.0

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

      unpow2 [=>]64.0

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

      associate-*r* [<=]64.0

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

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y \cdot 4} - 1} \]

    if -6.59999999999999989e153 < y < -1.20000000000000008e-145 or 3.5000000000000002e-177 < y < 1.0499999999999999e139

    1. Initial program 16.6

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

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

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

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

      [Start]16.6

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

      sub0-neg [=>]16.6

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

      associate-/l* [=>]16.2

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

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

    if -1.20000000000000008e-145 < y < 3.5000000000000002e-177

    1. Initial program 31.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 inf 31.9

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

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

      [Start]31.9

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

      unpow2 [=>]31.9

      \[ \frac{\color{blue}{x \cdot x}}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    4. Taylor expanded in x around inf 15.9

      \[\leadsto \color{blue}{1 + -4 \cdot \frac{{y}^{2}}{{x}^{2}}} \]
    5. Simplified15.9

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

      [Start]15.9

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

      associate-*r/ [=>]15.9

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

      unpow2 [=>]15.9

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

      unpow2 [=>]15.9

      \[ 1 + \frac{-4 \cdot \left(y \cdot y\right)}{\color{blue}{x \cdot x}} \]
    6. Applied egg-rr8.8

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

    if 1.0499999999999999e139 < y

    1. Initial program 60.0

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Simplified60.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]60.0

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

      fma-neg [=>]60.0

      \[ \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 [=>]60.0

      \[ \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* [=>]60.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 [=>]60.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 [=>]60.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 [=>]60.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 [=>]60.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 0 15.5

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

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

      [Start]15.5

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

      fma-neg [=>]15.5

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

      unpow2 [=>]15.5

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

      unpow2 [=>]15.5

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

      times-frac [=>]7.6

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

      metadata-eval [=>]7.6

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{\frac{y}{x}}}{y}} \cdot 0.5 + -1 \]
  3. Recombined 4 regimes into one program.
  4. Final simplification4.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.6 \cdot 10^{+153}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{x}{y \cdot 4} + -1\\ \mathbf{elif}\;y \leq -1.2 \cdot 10^{-145}:\\ \;\;\;\;\frac{y \cdot \left(y \cdot 4\right)}{y \cdot \left(y \cdot -4\right) - x \cdot x} - \frac{x}{\frac{y \cdot -4}{\frac{x}{y}} - x}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-177}:\\ \;\;\;\;1 - \frac{y}{x} \cdot \frac{y \cdot 4}{x}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+139}:\\ \;\;\;\;\frac{y \cdot \left(y \cdot 4\right)}{y \cdot \left(y \cdot -4\right) - x \cdot x} - \frac{x}{\frac{y \cdot -4}{\frac{x}{y}} - x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{\frac{y}{x}}}{y} \cdot 0.5 + -1\\ \end{array} \]

Alternatives

Alternative 1
Error14.9
Cost3544
\[\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^{-289}:\\ \;\;\;\;1 - \frac{y}{x} \cdot \frac{y \cdot 4}{x}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{-206}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_0 \leq 10^{-31}:\\ \;\;\;\;1 + \frac{\left(y \cdot y\right) \cdot -8}{x \cdot x}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+145}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_0 \leq 10^{+171}:\\ \;\;\;\;1\\ \mathbf{elif}\;t_0 \leq 10^{+214}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+260}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{\frac{y}{x}}}{y} \cdot 0.5 + -1\\ \end{array} \]
Alternative 2
Error17.8
Cost1762
\[\begin{array}{l} t_0 := \frac{\frac{x}{\frac{y}{x}}}{y} \cdot 0.5 + -1\\ t_1 := 1 - \frac{y}{x} \cdot \frac{y \cdot 4}{x}\\ \mathbf{if}\;x \leq -1.25 \cdot 10^{-52}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -4.4 \cdot 10^{-187}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -2.7 \cdot 10^{-220}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{-96} \lor \neg \left(x \leq 1.8 \cdot 10^{-77}\right) \land \left(x \leq 10^{-25} \lor \neg \left(x \leq 4.6 \cdot 10^{+82}\right) \land x \leq 2.7 \cdot 10^{+108}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error17.9
Cost1761
\[\begin{array}{l} t_0 := \frac{x}{y} \cdot \frac{x}{y \cdot 4} + -1\\ t_1 := 1 - \frac{y}{x} \cdot \frac{y \cdot 4}{x}\\ t_2 := \frac{\frac{x}{\frac{y}{x}}}{y} \cdot 0.5 + -1\\ \mathbf{if}\;x \leq -1.05 \cdot 10^{-53}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -4.4 \cdot 10^{-187}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -2.7 \cdot 10^{-220}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{-96}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 1.06 \cdot 10^{-76}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{-28}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{+82} \lor \neg \left(x \leq 3.1 \cdot 10^{+108}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 4
Error17.8
Cost1760
\[\begin{array}{l} t_0 := \frac{x}{y} \cdot \frac{x}{y \cdot 4} + -1\\ t_1 := 1 + \frac{\left(y \cdot y\right) \cdot -8}{x \cdot x}\\ t_2 := 1 - \frac{y}{x} \cdot \frac{y \cdot 4}{x}\\ t_3 := \frac{\frac{x}{\frac{y}{x}}}{y} \cdot 0.5 + -1\\ \mathbf{if}\;x \leq -5 \cdot 10^{-52}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -4.4 \cdot 10^{-187}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -2.7 \cdot 10^{-220}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{-96}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{-77}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-28}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{+82}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{+108}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Error16.9
Cost1233
\[\begin{array}{l} \mathbf{if}\;y \leq -212:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-7} \lor \neg \left(y \leq 1.2 \cdot 10^{+78}\right) \land y \leq 6 \cdot 10^{+136}:\\ \;\;\;\;1 - \frac{y}{x} \cdot \frac{y \cdot 4}{x}\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \]
Alternative 6
Error17.1
Cost592
\[\begin{array}{l} \mathbf{if}\;y \leq -7.2:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq 4:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+72}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+129}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \]
Alternative 7
Error31.2
Cost64
\[-1 \]

Error

Reproduce?

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