Diagrams.TwoD.Arc:arcBetween from diagrams-lib-1.3.0.3

Percentage Accurate: 50.2% → 80.2%
Time: 10.2s
Alternatives: 5
Speedup: 19.0×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(y \cdot 4\right) \cdot y\\ \frac{x \cdot x - t_0}{x \cdot x + t_0} \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* (* y 4.0) y))) (/ (- (* x x) t_0) (+ (* x x) t_0))))
double code(double x, double y) {
	double t_0 = (y * 4.0) * y;
	return ((x * x) - t_0) / ((x * x) + t_0);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    t_0 = (y * 4.0d0) * y
    code = ((x * x) - t_0) / ((x * x) + t_0)
end function
public static double code(double x, double y) {
	double t_0 = (y * 4.0) * y;
	return ((x * x) - t_0) / ((x * x) + t_0);
}
def code(x, y):
	t_0 = (y * 4.0) * y
	return ((x * x) - t_0) / ((x * x) + t_0)
function code(x, y)
	t_0 = Float64(Float64(y * 4.0) * y)
	return Float64(Float64(Float64(x * x) - t_0) / Float64(Float64(x * x) + t_0))
end
function tmp = code(x, y)
	t_0 = (y * 4.0) * y;
	tmp = ((x * x) - t_0) / ((x * x) + t_0);
end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * 4.0), $MachinePrecision] * y), $MachinePrecision]}, N[(N[(N[(x * x), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(N[(x * x), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(y \cdot 4\right) \cdot y\\
\frac{x \cdot x - t_0}{x \cdot x + t_0}
\end{array}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 5 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 50.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(y \cdot 4\right) \cdot y\\ \frac{x \cdot x - t_0}{x \cdot x + t_0} \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* (* y 4.0) y))) (/ (- (* x x) t_0) (+ (* x x) t_0))))
double code(double x, double y) {
	double t_0 = (y * 4.0) * y;
	return ((x * x) - t_0) / ((x * x) + t_0);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    t_0 = (y * 4.0d0) * y
    code = ((x * x) - t_0) / ((x * x) + t_0)
end function
public static double code(double x, double y) {
	double t_0 = (y * 4.0) * y;
	return ((x * x) - t_0) / ((x * x) + t_0);
}
def code(x, y):
	t_0 = (y * 4.0) * y
	return ((x * x) - t_0) / ((x * x) + t_0)
function code(x, y)
	t_0 = Float64(Float64(y * 4.0) * y)
	return Float64(Float64(Float64(x * x) - t_0) / Float64(Float64(x * x) + t_0))
end
function tmp = code(x, y)
	t_0 = (y * 4.0) * y;
	tmp = ((x * x) - t_0) / ((x * x) + t_0);
end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * 4.0), $MachinePrecision] * y), $MachinePrecision]}, N[(N[(N[(x * x), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(N[(x * x), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(y \cdot 4\right) \cdot y\\
\frac{x \cdot x - t_0}{x \cdot x + t_0}
\end{array}
\end{array}

Alternative 1: 80.2% accurate, 0.8× speedup?

\[\begin{array}{l} y = |y|\\ \\ \begin{array}{l} t_0 := y \cdot \left(y \cdot 4\right)\\ t_1 := \frac{\frac{x}{y}}{\frac{y}{x}}\\ \mathbf{if}\;y \leq 4.8 \cdot 10^{-68}:\\ \;\;\;\;1 + \frac{-8}{t_1}\\ \mathbf{elif}\;y \leq 3.05 \cdot 10^{+81}:\\ \;\;\;\;\frac{x \cdot x - t_0}{x \cdot x + t_0}\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot 0.5 + -1\\ \end{array} \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* y (* y 4.0))) (t_1 (/ (/ x y) (/ y x))))
   (if (<= y 4.8e-68)
     (+ 1.0 (/ -8.0 t_1))
     (if (<= y 3.05e+81)
       (/ (- (* x x) t_0) (+ (* x x) t_0))
       (+ (* t_1 0.5) -1.0)))))
y = abs(y);
double code(double x, double y) {
	double t_0 = y * (y * 4.0);
	double t_1 = (x / y) / (y / x);
	double tmp;
	if (y <= 4.8e-68) {
		tmp = 1.0 + (-8.0 / t_1);
	} else if (y <= 3.05e+81) {
		tmp = ((x * x) - t_0) / ((x * x) + t_0);
	} else {
		tmp = (t_1 * 0.5) + -1.0;
	}
	return tmp;
}
NOTE: y should be positive before calling this function
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = y * (y * 4.0d0)
    t_1 = (x / y) / (y / x)
    if (y <= 4.8d-68) then
        tmp = 1.0d0 + ((-8.0d0) / t_1)
    else if (y <= 3.05d+81) then
        tmp = ((x * x) - t_0) / ((x * x) + t_0)
    else
        tmp = (t_1 * 0.5d0) + (-1.0d0)
    end if
    code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y) {
	double t_0 = y * (y * 4.0);
	double t_1 = (x / y) / (y / x);
	double tmp;
	if (y <= 4.8e-68) {
		tmp = 1.0 + (-8.0 / t_1);
	} else if (y <= 3.05e+81) {
		tmp = ((x * x) - t_0) / ((x * x) + t_0);
	} else {
		tmp = (t_1 * 0.5) + -1.0;
	}
	return tmp;
}
y = abs(y)
def code(x, y):
	t_0 = y * (y * 4.0)
	t_1 = (x / y) / (y / x)
	tmp = 0
	if y <= 4.8e-68:
		tmp = 1.0 + (-8.0 / t_1)
	elif y <= 3.05e+81:
		tmp = ((x * x) - t_0) / ((x * x) + t_0)
	else:
		tmp = (t_1 * 0.5) + -1.0
	return tmp
y = abs(y)
function code(x, y)
	t_0 = Float64(y * Float64(y * 4.0))
	t_1 = Float64(Float64(x / y) / Float64(y / x))
	tmp = 0.0
	if (y <= 4.8e-68)
		tmp = Float64(1.0 + Float64(-8.0 / t_1));
	elseif (y <= 3.05e+81)
		tmp = Float64(Float64(Float64(x * x) - t_0) / Float64(Float64(x * x) + t_0));
	else
		tmp = Float64(Float64(t_1 * 0.5) + -1.0);
	end
	return tmp
end
y = abs(y)
function tmp_2 = code(x, y)
	t_0 = y * (y * 4.0);
	t_1 = (x / y) / (y / x);
	tmp = 0.0;
	if (y <= 4.8e-68)
		tmp = 1.0 + (-8.0 / t_1);
	elseif (y <= 3.05e+81)
		tmp = ((x * x) - t_0) / ((x * x) + t_0);
	else
		tmp = (t_1 * 0.5) + -1.0;
	end
	tmp_2 = tmp;
end
NOTE: y should be positive before calling this function
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4.8e-68], N[(1.0 + N[(-8.0 / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.05e+81], N[(N[(N[(x * x), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(N[(x * x), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]]]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot 4\right)\\
t_1 := \frac{\frac{x}{y}}{\frac{y}{x}}\\
\mathbf{if}\;y \leq 4.8 \cdot 10^{-68}:\\
\;\;\;\;1 + \frac{-8}{t_1}\\

\mathbf{elif}\;y \leq 3.05 \cdot 10^{+81}:\\
\;\;\;\;\frac{x \cdot x - t_0}{x \cdot x + t_0}\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot 0.5 + -1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 4.79999999999999982e-68

    1. Initial program 49.1%

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Step-by-step derivation
      1. frac-2neg49.1%

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

        \[\leadsto \color{blue}{\left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \cdot \frac{1}{-\left(x \cdot x + \left(y \cdot 4\right) \cdot y\right)}} \]
      3. *-commutative48.4%

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

        \[\leadsto \frac{1}{\color{blue}{0 - \left(x \cdot x + \left(y \cdot 4\right) \cdot y\right)}} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      5. +-commutative48.4%

        \[\leadsto \frac{1}{0 - \color{blue}{\left(\left(y \cdot 4\right) \cdot y + x \cdot x\right)}} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      6. associate--r+48.4%

        \[\leadsto \frac{1}{\color{blue}{\left(0 - \left(y \cdot 4\right) \cdot y\right) - x \cdot x}} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      7. neg-sub048.4%

        \[\leadsto \frac{1}{\color{blue}{\left(-\left(y \cdot 4\right) \cdot y\right)} - x \cdot x} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      8. distribute-lft-neg-in48.4%

        \[\leadsto \frac{1}{\color{blue}{\left(-y \cdot 4\right) \cdot y} - x \cdot x} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      9. *-commutative48.4%

        \[\leadsto \frac{1}{\color{blue}{y \cdot \left(-y \cdot 4\right)} - x \cdot x} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      10. distribute-rgt-neg-in48.4%

        \[\leadsto \frac{1}{y \cdot \color{blue}{\left(y \cdot \left(-4\right)\right)} - x \cdot x} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      11. metadata-eval48.4%

        \[\leadsto \frac{1}{y \cdot \left(y \cdot \color{blue}{-4}\right) - x \cdot x} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      12. pow248.4%

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

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

        \[\leadsto \frac{1}{y \cdot \left(y \cdot -4\right) - {x}^{2}} \cdot \left(-\left({x}^{2} - \color{blue}{\left(4 \cdot y\right)} \cdot y\right)\right) \]
      15. associate-*l*48.4%

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

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

      \[\leadsto \color{blue}{\frac{1}{y \cdot \left(y \cdot -4\right) - {x}^{2}} \cdot \left(-\left({x}^{2} - 4 \cdot {y}^{2}\right)\right)} \]
    4. Step-by-step derivation
      1. unpow248.4%

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

        \[\leadsto \frac{1}{y \cdot \left(y \cdot -4\right) - {x}^{2}} \cdot \left(-\left(x \cdot x - \color{blue}{\sqrt{4 \cdot {y}^{2}} \cdot \sqrt{4 \cdot {y}^{2}}}\right)\right) \]
      3. difference-of-squares48.4%

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

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

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

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

        \[\leadsto \frac{1}{y \cdot \left(y \cdot -4\right) - {x}^{2}} \cdot \left(-\left(x + \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot \sqrt{4}\right) \cdot \left(x - \sqrt{4 \cdot {y}^{2}}\right)\right) \]
      8. add-sqr-sqrt29.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1 + -8 \cdot \frac{{y}^{2}}{{x}^{2}}} \]
    7. Step-by-step derivation
      1. associate-*r/50.6%

        \[\leadsto 1 + \color{blue}{\frac{-8 \cdot {y}^{2}}{{x}^{2}}} \]
      2. associate-/l*50.6%

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

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

        \[\leadsto 1 + \frac{-8}{\frac{\color{blue}{x \cdot x}}{y \cdot y}} \]
      5. times-frac57.3%

        \[\leadsto 1 + \frac{-8}{\color{blue}{\frac{x}{y} \cdot \frac{x}{y}}} \]
      6. unpow257.3%

        \[\leadsto 1 + \frac{-8}{\color{blue}{{\left(\frac{x}{y}\right)}^{2}}} \]
    8. Simplified57.3%

      \[\leadsto \color{blue}{1 + \frac{-8}{{\left(\frac{x}{y}\right)}^{2}}} \]
    9. Step-by-step derivation
      1. unpow257.3%

        \[\leadsto 1 + \frac{-8}{\color{blue}{\frac{x}{y} \cdot \frac{x}{y}}} \]
      2. associate-*r/57.3%

        \[\leadsto 1 + \frac{-8}{\color{blue}{\frac{\frac{x}{y} \cdot x}{y}}} \]
      3. associate-/l*57.3%

        \[\leadsto 1 + \frac{-8}{\color{blue}{\frac{\frac{x}{y}}{\frac{y}{x}}}} \]
    10. Applied egg-rr57.3%

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

    if 4.79999999999999982e-68 < y < 3.05000000000000019e81

    1. Initial program 87.0%

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

    if 3.05000000000000019e81 < y

    1. Initial program 19.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 0 71.2%

      \[\leadsto \color{blue}{\left(-0.125 \cdot \frac{{x}^{4}}{{y}^{4}} + 0.5 \cdot \frac{{x}^{2}}{{y}^{2}}\right) - 1} \]
    3. Step-by-step derivation
      1. unpow271.2%

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

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2}}{{y}^{2}}} - 1 \]
    6. Step-by-step derivation
      1. unpow279.0%

        \[\leadsto 0.5 \cdot \frac{{x}^{2}}{\color{blue}{y \cdot y}} - 1 \]
      2. unpow279.0%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x}}{y \cdot y} - 1 \]
      3. times-frac85.5%

        \[\leadsto 0.5 \cdot \color{blue}{\left(\frac{x}{y} \cdot \frac{x}{y}\right)} - 1 \]
      4. unpow285.5%

        \[\leadsto 0.5 \cdot \color{blue}{{\left(\frac{x}{y}\right)}^{2}} - 1 \]
    7. Simplified85.5%

      \[\leadsto \color{blue}{0.5 \cdot {\left(\frac{x}{y}\right)}^{2}} - 1 \]
    8. Step-by-step derivation
      1. unpow218.5%

        \[\leadsto 1 + \frac{-8}{\color{blue}{\frac{x}{y} \cdot \frac{x}{y}}} \]
      2. associate-*r/18.5%

        \[\leadsto 1 + \frac{-8}{\color{blue}{\frac{\frac{x}{y} \cdot x}{y}}} \]
      3. associate-/l*18.5%

        \[\leadsto 1 + \frac{-8}{\color{blue}{\frac{\frac{x}{y}}{\frac{y}{x}}}} \]
    9. Applied egg-rr85.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4.8 \cdot 10^{-68}:\\ \;\;\;\;1 + \frac{-8}{\frac{\frac{x}{y}}{\frac{y}{x}}}\\ \mathbf{elif}\;y \leq 3.05 \cdot 10^{+81}:\\ \;\;\;\;\frac{x \cdot x - y \cdot \left(y \cdot 4\right)}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{\frac{y}{x}} \cdot 0.5 + -1\\ \end{array} \]

Alternative 2: 73.9% accurate, 1.1× speedup?

\[\begin{array}{l} y = |y|\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 4.6 \cdot 10^{-68} \lor \neg \left(y \leq 0.000162\right) \land y \leq 3.25 \cdot 10^{+35}:\\ \;\;\;\;1 + \frac{-8}{\frac{\frac{x}{y}}{\frac{y}{x}}}\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y)
 :precision binary64
 (if (or (<= y 4.6e-68) (and (not (<= y 0.000162)) (<= y 3.25e+35)))
   (+ 1.0 (/ -8.0 (/ (/ x y) (/ y x))))
   -1.0))
y = abs(y);
double code(double x, double y) {
	double tmp;
	if ((y <= 4.6e-68) || (!(y <= 0.000162) && (y <= 3.25e+35))) {
		tmp = 1.0 + (-8.0 / ((x / y) / (y / x)));
	} else {
		tmp = -1.0;
	}
	return tmp;
}
NOTE: y should be positive before calling this function
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((y <= 4.6d-68) .or. (.not. (y <= 0.000162d0)) .and. (y <= 3.25d+35)) then
        tmp = 1.0d0 + ((-8.0d0) / ((x / y) / (y / x)))
    else
        tmp = -1.0d0
    end if
    code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y) {
	double tmp;
	if ((y <= 4.6e-68) || (!(y <= 0.000162) && (y <= 3.25e+35))) {
		tmp = 1.0 + (-8.0 / ((x / y) / (y / x)));
	} else {
		tmp = -1.0;
	}
	return tmp;
}
y = abs(y)
def code(x, y):
	tmp = 0
	if (y <= 4.6e-68) or (not (y <= 0.000162) and (y <= 3.25e+35)):
		tmp = 1.0 + (-8.0 / ((x / y) / (y / x)))
	else:
		tmp = -1.0
	return tmp
y = abs(y)
function code(x, y)
	tmp = 0.0
	if ((y <= 4.6e-68) || (!(y <= 0.000162) && (y <= 3.25e+35)))
		tmp = Float64(1.0 + Float64(-8.0 / Float64(Float64(x / y) / Float64(y / x))));
	else
		tmp = -1.0;
	end
	return tmp
end
y = abs(y)
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((y <= 4.6e-68) || (~((y <= 0.000162)) && (y <= 3.25e+35)))
		tmp = 1.0 + (-8.0 / ((x / y) / (y / x)));
	else
		tmp = -1.0;
	end
	tmp_2 = tmp;
end
NOTE: y should be positive before calling this function
code[x_, y_] := If[Or[LessEqual[y, 4.6e-68], And[N[Not[LessEqual[y, 0.000162]], $MachinePrecision], LessEqual[y, 3.25e+35]]], N[(1.0 + N[(-8.0 / N[(N[(x / y), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.6 \cdot 10^{-68} \lor \neg \left(y \leq 0.000162\right) \land y \leq 3.25 \cdot 10^{+35}:\\
\;\;\;\;1 + \frac{-8}{\frac{\frac{x}{y}}{\frac{y}{x}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 4.59999999999999994e-68 or 1.62000000000000007e-4 < y < 3.2500000000000002e35

    1. Initial program 49.4%

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Step-by-step derivation
      1. frac-2neg49.4%

        \[\leadsto \color{blue}{\frac{-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)}{-\left(x \cdot x + \left(y \cdot 4\right) \cdot y\right)}} \]
      2. div-inv48.8%

        \[\leadsto \color{blue}{\left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \cdot \frac{1}{-\left(x \cdot x + \left(y \cdot 4\right) \cdot y\right)}} \]
      3. *-commutative48.8%

        \[\leadsto \color{blue}{\frac{1}{-\left(x \cdot x + \left(y \cdot 4\right) \cdot y\right)} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right)} \]
      4. neg-sub048.8%

        \[\leadsto \frac{1}{\color{blue}{0 - \left(x \cdot x + \left(y \cdot 4\right) \cdot y\right)}} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      5. +-commutative48.8%

        \[\leadsto \frac{1}{0 - \color{blue}{\left(\left(y \cdot 4\right) \cdot y + x \cdot x\right)}} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      6. associate--r+48.8%

        \[\leadsto \frac{1}{\color{blue}{\left(0 - \left(y \cdot 4\right) \cdot y\right) - x \cdot x}} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      7. neg-sub048.8%

        \[\leadsto \frac{1}{\color{blue}{\left(-\left(y \cdot 4\right) \cdot y\right)} - x \cdot x} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      8. distribute-lft-neg-in48.8%

        \[\leadsto \frac{1}{\color{blue}{\left(-y \cdot 4\right) \cdot y} - x \cdot x} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      9. *-commutative48.8%

        \[\leadsto \frac{1}{\color{blue}{y \cdot \left(-y \cdot 4\right)} - x \cdot x} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      10. distribute-rgt-neg-in48.8%

        \[\leadsto \frac{1}{y \cdot \color{blue}{\left(y \cdot \left(-4\right)\right)} - x \cdot x} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      11. metadata-eval48.8%

        \[\leadsto \frac{1}{y \cdot \left(y \cdot \color{blue}{-4}\right) - x \cdot x} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      12. pow248.8%

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

        \[\leadsto \frac{1}{y \cdot \left(y \cdot -4\right) - {x}^{2}} \cdot \left(-\left(\color{blue}{{x}^{2}} - \left(y \cdot 4\right) \cdot y\right)\right) \]
      14. *-commutative48.8%

        \[\leadsto \frac{1}{y \cdot \left(y \cdot -4\right) - {x}^{2}} \cdot \left(-\left({x}^{2} - \color{blue}{\left(4 \cdot y\right)} \cdot y\right)\right) \]
      15. associate-*l*48.8%

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

        \[\leadsto \frac{1}{y \cdot \left(y \cdot -4\right) - {x}^{2}} \cdot \left(-\left({x}^{2} - 4 \cdot \color{blue}{{y}^{2}}\right)\right) \]
    3. Applied egg-rr48.8%

      \[\leadsto \color{blue}{\frac{1}{y \cdot \left(y \cdot -4\right) - {x}^{2}} \cdot \left(-\left({x}^{2} - 4 \cdot {y}^{2}\right)\right)} \]
    4. Step-by-step derivation
      1. unpow248.8%

        \[\leadsto \frac{1}{y \cdot \left(y \cdot -4\right) - {x}^{2}} \cdot \left(-\left(\color{blue}{x \cdot x} - 4 \cdot {y}^{2}\right)\right) \]
      2. add-sqr-sqrt48.8%

        \[\leadsto \frac{1}{y \cdot \left(y \cdot -4\right) - {x}^{2}} \cdot \left(-\left(x \cdot x - \color{blue}{\sqrt{4 \cdot {y}^{2}} \cdot \sqrt{4 \cdot {y}^{2}}}\right)\right) \]
      3. difference-of-squares48.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{y \cdot \left(y \cdot -4\right) - {x}^{2}} \cdot \left(-\left(x + y \cdot 2\right) \cdot \left(x - \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot \sqrt{4}\right)\right) \]
      14. add-sqr-sqrt48.8%

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

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

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

      \[\leadsto \color{blue}{1 + -8 \cdot \frac{{y}^{2}}{{x}^{2}}} \]
    7. Step-by-step derivation
      1. associate-*r/51.4%

        \[\leadsto 1 + \color{blue}{\frac{-8 \cdot {y}^{2}}{{x}^{2}}} \]
      2. associate-/l*51.4%

        \[\leadsto 1 + \color{blue}{\frac{-8}{\frac{{x}^{2}}{{y}^{2}}}} \]
      3. unpow251.4%

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

        \[\leadsto 1 + \frac{-8}{\frac{\color{blue}{x \cdot x}}{y \cdot y}} \]
      5. times-frac58.0%

        \[\leadsto 1 + \frac{-8}{\color{blue}{\frac{x}{y} \cdot \frac{x}{y}}} \]
      6. unpow258.0%

        \[\leadsto 1 + \frac{-8}{\color{blue}{{\left(\frac{x}{y}\right)}^{2}}} \]
    8. Simplified58.0%

      \[\leadsto \color{blue}{1 + \frac{-8}{{\left(\frac{x}{y}\right)}^{2}}} \]
    9. Step-by-step derivation
      1. unpow258.0%

        \[\leadsto 1 + \frac{-8}{\color{blue}{\frac{x}{y} \cdot \frac{x}{y}}} \]
      2. associate-*r/57.9%

        \[\leadsto 1 + \frac{-8}{\color{blue}{\frac{\frac{x}{y} \cdot x}{y}}} \]
      3. associate-/l*58.0%

        \[\leadsto 1 + \frac{-8}{\color{blue}{\frac{\frac{x}{y}}{\frac{y}{x}}}} \]
    10. Applied egg-rr58.0%

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

    if 4.59999999999999994e-68 < y < 1.62000000000000007e-4 or 3.2500000000000002e35 < y

    1. Initial program 43.6%

      \[\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 81.0%

      \[\leadsto \color{blue}{-1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification65.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4.6 \cdot 10^{-68} \lor \neg \left(y \leq 0.000162\right) \land y \leq 3.25 \cdot 10^{+35}:\\ \;\;\;\;1 + \frac{-8}{\frac{\frac{x}{y}}{\frac{y}{x}}}\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \]

Alternative 3: 74.9% accurate, 1.1× speedup?

\[\begin{array}{l} y = |y|\\ \\ \begin{array}{l} t_0 := \frac{\frac{x}{y}}{\frac{y}{x}}\\ \mathbf{if}\;y \leq 1.65 \cdot 10^{-67}:\\ \;\;\;\;1 + \frac{-8}{t_0}\\ \mathbf{elif}\;y \leq 0.000175 \lor \neg \left(y \leq 4000\right):\\ \;\;\;\;t_0 \cdot 0.5 + -1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ (/ x y) (/ y x))))
   (if (<= y 1.65e-67)
     (+ 1.0 (/ -8.0 t_0))
     (if (or (<= y 0.000175) (not (<= y 4000.0))) (+ (* t_0 0.5) -1.0) 1.0))))
y = abs(y);
double code(double x, double y) {
	double t_0 = (x / y) / (y / x);
	double tmp;
	if (y <= 1.65e-67) {
		tmp = 1.0 + (-8.0 / t_0);
	} else if ((y <= 0.000175) || !(y <= 4000.0)) {
		tmp = (t_0 * 0.5) + -1.0;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
NOTE: y should be positive before calling this 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 = (x / y) / (y / x)
    if (y <= 1.65d-67) then
        tmp = 1.0d0 + ((-8.0d0) / t_0)
    else if ((y <= 0.000175d0) .or. (.not. (y <= 4000.0d0))) then
        tmp = (t_0 * 0.5d0) + (-1.0d0)
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y) {
	double t_0 = (x / y) / (y / x);
	double tmp;
	if (y <= 1.65e-67) {
		tmp = 1.0 + (-8.0 / t_0);
	} else if ((y <= 0.000175) || !(y <= 4000.0)) {
		tmp = (t_0 * 0.5) + -1.0;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
y = abs(y)
def code(x, y):
	t_0 = (x / y) / (y / x)
	tmp = 0
	if y <= 1.65e-67:
		tmp = 1.0 + (-8.0 / t_0)
	elif (y <= 0.000175) or not (y <= 4000.0):
		tmp = (t_0 * 0.5) + -1.0
	else:
		tmp = 1.0
	return tmp
y = abs(y)
function code(x, y)
	t_0 = Float64(Float64(x / y) / Float64(y / x))
	tmp = 0.0
	if (y <= 1.65e-67)
		tmp = Float64(1.0 + Float64(-8.0 / t_0));
	elseif ((y <= 0.000175) || !(y <= 4000.0))
		tmp = Float64(Float64(t_0 * 0.5) + -1.0);
	else
		tmp = 1.0;
	end
	return tmp
end
y = abs(y)
function tmp_2 = code(x, y)
	t_0 = (x / y) / (y / x);
	tmp = 0.0;
	if (y <= 1.65e-67)
		tmp = 1.0 + (-8.0 / t_0);
	elseif ((y <= 0.000175) || ~((y <= 4000.0)))
		tmp = (t_0 * 0.5) + -1.0;
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
NOTE: y should be positive before calling this function
code[x_, y_] := Block[{t$95$0 = N[(N[(x / y), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.65e-67], N[(1.0 + N[(-8.0 / t$95$0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 0.000175], N[Not[LessEqual[y, 4000.0]], $MachinePrecision]], N[(N[(t$95$0 * 0.5), $MachinePrecision] + -1.0), $MachinePrecision], 1.0]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
t_0 := \frac{\frac{x}{y}}{\frac{y}{x}}\\
\mathbf{if}\;y \leq 1.65 \cdot 10^{-67}:\\
\;\;\;\;1 + \frac{-8}{t_0}\\

\mathbf{elif}\;y \leq 0.000175 \lor \neg \left(y \leq 4000\right):\\
\;\;\;\;t_0 \cdot 0.5 + -1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 1.6500000000000001e-67

    1. Initial program 49.1%

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Step-by-step derivation
      1. frac-2neg49.1%

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

        \[\leadsto \color{blue}{\left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \cdot \frac{1}{-\left(x \cdot x + \left(y \cdot 4\right) \cdot y\right)}} \]
      3. *-commutative48.4%

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

        \[\leadsto \frac{1}{\color{blue}{0 - \left(x \cdot x + \left(y \cdot 4\right) \cdot y\right)}} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      5. +-commutative48.4%

        \[\leadsto \frac{1}{0 - \color{blue}{\left(\left(y \cdot 4\right) \cdot y + x \cdot x\right)}} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      6. associate--r+48.4%

        \[\leadsto \frac{1}{\color{blue}{\left(0 - \left(y \cdot 4\right) \cdot y\right) - x \cdot x}} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      7. neg-sub048.4%

        \[\leadsto \frac{1}{\color{blue}{\left(-\left(y \cdot 4\right) \cdot y\right)} - x \cdot x} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      8. distribute-lft-neg-in48.4%

        \[\leadsto \frac{1}{\color{blue}{\left(-y \cdot 4\right) \cdot y} - x \cdot x} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      9. *-commutative48.4%

        \[\leadsto \frac{1}{\color{blue}{y \cdot \left(-y \cdot 4\right)} - x \cdot x} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      10. distribute-rgt-neg-in48.4%

        \[\leadsto \frac{1}{y \cdot \color{blue}{\left(y \cdot \left(-4\right)\right)} - x \cdot x} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      11. metadata-eval48.4%

        \[\leadsto \frac{1}{y \cdot \left(y \cdot \color{blue}{-4}\right) - x \cdot x} \cdot \left(-\left(x \cdot x - \left(y \cdot 4\right) \cdot y\right)\right) \]
      12. pow248.4%

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

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

        \[\leadsto \frac{1}{y \cdot \left(y \cdot -4\right) - {x}^{2}} \cdot \left(-\left({x}^{2} - \color{blue}{\left(4 \cdot y\right)} \cdot y\right)\right) \]
      15. associate-*l*48.4%

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

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

      \[\leadsto \color{blue}{\frac{1}{y \cdot \left(y \cdot -4\right) - {x}^{2}} \cdot \left(-\left({x}^{2} - 4 \cdot {y}^{2}\right)\right)} \]
    4. Step-by-step derivation
      1. unpow248.4%

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

        \[\leadsto \frac{1}{y \cdot \left(y \cdot -4\right) - {x}^{2}} \cdot \left(-\left(x \cdot x - \color{blue}{\sqrt{4 \cdot {y}^{2}} \cdot \sqrt{4 \cdot {y}^{2}}}\right)\right) \]
      3. difference-of-squares48.4%

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

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

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

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

        \[\leadsto \frac{1}{y \cdot \left(y \cdot -4\right) - {x}^{2}} \cdot \left(-\left(x + \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot \sqrt{4}\right) \cdot \left(x - \sqrt{4 \cdot {y}^{2}}\right)\right) \]
      8. add-sqr-sqrt29.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1 + -8 \cdot \frac{{y}^{2}}{{x}^{2}}} \]
    7. Step-by-step derivation
      1. associate-*r/50.6%

        \[\leadsto 1 + \color{blue}{\frac{-8 \cdot {y}^{2}}{{x}^{2}}} \]
      2. associate-/l*50.6%

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

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

        \[\leadsto 1 + \frac{-8}{\frac{\color{blue}{x \cdot x}}{y \cdot y}} \]
      5. times-frac57.3%

        \[\leadsto 1 + \frac{-8}{\color{blue}{\frac{x}{y} \cdot \frac{x}{y}}} \]
      6. unpow257.3%

        \[\leadsto 1 + \frac{-8}{\color{blue}{{\left(\frac{x}{y}\right)}^{2}}} \]
    8. Simplified57.3%

      \[\leadsto \color{blue}{1 + \frac{-8}{{\left(\frac{x}{y}\right)}^{2}}} \]
    9. Step-by-step derivation
      1. unpow257.3%

        \[\leadsto 1 + \frac{-8}{\color{blue}{\frac{x}{y} \cdot \frac{x}{y}}} \]
      2. associate-*r/57.3%

        \[\leadsto 1 + \frac{-8}{\color{blue}{\frac{\frac{x}{y} \cdot x}{y}}} \]
      3. associate-/l*57.3%

        \[\leadsto 1 + \frac{-8}{\color{blue}{\frac{\frac{x}{y}}{\frac{y}{x}}}} \]
    10. Applied egg-rr57.3%

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

    if 1.6500000000000001e-67 < y < 1.74999999999999998e-4 or 4e3 < y

    1. Initial program 44.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 71.7%

      \[\leadsto \color{blue}{\left(-0.125 \cdot \frac{{x}^{4}}{{y}^{4}} + 0.5 \cdot \frac{{x}^{2}}{{y}^{2}}\right) - 1} \]
    3. Step-by-step derivation
      1. unpow271.7%

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

        \[\leadsto \left(-0.125 \cdot \frac{{x}^{4}}{{y}^{4}} + 0.5 \cdot \frac{x \cdot x}{\color{blue}{y \cdot y}}\right) - 1 \]
      3. times-frac71.7%

        \[\leadsto \left(-0.125 \cdot \frac{{x}^{4}}{{y}^{4}} + 0.5 \cdot \color{blue}{\left(\frac{x}{y} \cdot \frac{x}{y}\right)}\right) - 1 \]
    4. Applied egg-rr71.7%

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2}}{{y}^{2}}} - 1 \]
    6. Step-by-step derivation
      1. unpow276.9%

        \[\leadsto 0.5 \cdot \frac{{x}^{2}}{\color{blue}{y \cdot y}} - 1 \]
      2. unpow276.9%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x}}{y \cdot y} - 1 \]
      3. times-frac81.1%

        \[\leadsto 0.5 \cdot \color{blue}{\left(\frac{x}{y} \cdot \frac{x}{y}\right)} - 1 \]
      4. unpow281.1%

        \[\leadsto 0.5 \cdot \color{blue}{{\left(\frac{x}{y}\right)}^{2}} - 1 \]
    7. Simplified81.1%

      \[\leadsto \color{blue}{0.5 \cdot {\left(\frac{x}{y}\right)}^{2}} - 1 \]
    8. Step-by-step derivation
      1. unpow222.8%

        \[\leadsto 1 + \frac{-8}{\color{blue}{\frac{x}{y} \cdot \frac{x}{y}}} \]
      2. associate-*r/22.8%

        \[\leadsto 1 + \frac{-8}{\color{blue}{\frac{\frac{x}{y} \cdot x}{y}}} \]
      3. associate-/l*22.8%

        \[\leadsto 1 + \frac{-8}{\color{blue}{\frac{\frac{x}{y}}{\frac{y}{x}}}} \]
    9. Applied egg-rr81.1%

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

    if 1.74999999999999998e-4 < y < 4e3

    1. Initial program 50.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 inf 100.0%

      \[\leadsto \color{blue}{1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.65 \cdot 10^{-67}:\\ \;\;\;\;1 + \frac{-8}{\frac{\frac{x}{y}}{\frac{y}{x}}}\\ \mathbf{elif}\;y \leq 0.000175 \lor \neg \left(y \leq 4000\right):\\ \;\;\;\;\frac{\frac{x}{y}}{\frac{y}{x}} \cdot 0.5 + -1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 4: 73.5% accurate, 2.6× speedup?

\[\begin{array}{l} y = |y|\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 1.6 \cdot 10^{-67}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-5}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{+35}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y)
 :precision binary64
 (if (<= y 1.6e-67) 1.0 (if (<= y 8e-5) -1.0 (if (<= y 3.9e+35) 1.0 -1.0))))
y = abs(y);
double code(double x, double y) {
	double tmp;
	if (y <= 1.6e-67) {
		tmp = 1.0;
	} else if (y <= 8e-5) {
		tmp = -1.0;
	} else if (y <= 3.9e+35) {
		tmp = 1.0;
	} else {
		tmp = -1.0;
	}
	return tmp;
}
NOTE: y should be positive before calling this function
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 1.6d-67) then
        tmp = 1.0d0
    else if (y <= 8d-5) then
        tmp = -1.0d0
    else if (y <= 3.9d+35) then
        tmp = 1.0d0
    else
        tmp = -1.0d0
    end if
    code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y) {
	double tmp;
	if (y <= 1.6e-67) {
		tmp = 1.0;
	} else if (y <= 8e-5) {
		tmp = -1.0;
	} else if (y <= 3.9e+35) {
		tmp = 1.0;
	} else {
		tmp = -1.0;
	}
	return tmp;
}
y = abs(y)
def code(x, y):
	tmp = 0
	if y <= 1.6e-67:
		tmp = 1.0
	elif y <= 8e-5:
		tmp = -1.0
	elif y <= 3.9e+35:
		tmp = 1.0
	else:
		tmp = -1.0
	return tmp
y = abs(y)
function code(x, y)
	tmp = 0.0
	if (y <= 1.6e-67)
		tmp = 1.0;
	elseif (y <= 8e-5)
		tmp = -1.0;
	elseif (y <= 3.9e+35)
		tmp = 1.0;
	else
		tmp = -1.0;
	end
	return tmp
end
y = abs(y)
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 1.6e-67)
		tmp = 1.0;
	elseif (y <= 8e-5)
		tmp = -1.0;
	elseif (y <= 3.9e+35)
		tmp = 1.0;
	else
		tmp = -1.0;
	end
	tmp_2 = tmp;
end
NOTE: y should be positive before calling this function
code[x_, y_] := If[LessEqual[y, 1.6e-67], 1.0, If[LessEqual[y, 8e-5], -1.0, If[LessEqual[y, 3.9e+35], 1.0, -1.0]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.6 \cdot 10^{-67}:\\
\;\;\;\;1\\

\mathbf{elif}\;y \leq 8 \cdot 10^{-5}:\\
\;\;\;\;-1\\

\mathbf{elif}\;y \leq 3.9 \cdot 10^{+35}:\\
\;\;\;\;1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.60000000000000011e-67 or 8.00000000000000065e-5 < y < 3.8999999999999999e35

    1. Initial program 49.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 56.7%

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

    if 1.60000000000000011e-67 < y < 8.00000000000000065e-5 or 3.8999999999999999e35 < y

    1. Initial program 43.6%

      \[\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 81.0%

      \[\leadsto \color{blue}{-1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification64.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.6 \cdot 10^{-67}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-5}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{+35}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \]

Alternative 5: 50.5% accurate, 19.0× speedup?

\[\begin{array}{l} y = |y|\\ \\ -1 \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y) :precision binary64 -1.0)
y = abs(y);
double code(double x, double y) {
	return -1.0;
}
NOTE: y should be positive before calling this function
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = -1.0d0
end function
y = Math.abs(y);
public static double code(double x, double y) {
	return -1.0;
}
y = abs(y)
def code(x, y):
	return -1.0
y = abs(y)
function code(x, y)
	return -1.0
end
y = abs(y)
function tmp = code(x, y)
	tmp = -1.0;
end
NOTE: y should be positive before calling this function
code[x_, y_] := -1.0
\begin{array}{l}
y = |y|\\
\\
-1
\end{array}
Derivation
  1. Initial program 47.6%

    \[\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 55.6%

    \[\leadsto \color{blue}{-1} \]
  3. Final simplification55.6%

    \[\leadsto -1 \]

Developer target: 50.6% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(y \cdot y\right) \cdot 4\\ t_1 := x \cdot x + t_0\\ t_2 := \frac{t_0}{t_1}\\ t_3 := \left(y \cdot 4\right) \cdot y\\ \mathbf{if}\;\frac{x \cdot x - t_3}{x \cdot x + t_3} < 0.9743233849626781:\\ \;\;\;\;\frac{x \cdot x}{t_1} - t_2\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{x}{\sqrt{t_1}}\right)}^{2} - t_2\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* (* y y) 4.0))
        (t_1 (+ (* x x) t_0))
        (t_2 (/ t_0 t_1))
        (t_3 (* (* y 4.0) y)))
   (if (< (/ (- (* x x) t_3) (+ (* x x) t_3)) 0.9743233849626781)
     (- (/ (* x x) t_1) t_2)
     (- (pow (/ x (sqrt t_1)) 2.0) t_2))))
double code(double x, double y) {
	double t_0 = (y * y) * 4.0;
	double t_1 = (x * x) + t_0;
	double t_2 = t_0 / t_1;
	double t_3 = (y * 4.0) * y;
	double tmp;
	if ((((x * x) - t_3) / ((x * x) + t_3)) < 0.9743233849626781) {
		tmp = ((x * x) / t_1) - t_2;
	} else {
		tmp = pow((x / sqrt(t_1)), 2.0) - t_2;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = (y * y) * 4.0d0
    t_1 = (x * x) + t_0
    t_2 = t_0 / t_1
    t_3 = (y * 4.0d0) * y
    if ((((x * x) - t_3) / ((x * x) + t_3)) < 0.9743233849626781d0) then
        tmp = ((x * x) / t_1) - t_2
    else
        tmp = ((x / sqrt(t_1)) ** 2.0d0) - t_2
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = (y * y) * 4.0;
	double t_1 = (x * x) + t_0;
	double t_2 = t_0 / t_1;
	double t_3 = (y * 4.0) * y;
	double tmp;
	if ((((x * x) - t_3) / ((x * x) + t_3)) < 0.9743233849626781) {
		tmp = ((x * x) / t_1) - t_2;
	} else {
		tmp = Math.pow((x / Math.sqrt(t_1)), 2.0) - t_2;
	}
	return tmp;
}
def code(x, y):
	t_0 = (y * y) * 4.0
	t_1 = (x * x) + t_0
	t_2 = t_0 / t_1
	t_3 = (y * 4.0) * y
	tmp = 0
	if (((x * x) - t_3) / ((x * x) + t_3)) < 0.9743233849626781:
		tmp = ((x * x) / t_1) - t_2
	else:
		tmp = math.pow((x / math.sqrt(t_1)), 2.0) - t_2
	return tmp
function code(x, y)
	t_0 = Float64(Float64(y * y) * 4.0)
	t_1 = Float64(Float64(x * x) + t_0)
	t_2 = Float64(t_0 / t_1)
	t_3 = Float64(Float64(y * 4.0) * y)
	tmp = 0.0
	if (Float64(Float64(Float64(x * x) - t_3) / Float64(Float64(x * x) + t_3)) < 0.9743233849626781)
		tmp = Float64(Float64(Float64(x * x) / t_1) - t_2);
	else
		tmp = Float64((Float64(x / sqrt(t_1)) ^ 2.0) - t_2);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = (y * y) * 4.0;
	t_1 = (x * x) + t_0;
	t_2 = t_0 / t_1;
	t_3 = (y * 4.0) * y;
	tmp = 0.0;
	if ((((x * x) - t_3) / ((x * x) + t_3)) < 0.9743233849626781)
		tmp = ((x * x) / t_1) - t_2;
	else
		tmp = ((x / sqrt(t_1)) ^ 2.0) - t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * y), $MachinePrecision] * 4.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y * 4.0), $MachinePrecision] * y), $MachinePrecision]}, If[Less[N[(N[(N[(x * x), $MachinePrecision] - t$95$3), $MachinePrecision] / N[(N[(x * x), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], 0.9743233849626781], N[(N[(N[(x * x), $MachinePrecision] / t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], N[(N[Power[N[(x / N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(y \cdot y\right) \cdot 4\\
t_1 := x \cdot x + t_0\\
t_2 := \frac{t_0}{t_1}\\
t_3 := \left(y \cdot 4\right) \cdot y\\
\mathbf{if}\;\frac{x \cdot x - t_3}{x \cdot x + t_3} < 0.9743233849626781:\\
\;\;\;\;\frac{x \cdot x}{t_1} - t_2\\

\mathbf{else}:\\
\;\;\;\;{\left(\frac{x}{\sqrt{t_1}}\right)}^{2} - t_2\\


\end{array}
\end{array}

Reproduce

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