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

Percentage Accurate: 50.7% → 81.4%
Time: 16.9s
Alternatives: 7
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 7 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.7% 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: 81.4% accurate, 0.0× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ \begin{array}{l} \mathbf{if}\;x\_m \leq 9 \cdot 10^{-156}:\\ \;\;\;\;\mathsf{log1p}\left(e^{-1} \cdot \frac{\frac{x\_m}{y} \cdot 0.5}{\frac{y}{x\_m}} + \mathsf{expm1}\left(-1\right)\right)\\ \mathbf{elif}\;x\_m \leq 5.1 \cdot 10^{+115}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x\_m}^{2}\right)}{\mathsf{fma}\left(4, {y}^{2}, {x\_m}^{2}\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 + -8 \cdot \left(\frac{y}{x\_m} \cdot \frac{y}{x\_m}\right)\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
(FPCore (x_m y)
 :precision binary64
 (if (<= x_m 9e-156)
   (log1p (+ (* (exp -1.0) (/ (* (/ x_m y) 0.5) (/ y x_m))) (expm1 -1.0)))
   (if (<= x_m 5.1e+115)
     (log1p
      (expm1
       (/
        (fma y (* y -4.0) (pow x_m 2.0))
        (fma 4.0 (pow y 2.0) (pow x_m 2.0)))))
     (+ 1.0 (* -8.0 (* (/ y x_m) (/ y x_m)))))))
x_m = fabs(x);
double code(double x_m, double y) {
	double tmp;
	if (x_m <= 9e-156) {
		tmp = log1p(((exp(-1.0) * (((x_m / y) * 0.5) / (y / x_m))) + expm1(-1.0)));
	} else if (x_m <= 5.1e+115) {
		tmp = log1p(expm1((fma(y, (y * -4.0), pow(x_m, 2.0)) / fma(4.0, pow(y, 2.0), pow(x_m, 2.0)))));
	} else {
		tmp = 1.0 + (-8.0 * ((y / x_m) * (y / x_m)));
	}
	return tmp;
}
x_m = abs(x)
function code(x_m, y)
	tmp = 0.0
	if (x_m <= 9e-156)
		tmp = log1p(Float64(Float64(exp(-1.0) * Float64(Float64(Float64(x_m / y) * 0.5) / Float64(y / x_m))) + expm1(-1.0)));
	elseif (x_m <= 5.1e+115)
		tmp = log1p(expm1(Float64(fma(y, Float64(y * -4.0), (x_m ^ 2.0)) / fma(4.0, (y ^ 2.0), (x_m ^ 2.0)))));
	else
		tmp = Float64(1.0 + Float64(-8.0 * Float64(Float64(y / x_m) * Float64(y / x_m))));
	end
	return tmp
end
x_m = N[Abs[x], $MachinePrecision]
code[x$95$m_, y_] := If[LessEqual[x$95$m, 9e-156], N[Log[1 + N[(N[(N[Exp[-1.0], $MachinePrecision] * N[(N[(N[(x$95$m / y), $MachinePrecision] * 0.5), $MachinePrecision] / N[(y / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(Exp[-1.0] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x$95$m, 5.1e+115], N[Log[1 + N[(Exp[N[(N[(y * N[(y * -4.0), $MachinePrecision] + N[Power[x$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[(4.0 * N[Power[y, 2.0], $MachinePrecision] + N[Power[x$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], N[(1.0 + N[(-8.0 * N[(N[(y / x$95$m), $MachinePrecision] * N[(y / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x_m = \left|x\right|

\\
\begin{array}{l}
\mathbf{if}\;x\_m \leq 9 \cdot 10^{-156}:\\
\;\;\;\;\mathsf{log1p}\left(e^{-1} \cdot \frac{\frac{x\_m}{y} \cdot 0.5}{\frac{y}{x\_m}} + \mathsf{expm1}\left(-1\right)\right)\\

\mathbf{elif}\;x\_m \leq 5.1 \cdot 10^{+115}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x\_m}^{2}\right)}{\mathsf{fma}\left(4, {y}^{2}, {x\_m}^{2}\right)}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;1 + -8 \cdot \left(\frac{y}{x\_m} \cdot \frac{y}{x\_m}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 8.99999999999999971e-156

    1. Initial program 45.3%

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. log1p-expm1-u45.3%

        \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right)} \]
      2. sub-neg45.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\color{blue}{x \cdot x + \left(-\left(y \cdot 4\right) \cdot y\right)}}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      3. +-commutative45.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\color{blue}{\left(-\left(y \cdot 4\right) \cdot y\right) + x \cdot x}}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      4. *-commutative45.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\left(-\color{blue}{y \cdot \left(y \cdot 4\right)}\right) + x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      5. distribute-rgt-neg-in45.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\color{blue}{y \cdot \left(-y \cdot 4\right)} + x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      6. fma-define45.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\color{blue}{\mathsf{fma}\left(y, -y \cdot 4, x \cdot x\right)}}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      7. distribute-rgt-neg-in45.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, \color{blue}{y \cdot \left(-4\right)}, x \cdot x\right)}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      8. metadata-eval45.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot \color{blue}{-4}, x \cdot x\right)}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      9. pow245.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, \color{blue}{{x}^{2}}\right)}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      10. +-commutative45.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\color{blue}{\left(y \cdot 4\right) \cdot y + x \cdot x}}\right)\right) \]
      11. *-commutative45.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\color{blue}{\left(4 \cdot y\right)} \cdot y + x \cdot x}\right)\right) \]
      12. associate-*l*45.2%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\color{blue}{4 \cdot \left(y \cdot y\right)} + x \cdot x}\right)\right) \]
      13. fma-define45.2%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\color{blue}{\mathsf{fma}\left(4, y \cdot y, x \cdot x\right)}}\right)\right) \]
      14. pow245.2%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\mathsf{fma}\left(4, \color{blue}{{y}^{2}}, x \cdot x\right)}\right)\right) \]
      15. pow245.2%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\mathsf{fma}\left(4, {y}^{2}, \color{blue}{{x}^{2}}\right)}\right)\right) \]
    4. Applied egg-rr45.2%

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}\right)\right)} \]
    5. Taylor expanded in y around inf 50.7%

      \[\leadsto \mathsf{log1p}\left(\color{blue}{\left(e^{-1} + \frac{e^{-1} \cdot \left(0.25 \cdot {x}^{2} - -0.25 \cdot {x}^{2}\right)}{{y}^{2}}\right) - 1}\right) \]
    6. Step-by-step derivation
      1. +-commutative50.7%

        \[\leadsto \mathsf{log1p}\left(\color{blue}{\left(\frac{e^{-1} \cdot \left(0.25 \cdot {x}^{2} - -0.25 \cdot {x}^{2}\right)}{{y}^{2}} + e^{-1}\right)} - 1\right) \]
      2. associate--l+50.7%

        \[\leadsto \mathsf{log1p}\left(\color{blue}{\frac{e^{-1} \cdot \left(0.25 \cdot {x}^{2} - -0.25 \cdot {x}^{2}\right)}{{y}^{2}} + \left(e^{-1} - 1\right)}\right) \]
      3. distribute-rgt-out--50.7%

        \[\leadsto \mathsf{log1p}\left(\frac{e^{-1} \cdot \color{blue}{\left({x}^{2} \cdot \left(0.25 - -0.25\right)\right)}}{{y}^{2}} + \left(e^{-1} - 1\right)\right) \]
      4. metadata-eval50.7%

        \[\leadsto \mathsf{log1p}\left(\frac{e^{-1} \cdot \left({x}^{2} \cdot \color{blue}{0.5}\right)}{{y}^{2}} + \left(e^{-1} - 1\right)\right) \]
      5. associate-/l*50.7%

        \[\leadsto \mathsf{log1p}\left(\color{blue}{e^{-1} \cdot \frac{{x}^{2} \cdot 0.5}{{y}^{2}}} + \left(e^{-1} - 1\right)\right) \]
      6. associate-*l/50.7%

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

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \left(\frac{\color{blue}{x \cdot x}}{{y}^{2}} \cdot 0.5\right) + \left(e^{-1} - 1\right)\right) \]
      8. unpow250.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \left(\frac{x \cdot x}{\color{blue}{y \cdot y}} \cdot 0.5\right) + \left(e^{-1} - 1\right)\right) \]
      9. times-frac63.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \left(\color{blue}{\left(\frac{x}{y} \cdot \frac{x}{y}\right)} \cdot 0.5\right) + \left(e^{-1} - 1\right)\right) \]
      10. unpow263.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \left(\color{blue}{{\left(\frac{x}{y}\right)}^{2}} \cdot 0.5\right) + \left(e^{-1} - 1\right)\right) \]
      11. expm1-define63.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \left({\left(\frac{x}{y}\right)}^{2} \cdot 0.5\right) + \color{blue}{\mathsf{expm1}\left(-1\right)}\right) \]
    7. Simplified63.7%

      \[\leadsto \mathsf{log1p}\left(\color{blue}{e^{-1} \cdot \left({\left(\frac{x}{y}\right)}^{2} \cdot 0.5\right) + \mathsf{expm1}\left(-1\right)}\right) \]
    8. Step-by-step derivation
      1. pow263.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \left(\color{blue}{\left(\frac{x}{y} \cdot \frac{x}{y}\right)} \cdot 0.5\right) + \mathsf{expm1}\left(-1\right)\right) \]
      2. *-commutative63.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \color{blue}{\left(0.5 \cdot \left(\frac{x}{y} \cdot \frac{x}{y}\right)\right)} + \mathsf{expm1}\left(-1\right)\right) \]
      3. associate-*r*63.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \color{blue}{\left(\left(0.5 \cdot \frac{x}{y}\right) \cdot \frac{x}{y}\right)} + \mathsf{expm1}\left(-1\right)\right) \]
      4. clear-num63.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \left(\left(0.5 \cdot \frac{x}{y}\right) \cdot \color{blue}{\frac{1}{\frac{y}{x}}}\right) + \mathsf{expm1}\left(-1\right)\right) \]
      5. un-div-inv63.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \color{blue}{\frac{0.5 \cdot \frac{x}{y}}{\frac{y}{x}}} + \mathsf{expm1}\left(-1\right)\right) \]
      6. *-commutative63.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \frac{\color{blue}{\frac{x}{y} \cdot 0.5}}{\frac{y}{x}} + \mathsf{expm1}\left(-1\right)\right) \]
    9. Applied egg-rr63.7%

      \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \color{blue}{\frac{\frac{x}{y} \cdot 0.5}{\frac{y}{x}}} + \mathsf{expm1}\left(-1\right)\right) \]

    if 8.99999999999999971e-156 < x < 5.0999999999999996e115

    1. Initial program 80.8%

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. log1p-expm1-u80.8%

        \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right)} \]
      2. sub-neg80.8%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\color{blue}{x \cdot x + \left(-\left(y \cdot 4\right) \cdot y\right)}}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      3. +-commutative80.8%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\color{blue}{\left(-\left(y \cdot 4\right) \cdot y\right) + x \cdot x}}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      4. *-commutative80.8%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\left(-\color{blue}{y \cdot \left(y \cdot 4\right)}\right) + x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      5. distribute-rgt-neg-in80.8%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\color{blue}{y \cdot \left(-y \cdot 4\right)} + x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      6. fma-define80.8%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\color{blue}{\mathsf{fma}\left(y, -y \cdot 4, x \cdot x\right)}}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      7. distribute-rgt-neg-in80.8%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, \color{blue}{y \cdot \left(-4\right)}, x \cdot x\right)}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      8. metadata-eval80.8%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot \color{blue}{-4}, x \cdot x\right)}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      9. pow280.8%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, \color{blue}{{x}^{2}}\right)}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      10. +-commutative80.8%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\color{blue}{\left(y \cdot 4\right) \cdot y + x \cdot x}}\right)\right) \]
      11. *-commutative80.8%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\color{blue}{\left(4 \cdot y\right)} \cdot y + x \cdot x}\right)\right) \]
      12. associate-*l*80.8%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\color{blue}{4 \cdot \left(y \cdot y\right)} + x \cdot x}\right)\right) \]
      13. fma-define80.8%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\color{blue}{\mathsf{fma}\left(4, y \cdot y, x \cdot x\right)}}\right)\right) \]
      14. pow280.8%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\mathsf{fma}\left(4, \color{blue}{{y}^{2}}, x \cdot x\right)}\right)\right) \]
      15. pow280.8%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\mathsf{fma}\left(4, {y}^{2}, \color{blue}{{x}^{2}}\right)}\right)\right) \]
    4. Applied egg-rr80.8%

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

    if 5.0999999999999996e115 < x

    1. Initial program 14.0%

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 80.1%

      \[\leadsto \color{blue}{1 + -8 \cdot \frac{{y}^{2}}{{x}^{2}}} \]
    4. Step-by-step derivation
      1. unpow280.1%

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

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

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

      \[\leadsto 1 + -8 \cdot \color{blue}{\left(\frac{y}{x} \cdot \frac{y}{x}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification72.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 9 \cdot 10^{-156}:\\ \;\;\;\;\mathsf{log1p}\left(e^{-1} \cdot \frac{\frac{x}{y} \cdot 0.5}{\frac{y}{x}} + \mathsf{expm1}\left(-1\right)\right)\\ \mathbf{elif}\;x \leq 5.1 \cdot 10^{+115}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 + -8 \cdot \left(\frac{y}{x} \cdot \frac{y}{x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 81.5% accurate, 0.1× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ \begin{array}{l} t_0 := y \cdot \left(y \cdot 4\right)\\ \mathbf{if}\;x\_m \leq 3 \cdot 10^{-156}:\\ \;\;\;\;\mathsf{log1p}\left(e^{-1} \cdot \frac{\frac{x\_m}{y} \cdot 0.5}{\frac{y}{x\_m}} + \mathsf{expm1}\left(-1\right)\right)\\ \mathbf{elif}\;x\_m \leq 6.3 \cdot 10^{+115}:\\ \;\;\;\;\frac{x\_m \cdot x\_m - t\_0}{x\_m \cdot x\_m + t\_0}\\ \mathbf{else}:\\ \;\;\;\;1 + -8 \cdot \left(\frac{y}{x\_m} \cdot \frac{y}{x\_m}\right)\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
(FPCore (x_m y)
 :precision binary64
 (let* ((t_0 (* y (* y 4.0))))
   (if (<= x_m 3e-156)
     (log1p (+ (* (exp -1.0) (/ (* (/ x_m y) 0.5) (/ y x_m))) (expm1 -1.0)))
     (if (<= x_m 6.3e+115)
       (/ (- (* x_m x_m) t_0) (+ (* x_m x_m) t_0))
       (+ 1.0 (* -8.0 (* (/ y x_m) (/ y x_m))))))))
x_m = fabs(x);
double code(double x_m, double y) {
	double t_0 = y * (y * 4.0);
	double tmp;
	if (x_m <= 3e-156) {
		tmp = log1p(((exp(-1.0) * (((x_m / y) * 0.5) / (y / x_m))) + expm1(-1.0)));
	} else if (x_m <= 6.3e+115) {
		tmp = ((x_m * x_m) - t_0) / ((x_m * x_m) + t_0);
	} else {
		tmp = 1.0 + (-8.0 * ((y / x_m) * (y / x_m)));
	}
	return tmp;
}
x_m = Math.abs(x);
public static double code(double x_m, double y) {
	double t_0 = y * (y * 4.0);
	double tmp;
	if (x_m <= 3e-156) {
		tmp = Math.log1p(((Math.exp(-1.0) * (((x_m / y) * 0.5) / (y / x_m))) + Math.expm1(-1.0)));
	} else if (x_m <= 6.3e+115) {
		tmp = ((x_m * x_m) - t_0) / ((x_m * x_m) + t_0);
	} else {
		tmp = 1.0 + (-8.0 * ((y / x_m) * (y / x_m)));
	}
	return tmp;
}
x_m = math.fabs(x)
def code(x_m, y):
	t_0 = y * (y * 4.0)
	tmp = 0
	if x_m <= 3e-156:
		tmp = math.log1p(((math.exp(-1.0) * (((x_m / y) * 0.5) / (y / x_m))) + math.expm1(-1.0)))
	elif x_m <= 6.3e+115:
		tmp = ((x_m * x_m) - t_0) / ((x_m * x_m) + t_0)
	else:
		tmp = 1.0 + (-8.0 * ((y / x_m) * (y / x_m)))
	return tmp
x_m = abs(x)
function code(x_m, y)
	t_0 = Float64(y * Float64(y * 4.0))
	tmp = 0.0
	if (x_m <= 3e-156)
		tmp = log1p(Float64(Float64(exp(-1.0) * Float64(Float64(Float64(x_m / y) * 0.5) / Float64(y / x_m))) + expm1(-1.0)));
	elseif (x_m <= 6.3e+115)
		tmp = Float64(Float64(Float64(x_m * x_m) - t_0) / Float64(Float64(x_m * x_m) + t_0));
	else
		tmp = Float64(1.0 + Float64(-8.0 * Float64(Float64(y / x_m) * Float64(y / x_m))));
	end
	return tmp
end
x_m = N[Abs[x], $MachinePrecision]
code[x$95$m_, y_] := Block[{t$95$0 = N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$95$m, 3e-156], N[Log[1 + N[(N[(N[Exp[-1.0], $MachinePrecision] * N[(N[(N[(x$95$m / y), $MachinePrecision] * 0.5), $MachinePrecision] / N[(y / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(Exp[-1.0] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x$95$m, 6.3e+115], N[(N[(N[(x$95$m * x$95$m), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(N[(x$95$m * x$95$m), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-8.0 * N[(N[(y / x$95$m), $MachinePrecision] * N[(y / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
x_m = \left|x\right|

\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot 4\right)\\
\mathbf{if}\;x\_m \leq 3 \cdot 10^{-156}:\\
\;\;\;\;\mathsf{log1p}\left(e^{-1} \cdot \frac{\frac{x\_m}{y} \cdot 0.5}{\frac{y}{x\_m}} + \mathsf{expm1}\left(-1\right)\right)\\

\mathbf{elif}\;x\_m \leq 6.3 \cdot 10^{+115}:\\
\;\;\;\;\frac{x\_m \cdot x\_m - t\_0}{x\_m \cdot x\_m + t\_0}\\

\mathbf{else}:\\
\;\;\;\;1 + -8 \cdot \left(\frac{y}{x\_m} \cdot \frac{y}{x\_m}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 3e-156

    1. Initial program 45.3%

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. log1p-expm1-u45.3%

        \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right)} \]
      2. sub-neg45.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\color{blue}{x \cdot x + \left(-\left(y \cdot 4\right) \cdot y\right)}}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      3. +-commutative45.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\color{blue}{\left(-\left(y \cdot 4\right) \cdot y\right) + x \cdot x}}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      4. *-commutative45.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\left(-\color{blue}{y \cdot \left(y \cdot 4\right)}\right) + x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      5. distribute-rgt-neg-in45.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\color{blue}{y \cdot \left(-y \cdot 4\right)} + x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      6. fma-define45.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\color{blue}{\mathsf{fma}\left(y, -y \cdot 4, x \cdot x\right)}}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      7. distribute-rgt-neg-in45.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, \color{blue}{y \cdot \left(-4\right)}, x \cdot x\right)}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      8. metadata-eval45.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot \color{blue}{-4}, x \cdot x\right)}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      9. pow245.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, \color{blue}{{x}^{2}}\right)}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)\right) \]
      10. +-commutative45.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\color{blue}{\left(y \cdot 4\right) \cdot y + x \cdot x}}\right)\right) \]
      11. *-commutative45.3%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\color{blue}{\left(4 \cdot y\right)} \cdot y + x \cdot x}\right)\right) \]
      12. associate-*l*45.2%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\color{blue}{4 \cdot \left(y \cdot y\right)} + x \cdot x}\right)\right) \]
      13. fma-define45.2%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\color{blue}{\mathsf{fma}\left(4, y \cdot y, x \cdot x\right)}}\right)\right) \]
      14. pow245.2%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\mathsf{fma}\left(4, \color{blue}{{y}^{2}}, x \cdot x\right)}\right)\right) \]
      15. pow245.2%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\mathsf{fma}\left(4, {y}^{2}, \color{blue}{{x}^{2}}\right)}\right)\right) \]
    4. Applied egg-rr45.2%

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(y, y \cdot -4, {x}^{2}\right)}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}\right)\right)} \]
    5. Taylor expanded in y around inf 50.7%

      \[\leadsto \mathsf{log1p}\left(\color{blue}{\left(e^{-1} + \frac{e^{-1} \cdot \left(0.25 \cdot {x}^{2} - -0.25 \cdot {x}^{2}\right)}{{y}^{2}}\right) - 1}\right) \]
    6. Step-by-step derivation
      1. +-commutative50.7%

        \[\leadsto \mathsf{log1p}\left(\color{blue}{\left(\frac{e^{-1} \cdot \left(0.25 \cdot {x}^{2} - -0.25 \cdot {x}^{2}\right)}{{y}^{2}} + e^{-1}\right)} - 1\right) \]
      2. associate--l+50.7%

        \[\leadsto \mathsf{log1p}\left(\color{blue}{\frac{e^{-1} \cdot \left(0.25 \cdot {x}^{2} - -0.25 \cdot {x}^{2}\right)}{{y}^{2}} + \left(e^{-1} - 1\right)}\right) \]
      3. distribute-rgt-out--50.7%

        \[\leadsto \mathsf{log1p}\left(\frac{e^{-1} \cdot \color{blue}{\left({x}^{2} \cdot \left(0.25 - -0.25\right)\right)}}{{y}^{2}} + \left(e^{-1} - 1\right)\right) \]
      4. metadata-eval50.7%

        \[\leadsto \mathsf{log1p}\left(\frac{e^{-1} \cdot \left({x}^{2} \cdot \color{blue}{0.5}\right)}{{y}^{2}} + \left(e^{-1} - 1\right)\right) \]
      5. associate-/l*50.7%

        \[\leadsto \mathsf{log1p}\left(\color{blue}{e^{-1} \cdot \frac{{x}^{2} \cdot 0.5}{{y}^{2}}} + \left(e^{-1} - 1\right)\right) \]
      6. associate-*l/50.7%

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

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \left(\frac{\color{blue}{x \cdot x}}{{y}^{2}} \cdot 0.5\right) + \left(e^{-1} - 1\right)\right) \]
      8. unpow250.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \left(\frac{x \cdot x}{\color{blue}{y \cdot y}} \cdot 0.5\right) + \left(e^{-1} - 1\right)\right) \]
      9. times-frac63.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \left(\color{blue}{\left(\frac{x}{y} \cdot \frac{x}{y}\right)} \cdot 0.5\right) + \left(e^{-1} - 1\right)\right) \]
      10. unpow263.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \left(\color{blue}{{\left(\frac{x}{y}\right)}^{2}} \cdot 0.5\right) + \left(e^{-1} - 1\right)\right) \]
      11. expm1-define63.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \left({\left(\frac{x}{y}\right)}^{2} \cdot 0.5\right) + \color{blue}{\mathsf{expm1}\left(-1\right)}\right) \]
    7. Simplified63.7%

      \[\leadsto \mathsf{log1p}\left(\color{blue}{e^{-1} \cdot \left({\left(\frac{x}{y}\right)}^{2} \cdot 0.5\right) + \mathsf{expm1}\left(-1\right)}\right) \]
    8. Step-by-step derivation
      1. pow263.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \left(\color{blue}{\left(\frac{x}{y} \cdot \frac{x}{y}\right)} \cdot 0.5\right) + \mathsf{expm1}\left(-1\right)\right) \]
      2. *-commutative63.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \color{blue}{\left(0.5 \cdot \left(\frac{x}{y} \cdot \frac{x}{y}\right)\right)} + \mathsf{expm1}\left(-1\right)\right) \]
      3. associate-*r*63.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \color{blue}{\left(\left(0.5 \cdot \frac{x}{y}\right) \cdot \frac{x}{y}\right)} + \mathsf{expm1}\left(-1\right)\right) \]
      4. clear-num63.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \left(\left(0.5 \cdot \frac{x}{y}\right) \cdot \color{blue}{\frac{1}{\frac{y}{x}}}\right) + \mathsf{expm1}\left(-1\right)\right) \]
      5. un-div-inv63.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \color{blue}{\frac{0.5 \cdot \frac{x}{y}}{\frac{y}{x}}} + \mathsf{expm1}\left(-1\right)\right) \]
      6. *-commutative63.7%

        \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \frac{\color{blue}{\frac{x}{y} \cdot 0.5}}{\frac{y}{x}} + \mathsf{expm1}\left(-1\right)\right) \]
    9. Applied egg-rr63.7%

      \[\leadsto \mathsf{log1p}\left(e^{-1} \cdot \color{blue}{\frac{\frac{x}{y} \cdot 0.5}{\frac{y}{x}}} + \mathsf{expm1}\left(-1\right)\right) \]

    if 3e-156 < x < 6.2999999999999997e115

    1. Initial program 80.8%

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

    if 6.2999999999999997e115 < x

    1. Initial program 14.0%

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 80.1%

      \[\leadsto \color{blue}{1 + -8 \cdot \frac{{y}^{2}}{{x}^{2}}} \]
    4. Step-by-step derivation
      1. unpow280.1%

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

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

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

      \[\leadsto 1 + -8 \cdot \color{blue}{\left(\frac{y}{x} \cdot \frac{y}{x}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification72.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 3 \cdot 10^{-156}:\\ \;\;\;\;\mathsf{log1p}\left(e^{-1} \cdot \frac{\frac{x}{y} \cdot 0.5}{\frac{y}{x}} + \mathsf{expm1}\left(-1\right)\right)\\ \mathbf{elif}\;x \leq 6.3 \cdot 10^{+115}:\\ \;\;\;\;\frac{x \cdot x - y \cdot \left(y \cdot 4\right)}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\ \mathbf{else}:\\ \;\;\;\;1 + -8 \cdot \left(\frac{y}{x} \cdot \frac{y}{x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 81.2% accurate, 0.7× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ \begin{array}{l} t_0 := y \cdot \left(y \cdot 4\right)\\ \mathbf{if}\;x\_m \leq 7.3 \cdot 10^{-156}:\\ \;\;\;\;-1 + 0.5 \cdot \left(\frac{x\_m}{y} \cdot \frac{x\_m}{y}\right)\\ \mathbf{elif}\;x\_m \leq 4 \cdot 10^{+115}:\\ \;\;\;\;\frac{x\_m \cdot x\_m - t\_0}{x\_m \cdot x\_m + t\_0}\\ \mathbf{else}:\\ \;\;\;\;1 + -8 \cdot \left(\frac{y}{x\_m} \cdot \frac{y}{x\_m}\right)\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
(FPCore (x_m y)
 :precision binary64
 (let* ((t_0 (* y (* y 4.0))))
   (if (<= x_m 7.3e-156)
     (+ -1.0 (* 0.5 (* (/ x_m y) (/ x_m y))))
     (if (<= x_m 4e+115)
       (/ (- (* x_m x_m) t_0) (+ (* x_m x_m) t_0))
       (+ 1.0 (* -8.0 (* (/ y x_m) (/ y x_m))))))))
x_m = fabs(x);
double code(double x_m, double y) {
	double t_0 = y * (y * 4.0);
	double tmp;
	if (x_m <= 7.3e-156) {
		tmp = -1.0 + (0.5 * ((x_m / y) * (x_m / y)));
	} else if (x_m <= 4e+115) {
		tmp = ((x_m * x_m) - t_0) / ((x_m * x_m) + t_0);
	} else {
		tmp = 1.0 + (-8.0 * ((y / x_m) * (y / x_m)));
	}
	return tmp;
}
x_m = abs(x)
real(8) function code(x_m, y)
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = y * (y * 4.0d0)
    if (x_m <= 7.3d-156) then
        tmp = (-1.0d0) + (0.5d0 * ((x_m / y) * (x_m / y)))
    else if (x_m <= 4d+115) then
        tmp = ((x_m * x_m) - t_0) / ((x_m * x_m) + t_0)
    else
        tmp = 1.0d0 + ((-8.0d0) * ((y / x_m) * (y / x_m)))
    end if
    code = tmp
end function
x_m = Math.abs(x);
public static double code(double x_m, double y) {
	double t_0 = y * (y * 4.0);
	double tmp;
	if (x_m <= 7.3e-156) {
		tmp = -1.0 + (0.5 * ((x_m / y) * (x_m / y)));
	} else if (x_m <= 4e+115) {
		tmp = ((x_m * x_m) - t_0) / ((x_m * x_m) + t_0);
	} else {
		tmp = 1.0 + (-8.0 * ((y / x_m) * (y / x_m)));
	}
	return tmp;
}
x_m = math.fabs(x)
def code(x_m, y):
	t_0 = y * (y * 4.0)
	tmp = 0
	if x_m <= 7.3e-156:
		tmp = -1.0 + (0.5 * ((x_m / y) * (x_m / y)))
	elif x_m <= 4e+115:
		tmp = ((x_m * x_m) - t_0) / ((x_m * x_m) + t_0)
	else:
		tmp = 1.0 + (-8.0 * ((y / x_m) * (y / x_m)))
	return tmp
x_m = abs(x)
function code(x_m, y)
	t_0 = Float64(y * Float64(y * 4.0))
	tmp = 0.0
	if (x_m <= 7.3e-156)
		tmp = Float64(-1.0 + Float64(0.5 * Float64(Float64(x_m / y) * Float64(x_m / y))));
	elseif (x_m <= 4e+115)
		tmp = Float64(Float64(Float64(x_m * x_m) - t_0) / Float64(Float64(x_m * x_m) + t_0));
	else
		tmp = Float64(1.0 + Float64(-8.0 * Float64(Float64(y / x_m) * Float64(y / x_m))));
	end
	return tmp
end
x_m = abs(x);
function tmp_2 = code(x_m, y)
	t_0 = y * (y * 4.0);
	tmp = 0.0;
	if (x_m <= 7.3e-156)
		tmp = -1.0 + (0.5 * ((x_m / y) * (x_m / y)));
	elseif (x_m <= 4e+115)
		tmp = ((x_m * x_m) - t_0) / ((x_m * x_m) + t_0);
	else
		tmp = 1.0 + (-8.0 * ((y / x_m) * (y / x_m)));
	end
	tmp_2 = tmp;
end
x_m = N[Abs[x], $MachinePrecision]
code[x$95$m_, y_] := Block[{t$95$0 = N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$95$m, 7.3e-156], N[(-1.0 + N[(0.5 * N[(N[(x$95$m / y), $MachinePrecision] * N[(x$95$m / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$95$m, 4e+115], N[(N[(N[(x$95$m * x$95$m), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(N[(x$95$m * x$95$m), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-8.0 * N[(N[(y / x$95$m), $MachinePrecision] * N[(y / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
x_m = \left|x\right|

\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot 4\right)\\
\mathbf{if}\;x\_m \leq 7.3 \cdot 10^{-156}:\\
\;\;\;\;-1 + 0.5 \cdot \left(\frac{x\_m}{y} \cdot \frac{x\_m}{y}\right)\\

\mathbf{elif}\;x\_m \leq 4 \cdot 10^{+115}:\\
\;\;\;\;\frac{x\_m \cdot x\_m - t\_0}{x\_m \cdot x\_m + t\_0}\\

\mathbf{else}:\\
\;\;\;\;1 + -8 \cdot \left(\frac{y}{x\_m} \cdot \frac{y}{x\_m}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 7.3e-156

    1. Initial program 45.3%

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 50.2%

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

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

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

        \[\leadsto 0.5 \cdot \color{blue}{\left(\frac{x}{y} \cdot \frac{x}{y}\right)} - 1 \]
    5. Applied egg-rr61.8%

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

    if 7.3e-156 < x < 4.0000000000000001e115

    1. Initial program 80.8%

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

    if 4.0000000000000001e115 < x

    1. Initial program 14.0%

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 80.1%

      \[\leadsto \color{blue}{1 + -8 \cdot \frac{{y}^{2}}{{x}^{2}}} \]
    4. Step-by-step derivation
      1. unpow280.1%

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

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

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

      \[\leadsto 1 + -8 \cdot \color{blue}{\left(\frac{y}{x} \cdot \frac{y}{x}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification71.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 7.3 \cdot 10^{-156}:\\ \;\;\;\;-1 + 0.5 \cdot \left(\frac{x}{y} \cdot \frac{x}{y}\right)\\ \mathbf{elif}\;x \leq 4 \cdot 10^{+115}:\\ \;\;\;\;\frac{x \cdot x - y \cdot \left(y \cdot 4\right)}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\ \mathbf{else}:\\ \;\;\;\;1 + -8 \cdot \left(\frac{y}{x} \cdot \frac{y}{x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 74.9% accurate, 1.2× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ \begin{array}{l} \mathbf{if}\;x\_m \leq 2.35 \cdot 10^{-21}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1 + -8 \cdot \left(\frac{y}{x\_m} \cdot \frac{y}{x\_m}\right)\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
(FPCore (x_m y)
 :precision binary64
 (if (<= x_m 2.35e-21) -1.0 (+ 1.0 (* -8.0 (* (/ y x_m) (/ y x_m))))))
x_m = fabs(x);
double code(double x_m, double y) {
	double tmp;
	if (x_m <= 2.35e-21) {
		tmp = -1.0;
	} else {
		tmp = 1.0 + (-8.0 * ((y / x_m) * (y / x_m)));
	}
	return tmp;
}
x_m = abs(x)
real(8) function code(x_m, y)
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x_m <= 2.35d-21) then
        tmp = -1.0d0
    else
        tmp = 1.0d0 + ((-8.0d0) * ((y / x_m) * (y / x_m)))
    end if
    code = tmp
end function
x_m = Math.abs(x);
public static double code(double x_m, double y) {
	double tmp;
	if (x_m <= 2.35e-21) {
		tmp = -1.0;
	} else {
		tmp = 1.0 + (-8.0 * ((y / x_m) * (y / x_m)));
	}
	return tmp;
}
x_m = math.fabs(x)
def code(x_m, y):
	tmp = 0
	if x_m <= 2.35e-21:
		tmp = -1.0
	else:
		tmp = 1.0 + (-8.0 * ((y / x_m) * (y / x_m)))
	return tmp
x_m = abs(x)
function code(x_m, y)
	tmp = 0.0
	if (x_m <= 2.35e-21)
		tmp = -1.0;
	else
		tmp = Float64(1.0 + Float64(-8.0 * Float64(Float64(y / x_m) * Float64(y / x_m))));
	end
	return tmp
end
x_m = abs(x);
function tmp_2 = code(x_m, y)
	tmp = 0.0;
	if (x_m <= 2.35e-21)
		tmp = -1.0;
	else
		tmp = 1.0 + (-8.0 * ((y / x_m) * (y / x_m)));
	end
	tmp_2 = tmp;
end
x_m = N[Abs[x], $MachinePrecision]
code[x$95$m_, y_] := If[LessEqual[x$95$m, 2.35e-21], -1.0, N[(1.0 + N[(-8.0 * N[(N[(y / x$95$m), $MachinePrecision] * N[(y / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|

\\
\begin{array}{l}
\mathbf{if}\;x\_m \leq 2.35 \cdot 10^{-21}:\\
\;\;\;\;-1\\

\mathbf{else}:\\
\;\;\;\;1 + -8 \cdot \left(\frac{y}{x\_m} \cdot \frac{y}{x\_m}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.35000000000000015e-21

    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. Add Preprocessing
    3. Taylor expanded in x around 0 61.6%

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

    if 2.35000000000000015e-21 < x

    1. Initial program 34.2%

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 75.0%

      \[\leadsto \color{blue}{1 + -8 \cdot \frac{{y}^{2}}{{x}^{2}}} \]
    4. Step-by-step derivation
      1. unpow275.0%

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

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

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

      \[\leadsto 1 + -8 \cdot \color{blue}{\left(\frac{y}{x} \cdot \frac{y}{x}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification67.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.35 \cdot 10^{-21}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1 + -8 \cdot \left(\frac{y}{x} \cdot \frac{y}{x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 75.4% accurate, 1.2× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ \begin{array}{l} \mathbf{if}\;x\_m \leq 2.4 \cdot 10^{-21}:\\ \;\;\;\;-1 + 0.5 \cdot \left(\frac{x\_m}{y} \cdot \frac{x\_m}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;1 + -8 \cdot \left(\frac{y}{x\_m} \cdot \frac{y}{x\_m}\right)\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
(FPCore (x_m y)
 :precision binary64
 (if (<= x_m 2.4e-21)
   (+ -1.0 (* 0.5 (* (/ x_m y) (/ x_m y))))
   (+ 1.0 (* -8.0 (* (/ y x_m) (/ y x_m))))))
x_m = fabs(x);
double code(double x_m, double y) {
	double tmp;
	if (x_m <= 2.4e-21) {
		tmp = -1.0 + (0.5 * ((x_m / y) * (x_m / y)));
	} else {
		tmp = 1.0 + (-8.0 * ((y / x_m) * (y / x_m)));
	}
	return tmp;
}
x_m = abs(x)
real(8) function code(x_m, y)
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x_m <= 2.4d-21) then
        tmp = (-1.0d0) + (0.5d0 * ((x_m / y) * (x_m / y)))
    else
        tmp = 1.0d0 + ((-8.0d0) * ((y / x_m) * (y / x_m)))
    end if
    code = tmp
end function
x_m = Math.abs(x);
public static double code(double x_m, double y) {
	double tmp;
	if (x_m <= 2.4e-21) {
		tmp = -1.0 + (0.5 * ((x_m / y) * (x_m / y)));
	} else {
		tmp = 1.0 + (-8.0 * ((y / x_m) * (y / x_m)));
	}
	return tmp;
}
x_m = math.fabs(x)
def code(x_m, y):
	tmp = 0
	if x_m <= 2.4e-21:
		tmp = -1.0 + (0.5 * ((x_m / y) * (x_m / y)))
	else:
		tmp = 1.0 + (-8.0 * ((y / x_m) * (y / x_m)))
	return tmp
x_m = abs(x)
function code(x_m, y)
	tmp = 0.0
	if (x_m <= 2.4e-21)
		tmp = Float64(-1.0 + Float64(0.5 * Float64(Float64(x_m / y) * Float64(x_m / y))));
	else
		tmp = Float64(1.0 + Float64(-8.0 * Float64(Float64(y / x_m) * Float64(y / x_m))));
	end
	return tmp
end
x_m = abs(x);
function tmp_2 = code(x_m, y)
	tmp = 0.0;
	if (x_m <= 2.4e-21)
		tmp = -1.0 + (0.5 * ((x_m / y) * (x_m / y)));
	else
		tmp = 1.0 + (-8.0 * ((y / x_m) * (y / x_m)));
	end
	tmp_2 = tmp;
end
x_m = N[Abs[x], $MachinePrecision]
code[x$95$m_, y_] := If[LessEqual[x$95$m, 2.4e-21], N[(-1.0 + N[(0.5 * N[(N[(x$95$m / y), $MachinePrecision] * N[(x$95$m / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-8.0 * N[(N[(y / x$95$m), $MachinePrecision] * N[(y / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|

\\
\begin{array}{l}
\mathbf{if}\;x\_m \leq 2.4 \cdot 10^{-21}:\\
\;\;\;\;-1 + 0.5 \cdot \left(\frac{x\_m}{y} \cdot \frac{x\_m}{y}\right)\\

\mathbf{else}:\\
\;\;\;\;1 + -8 \cdot \left(\frac{y}{x\_m} \cdot \frac{y}{x\_m}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.3999999999999999e-21

    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. Add Preprocessing
    3. Taylor expanded in x around 0 52.9%

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

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

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

        \[\leadsto 0.5 \cdot \color{blue}{\left(\frac{x}{y} \cdot \frac{x}{y}\right)} - 1 \]
    5. Applied egg-rr62.8%

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

    if 2.3999999999999999e-21 < x

    1. Initial program 34.2%

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 75.0%

      \[\leadsto \color{blue}{1 + -8 \cdot \frac{{y}^{2}}{{x}^{2}}} \]
    4. Step-by-step derivation
      1. unpow275.0%

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

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

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

      \[\leadsto 1 + -8 \cdot \color{blue}{\left(\frac{y}{x} \cdot \frac{y}{x}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification68.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.4 \cdot 10^{-21}:\\ \;\;\;\;-1 + 0.5 \cdot \left(\frac{x}{y} \cdot \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;1 + -8 \cdot \left(\frac{y}{x} \cdot \frac{y}{x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 74.2% accurate, 3.2× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ \begin{array}{l} \mathbf{if}\;x\_m \leq 2.6 \cdot 10^{-14}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
(FPCore (x_m y) :precision binary64 (if (<= x_m 2.6e-14) -1.0 1.0))
x_m = fabs(x);
double code(double x_m, double y) {
	double tmp;
	if (x_m <= 2.6e-14) {
		tmp = -1.0;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
x_m = abs(x)
real(8) function code(x_m, y)
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x_m <= 2.6d-14) then
        tmp = -1.0d0
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
x_m = Math.abs(x);
public static double code(double x_m, double y) {
	double tmp;
	if (x_m <= 2.6e-14) {
		tmp = -1.0;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
x_m = math.fabs(x)
def code(x_m, y):
	tmp = 0
	if x_m <= 2.6e-14:
		tmp = -1.0
	else:
		tmp = 1.0
	return tmp
x_m = abs(x)
function code(x_m, y)
	tmp = 0.0
	if (x_m <= 2.6e-14)
		tmp = -1.0;
	else
		tmp = 1.0;
	end
	return tmp
end
x_m = abs(x);
function tmp_2 = code(x_m, y)
	tmp = 0.0;
	if (x_m <= 2.6e-14)
		tmp = -1.0;
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
x_m = N[Abs[x], $MachinePrecision]
code[x$95$m_, y_] := If[LessEqual[x$95$m, 2.6e-14], -1.0, 1.0]
\begin{array}{l}
x_m = \left|x\right|

\\
\begin{array}{l}
\mathbf{if}\;x\_m \leq 2.6 \cdot 10^{-14}:\\
\;\;\;\;-1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.59999999999999997e-14

    1. Initial program 50.3%

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 61.3%

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

    if 2.59999999999999997e-14 < x

    1. Initial program 33.3%

      \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 82.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.6 \cdot 10^{-14}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 50.8% accurate, 19.0× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ -1 \end{array} \]
x_m = (fabs.f64 x)
(FPCore (x_m y) :precision binary64 -1.0)
x_m = fabs(x);
double code(double x_m, double y) {
	return -1.0;
}
x_m = abs(x)
real(8) function code(x_m, y)
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    code = -1.0d0
end function
x_m = Math.abs(x);
public static double code(double x_m, double y) {
	return -1.0;
}
x_m = math.fabs(x)
def code(x_m, y):
	return -1.0
x_m = abs(x)
function code(x_m, y)
	return -1.0
end
x_m = abs(x);
function tmp = code(x_m, y)
	tmp = -1.0;
end
x_m = N[Abs[x], $MachinePrecision]
code[x$95$m_, y_] := -1.0
\begin{array}{l}
x_m = \left|x\right|

\\
-1
\end{array}
Derivation
  1. Initial program 45.7%

    \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y} \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0 49.5%

    \[\leadsto \color{blue}{-1} \]
  4. Final simplification49.5%

    \[\leadsto -1 \]
  5. Add Preprocessing

Developer target: 51.1% 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 2024079 
(FPCore (x y)
  :name "Diagrams.TwoD.Arc:arcBetween from diagrams-lib-1.3.0.3"
  :precision binary64

  :alt
  (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))))