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

Percentage Accurate: 50.1% → 100.0%
Time: 20.8s
Alternatives: 12
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 12 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.1% 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: 100.0% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{hypot}\left(y \cdot 2, x\right)\\ t_1 := {\left(\frac{y \cdot 2}{t\_0}\right)}^{2}\\ 0 \cdot t\_1 + \left(\log \left(e^{{\left(\frac{x}{t\_0}\right)}^{2}}\right) - t\_1\right) \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (hypot (* y 2.0) x)) (t_1 (pow (/ (* y 2.0) t_0) 2.0)))
   (+ (* 0.0 t_1) (- (log (exp (pow (/ x t_0) 2.0))) t_1))))
double code(double x, double y) {
	double t_0 = hypot((y * 2.0), x);
	double t_1 = pow(((y * 2.0) / t_0), 2.0);
	return (0.0 * t_1) + (log(exp(pow((x / t_0), 2.0))) - t_1);
}
public static double code(double x, double y) {
	double t_0 = Math.hypot((y * 2.0), x);
	double t_1 = Math.pow(((y * 2.0) / t_0), 2.0);
	return (0.0 * t_1) + (Math.log(Math.exp(Math.pow((x / t_0), 2.0))) - t_1);
}
def code(x, y):
	t_0 = math.hypot((y * 2.0), x)
	t_1 = math.pow(((y * 2.0) / t_0), 2.0)
	return (0.0 * t_1) + (math.log(math.exp(math.pow((x / t_0), 2.0))) - t_1)
function code(x, y)
	t_0 = hypot(Float64(y * 2.0), x)
	t_1 = Float64(Float64(y * 2.0) / t_0) ^ 2.0
	return Float64(Float64(0.0 * t_1) + Float64(log(exp((Float64(x / t_0) ^ 2.0))) - t_1))
end
function tmp = code(x, y)
	t_0 = hypot((y * 2.0), x);
	t_1 = ((y * 2.0) / t_0) ^ 2.0;
	tmp = (0.0 * t_1) + (log(exp(((x / t_0) ^ 2.0))) - t_1);
end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[N[(y * 2.0), $MachinePrecision] ^ 2 + x ^ 2], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(N[(y * 2.0), $MachinePrecision] / t$95$0), $MachinePrecision], 2.0], $MachinePrecision]}, N[(N[(0.0 * t$95$1), $MachinePrecision] + N[(N[Log[N[Exp[N[Power[N[(x / t$95$0), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(y \cdot 2, x\right)\\
t_1 := {\left(\frac{y \cdot 2}{t\_0}\right)}^{2}\\
0 \cdot t\_1 + \left(\log \left(e^{{\left(\frac{x}{t\_0}\right)}^{2}}\right) - t\_1\right)
\end{array}
\end{array}
Derivation
  1. Initial program 51.5%

    \[\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. div-sub51.6%

      \[\leadsto \color{blue}{\frac{x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y} - \frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}} \]
    2. associate-/l*51.9%

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

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\color{blue}{\left(y \cdot 4\right) \cdot y + x \cdot x}}, -\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
    5. *-commutative51.9%

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\color{blue}{\left(4 \cdot y\right)} \cdot y + x \cdot x}, -\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
    6. associate-*l*51.9%

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

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

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, \color{blue}{{x}^{2}}\right)}, -\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
    10. *-commutative51.9%

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}, -\frac{\color{blue}{4 \cdot \left(y \cdot y\right)}}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
    12. pow251.9%

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}, -\frac{4 \cdot {y}^{2}}{\color{blue}{\left(y \cdot 4\right) \cdot y + x \cdot x}}\right) \]
    14. *-commutative51.9%

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}, -\frac{4 \cdot {y}^{2}}{\color{blue}{4 \cdot \left(y \cdot y\right)} + x \cdot x}\right) \]
    16. fma-define51.9%

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot \frac{\sqrt{x}}{\mathsf{hypot}\left(y \cdot 2, x\right)}, \frac{\sqrt{x}}{\mathsf{hypot}\left(y \cdot 2, x\right)}, -\frac{4}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}} \cdot {y}^{2}\right) + \mathsf{fma}\left(-\frac{4}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}, {y}^{2}, \frac{4}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}} \cdot {y}^{2}\right)} \]
  6. Simplified52.9%

    \[\leadsto \color{blue}{0 \cdot {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(\left(x \cdot \frac{\sqrt{x}}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right) \cdot \frac{\sqrt{x}}{\mathsf{hypot}\left(y \cdot 2, x\right)} - {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right)} \]
  7. Step-by-step derivation
    1. add-log-exp53.0%

      \[\leadsto 0 \cdot {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(\color{blue}{\log \left(e^{\left(x \cdot \frac{\sqrt{x}}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right) \cdot \frac{\sqrt{x}}{\mathsf{hypot}\left(y \cdot 2, x\right)}}\right)} - {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    2. associate-*r/45.0%

      \[\leadsto 0 \cdot {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(\log \left(e^{\color{blue}{\frac{x \cdot \sqrt{x}}{\mathsf{hypot}\left(y \cdot 2, x\right)}} \cdot \frac{\sqrt{x}}{\mathsf{hypot}\left(y \cdot 2, x\right)}}\right) - {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    3. frac-times39.0%

      \[\leadsto 0 \cdot {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(\log \left(e^{\color{blue}{\frac{\left(x \cdot \sqrt{x}\right) \cdot \sqrt{x}}{\mathsf{hypot}\left(y \cdot 2, x\right) \cdot \mathsf{hypot}\left(y \cdot 2, x\right)}}}\right) - {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    4. associate-*r*38.9%

      \[\leadsto 0 \cdot {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(\log \left(e^{\frac{\color{blue}{x \cdot \left(\sqrt{x} \cdot \sqrt{x}\right)}}{\mathsf{hypot}\left(y \cdot 2, x\right) \cdot \mathsf{hypot}\left(y \cdot 2, x\right)}}\right) - {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    5. add-sqr-sqrt74.2%

      \[\leadsto 0 \cdot {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(\log \left(e^{\frac{x \cdot \color{blue}{x}}{\mathsf{hypot}\left(y \cdot 2, x\right) \cdot \mathsf{hypot}\left(y \cdot 2, x\right)}}\right) - {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    6. unpow274.2%

      \[\leadsto 0 \cdot {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(\log \left(e^{\frac{\color{blue}{{x}^{2}}}{\mathsf{hypot}\left(y \cdot 2, x\right) \cdot \mathsf{hypot}\left(y \cdot 2, x\right)}}\right) - {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    7. unpow274.2%

      \[\leadsto 0 \cdot {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(\log \left(e^{\frac{{x}^{2}}{\color{blue}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}}\right) - {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    8. add-sqr-sqrt74.2%

      \[\leadsto 0 \cdot {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(\log \left(e^{\color{blue}{\sqrt{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}} \cdot \sqrt{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}}}\right) - {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    9. pow274.2%

      \[\leadsto 0 \cdot {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(\log \left(e^{\color{blue}{{\left(\sqrt{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}^{2}}}\right) - {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
  8. Applied egg-rr100.0%

    \[\leadsto 0 \cdot {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(\color{blue}{\log \left(e^{{\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}}\right)} - {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
  9. Add Preprocessing

Alternative 2: 100.0% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{hypot}\left(y \cdot 2, x\right)\\ t_1 := \frac{t\_0}{y}\\ {\left(\frac{x}{t\_0}\right)}^{2} + \frac{-1}{0.25 \cdot \left(t\_1 \cdot t\_1\right)} \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (hypot (* y 2.0) x)) (t_1 (/ t_0 y)))
   (+ (pow (/ x t_0) 2.0) (/ -1.0 (* 0.25 (* t_1 t_1))))))
double code(double x, double y) {
	double t_0 = hypot((y * 2.0), x);
	double t_1 = t_0 / y;
	return pow((x / t_0), 2.0) + (-1.0 / (0.25 * (t_1 * t_1)));
}
public static double code(double x, double y) {
	double t_0 = Math.hypot((y * 2.0), x);
	double t_1 = t_0 / y;
	return Math.pow((x / t_0), 2.0) + (-1.0 / (0.25 * (t_1 * t_1)));
}
def code(x, y):
	t_0 = math.hypot((y * 2.0), x)
	t_1 = t_0 / y
	return math.pow((x / t_0), 2.0) + (-1.0 / (0.25 * (t_1 * t_1)))
function code(x, y)
	t_0 = hypot(Float64(y * 2.0), x)
	t_1 = Float64(t_0 / y)
	return Float64((Float64(x / t_0) ^ 2.0) + Float64(-1.0 / Float64(0.25 * Float64(t_1 * t_1))))
end
function tmp = code(x, y)
	t_0 = hypot((y * 2.0), x);
	t_1 = t_0 / y;
	tmp = ((x / t_0) ^ 2.0) + (-1.0 / (0.25 * (t_1 * t_1)));
end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[N[(y * 2.0), $MachinePrecision] ^ 2 + x ^ 2], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / y), $MachinePrecision]}, N[(N[Power[N[(x / t$95$0), $MachinePrecision], 2.0], $MachinePrecision] + N[(-1.0 / N[(0.25 * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(y \cdot 2, x\right)\\
t_1 := \frac{t\_0}{y}\\
{\left(\frac{x}{t\_0}\right)}^{2} + \frac{-1}{0.25 \cdot \left(t\_1 \cdot t\_1\right)}
\end{array}
\end{array}
Derivation
  1. Initial program 51.5%

    \[\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. div-sub51.6%

      \[\leadsto \color{blue}{\frac{x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y} - \frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}} \]
    2. associate-/l*51.9%

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

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\color{blue}{\left(y \cdot 4\right) \cdot y + x \cdot x}}, -\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
    5. *-commutative51.9%

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\color{blue}{\left(4 \cdot y\right)} \cdot y + x \cdot x}, -\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
    6. associate-*l*51.9%

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

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

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, \color{blue}{{x}^{2}}\right)}, -\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
    10. *-commutative51.9%

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}, -\frac{\color{blue}{4 \cdot \left(y \cdot y\right)}}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
    12. pow251.9%

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}, -\frac{4 \cdot {y}^{2}}{\color{blue}{\left(y \cdot 4\right) \cdot y + x \cdot x}}\right) \]
    14. *-commutative51.9%

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}, -\frac{4 \cdot {y}^{2}}{\color{blue}{4 \cdot \left(y \cdot y\right)} + x \cdot x}\right) \]
    16. fma-define51.9%

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}, -\frac{4 \cdot {y}^{2}}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}\right)} \]
  5. Step-by-step derivation
    1. fma-undefine51.9%

      \[\leadsto \color{blue}{x \cdot \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)} + \left(-\frac{4 \cdot {y}^{2}}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}\right)} \]
    2. unsub-neg51.9%

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

    \[\leadsto \color{blue}{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}} - {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}} \]
  7. Step-by-step derivation
    1. sub-neg74.2%

      \[\leadsto \color{blue}{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right)} \]
    2. add-sqr-sqrt74.2%

      \[\leadsto \color{blue}{\sqrt{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}} \cdot \sqrt{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    3. pow274.2%

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}^{2}} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    4. sqrt-div74.2%

      \[\leadsto {\color{blue}{\left(\frac{\sqrt{{x}^{2}}}{\sqrt{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    5. unpow274.2%

      \[\leadsto {\left(\frac{\sqrt{\color{blue}{x \cdot x}}}{\sqrt{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    6. sqrt-prod39.2%

      \[\leadsto {\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{\sqrt{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    7. add-sqr-sqrt75.8%

      \[\leadsto {\left(\frac{\color{blue}{x}}{\sqrt{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    8. sqrt-pow1100.0%

      \[\leadsto {\left(\frac{x}{\color{blue}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{\left(\frac{2}{2}\right)}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    9. metadata-eval100.0%

      \[\leadsto {\left(\frac{x}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{\color{blue}{1}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    10. pow1100.0%

      \[\leadsto {\left(\frac{x}{\color{blue}{\mathsf{hypot}\left(y \cdot 2, x\right)}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    11. add-sqr-sqrt100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-\color{blue}{\sqrt{{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}} \cdot \sqrt{{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}}}\right) \]
    12. add-sqr-sqrt100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-\color{blue}{{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}}\right) \]
    13. *-commutative100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-{\left(\frac{\color{blue}{2 \cdot y}}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    14. associate-/l*100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-{\color{blue}{\left(2 \cdot \frac{y}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}}^{2}\right) \]
  8. Applied egg-rr100.0%

    \[\leadsto \color{blue}{{\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-{\left(2 \cdot \frac{y}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right)} \]
  9. Step-by-step derivation
    1. sub-neg100.0%

      \[\leadsto \color{blue}{{\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\left(2 \cdot \frac{y}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}} \]
    2. associate-*r/100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\color{blue}{\left(\frac{2 \cdot y}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}}^{2} \]
    3. *-commutative100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\left(\frac{\color{blue}{y \cdot 2}}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} \]
  10. Simplified100.0%

    \[\leadsto \color{blue}{{\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}} \]
  11. Step-by-step derivation
    1. unpow2100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \color{blue}{\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)} \cdot \frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}} \]
    2. clear-num100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \color{blue}{\frac{1}{\frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y \cdot 2}}} \cdot \frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)} \]
    3. clear-num100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \frac{1}{\frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y \cdot 2}} \cdot \color{blue}{\frac{1}{\frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y \cdot 2}}} \]
    4. frac-times100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \color{blue}{\frac{1 \cdot 1}{\frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y \cdot 2} \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y \cdot 2}}} \]
    5. metadata-eval100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \frac{\color{blue}{1}}{\frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y \cdot 2} \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y \cdot 2}} \]
    6. *-un-lft-identity100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \frac{1}{\frac{\color{blue}{1 \cdot \mathsf{hypot}\left(y \cdot 2, x\right)}}{y \cdot 2} \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y \cdot 2}} \]
    7. *-commutative100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \frac{1}{\frac{1 \cdot \mathsf{hypot}\left(y \cdot 2, x\right)}{\color{blue}{2 \cdot y}} \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y \cdot 2}} \]
    8. times-frac100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \frac{1}{\color{blue}{\left(\frac{1}{2} \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y}\right)} \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y \cdot 2}} \]
    9. metadata-eval100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \frac{1}{\left(\color{blue}{0.5} \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y}\right) \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y \cdot 2}} \]
    10. *-un-lft-identity100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \frac{1}{\left(0.5 \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y}\right) \cdot \frac{\color{blue}{1 \cdot \mathsf{hypot}\left(y \cdot 2, x\right)}}{y \cdot 2}} \]
    11. *-commutative100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \frac{1}{\left(0.5 \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y}\right) \cdot \frac{1 \cdot \mathsf{hypot}\left(y \cdot 2, x\right)}{\color{blue}{2 \cdot y}}} \]
    12. times-frac100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \frac{1}{\left(0.5 \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y}\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y}\right)}} \]
    13. metadata-eval100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \frac{1}{\left(0.5 \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y}\right) \cdot \left(\color{blue}{0.5} \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y}\right)} \]
  12. Applied egg-rr100.0%

    \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \color{blue}{\frac{1}{\left(0.5 \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y}\right) \cdot \left(0.5 \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y}\right)}} \]
  13. Step-by-step derivation
    1. swap-sqr100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \frac{1}{\color{blue}{\left(0.5 \cdot 0.5\right) \cdot \left(\frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y} \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y}\right)}} \]
    2. metadata-eval100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \frac{1}{\color{blue}{0.25} \cdot \left(\frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y} \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y}\right)} \]
  14. Simplified100.0%

    \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \color{blue}{\frac{1}{0.25 \cdot \left(\frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y} \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y}\right)}} \]
  15. Final simplification100.0%

    \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \frac{-1}{0.25 \cdot \left(\frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y} \cdot \frac{\mathsf{hypot}\left(y \cdot 2, x\right)}{y}\right)} \]
  16. Add Preprocessing

Alternative 3: 100.0% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{hypot}\left(y \cdot 2, x\right)\\ {\left(\frac{x}{t\_0}\right)}^{2} - {\left(\frac{y \cdot 2}{t\_0}\right)}^{2} \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (hypot (* y 2.0) x)))
   (- (pow (/ x t_0) 2.0) (pow (/ (* y 2.0) t_0) 2.0))))
double code(double x, double y) {
	double t_0 = hypot((y * 2.0), x);
	return pow((x / t_0), 2.0) - pow(((y * 2.0) / t_0), 2.0);
}
public static double code(double x, double y) {
	double t_0 = Math.hypot((y * 2.0), x);
	return Math.pow((x / t_0), 2.0) - Math.pow(((y * 2.0) / t_0), 2.0);
}
def code(x, y):
	t_0 = math.hypot((y * 2.0), x)
	return math.pow((x / t_0), 2.0) - math.pow(((y * 2.0) / t_0), 2.0)
function code(x, y)
	t_0 = hypot(Float64(y * 2.0), x)
	return Float64((Float64(x / t_0) ^ 2.0) - (Float64(Float64(y * 2.0) / t_0) ^ 2.0))
end
function tmp = code(x, y)
	t_0 = hypot((y * 2.0), x);
	tmp = ((x / t_0) ^ 2.0) - (((y * 2.0) / t_0) ^ 2.0);
end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[N[(y * 2.0), $MachinePrecision] ^ 2 + x ^ 2], $MachinePrecision]}, N[(N[Power[N[(x / t$95$0), $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[(N[(y * 2.0), $MachinePrecision] / t$95$0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(y \cdot 2, x\right)\\
{\left(\frac{x}{t\_0}\right)}^{2} - {\left(\frac{y \cdot 2}{t\_0}\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 51.5%

    \[\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. div-sub51.6%

      \[\leadsto \color{blue}{\frac{x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y} - \frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}} \]
    2. associate-/l*51.9%

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

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\color{blue}{\left(y \cdot 4\right) \cdot y + x \cdot x}}, -\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
    5. *-commutative51.9%

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\color{blue}{\left(4 \cdot y\right)} \cdot y + x \cdot x}, -\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
    6. associate-*l*51.9%

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

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

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, \color{blue}{{x}^{2}}\right)}, -\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
    10. *-commutative51.9%

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}, -\frac{\color{blue}{4 \cdot \left(y \cdot y\right)}}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
    12. pow251.9%

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}, -\frac{4 \cdot {y}^{2}}{\color{blue}{\left(y \cdot 4\right) \cdot y + x \cdot x}}\right) \]
    14. *-commutative51.9%

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}, -\frac{4 \cdot {y}^{2}}{\color{blue}{4 \cdot \left(y \cdot y\right)} + x \cdot x}\right) \]
    16. fma-define51.9%

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}, -\frac{4 \cdot {y}^{2}}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}\right)} \]
  5. Step-by-step derivation
    1. fma-undefine51.9%

      \[\leadsto \color{blue}{x \cdot \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)} + \left(-\frac{4 \cdot {y}^{2}}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}\right)} \]
    2. unsub-neg51.9%

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

    \[\leadsto \color{blue}{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}} - {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}} \]
  7. Step-by-step derivation
    1. sub-neg74.2%

      \[\leadsto \color{blue}{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right)} \]
    2. add-sqr-sqrt74.2%

      \[\leadsto \color{blue}{\sqrt{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}} \cdot \sqrt{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    3. pow274.2%

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}^{2}} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    4. sqrt-div74.2%

      \[\leadsto {\color{blue}{\left(\frac{\sqrt{{x}^{2}}}{\sqrt{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    5. unpow274.2%

      \[\leadsto {\left(\frac{\sqrt{\color{blue}{x \cdot x}}}{\sqrt{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    6. sqrt-prod39.2%

      \[\leadsto {\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{\sqrt{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    7. add-sqr-sqrt75.8%

      \[\leadsto {\left(\frac{\color{blue}{x}}{\sqrt{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    8. sqrt-pow1100.0%

      \[\leadsto {\left(\frac{x}{\color{blue}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{\left(\frac{2}{2}\right)}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    9. metadata-eval100.0%

      \[\leadsto {\left(\frac{x}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{\color{blue}{1}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    10. pow1100.0%

      \[\leadsto {\left(\frac{x}{\color{blue}{\mathsf{hypot}\left(y \cdot 2, x\right)}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    11. add-sqr-sqrt100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-\color{blue}{\sqrt{{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}} \cdot \sqrt{{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}}}\right) \]
    12. add-sqr-sqrt100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-\color{blue}{{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}}\right) \]
    13. *-commutative100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-{\left(\frac{\color{blue}{2 \cdot y}}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    14. associate-/l*100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-{\color{blue}{\left(2 \cdot \frac{y}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}}^{2}\right) \]
  8. Applied egg-rr100.0%

    \[\leadsto \color{blue}{{\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-{\left(2 \cdot \frac{y}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right)} \]
  9. Step-by-step derivation
    1. sub-neg100.0%

      \[\leadsto \color{blue}{{\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\left(2 \cdot \frac{y}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}} \]
    2. associate-*r/100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\color{blue}{\left(\frac{2 \cdot y}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}}^{2} \]
    3. *-commutative100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\left(\frac{\color{blue}{y \cdot 2}}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} \]
  10. Simplified100.0%

    \[\leadsto \color{blue}{{\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}} \]
  11. Add Preprocessing

Alternative 4: 99.8% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{hypot}\left(y \cdot 2, x\right)\\ {\left(\frac{x}{t\_0}\right)}^{2} - {\left(y \cdot \frac{2}{t\_0}\right)}^{2} \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (hypot (* y 2.0) x)))
   (- (pow (/ x t_0) 2.0) (pow (* y (/ 2.0 t_0)) 2.0))))
double code(double x, double y) {
	double t_0 = hypot((y * 2.0), x);
	return pow((x / t_0), 2.0) - pow((y * (2.0 / t_0)), 2.0);
}
public static double code(double x, double y) {
	double t_0 = Math.hypot((y * 2.0), x);
	return Math.pow((x / t_0), 2.0) - Math.pow((y * (2.0 / t_0)), 2.0);
}
def code(x, y):
	t_0 = math.hypot((y * 2.0), x)
	return math.pow((x / t_0), 2.0) - math.pow((y * (2.0 / t_0)), 2.0)
function code(x, y)
	t_0 = hypot(Float64(y * 2.0), x)
	return Float64((Float64(x / t_0) ^ 2.0) - (Float64(y * Float64(2.0 / t_0)) ^ 2.0))
end
function tmp = code(x, y)
	t_0 = hypot((y * 2.0), x);
	tmp = ((x / t_0) ^ 2.0) - ((y * (2.0 / t_0)) ^ 2.0);
end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[N[(y * 2.0), $MachinePrecision] ^ 2 + x ^ 2], $MachinePrecision]}, N[(N[Power[N[(x / t$95$0), $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[(y * N[(2.0 / t$95$0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(y \cdot 2, x\right)\\
{\left(\frac{x}{t\_0}\right)}^{2} - {\left(y \cdot \frac{2}{t\_0}\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 51.5%

    \[\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. div-sub51.6%

      \[\leadsto \color{blue}{\frac{x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y} - \frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}} \]
    2. associate-/l*51.9%

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

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\color{blue}{\left(y \cdot 4\right) \cdot y + x \cdot x}}, -\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
    5. *-commutative51.9%

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\color{blue}{\left(4 \cdot y\right)} \cdot y + x \cdot x}, -\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
    6. associate-*l*51.9%

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

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

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, \color{blue}{{x}^{2}}\right)}, -\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
    10. *-commutative51.9%

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}, -\frac{\color{blue}{4 \cdot \left(y \cdot y\right)}}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
    12. pow251.9%

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}, -\frac{4 \cdot {y}^{2}}{\color{blue}{\left(y \cdot 4\right) \cdot y + x \cdot x}}\right) \]
    14. *-commutative51.9%

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

      \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}, -\frac{4 \cdot {y}^{2}}{\color{blue}{4 \cdot \left(y \cdot y\right)} + x \cdot x}\right) \]
    16. fma-define51.9%

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}, -\frac{4 \cdot {y}^{2}}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}\right)} \]
  5. Step-by-step derivation
    1. fma-undefine51.9%

      \[\leadsto \color{blue}{x \cdot \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)} + \left(-\frac{4 \cdot {y}^{2}}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}\right)} \]
    2. unsub-neg51.9%

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

    \[\leadsto \color{blue}{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}} - {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}} \]
  7. Step-by-step derivation
    1. sub-neg74.2%

      \[\leadsto \color{blue}{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right)} \]
    2. add-sqr-sqrt74.2%

      \[\leadsto \color{blue}{\sqrt{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}} \cdot \sqrt{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    3. pow274.2%

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}^{2}} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    4. sqrt-div74.2%

      \[\leadsto {\color{blue}{\left(\frac{\sqrt{{x}^{2}}}{\sqrt{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    5. unpow274.2%

      \[\leadsto {\left(\frac{\sqrt{\color{blue}{x \cdot x}}}{\sqrt{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    6. sqrt-prod39.2%

      \[\leadsto {\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{\sqrt{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    7. add-sqr-sqrt75.8%

      \[\leadsto {\left(\frac{\color{blue}{x}}{\sqrt{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    8. sqrt-pow1100.0%

      \[\leadsto {\left(\frac{x}{\color{blue}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{\left(\frac{2}{2}\right)}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    9. metadata-eval100.0%

      \[\leadsto {\left(\frac{x}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{\color{blue}{1}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    10. pow1100.0%

      \[\leadsto {\left(\frac{x}{\color{blue}{\mathsf{hypot}\left(y \cdot 2, x\right)}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    11. add-sqr-sqrt100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-\color{blue}{\sqrt{{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}} \cdot \sqrt{{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}}}\right) \]
    12. add-sqr-sqrt100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-\color{blue}{{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}}\right) \]
    13. *-commutative100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-{\left(\frac{\color{blue}{2 \cdot y}}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
    14. associate-/l*100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-{\color{blue}{\left(2 \cdot \frac{y}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}}^{2}\right) \]
  8. Applied egg-rr100.0%

    \[\leadsto \color{blue}{{\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-{\left(2 \cdot \frac{y}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right)} \]
  9. Step-by-step derivation
    1. sub-neg100.0%

      \[\leadsto \color{blue}{{\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\left(2 \cdot \frac{y}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}} \]
    2. associate-*r/100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\color{blue}{\left(\frac{2 \cdot y}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}}^{2} \]
    3. *-commutative100.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\left(\frac{\color{blue}{y \cdot 2}}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} \]
  10. Simplified100.0%

    \[\leadsto \color{blue}{{\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}} \]
  11. Step-by-step derivation
    1. associate-/l*99.8%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\color{blue}{\left(y \cdot \frac{2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}}^{2} \]
    2. *-commutative99.8%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\color{blue}{\left(\frac{2}{\mathsf{hypot}\left(y \cdot 2, x\right)} \cdot y\right)}}^{2} \]
  12. Applied egg-rr99.8%

    \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\color{blue}{\left(\frac{2}{\mathsf{hypot}\left(y \cdot 2, x\right)} \cdot y\right)}}^{2} \]
  13. Final simplification99.8%

    \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\left(y \cdot \frac{2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} \]
  14. Add Preprocessing

Alternative 5: 80.2% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(y \cdot 4\right)\\ t_1 := {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-1 - -0.25 \cdot {\left(\frac{x}{y}\right)}^{2}\right)\\ t_2 := \frac{x \cdot x - t\_0}{x \cdot x + t\_0}\\ \mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-254}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{-137}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{-44}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot x \leq 10^{+223}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;1 + -8 \cdot \left(\frac{y}{x} \cdot \frac{y}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* y (* y 4.0)))
        (t_1
         (+
          (pow (/ x (hypot (* y 2.0) x)) 2.0)
          (- -1.0 (* -0.25 (pow (/ x y) 2.0)))))
        (t_2 (/ (- (* x x) t_0) (+ (* x x) t_0))))
   (if (<= (* x x) 2e-254)
     t_1
     (if (<= (* x x) 2e-137)
       t_2
       (if (<= (* x x) 5e-44)
         t_1
         (if (<= (* x x) 1e+223) t_2 (+ 1.0 (* -8.0 (* (/ y x) (/ y x))))))))))
double code(double x, double y) {
	double t_0 = y * (y * 4.0);
	double t_1 = pow((x / hypot((y * 2.0), x)), 2.0) + (-1.0 - (-0.25 * pow((x / y), 2.0)));
	double t_2 = ((x * x) - t_0) / ((x * x) + t_0);
	double tmp;
	if ((x * x) <= 2e-254) {
		tmp = t_1;
	} else if ((x * x) <= 2e-137) {
		tmp = t_2;
	} else if ((x * x) <= 5e-44) {
		tmp = t_1;
	} else if ((x * x) <= 1e+223) {
		tmp = t_2;
	} else {
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)));
	}
	return tmp;
}
public static double code(double x, double y) {
	double t_0 = y * (y * 4.0);
	double t_1 = Math.pow((x / Math.hypot((y * 2.0), x)), 2.0) + (-1.0 - (-0.25 * Math.pow((x / y), 2.0)));
	double t_2 = ((x * x) - t_0) / ((x * x) + t_0);
	double tmp;
	if ((x * x) <= 2e-254) {
		tmp = t_1;
	} else if ((x * x) <= 2e-137) {
		tmp = t_2;
	} else if ((x * x) <= 5e-44) {
		tmp = t_1;
	} else if ((x * x) <= 1e+223) {
		tmp = t_2;
	} else {
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)));
	}
	return tmp;
}
def code(x, y):
	t_0 = y * (y * 4.0)
	t_1 = math.pow((x / math.hypot((y * 2.0), x)), 2.0) + (-1.0 - (-0.25 * math.pow((x / y), 2.0)))
	t_2 = ((x * x) - t_0) / ((x * x) + t_0)
	tmp = 0
	if (x * x) <= 2e-254:
		tmp = t_1
	elif (x * x) <= 2e-137:
		tmp = t_2
	elif (x * x) <= 5e-44:
		tmp = t_1
	elif (x * x) <= 1e+223:
		tmp = t_2
	else:
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)))
	return tmp
function code(x, y)
	t_0 = Float64(y * Float64(y * 4.0))
	t_1 = Float64((Float64(x / hypot(Float64(y * 2.0), x)) ^ 2.0) + Float64(-1.0 - Float64(-0.25 * (Float64(x / y) ^ 2.0))))
	t_2 = Float64(Float64(Float64(x * x) - t_0) / Float64(Float64(x * x) + t_0))
	tmp = 0.0
	if (Float64(x * x) <= 2e-254)
		tmp = t_1;
	elseif (Float64(x * x) <= 2e-137)
		tmp = t_2;
	elseif (Float64(x * x) <= 5e-44)
		tmp = t_1;
	elseif (Float64(x * x) <= 1e+223)
		tmp = t_2;
	else
		tmp = Float64(1.0 + Float64(-8.0 * Float64(Float64(y / x) * Float64(y / x))));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = y * (y * 4.0);
	t_1 = ((x / hypot((y * 2.0), x)) ^ 2.0) + (-1.0 - (-0.25 * ((x / y) ^ 2.0)));
	t_2 = ((x * x) - t_0) / ((x * x) + t_0);
	tmp = 0.0;
	if ((x * x) <= 2e-254)
		tmp = t_1;
	elseif ((x * x) <= 2e-137)
		tmp = t_2;
	elseif ((x * x) <= 5e-44)
		tmp = t_1;
	elseif ((x * x) <= 1e+223)
		tmp = t_2;
	else
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)));
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[(x / N[Sqrt[N[(y * 2.0), $MachinePrecision] ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(-1.0 - N[(-0.25 * N[Power[N[(x / y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * x), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(N[(x * x), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 2e-254], t$95$1, If[LessEqual[N[(x * x), $MachinePrecision], 2e-137], t$95$2, If[LessEqual[N[(x * x), $MachinePrecision], 5e-44], t$95$1, If[LessEqual[N[(x * x), $MachinePrecision], 1e+223], t$95$2, N[(1.0 + N[(-8.0 * N[(N[(y / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot 4\right)\\
t_1 := {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-1 - -0.25 \cdot {\left(\frac{x}{y}\right)}^{2}\right)\\
t_2 := \frac{x \cdot x - t\_0}{x \cdot x + t\_0}\\
\mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-254}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{-137}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot x \leq 10^{+223}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x x) < 1.9999999999999998e-254 or 1.99999999999999996e-137 < (*.f64 x x) < 5.00000000000000039e-44

    1. Initial program 50.9%

      \[\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. div-sub51.0%

        \[\leadsto \color{blue}{\frac{x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y} - \frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}} \]
      2. associate-/l*50.9%

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

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

        \[\leadsto \mathsf{fma}\left(x, \frac{x}{\color{blue}{\left(y \cdot 4\right) \cdot y + x \cdot x}}, -\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
      5. *-commutative50.9%

        \[\leadsto \mathsf{fma}\left(x, \frac{x}{\color{blue}{\left(4 \cdot y\right)} \cdot y + x \cdot x}, -\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
      6. associate-*l*50.9%

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, \color{blue}{{x}^{2}}\right)}, -\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
      10. *-commutative50.9%

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

        \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}, -\frac{\color{blue}{4 \cdot \left(y \cdot y\right)}}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right) \]
      12. pow250.9%

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

        \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}, -\frac{4 \cdot {y}^{2}}{\color{blue}{\left(y \cdot 4\right) \cdot y + x \cdot x}}\right) \]
      14. *-commutative50.9%

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

        \[\leadsto \mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}, -\frac{4 \cdot {y}^{2}}{\color{blue}{4 \cdot \left(y \cdot y\right)} + x \cdot x}\right) \]
      16. fma-define50.9%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}, -\frac{4 \cdot {y}^{2}}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}\right)} \]
    5. Step-by-step derivation
      1. fma-undefine50.9%

        \[\leadsto \color{blue}{x \cdot \frac{x}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)} + \left(-\frac{4 \cdot {y}^{2}}{\mathsf{fma}\left(4, {y}^{2}, {x}^{2}\right)}\right)} \]
      2. unsub-neg50.9%

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

      \[\leadsto \color{blue}{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}} - {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}} \]
    7. Step-by-step derivation
      1. sub-neg87.5%

        \[\leadsto \color{blue}{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right)} \]
      2. add-sqr-sqrt87.5%

        \[\leadsto \color{blue}{\sqrt{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}} \cdot \sqrt{\frac{{x}^{2}}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
      3. pow287.5%

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

        \[\leadsto {\color{blue}{\left(\frac{\sqrt{{x}^{2}}}{\sqrt{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
      5. unpow287.5%

        \[\leadsto {\left(\frac{\sqrt{\color{blue}{x \cdot x}}}{\sqrt{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
      6. sqrt-prod48.2%

        \[\leadsto {\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{\sqrt{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
      7. add-sqr-sqrt87.7%

        \[\leadsto {\left(\frac{\color{blue}{x}}{\sqrt{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{2}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
      8. sqrt-pow1100.0%

        \[\leadsto {\left(\frac{x}{\color{blue}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{\left(\frac{2}{2}\right)}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
      9. metadata-eval100.0%

        \[\leadsto {\left(\frac{x}{{\left(\mathsf{hypot}\left(y \cdot 2, x\right)\right)}^{\color{blue}{1}}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
      10. pow1100.0%

        \[\leadsto {\left(\frac{x}{\color{blue}{\mathsf{hypot}\left(y \cdot 2, x\right)}}\right)}^{2} + \left(-{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
      11. add-sqr-sqrt100.0%

        \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-\color{blue}{\sqrt{{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}} \cdot \sqrt{{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}}}\right) \]
      12. add-sqr-sqrt100.0%

        \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-\color{blue}{{\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}}\right) \]
      13. *-commutative100.0%

        \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-{\left(\frac{\color{blue}{2 \cdot y}}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right) \]
      14. associate-/l*100.0%

        \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-{\color{blue}{\left(2 \cdot \frac{y}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}}^{2}\right) \]
    8. Applied egg-rr100.0%

      \[\leadsto \color{blue}{{\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-{\left(2 \cdot \frac{y}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}\right)} \]
    9. Step-by-step derivation
      1. sub-neg100.0%

        \[\leadsto \color{blue}{{\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\left(2 \cdot \frac{y}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}} \]
      2. associate-*r/100.0%

        \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\color{blue}{\left(\frac{2 \cdot y}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}}^{2} \]
      3. *-commutative100.0%

        \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\left(\frac{\color{blue}{y \cdot 2}}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} \]
    10. Simplified100.0%

      \[\leadsto \color{blue}{{\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - {\left(\frac{y \cdot 2}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2}} \]
    11. Taylor expanded in y around inf 83.0%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \color{blue}{\left(1 + -0.25 \cdot \frac{{x}^{2}}{{y}^{2}}\right)} \]
    12. Step-by-step derivation
      1. unpow283.0%

        \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \left(1 + -0.25 \cdot \frac{\color{blue}{x \cdot x}}{{y}^{2}}\right) \]
      2. unpow283.0%

        \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \left(1 + -0.25 \cdot \frac{x \cdot x}{\color{blue}{y \cdot y}}\right) \]
      3. times-frac90.8%

        \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \left(1 + -0.25 \cdot \color{blue}{\left(\frac{x}{y} \cdot \frac{x}{y}\right)}\right) \]
      4. unpow290.8%

        \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \left(1 + -0.25 \cdot \color{blue}{{\left(\frac{x}{y}\right)}^{2}}\right) \]
    13. Simplified90.8%

      \[\leadsto {\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} - \color{blue}{\left(1 + -0.25 \cdot {\left(\frac{x}{y}\right)}^{2}\right)} \]

    if 1.9999999999999998e-254 < (*.f64 x x) < 1.99999999999999996e-137 or 5.00000000000000039e-44 < (*.f64 x x) < 1.00000000000000005e223

    1. Initial program 79.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

    if 1.00000000000000005e223 < (*.f64 x x)

    1. Initial program 17.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-254}:\\ \;\;\;\;{\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-1 - -0.25 \cdot {\left(\frac{x}{y}\right)}^{2}\right)\\ \mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{-137}:\\ \;\;\;\;\frac{x \cdot x - y \cdot \left(y \cdot 4\right)}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\ \mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{-44}:\\ \;\;\;\;{\left(\frac{x}{\mathsf{hypot}\left(y \cdot 2, x\right)}\right)}^{2} + \left(-1 - -0.25 \cdot {\left(\frac{x}{y}\right)}^{2}\right)\\ \mathbf{elif}\;x \cdot x \leq 10^{+223}:\\ \;\;\;\;\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 6: 80.2% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(y \cdot 4\right)\\ t_1 := \frac{x \cdot x - t\_0}{x \cdot x + t\_0}\\ t_2 := \left(\frac{x}{y} \cdot \frac{x}{y}\right) \cdot 0.5\\ \mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-254}:\\ \;\;\;\;\left({\left(\sqrt{1 + t\_2}\right)}^{2} + -1\right) + -1\\ \mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{-137}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{-44}:\\ \;\;\;\;t\_2 + -1\\ \mathbf{elif}\;x \cdot x \leq 10^{+223}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;1 + -8 \cdot \left(\frac{y}{x} \cdot \frac{y}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* y (* y 4.0)))
        (t_1 (/ (- (* x x) t_0) (+ (* x x) t_0)))
        (t_2 (* (* (/ x y) (/ x y)) 0.5)))
   (if (<= (* x x) 2e-254)
     (+ (+ (pow (sqrt (+ 1.0 t_2)) 2.0) -1.0) -1.0)
     (if (<= (* x x) 2e-137)
       t_1
       (if (<= (* x x) 5e-44)
         (+ t_2 -1.0)
         (if (<= (* x x) 1e+223) t_1 (+ 1.0 (* -8.0 (* (/ y x) (/ y x))))))))))
double code(double x, double y) {
	double t_0 = y * (y * 4.0);
	double t_1 = ((x * x) - t_0) / ((x * x) + t_0);
	double t_2 = ((x / y) * (x / y)) * 0.5;
	double tmp;
	if ((x * x) <= 2e-254) {
		tmp = (pow(sqrt((1.0 + t_2)), 2.0) + -1.0) + -1.0;
	} else if ((x * x) <= 2e-137) {
		tmp = t_1;
	} else if ((x * x) <= 5e-44) {
		tmp = t_2 + -1.0;
	} else if ((x * x) <= 1e+223) {
		tmp = t_1;
	} else {
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)));
	}
	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) :: tmp
    t_0 = y * (y * 4.0d0)
    t_1 = ((x * x) - t_0) / ((x * x) + t_0)
    t_2 = ((x / y) * (x / y)) * 0.5d0
    if ((x * x) <= 2d-254) then
        tmp = ((sqrt((1.0d0 + t_2)) ** 2.0d0) + (-1.0d0)) + (-1.0d0)
    else if ((x * x) <= 2d-137) then
        tmp = t_1
    else if ((x * x) <= 5d-44) then
        tmp = t_2 + (-1.0d0)
    else if ((x * x) <= 1d+223) then
        tmp = t_1
    else
        tmp = 1.0d0 + ((-8.0d0) * ((y / x) * (y / x)))
    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) / ((x * x) + t_0);
	double t_2 = ((x / y) * (x / y)) * 0.5;
	double tmp;
	if ((x * x) <= 2e-254) {
		tmp = (Math.pow(Math.sqrt((1.0 + t_2)), 2.0) + -1.0) + -1.0;
	} else if ((x * x) <= 2e-137) {
		tmp = t_1;
	} else if ((x * x) <= 5e-44) {
		tmp = t_2 + -1.0;
	} else if ((x * x) <= 1e+223) {
		tmp = t_1;
	} else {
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)));
	}
	return tmp;
}
def code(x, y):
	t_0 = y * (y * 4.0)
	t_1 = ((x * x) - t_0) / ((x * x) + t_0)
	t_2 = ((x / y) * (x / y)) * 0.5
	tmp = 0
	if (x * x) <= 2e-254:
		tmp = (math.pow(math.sqrt((1.0 + t_2)), 2.0) + -1.0) + -1.0
	elif (x * x) <= 2e-137:
		tmp = t_1
	elif (x * x) <= 5e-44:
		tmp = t_2 + -1.0
	elif (x * x) <= 1e+223:
		tmp = t_1
	else:
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)))
	return tmp
function code(x, y)
	t_0 = Float64(y * Float64(y * 4.0))
	t_1 = Float64(Float64(Float64(x * x) - t_0) / Float64(Float64(x * x) + t_0))
	t_2 = Float64(Float64(Float64(x / y) * Float64(x / y)) * 0.5)
	tmp = 0.0
	if (Float64(x * x) <= 2e-254)
		tmp = Float64(Float64((sqrt(Float64(1.0 + t_2)) ^ 2.0) + -1.0) + -1.0);
	elseif (Float64(x * x) <= 2e-137)
		tmp = t_1;
	elseif (Float64(x * x) <= 5e-44)
		tmp = Float64(t_2 + -1.0);
	elseif (Float64(x * x) <= 1e+223)
		tmp = t_1;
	else
		tmp = Float64(1.0 + Float64(-8.0 * Float64(Float64(y / x) * Float64(y / x))));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = y * (y * 4.0);
	t_1 = ((x * x) - t_0) / ((x * x) + t_0);
	t_2 = ((x / y) * (x / y)) * 0.5;
	tmp = 0.0;
	if ((x * x) <= 2e-254)
		tmp = ((sqrt((1.0 + t_2)) ^ 2.0) + -1.0) + -1.0;
	elseif ((x * x) <= 2e-137)
		tmp = t_1;
	elseif ((x * x) <= 5e-44)
		tmp = t_2 + -1.0;
	elseif ((x * x) <= 1e+223)
		tmp = t_1;
	else
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)));
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x * x), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(N[(x * x), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 2e-254], N[(N[(N[Power[N[Sqrt[N[(1.0 + t$95$2), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + -1.0), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 2e-137], t$95$1, If[LessEqual[N[(x * x), $MachinePrecision], 5e-44], N[(t$95$2 + -1.0), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 1e+223], t$95$1, N[(1.0 + N[(-8.0 * N[(N[(y / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot 4\right)\\
t_1 := \frac{x \cdot x - t\_0}{x \cdot x + t\_0}\\
t_2 := \left(\frac{x}{y} \cdot \frac{x}{y}\right) \cdot 0.5\\
\mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-254}:\\
\;\;\;\;\left({\left(\sqrt{1 + t\_2}\right)}^{2} + -1\right) + -1\\

\mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{-137}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{-44}:\\
\;\;\;\;t\_2 + -1\\

\mathbf{elif}\;x \cdot x \leq 10^{+223}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x x) < 1.9999999999999998e-254

    1. Initial program 51.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 x around 0 81.1%

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

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

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

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

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

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left({\left(\frac{\color{blue}{{x}^{\left(\frac{2}{2}\right)}}}{\sqrt{{y}^{2}}}\right)}^{2} \cdot 0.5\right)} - 1\right) - 1 \]
      8. metadata-eval81.3%

        \[\leadsto \left(e^{\mathsf{log1p}\left({\left(\frac{{x}^{\color{blue}{1}}}{\sqrt{{y}^{2}}}\right)}^{2} \cdot 0.5\right)} - 1\right) - 1 \]
      9. pow181.3%

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

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

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

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

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

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

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

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

        \[\leadsto \left({\left(\sqrt{e^{\log \left(1 + \color{blue}{\left(\frac{x}{y} \cdot \frac{x}{y}\right)} \cdot 0.5\right)}}\right)}^{2} - 1\right) - 1 \]
      5. *-commutative90.7%

        \[\leadsto \left({\left(\sqrt{e^{\log \left(1 + \color{blue}{0.5 \cdot \left(\frac{x}{y} \cdot \frac{x}{y}\right)}\right)}}\right)}^{2} - 1\right) - 1 \]
      6. add-exp-log90.7%

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

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

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

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

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

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

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

    if 1.9999999999999998e-254 < (*.f64 x x) < 1.99999999999999996e-137 or 5.00000000000000039e-44 < (*.f64 x x) < 1.00000000000000005e223

    1. Initial program 79.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

    if 1.99999999999999996e-137 < (*.f64 x x) < 5.00000000000000039e-44

    1. Initial program 49.9%

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

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

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

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

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

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

    if 1.00000000000000005e223 < (*.f64 x x)

    1. Initial program 17.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-254}:\\ \;\;\;\;\left({\left(\sqrt{1 + \left(\frac{x}{y} \cdot \frac{x}{y}\right) \cdot 0.5}\right)}^{2} + -1\right) + -1\\ \mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{-137}:\\ \;\;\;\;\frac{x \cdot x - y \cdot \left(y \cdot 4\right)}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\ \mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{-44}:\\ \;\;\;\;\left(\frac{x}{y} \cdot \frac{x}{y}\right) \cdot 0.5 + -1\\ \mathbf{elif}\;x \cdot x \leq 10^{+223}:\\ \;\;\;\;\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 7: 80.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(y \cdot 4\right)\\ t_1 := \frac{x \cdot x - t\_0}{x \cdot x + t\_0}\\ t_2 := \left(\frac{x}{y} \cdot \frac{x}{y}\right) \cdot 0.5\\ \mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(1 + t\_2\right) + -1\right) + -1\\ \mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{-137}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{-44}:\\ \;\;\;\;t\_2 + -1\\ \mathbf{elif}\;x \cdot x \leq 10^{+223}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;1 + -8 \cdot \left(\frac{y}{x} \cdot \frac{y}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* y (* y 4.0)))
        (t_1 (/ (- (* x x) t_0) (+ (* x x) t_0)))
        (t_2 (* (* (/ x y) (/ x y)) 0.5)))
   (if (<= (* x x) 2e-254)
     (+ (+ (+ 1.0 t_2) -1.0) -1.0)
     (if (<= (* x x) 2e-137)
       t_1
       (if (<= (* x x) 5e-44)
         (+ t_2 -1.0)
         (if (<= (* x x) 1e+223) t_1 (+ 1.0 (* -8.0 (* (/ y x) (/ y x))))))))))
double code(double x, double y) {
	double t_0 = y * (y * 4.0);
	double t_1 = ((x * x) - t_0) / ((x * x) + t_0);
	double t_2 = ((x / y) * (x / y)) * 0.5;
	double tmp;
	if ((x * x) <= 2e-254) {
		tmp = ((1.0 + t_2) + -1.0) + -1.0;
	} else if ((x * x) <= 2e-137) {
		tmp = t_1;
	} else if ((x * x) <= 5e-44) {
		tmp = t_2 + -1.0;
	} else if ((x * x) <= 1e+223) {
		tmp = t_1;
	} else {
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)));
	}
	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) :: tmp
    t_0 = y * (y * 4.0d0)
    t_1 = ((x * x) - t_0) / ((x * x) + t_0)
    t_2 = ((x / y) * (x / y)) * 0.5d0
    if ((x * x) <= 2d-254) then
        tmp = ((1.0d0 + t_2) + (-1.0d0)) + (-1.0d0)
    else if ((x * x) <= 2d-137) then
        tmp = t_1
    else if ((x * x) <= 5d-44) then
        tmp = t_2 + (-1.0d0)
    else if ((x * x) <= 1d+223) then
        tmp = t_1
    else
        tmp = 1.0d0 + ((-8.0d0) * ((y / x) * (y / x)))
    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) / ((x * x) + t_0);
	double t_2 = ((x / y) * (x / y)) * 0.5;
	double tmp;
	if ((x * x) <= 2e-254) {
		tmp = ((1.0 + t_2) + -1.0) + -1.0;
	} else if ((x * x) <= 2e-137) {
		tmp = t_1;
	} else if ((x * x) <= 5e-44) {
		tmp = t_2 + -1.0;
	} else if ((x * x) <= 1e+223) {
		tmp = t_1;
	} else {
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)));
	}
	return tmp;
}
def code(x, y):
	t_0 = y * (y * 4.0)
	t_1 = ((x * x) - t_0) / ((x * x) + t_0)
	t_2 = ((x / y) * (x / y)) * 0.5
	tmp = 0
	if (x * x) <= 2e-254:
		tmp = ((1.0 + t_2) + -1.0) + -1.0
	elif (x * x) <= 2e-137:
		tmp = t_1
	elif (x * x) <= 5e-44:
		tmp = t_2 + -1.0
	elif (x * x) <= 1e+223:
		tmp = t_1
	else:
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)))
	return tmp
function code(x, y)
	t_0 = Float64(y * Float64(y * 4.0))
	t_1 = Float64(Float64(Float64(x * x) - t_0) / Float64(Float64(x * x) + t_0))
	t_2 = Float64(Float64(Float64(x / y) * Float64(x / y)) * 0.5)
	tmp = 0.0
	if (Float64(x * x) <= 2e-254)
		tmp = Float64(Float64(Float64(1.0 + t_2) + -1.0) + -1.0);
	elseif (Float64(x * x) <= 2e-137)
		tmp = t_1;
	elseif (Float64(x * x) <= 5e-44)
		tmp = Float64(t_2 + -1.0);
	elseif (Float64(x * x) <= 1e+223)
		tmp = t_1;
	else
		tmp = Float64(1.0 + Float64(-8.0 * Float64(Float64(y / x) * Float64(y / x))));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = y * (y * 4.0);
	t_1 = ((x * x) - t_0) / ((x * x) + t_0);
	t_2 = ((x / y) * (x / y)) * 0.5;
	tmp = 0.0;
	if ((x * x) <= 2e-254)
		tmp = ((1.0 + t_2) + -1.0) + -1.0;
	elseif ((x * x) <= 2e-137)
		tmp = t_1;
	elseif ((x * x) <= 5e-44)
		tmp = t_2 + -1.0;
	elseif ((x * x) <= 1e+223)
		tmp = t_1;
	else
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)));
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x * x), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(N[(x * x), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 2e-254], N[(N[(N[(1.0 + t$95$2), $MachinePrecision] + -1.0), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 2e-137], t$95$1, If[LessEqual[N[(x * x), $MachinePrecision], 5e-44], N[(t$95$2 + -1.0), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 1e+223], t$95$1, N[(1.0 + N[(-8.0 * N[(N[(y / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot 4\right)\\
t_1 := \frac{x \cdot x - t\_0}{x \cdot x + t\_0}\\
t_2 := \left(\frac{x}{y} \cdot \frac{x}{y}\right) \cdot 0.5\\
\mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-254}:\\
\;\;\;\;\left(\left(1 + t\_2\right) + -1\right) + -1\\

\mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{-137}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{-44}:\\
\;\;\;\;t\_2 + -1\\

\mathbf{elif}\;x \cdot x \leq 10^{+223}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x x) < 1.9999999999999998e-254

    1. Initial program 51.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 x around 0 81.1%

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

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

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

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

      \[\leadsto 0.5 \cdot \color{blue}{\left(\frac{x}{y} \cdot \frac{x}{y}\right)} - 1 \]
    6. Step-by-step derivation
      1. *-commutative90.7%

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

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

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

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

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

        \[\leadsto \left(e^{\log \left(1 + \color{blue}{\left(\frac{x}{y} \cdot \frac{x}{y}\right)} \cdot 0.5\right)} - 1\right) - 1 \]
      7. *-commutative90.7%

        \[\leadsto \left(e^{\log \left(1 + \color{blue}{0.5 \cdot \left(\frac{x}{y} \cdot \frac{x}{y}\right)}\right)} - 1\right) - 1 \]
      8. add-exp-log90.7%

        \[\leadsto \left(\color{blue}{\left(1 + 0.5 \cdot \left(\frac{x}{y} \cdot \frac{x}{y}\right)\right)} - 1\right) - 1 \]
      9. +-commutative90.7%

        \[\leadsto \left(\color{blue}{\left(0.5 \cdot \left(\frac{x}{y} \cdot \frac{x}{y}\right) + 1\right)} - 1\right) - 1 \]
      10. *-commutative90.7%

        \[\leadsto \left(\left(\color{blue}{\left(\frac{x}{y} \cdot \frac{x}{y}\right) \cdot 0.5} + 1\right) - 1\right) - 1 \]
      11. pow290.7%

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

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

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

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

    if 1.9999999999999998e-254 < (*.f64 x x) < 1.99999999999999996e-137 or 5.00000000000000039e-44 < (*.f64 x x) < 1.00000000000000005e223

    1. Initial program 79.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

    if 1.99999999999999996e-137 < (*.f64 x x) < 5.00000000000000039e-44

    1. Initial program 49.9%

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

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

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

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

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

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

    if 1.00000000000000005e223 < (*.f64 x x)

    1. Initial program 17.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(1 + \left(\frac{x}{y} \cdot \frac{x}{y}\right) \cdot 0.5\right) + -1\right) + -1\\ \mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{-137}:\\ \;\;\;\;\frac{x \cdot x - y \cdot \left(y \cdot 4\right)}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\ \mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{-44}:\\ \;\;\;\;\left(\frac{x}{y} \cdot \frac{x}{y}\right) \cdot 0.5 + -1\\ \mathbf{elif}\;x \cdot x \leq 10^{+223}:\\ \;\;\;\;\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 8: 65.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2.05 \cdot 10^{-18}:\\ \;\;\;\;\left(\left(1 + \left(\frac{x}{y} \cdot \frac{x}{y}\right) \cdot 0.5\right) + -1\right) + -1\\ \mathbf{else}:\\ \;\;\;\;1 + -8 \cdot \left(\frac{y}{x} \cdot \frac{y}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x 2.05e-18)
   (+ (+ (+ 1.0 (* (* (/ x y) (/ x y)) 0.5)) -1.0) -1.0)
   (+ 1.0 (* -8.0 (* (/ y x) (/ y x))))))
double code(double x, double y) {
	double tmp;
	if (x <= 2.05e-18) {
		tmp = ((1.0 + (((x / y) * (x / y)) * 0.5)) + -1.0) + -1.0;
	} else {
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= 2.05d-18) then
        tmp = ((1.0d0 + (((x / y) * (x / y)) * 0.5d0)) + (-1.0d0)) + (-1.0d0)
    else
        tmp = 1.0d0 + ((-8.0d0) * ((y / x) * (y / x)))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= 2.05e-18) {
		tmp = ((1.0 + (((x / y) * (x / y)) * 0.5)) + -1.0) + -1.0;
	} else {
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= 2.05e-18:
		tmp = ((1.0 + (((x / y) * (x / y)) * 0.5)) + -1.0) + -1.0
	else:
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)))
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= 2.05e-18)
		tmp = Float64(Float64(Float64(1.0 + Float64(Float64(Float64(x / y) * Float64(x / y)) * 0.5)) + -1.0) + -1.0);
	else
		tmp = Float64(1.0 + Float64(-8.0 * Float64(Float64(y / x) * Float64(y / x))));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= 2.05e-18)
		tmp = ((1.0 + (((x / y) * (x / y)) * 0.5)) + -1.0) + -1.0;
	else
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, 2.05e-18], N[(N[(N[(1.0 + N[(N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] + -1.0), $MachinePrecision], N[(1.0 + N[(-8.0 * N[(N[(y / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 53.6%

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

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

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

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

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

      \[\leadsto 0.5 \cdot \color{blue}{\left(\frac{x}{y} \cdot \frac{x}{y}\right)} - 1 \]
    6. Step-by-step derivation
      1. *-commutative64.9%

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

        \[\leadsto \color{blue}{{\left(\frac{x}{y}\right)}^{2}} \cdot 0.5 - 1 \]
      3. expm1-log1p-u64.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(\frac{x}{y}\right)}^{2} \cdot 0.5\right)\right)} - 1 \]
      4. expm1-define64.9%

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

        \[\leadsto \left(e^{\color{blue}{\log \left(1 + {\left(\frac{x}{y}\right)}^{2} \cdot 0.5\right)}} - 1\right) - 1 \]
      6. pow264.9%

        \[\leadsto \left(e^{\log \left(1 + \color{blue}{\left(\frac{x}{y} \cdot \frac{x}{y}\right)} \cdot 0.5\right)} - 1\right) - 1 \]
      7. *-commutative64.9%

        \[\leadsto \left(e^{\log \left(1 + \color{blue}{0.5 \cdot \left(\frac{x}{y} \cdot \frac{x}{y}\right)}\right)} - 1\right) - 1 \]
      8. add-exp-log64.9%

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

        \[\leadsto \left(\color{blue}{\left(0.5 \cdot \left(\frac{x}{y} \cdot \frac{x}{y}\right) + 1\right)} - 1\right) - 1 \]
      10. *-commutative64.9%

        \[\leadsto \left(\left(\color{blue}{\left(\frac{x}{y} \cdot \frac{x}{y}\right) \cdot 0.5} + 1\right) - 1\right) - 1 \]
      11. pow264.9%

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

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

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

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

    if 2.0499999999999999e-18 < x

    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 y around 0 78.7%

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

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

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

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

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

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

Alternative 9: 65.0% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 7.6 \cdot 10^{-19}:\\ \;\;\;\;\left(\frac{x}{y} \cdot \frac{x}{y}\right) \cdot 0.5 + -1\\ \mathbf{else}:\\ \;\;\;\;1 + -8 \cdot \left(\frac{y}{x} \cdot \frac{y}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x 7.6e-19)
   (+ (* (* (/ x y) (/ x y)) 0.5) -1.0)
   (+ 1.0 (* -8.0 (* (/ y x) (/ y x))))))
double code(double x, double y) {
	double tmp;
	if (x <= 7.6e-19) {
		tmp = (((x / y) * (x / y)) * 0.5) + -1.0;
	} else {
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= 7.6d-19) then
        tmp = (((x / y) * (x / y)) * 0.5d0) + (-1.0d0)
    else
        tmp = 1.0d0 + ((-8.0d0) * ((y / x) * (y / x)))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= 7.6e-19) {
		tmp = (((x / y) * (x / y)) * 0.5) + -1.0;
	} else {
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= 7.6e-19:
		tmp = (((x / y) * (x / y)) * 0.5) + -1.0
	else:
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)))
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= 7.6e-19)
		tmp = Float64(Float64(Float64(Float64(x / y) * Float64(x / y)) * 0.5) + -1.0);
	else
		tmp = Float64(1.0 + Float64(-8.0 * Float64(Float64(y / x) * Float64(y / x))));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= 7.6e-19)
		tmp = (((x / y) * (x / y)) * 0.5) + -1.0;
	else
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, 7.6e-19], N[(N[(N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] + -1.0), $MachinePrecision], N[(1.0 + N[(-8.0 * N[(N[(y / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 53.6%

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

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

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

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

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

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

    if 7.6e-19 < x

    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 y around 0 78.7%

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

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

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

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

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

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

Alternative 10: 64.0% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 4 \cdot 10^{-19}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1 + -8 \cdot \left(\frac{y}{x} \cdot \frac{y}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x 4e-19) -1.0 (+ 1.0 (* -8.0 (* (/ y x) (/ y x))))))
double code(double x, double y) {
	double tmp;
	if (x <= 4e-19) {
		tmp = -1.0;
	} else {
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= 4d-19) then
        tmp = -1.0d0
    else
        tmp = 1.0d0 + ((-8.0d0) * ((y / x) * (y / x)))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= 4e-19) {
		tmp = -1.0;
	} else {
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= 4e-19:
		tmp = -1.0
	else:
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)))
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= 4e-19)
		tmp = -1.0;
	else
		tmp = Float64(1.0 + Float64(-8.0 * Float64(Float64(y / x) * Float64(y / x))));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= 4e-19)
		tmp = -1.0;
	else
		tmp = 1.0 + (-8.0 * ((y / x) * (y / x)));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, 4e-19], -1.0, N[(1.0 + N[(-8.0 * N[(N[(y / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 4 \cdot 10^{-19}:\\
\;\;\;\;-1\\

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


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

    1. Initial program 53.6%

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

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

    if 3.9999999999999999e-19 < x

    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 y around 0 78.7%

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

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

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

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

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

Alternative 11: 63.7% accurate, 3.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 10^{-20}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
(FPCore (x y) :precision binary64 (if (<= x 1e-20) -1.0 1.0))
double code(double x, double y) {
	double tmp;
	if (x <= 1e-20) {
		tmp = -1.0;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= 1d-20) then
        tmp = -1.0d0
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= 1e-20) {
		tmp = -1.0;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= 1e-20:
		tmp = -1.0
	else:
		tmp = 1.0
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= 1e-20)
		tmp = -1.0;
	else
		tmp = 1.0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= 1e-20)
		tmp = -1.0;
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, 1e-20], -1.0, 1.0]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{-20}:\\
\;\;\;\;-1\\

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


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

    1. Initial program 53.6%

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

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

    if 9.99999999999999945e-21 < x

    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 inf 86.2%

      \[\leadsto \color{blue}{1} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 50.6% accurate, 19.0× speedup?

\[\begin{array}{l} \\ -1 \end{array} \]
(FPCore (x y) :precision binary64 -1.0)
double code(double x, double y) {
	return -1.0;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = -1.0d0
end function
public static double code(double x, double y) {
	return -1.0;
}
def code(x, y):
	return -1.0
function code(x, y)
	return -1.0
end
function tmp = code(x, y)
	tmp = -1.0;
end
code[x_, y_] := -1.0
\begin{array}{l}

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

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

    \[\leadsto \color{blue}{-1} \]
  4. Add Preprocessing

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 2024088 
(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))))