Diagrams.TwoD.Apollonian:initialConfig from diagrams-contrib-1.3.0.5, A

Percentage Accurate: 68.8% → 91.6%
Time: 10.5s
Alternatives: 12
Speedup: 0.7×

Specification

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

\\
\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}
\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: 68.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0)))
double code(double x, double y, double z) {
	return (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (((x * x) + (y * y)) - (z * z)) / (y * 2.0d0)
end function
public static double code(double x, double y, double z) {
	return (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
}
def code(x, y, z):
	return (((x * x) + (y * y)) - (z * z)) / (y * 2.0)
function code(x, y, z)
	return Float64(Float64(Float64(Float64(x * x) + Float64(y * y)) - Float64(z * z)) / Float64(y * 2.0))
end
function tmp = code(x, y, z)
	tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
end
code[x_, y_, z_] := N[(N[(N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}
\end{array}

Alternative 1: 91.6% accurate, 0.0× speedup?

\[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;y\_m \leq 1.4 \cdot 10^{+19}:\\ \;\;\;\;0.5 \cdot \frac{\mathsf{fma}\left(x, x, y\_m \cdot y\_m - z \cdot z\right)}{y\_m}\\ \mathbf{elif}\;y\_m \leq 9.5 \cdot 10^{+153}:\\ \;\;\;\;y\_m \cdot \left(\left(0.5 + \frac{{x}^{2}}{2 \cdot {y\_m}^{2}}\right) + {\left(\frac{z}{y\_m}\right)}^{2} \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(\mathsf{hypot}\left(y\_m, x\right) \cdot \frac{\mathsf{hypot}\left(y\_m, x\right)}{y\_m}\right)\\ \end{array} \end{array} \]
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
 :precision binary64
 (*
  y_s
  (if (<= y_m 1.4e+19)
    (* 0.5 (/ (fma x x (- (* y_m y_m) (* z z))) y_m))
    (if (<= y_m 9.5e+153)
      (*
       y_m
       (+
        (+ 0.5 (/ (pow x 2.0) (* 2.0 (pow y_m 2.0))))
        (* (pow (/ z y_m) 2.0) -0.5)))
      (* 0.5 (* (hypot y_m x) (/ (hypot y_m x) y_m)))))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (y_m <= 1.4e+19) {
		tmp = 0.5 * (fma(x, x, ((y_m * y_m) - (z * z))) / y_m);
	} else if (y_m <= 9.5e+153) {
		tmp = y_m * ((0.5 + (pow(x, 2.0) / (2.0 * pow(y_m, 2.0)))) + (pow((z / y_m), 2.0) * -0.5));
	} else {
		tmp = 0.5 * (hypot(y_m, x) * (hypot(y_m, x) / y_m));
	}
	return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0, y)
function code(y_s, x, y_m, z)
	tmp = 0.0
	if (y_m <= 1.4e+19)
		tmp = Float64(0.5 * Float64(fma(x, x, Float64(Float64(y_m * y_m) - Float64(z * z))) / y_m));
	elseif (y_m <= 9.5e+153)
		tmp = Float64(y_m * Float64(Float64(0.5 + Float64((x ^ 2.0) / Float64(2.0 * (y_m ^ 2.0)))) + Float64((Float64(z / y_m) ^ 2.0) * -0.5)));
	else
		tmp = Float64(0.5 * Float64(hypot(y_m, x) * Float64(hypot(y_m, x) / y_m)));
	end
	return Float64(y_s * tmp)
end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 1.4e+19], N[(0.5 * N[(N[(x * x + N[(N[(y$95$m * y$95$m), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 9.5e+153], N[(y$95$m * N[(N[(0.5 + N[(N[Power[x, 2.0], $MachinePrecision] / N[(2.0 * N[Power[y$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[(z / y$95$m), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[Sqrt[y$95$m ^ 2 + x ^ 2], $MachinePrecision] * N[(N[Sqrt[y$95$m ^ 2 + x ^ 2], $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 1.4 \cdot 10^{+19}:\\
\;\;\;\;0.5 \cdot \frac{\mathsf{fma}\left(x, x, y\_m \cdot y\_m - z \cdot z\right)}{y\_m}\\

\mathbf{elif}\;y\_m \leq 9.5 \cdot 10^{+153}:\\
\;\;\;\;y\_m \cdot \left(\left(0.5 + \frac{{x}^{2}}{2 \cdot {y\_m}^{2}}\right) + {\left(\frac{z}{y\_m}\right)}^{2} \cdot -0.5\right)\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\mathsf{hypot}\left(y\_m, x\right) \cdot \frac{\mathsf{hypot}\left(y\_m, x\right)}{y\_m}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 1.4e19

    1. Initial program 77.8%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg77.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out77.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg277.8%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-177.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out77.8%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac77.8%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval77.8%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval77.8%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+77.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define79.9%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified79.9%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing

    if 1.4e19 < y < 9.4999999999999995e153

    1. Initial program 85.9%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt85.5%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{\sqrt{y \cdot 2} \cdot \sqrt{y \cdot 2}}} \]
      2. pow285.5%

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

      \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{{\left(\sqrt{y \cdot 2}\right)}^{2}}} \]
    5. Taylor expanded in y around inf 84.8%

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

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

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

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

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

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

        \[\leadsto y \cdot \left(\left(\frac{{x}^{2}}{2 \cdot {y}^{2}} + \frac{1}{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}\right) + \left(-\frac{{z}^{2}}{{y}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}\right)\right) \]
      7. rem-square-sqrt86.0%

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

        \[\leadsto y \cdot \left(\left(\frac{{x}^{2}}{2 \cdot {y}^{2}} + \color{blue}{0.5}\right) + \left(-\frac{{z}^{2}}{{y}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}\right)\right) \]
      9. associate-/r*86.0%

        \[\leadsto y \cdot \left(\left(\frac{{x}^{2}}{2 \cdot {y}^{2}} + 0.5\right) + \left(-\color{blue}{\frac{\frac{{z}^{2}}{{y}^{2}}}{{\left(\sqrt{2}\right)}^{2}}}\right)\right) \]
      10. unpow286.0%

        \[\leadsto y \cdot \left(\left(\frac{{x}^{2}}{2 \cdot {y}^{2}} + 0.5\right) + \left(-\frac{\frac{{z}^{2}}{{y}^{2}}}{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}\right)\right) \]
      11. rem-square-sqrt86.1%

        \[\leadsto y \cdot \left(\left(\frac{{x}^{2}}{2 \cdot {y}^{2}} + 0.5\right) + \left(-\frac{\frac{{z}^{2}}{{y}^{2}}}{\color{blue}{2}}\right)\right) \]
      12. distribute-neg-frac286.1%

        \[\leadsto y \cdot \left(\left(\frac{{x}^{2}}{2 \cdot {y}^{2}} + 0.5\right) + \color{blue}{\frac{\frac{{z}^{2}}{{y}^{2}}}{-2}}\right) \]
      13. metadata-eval86.1%

        \[\leadsto y \cdot \left(\left(\frac{{x}^{2}}{2 \cdot {y}^{2}} + 0.5\right) + \frac{\frac{{z}^{2}}{{y}^{2}}}{\color{blue}{-2}}\right) \]
      14. rem-square-sqrt0.0%

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

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

    if 9.4999999999999995e153 < y

    1. Initial program 14.0%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg14.0%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out14.0%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg214.0%

        \[\leadsto \color{blue}{-\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\left(-y\right) \cdot 2}} \]
      4. distribute-frac-neg14.0%

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-114.0%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out14.0%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{-y \cdot 2}} \]
      7. *-commutative14.0%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{-\color{blue}{2 \cdot y}} \]
      8. distribute-lft-neg-in14.0%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac14.0%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval14.0%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval14.0%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+14.0%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define14.0%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified14.0%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 14.9%

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

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\sqrt{{x}^{2} + {y}^{2}} \cdot \sqrt{{x}^{2} + {y}^{2}}}}{y} \]
      2. unpow214.9%

        \[\leadsto 0.5 \cdot \frac{\sqrt{\color{blue}{x \cdot x} + {y}^{2}} \cdot \sqrt{{x}^{2} + {y}^{2}}}{y} \]
      3. unpow214.9%

        \[\leadsto 0.5 \cdot \frac{\sqrt{x \cdot x + \color{blue}{y \cdot y}} \cdot \sqrt{{x}^{2} + {y}^{2}}}{y} \]
      4. hypot-undefine14.9%

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

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

        \[\leadsto 0.5 \cdot \frac{\mathsf{hypot}\left(x, y\right) \cdot \sqrt{x \cdot x + \color{blue}{y \cdot y}}}{y} \]
      7. hypot-undefine14.9%

        \[\leadsto 0.5 \cdot \frac{\mathsf{hypot}\left(x, y\right) \cdot \color{blue}{\mathsf{hypot}\left(x, y\right)}}{y} \]
      8. unpow214.9%

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

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

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

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

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

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

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

        \[\leadsto 0.5 \cdot \frac{{\color{blue}{\left(\mathsf{hypot}\left(y, x\right)\right)}}^{2}}{y} \]
    7. Simplified14.9%

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

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

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

        \[\leadsto 0.5 \cdot \frac{{\color{blue}{\left(\mathsf{hypot}\left(x, y\right)\right)}}^{2}}{y} \]
      4. unpow214.9%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{hypot}\left(x, y\right) \cdot \mathsf{hypot}\left(x, y\right)}}{y} \]
      5. *-un-lft-identity14.9%

        \[\leadsto 0.5 \cdot \frac{\mathsf{hypot}\left(x, y\right) \cdot \mathsf{hypot}\left(x, y\right)}{\color{blue}{1 \cdot y}} \]
      6. times-frac88.1%

        \[\leadsto 0.5 \cdot \color{blue}{\left(\frac{\mathsf{hypot}\left(x, y\right)}{1} \cdot \frac{\mathsf{hypot}\left(x, y\right)}{y}\right)} \]
      7. hypot-undefine14.9%

        \[\leadsto 0.5 \cdot \left(\frac{\color{blue}{\sqrt{x \cdot x + y \cdot y}}}{1} \cdot \frac{\mathsf{hypot}\left(x, y\right)}{y}\right) \]
      8. +-commutative14.9%

        \[\leadsto 0.5 \cdot \left(\frac{\sqrt{\color{blue}{y \cdot y + x \cdot x}}}{1} \cdot \frac{\mathsf{hypot}\left(x, y\right)}{y}\right) \]
      9. hypot-undefine88.1%

        \[\leadsto 0.5 \cdot \left(\frac{\color{blue}{\mathsf{hypot}\left(y, x\right)}}{1} \cdot \frac{\mathsf{hypot}\left(x, y\right)}{y}\right) \]
      10. hypot-undefine14.9%

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

        \[\leadsto 0.5 \cdot \left(\frac{\mathsf{hypot}\left(y, x\right)}{1} \cdot \frac{\sqrt{\color{blue}{y \cdot y + x \cdot x}}}{y}\right) \]
      12. hypot-undefine88.1%

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

      \[\leadsto 0.5 \cdot \color{blue}{\left(\frac{\mathsf{hypot}\left(y, x\right)}{1} \cdot \frac{\mathsf{hypot}\left(y, x\right)}{y}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification83.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.4 \cdot 10^{+19}:\\ \;\;\;\;0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+153}:\\ \;\;\;\;y \cdot \left(\left(0.5 + \frac{{x}^{2}}{2 \cdot {y}^{2}}\right) + {\left(\frac{z}{y}\right)}^{2} \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(\mathsf{hypot}\left(y, x\right) \cdot \frac{\mathsf{hypot}\left(y, x\right)}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 93.1% accurate, 0.1× speedup?

\[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{\left(y\_m \cdot y\_m + x \cdot x\right) - z \cdot z}{y\_m \cdot 2} \leq -5 \cdot 10^{-74}:\\ \;\;\;\;\frac{0.5}{\frac{y\_m}{z} \cdot \frac{-1}{z}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(\mathsf{hypot}\left(y\_m, x\right) \cdot \frac{\mathsf{hypot}\left(y\_m, x\right)}{y\_m}\right)\\ \end{array} \end{array} \]
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
 :precision binary64
 (*
  y_s
  (if (<= (/ (- (+ (* y_m y_m) (* x x)) (* z z)) (* y_m 2.0)) -5e-74)
    (/ 0.5 (* (/ y_m z) (/ -1.0 z)))
    (* 0.5 (* (hypot y_m x) (/ (hypot y_m x) y_m))))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (((((y_m * y_m) + (x * x)) - (z * z)) / (y_m * 2.0)) <= -5e-74) {
		tmp = 0.5 / ((y_m / z) * (-1.0 / z));
	} else {
		tmp = 0.5 * (hypot(y_m, x) * (hypot(y_m, x) / y_m));
	}
	return y_s * tmp;
}
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (((((y_m * y_m) + (x * x)) - (z * z)) / (y_m * 2.0)) <= -5e-74) {
		tmp = 0.5 / ((y_m / z) * (-1.0 / z));
	} else {
		tmp = 0.5 * (Math.hypot(y_m, x) * (Math.hypot(y_m, x) / y_m));
	}
	return y_s * tmp;
}
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
def code(y_s, x, y_m, z):
	tmp = 0
	if ((((y_m * y_m) + (x * x)) - (z * z)) / (y_m * 2.0)) <= -5e-74:
		tmp = 0.5 / ((y_m / z) * (-1.0 / z))
	else:
		tmp = 0.5 * (math.hypot(y_m, x) * (math.hypot(y_m, x) / y_m))
	return y_s * tmp
y\_m = abs(y)
y\_s = copysign(1.0, y)
function code(y_s, x, y_m, z)
	tmp = 0.0
	if (Float64(Float64(Float64(Float64(y_m * y_m) + Float64(x * x)) - Float64(z * z)) / Float64(y_m * 2.0)) <= -5e-74)
		tmp = Float64(0.5 / Float64(Float64(y_m / z) * Float64(-1.0 / z)));
	else
		tmp = Float64(0.5 * Float64(hypot(y_m, x) * Float64(hypot(y_m, x) / y_m)));
	end
	return Float64(y_s * tmp)
end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
function tmp_2 = code(y_s, x, y_m, z)
	tmp = 0.0;
	if (((((y_m * y_m) + (x * x)) - (z * z)) / (y_m * 2.0)) <= -5e-74)
		tmp = 0.5 / ((y_m / z) * (-1.0 / z));
	else
		tmp = 0.5 * (hypot(y_m, x) * (hypot(y_m, x) / y_m));
	end
	tmp_2 = y_s * tmp;
end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[N[(N[(N[(N[(y$95$m * y$95$m), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y$95$m * 2.0), $MachinePrecision]), $MachinePrecision], -5e-74], N[(0.5 / N[(N[(y$95$m / z), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[Sqrt[y$95$m ^ 2 + x ^ 2], $MachinePrecision] * N[(N[Sqrt[y$95$m ^ 2 + x ^ 2], $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{\left(y\_m \cdot y\_m + x \cdot x\right) - z \cdot z}{y\_m \cdot 2} \leq -5 \cdot 10^{-74}:\\
\;\;\;\;\frac{0.5}{\frac{y\_m}{z} \cdot \frac{-1}{z}}\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\mathsf{hypot}\left(y\_m, x\right) \cdot \frac{\mathsf{hypot}\left(y\_m, x\right)}{y\_m}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 x x) (*.f64 y y)) (*.f64 z z)) (*.f64 y #s(literal 2 binary64))) < -4.99999999999999998e-74

    1. Initial program 75.7%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg75.7%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out75.7%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg275.7%

        \[\leadsto \color{blue}{-\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\left(-y\right) \cdot 2}} \]
      4. distribute-frac-neg75.7%

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-175.7%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out75.7%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{-y \cdot 2}} \]
      7. *-commutative75.7%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{-\color{blue}{2 \cdot y}} \]
      8. distribute-lft-neg-in75.7%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac75.7%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval75.7%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval75.7%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+75.7%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define75.7%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified75.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num75.5%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv75.5%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine75.5%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+75.5%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt75.6%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow275.6%

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

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

        \[\leadsto \frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - \color{blue}{{z}^{2}}}} \]
    6. Applied egg-rr75.6%

      \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - {z}^{2}}}} \]
    7. Applied egg-rr73.1%

      \[\leadsto \frac{0.5}{\color{blue}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \frac{y}{\mathsf{hypot}\left(x, y + z\right)}}} \]
    8. Taylor expanded in z around -inf 17.4%

      \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\left(-1 \cdot \frac{y}{z}\right)}} \]
    9. Step-by-step derivation
      1. associate-*r/17.4%

        \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\frac{-1 \cdot y}{z}}} \]
      2. neg-mul-117.4%

        \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \frac{\color{blue}{-y}}{z}} \]
    10. Simplified17.4%

      \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\frac{-y}{z}}} \]
    11. Taylor expanded in z around inf 27.7%

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

    if -4.99999999999999998e-74 < (/.f64 (-.f64 (+.f64 (*.f64 x x) (*.f64 y y)) (*.f64 z z)) (*.f64 y #s(literal 2 binary64)))

    1. Initial program 65.7%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg65.7%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out65.7%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg265.7%

        \[\leadsto \color{blue}{-\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\left(-y\right) \cdot 2}} \]
      4. distribute-frac-neg65.7%

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-165.7%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out65.7%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{-y \cdot 2}} \]
      7. *-commutative65.7%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{-\color{blue}{2 \cdot y}} \]
      8. distribute-lft-neg-in65.7%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac65.7%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval65.7%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval65.7%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+65.7%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define68.6%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified68.6%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 43.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{{x}^{2} + {y}^{2}}{y}} \]
    6. Step-by-step derivation
      1. rem-square-sqrt43.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\sqrt{{x}^{2} + {y}^{2}} \cdot \sqrt{{x}^{2} + {y}^{2}}}}{y} \]
      2. unpow243.8%

        \[\leadsto 0.5 \cdot \frac{\sqrt{\color{blue}{x \cdot x} + {y}^{2}} \cdot \sqrt{{x}^{2} + {y}^{2}}}{y} \]
      3. unpow243.8%

        \[\leadsto 0.5 \cdot \frac{\sqrt{x \cdot x + \color{blue}{y \cdot y}} \cdot \sqrt{{x}^{2} + {y}^{2}}}{y} \]
      4. hypot-undefine43.8%

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

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

        \[\leadsto 0.5 \cdot \frac{\mathsf{hypot}\left(x, y\right) \cdot \sqrt{x \cdot x + \color{blue}{y \cdot y}}}{y} \]
      7. hypot-undefine43.8%

        \[\leadsto 0.5 \cdot \frac{\mathsf{hypot}\left(x, y\right) \cdot \color{blue}{\mathsf{hypot}\left(x, y\right)}}{y} \]
      8. unpow243.8%

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

        \[\leadsto 0.5 \cdot \frac{{\color{blue}{\left(\sqrt{x \cdot x + y \cdot y}\right)}}^{2}}{y} \]
      10. unpow243.8%

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

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

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

        \[\leadsto 0.5 \cdot \frac{{\left(\sqrt{\color{blue}{y \cdot y} + {x}^{2}}\right)}^{2}}{y} \]
      14. unpow243.8%

        \[\leadsto 0.5 \cdot \frac{{\left(\sqrt{y \cdot y + \color{blue}{x \cdot x}}\right)}^{2}}{y} \]
      15. hypot-define43.8%

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

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

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

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

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

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{hypot}\left(x, y\right) \cdot \mathsf{hypot}\left(x, y\right)}}{y} \]
      5. *-un-lft-identity43.8%

        \[\leadsto 0.5 \cdot \frac{\mathsf{hypot}\left(x, y\right) \cdot \mathsf{hypot}\left(x, y\right)}{\color{blue}{1 \cdot y}} \]
      6. times-frac64.8%

        \[\leadsto 0.5 \cdot \color{blue}{\left(\frac{\mathsf{hypot}\left(x, y\right)}{1} \cdot \frac{\mathsf{hypot}\left(x, y\right)}{y}\right)} \]
      7. hypot-undefine43.8%

        \[\leadsto 0.5 \cdot \left(\frac{\color{blue}{\sqrt{x \cdot x + y \cdot y}}}{1} \cdot \frac{\mathsf{hypot}\left(x, y\right)}{y}\right) \]
      8. +-commutative43.8%

        \[\leadsto 0.5 \cdot \left(\frac{\sqrt{\color{blue}{y \cdot y + x \cdot x}}}{1} \cdot \frac{\mathsf{hypot}\left(x, y\right)}{y}\right) \]
      9. hypot-undefine64.8%

        \[\leadsto 0.5 \cdot \left(\frac{\color{blue}{\mathsf{hypot}\left(y, x\right)}}{1} \cdot \frac{\mathsf{hypot}\left(x, y\right)}{y}\right) \]
      10. hypot-undefine43.8%

        \[\leadsto 0.5 \cdot \left(\frac{\mathsf{hypot}\left(y, x\right)}{1} \cdot \frac{\color{blue}{\sqrt{x \cdot x + y \cdot y}}}{y}\right) \]
      11. +-commutative43.8%

        \[\leadsto 0.5 \cdot \left(\frac{\mathsf{hypot}\left(y, x\right)}{1} \cdot \frac{\sqrt{\color{blue}{y \cdot y + x \cdot x}}}{y}\right) \]
      12. hypot-undefine64.8%

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

      \[\leadsto 0.5 \cdot \color{blue}{\left(\frac{\mathsf{hypot}\left(y, x\right)}{1} \cdot \frac{\mathsf{hypot}\left(y, x\right)}{y}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification48.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(y \cdot y + x \cdot x\right) - z \cdot z}{y \cdot 2} \leq -5 \cdot 10^{-74}:\\ \;\;\;\;\frac{0.5}{\frac{y}{z} \cdot \frac{-1}{z}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(\mathsf{hypot}\left(y, x\right) \cdot \frac{\mathsf{hypot}\left(y, x\right)}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 87.9% accurate, 0.1× speedup?

\[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ \begin{array}{l} t_0 := \frac{\left(y\_m \cdot y\_m + x \cdot x\right) - z \cdot z}{y\_m \cdot 2}\\ y\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq -5 \cdot 10^{-74} \lor \neg \left(t\_0 \leq \infty\right):\\ \;\;\;\;\frac{0.5}{\frac{y\_m}{z} \cdot \frac{-1}{z}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(y\_m + \frac{{x}^{2}}{y\_m}\right)\\ \end{array} \end{array} \end{array} \]
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
 :precision binary64
 (let* ((t_0 (/ (- (+ (* y_m y_m) (* x x)) (* z z)) (* y_m 2.0))))
   (*
    y_s
    (if (or (<= t_0 -5e-74) (not (<= t_0 INFINITY)))
      (/ 0.5 (* (/ y_m z) (/ -1.0 z)))
      (* 0.5 (+ y_m (/ (pow x 2.0) y_m)))))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
	double t_0 = (((y_m * y_m) + (x * x)) - (z * z)) / (y_m * 2.0);
	double tmp;
	if ((t_0 <= -5e-74) || !(t_0 <= ((double) INFINITY))) {
		tmp = 0.5 / ((y_m / z) * (-1.0 / z));
	} else {
		tmp = 0.5 * (y_m + (pow(x, 2.0) / y_m));
	}
	return y_s * tmp;
}
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
	double t_0 = (((y_m * y_m) + (x * x)) - (z * z)) / (y_m * 2.0);
	double tmp;
	if ((t_0 <= -5e-74) || !(t_0 <= Double.POSITIVE_INFINITY)) {
		tmp = 0.5 / ((y_m / z) * (-1.0 / z));
	} else {
		tmp = 0.5 * (y_m + (Math.pow(x, 2.0) / y_m));
	}
	return y_s * tmp;
}
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
def code(y_s, x, y_m, z):
	t_0 = (((y_m * y_m) + (x * x)) - (z * z)) / (y_m * 2.0)
	tmp = 0
	if (t_0 <= -5e-74) or not (t_0 <= math.inf):
		tmp = 0.5 / ((y_m / z) * (-1.0 / z))
	else:
		tmp = 0.5 * (y_m + (math.pow(x, 2.0) / y_m))
	return y_s * tmp
y\_m = abs(y)
y\_s = copysign(1.0, y)
function code(y_s, x, y_m, z)
	t_0 = Float64(Float64(Float64(Float64(y_m * y_m) + Float64(x * x)) - Float64(z * z)) / Float64(y_m * 2.0))
	tmp = 0.0
	if ((t_0 <= -5e-74) || !(t_0 <= Inf))
		tmp = Float64(0.5 / Float64(Float64(y_m / z) * Float64(-1.0 / z)));
	else
		tmp = Float64(0.5 * Float64(y_m + Float64((x ^ 2.0) / y_m)));
	end
	return Float64(y_s * tmp)
end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
function tmp_2 = code(y_s, x, y_m, z)
	t_0 = (((y_m * y_m) + (x * x)) - (z * z)) / (y_m * 2.0);
	tmp = 0.0;
	if ((t_0 <= -5e-74) || ~((t_0 <= Inf)))
		tmp = 0.5 / ((y_m / z) * (-1.0 / z));
	else
		tmp = 0.5 * (y_m + ((x ^ 2.0) / y_m));
	end
	tmp_2 = y_s * tmp;
end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(N[(N[(y$95$m * y$95$m), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y$95$m * 2.0), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * If[Or[LessEqual[t$95$0, -5e-74], N[Not[LessEqual[t$95$0, Infinity]], $MachinePrecision]], N[(0.5 / N[(N[(y$95$m / z), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(y$95$m + N[(N[Power[x, 2.0], $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)

\\
\begin{array}{l}
t_0 := \frac{\left(y\_m \cdot y\_m + x \cdot x\right) - z \cdot z}{y\_m \cdot 2}\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-74} \lor \neg \left(t\_0 \leq \infty\right):\\
\;\;\;\;\frac{0.5}{\frac{y\_m}{z} \cdot \frac{-1}{z}}\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(y\_m + \frac{{x}^{2}}{y\_m}\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 x x) (*.f64 y y)) (*.f64 z z)) (*.f64 y #s(literal 2 binary64))) < -4.99999999999999998e-74 or +inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 x x) (*.f64 y y)) (*.f64 z z)) (*.f64 y #s(literal 2 binary64)))

    1. Initial program 63.2%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg63.2%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out63.2%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg263.2%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-163.2%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out63.2%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{-y \cdot 2}} \]
      7. *-commutative63.2%

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac63.2%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval63.2%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval63.2%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+63.2%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define66.1%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified66.1%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num66.0%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv66.0%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine63.0%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+63.0%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt63.0%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow263.0%

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

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

        \[\leadsto \frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - \color{blue}{{z}^{2}}}} \]
    6. Applied egg-rr63.0%

      \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - {z}^{2}}}} \]
    7. Applied egg-rr68.2%

      \[\leadsto \frac{0.5}{\color{blue}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \frac{y}{\mathsf{hypot}\left(x, y + z\right)}}} \]
    8. Taylor expanded in z around -inf 18.5%

      \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\left(-1 \cdot \frac{y}{z}\right)}} \]
    9. Step-by-step derivation
      1. associate-*r/18.5%

        \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\frac{-1 \cdot y}{z}}} \]
      2. neg-mul-118.5%

        \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \frac{\color{blue}{-y}}{z}} \]
    10. Simplified18.5%

      \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\frac{-y}{z}}} \]
    11. Taylor expanded in z around inf 32.1%

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

    if -4.99999999999999998e-74 < (/.f64 (-.f64 (+.f64 (*.f64 x x) (*.f64 y y)) (*.f64 z z)) (*.f64 y #s(literal 2 binary64))) < +inf.0

    1. Initial program 78.6%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg78.6%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out78.6%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg278.6%

        \[\leadsto \color{blue}{-\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\left(-y\right) \cdot 2}} \]
      4. distribute-frac-neg78.6%

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-178.6%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out78.6%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{-y \cdot 2}} \]
      7. *-commutative78.6%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{-\color{blue}{2 \cdot y}} \]
      8. distribute-lft-neg-in78.6%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac78.6%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval78.6%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval78.6%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+78.6%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define78.6%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified78.6%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 50.8%

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

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\sqrt{{x}^{2} + {y}^{2}} \cdot \sqrt{{x}^{2} + {y}^{2}}}}{y} \]
      2. unpow250.9%

        \[\leadsto 0.5 \cdot \frac{\sqrt{\color{blue}{x \cdot x} + {y}^{2}} \cdot \sqrt{{x}^{2} + {y}^{2}}}{y} \]
      3. unpow250.9%

        \[\leadsto 0.5 \cdot \frac{\sqrt{x \cdot x + \color{blue}{y \cdot y}} \cdot \sqrt{{x}^{2} + {y}^{2}}}{y} \]
      4. hypot-undefine50.9%

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

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

        \[\leadsto 0.5 \cdot \frac{\mathsf{hypot}\left(x, y\right) \cdot \sqrt{x \cdot x + \color{blue}{y \cdot y}}}{y} \]
      7. hypot-undefine50.9%

        \[\leadsto 0.5 \cdot \frac{\mathsf{hypot}\left(x, y\right) \cdot \color{blue}{\mathsf{hypot}\left(x, y\right)}}{y} \]
      8. unpow250.9%

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

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

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

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

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

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

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

        \[\leadsto 0.5 \cdot \frac{{\color{blue}{\left(\mathsf{hypot}\left(y, x\right)\right)}}^{2}}{y} \]
    7. Simplified50.9%

      \[\leadsto \color{blue}{0.5 \cdot \frac{{\left(\mathsf{hypot}\left(y, x\right)\right)}^{2}}{y}} \]
    8. Taylor expanded in x around 0 63.5%

      \[\leadsto 0.5 \cdot \color{blue}{\left(y + \frac{{x}^{2}}{y}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification46.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(y \cdot y + x \cdot x\right) - z \cdot z}{y \cdot 2} \leq -5 \cdot 10^{-74} \lor \neg \left(\frac{\left(y \cdot y + x \cdot x\right) - z \cdot z}{y \cdot 2} \leq \infty\right):\\ \;\;\;\;\frac{0.5}{\frac{y}{z} \cdot \frac{-1}{z}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(y + \frac{{x}^{2}}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 87.6% accurate, 0.1× speedup?

\[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;y\_m \leq 1.3 \cdot 10^{+157}:\\ \;\;\;\;0.5 \cdot \frac{\mathsf{fma}\left(x, x, y\_m \cdot y\_m - z \cdot z\right)}{y\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{\frac{1 + \frac{z}{y\_m} \cdot -2}{y\_m}}\\ \end{array} \end{array} \]
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
 :precision binary64
 (*
  y_s
  (if (<= y_m 1.3e+157)
    (* 0.5 (/ (fma x x (- (* y_m y_m) (* z z))) y_m))
    (/ 0.5 (/ (+ 1.0 (* (/ z y_m) -2.0)) y_m)))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (y_m <= 1.3e+157) {
		tmp = 0.5 * (fma(x, x, ((y_m * y_m) - (z * z))) / y_m);
	} else {
		tmp = 0.5 / ((1.0 + ((z / y_m) * -2.0)) / y_m);
	}
	return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0, y)
function code(y_s, x, y_m, z)
	tmp = 0.0
	if (y_m <= 1.3e+157)
		tmp = Float64(0.5 * Float64(fma(x, x, Float64(Float64(y_m * y_m) - Float64(z * z))) / y_m));
	else
		tmp = Float64(0.5 / Float64(Float64(1.0 + Float64(Float64(z / y_m) * -2.0)) / y_m));
	end
	return Float64(y_s * tmp)
end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 1.3e+157], N[(0.5 * N[(N[(x * x + N[(N[(y$95$m * y$95$m), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], N[(0.5 / N[(N[(1.0 + N[(N[(z / y$95$m), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 1.3 \cdot 10^{+157}:\\
\;\;\;\;0.5 \cdot \frac{\mathsf{fma}\left(x, x, y\_m \cdot y\_m - z \cdot z\right)}{y\_m}\\

\mathbf{else}:\\
\;\;\;\;\frac{0.5}{\frac{1 + \frac{z}{y\_m} \cdot -2}{y\_m}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.30000000000000005e157

    1. Initial program 78.9%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg78.9%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out78.9%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg278.9%

        \[\leadsto \color{blue}{-\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\left(-y\right) \cdot 2}} \]
      4. distribute-frac-neg78.9%

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-178.9%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out78.9%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{-y \cdot 2}} \]
      7. *-commutative78.9%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{-\color{blue}{2 \cdot y}} \]
      8. distribute-lft-neg-in78.9%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac78.9%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval78.9%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval78.9%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+78.9%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define80.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified80.8%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing

    if 1.30000000000000005e157 < y

    1. Initial program 11.4%

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

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out11.4%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg211.4%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-111.4%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out11.4%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac11.4%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval11.4%

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

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+11.4%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define11.4%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified11.4%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num11.4%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv11.4%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine11.4%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+11.4%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt11.4%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow211.4%

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

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

        \[\leadsto \frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - \color{blue}{{z}^{2}}}} \]
    6. Applied egg-rr11.4%

      \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - {z}^{2}}}} \]
    7. Applied egg-rr87.6%

      \[\leadsto \frac{0.5}{\color{blue}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \frac{y}{\mathsf{hypot}\left(x, y + z\right)}}} \]
    8. Taylor expanded in y around inf 71.3%

      \[\leadsto \frac{0.5}{\color{blue}{\frac{1 + -2 \cdot \frac{z}{y}}{y}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification79.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.3 \cdot 10^{+157}:\\ \;\;\;\;0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{\frac{1 + \frac{z}{y} \cdot -2}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 52.3% accurate, 0.5× speedup?

\[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;y\_m \leq 5.5 \cdot 10^{-261}:\\ \;\;\;\;-0.5 \cdot \frac{z \cdot \left(y\_m + z\right)}{y\_m}\\ \mathbf{elif}\;y\_m \leq 1.9 \cdot 10^{-204}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y\_m}\right)\\ \mathbf{elif}\;y\_m \leq 5.3 \cdot 10^{-130}:\\ \;\;\;\;\frac{0.5}{\frac{y\_m}{z \cdot \left(-z\right)}}\\ \mathbf{elif}\;y\_m \leq 1.65 \cdot 10^{+14}:\\ \;\;\;\;x \cdot \frac{0.5 \cdot x}{y\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{\frac{1 + \frac{z}{y\_m} \cdot -2}{y\_m}}\\ \end{array} \end{array} \]
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
 :precision binary64
 (*
  y_s
  (if (<= y_m 5.5e-261)
    (* -0.5 (/ (* z (+ y_m z)) y_m))
    (if (<= y_m 1.9e-204)
      (* x (* x (/ 0.5 y_m)))
      (if (<= y_m 5.3e-130)
        (/ 0.5 (/ y_m (* z (- z))))
        (if (<= y_m 1.65e+14)
          (* x (/ (* 0.5 x) y_m))
          (/ 0.5 (/ (+ 1.0 (* (/ z y_m) -2.0)) y_m))))))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (y_m <= 5.5e-261) {
		tmp = -0.5 * ((z * (y_m + z)) / y_m);
	} else if (y_m <= 1.9e-204) {
		tmp = x * (x * (0.5 / y_m));
	} else if (y_m <= 5.3e-130) {
		tmp = 0.5 / (y_m / (z * -z));
	} else if (y_m <= 1.65e+14) {
		tmp = x * ((0.5 * x) / y_m);
	} else {
		tmp = 0.5 / ((1.0 + ((z / y_m) * -2.0)) / y_m);
	}
	return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y_m <= 5.5d-261) then
        tmp = (-0.5d0) * ((z * (y_m + z)) / y_m)
    else if (y_m <= 1.9d-204) then
        tmp = x * (x * (0.5d0 / y_m))
    else if (y_m <= 5.3d-130) then
        tmp = 0.5d0 / (y_m / (z * -z))
    else if (y_m <= 1.65d+14) then
        tmp = x * ((0.5d0 * x) / y_m)
    else
        tmp = 0.5d0 / ((1.0d0 + ((z / y_m) * (-2.0d0))) / y_m)
    end if
    code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (y_m <= 5.5e-261) {
		tmp = -0.5 * ((z * (y_m + z)) / y_m);
	} else if (y_m <= 1.9e-204) {
		tmp = x * (x * (0.5 / y_m));
	} else if (y_m <= 5.3e-130) {
		tmp = 0.5 / (y_m / (z * -z));
	} else if (y_m <= 1.65e+14) {
		tmp = x * ((0.5 * x) / y_m);
	} else {
		tmp = 0.5 / ((1.0 + ((z / y_m) * -2.0)) / y_m);
	}
	return y_s * tmp;
}
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
def code(y_s, x, y_m, z):
	tmp = 0
	if y_m <= 5.5e-261:
		tmp = -0.5 * ((z * (y_m + z)) / y_m)
	elif y_m <= 1.9e-204:
		tmp = x * (x * (0.5 / y_m))
	elif y_m <= 5.3e-130:
		tmp = 0.5 / (y_m / (z * -z))
	elif y_m <= 1.65e+14:
		tmp = x * ((0.5 * x) / y_m)
	else:
		tmp = 0.5 / ((1.0 + ((z / y_m) * -2.0)) / y_m)
	return y_s * tmp
y\_m = abs(y)
y\_s = copysign(1.0, y)
function code(y_s, x, y_m, z)
	tmp = 0.0
	if (y_m <= 5.5e-261)
		tmp = Float64(-0.5 * Float64(Float64(z * Float64(y_m + z)) / y_m));
	elseif (y_m <= 1.9e-204)
		tmp = Float64(x * Float64(x * Float64(0.5 / y_m)));
	elseif (y_m <= 5.3e-130)
		tmp = Float64(0.5 / Float64(y_m / Float64(z * Float64(-z))));
	elseif (y_m <= 1.65e+14)
		tmp = Float64(x * Float64(Float64(0.5 * x) / y_m));
	else
		tmp = Float64(0.5 / Float64(Float64(1.0 + Float64(Float64(z / y_m) * -2.0)) / y_m));
	end
	return Float64(y_s * tmp)
end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
function tmp_2 = code(y_s, x, y_m, z)
	tmp = 0.0;
	if (y_m <= 5.5e-261)
		tmp = -0.5 * ((z * (y_m + z)) / y_m);
	elseif (y_m <= 1.9e-204)
		tmp = x * (x * (0.5 / y_m));
	elseif (y_m <= 5.3e-130)
		tmp = 0.5 / (y_m / (z * -z));
	elseif (y_m <= 1.65e+14)
		tmp = x * ((0.5 * x) / y_m);
	else
		tmp = 0.5 / ((1.0 + ((z / y_m) * -2.0)) / y_m);
	end
	tmp_2 = y_s * tmp;
end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 5.5e-261], N[(-0.5 * N[(N[(z * N[(y$95$m + z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 1.9e-204], N[(x * N[(x * N[(0.5 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 5.3e-130], N[(0.5 / N[(y$95$m / N[(z * (-z)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 1.65e+14], N[(x * N[(N[(0.5 * x), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], N[(0.5 / N[(N[(1.0 + N[(N[(z / y$95$m), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 5.5 \cdot 10^{-261}:\\
\;\;\;\;-0.5 \cdot \frac{z \cdot \left(y\_m + z\right)}{y\_m}\\

\mathbf{elif}\;y\_m \leq 1.9 \cdot 10^{-204}:\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y\_m}\right)\\

\mathbf{elif}\;y\_m \leq 5.3 \cdot 10^{-130}:\\
\;\;\;\;\frac{0.5}{\frac{y\_m}{z \cdot \left(-z\right)}}\\

\mathbf{elif}\;y\_m \leq 1.65 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \frac{0.5 \cdot x}{y\_m}\\

\mathbf{else}:\\
\;\;\;\;\frac{0.5}{\frac{1 + \frac{z}{y\_m} \cdot -2}{y\_m}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < 5.50000000000000042e-261

    1. Initial program 69.4%

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

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out69.4%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg269.4%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-169.4%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out69.4%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac69.4%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval69.4%

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

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+69.4%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define72.3%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified72.3%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num72.1%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv72.1%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine69.2%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+69.2%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt69.2%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow269.2%

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

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

        \[\leadsto \frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - \color{blue}{{z}^{2}}}} \]
    6. Applied egg-rr69.2%

      \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - {z}^{2}}}} \]
    7. Applied egg-rr65.4%

      \[\leadsto \frac{0.5}{\color{blue}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \frac{y}{\mathsf{hypot}\left(x, y + z\right)}}} \]
    8. Taylor expanded in z around -inf 21.5%

      \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\left(-1 \cdot \frac{y}{z}\right)}} \]
    9. Step-by-step derivation
      1. associate-*r/21.5%

        \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\frac{-1 \cdot y}{z}}} \]
      2. neg-mul-121.5%

        \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \frac{\color{blue}{-y}}{z}} \]
    10. Simplified21.5%

      \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\frac{-y}{z}}} \]
    11. Taylor expanded in x around 0 29.9%

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

    if 5.50000000000000042e-261 < y < 1.89999999999999991e-204

    1. Initial program 98.1%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg98.1%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out98.1%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg298.1%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-198.1%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out98.1%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{-y \cdot 2}} \]
      7. *-commutative98.1%

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac98.1%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval98.1%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval98.1%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+98.1%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define98.2%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified98.2%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num98.1%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv98.1%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine98.0%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+98.0%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt98.0%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow298.0%

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

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

        \[\leadsto \frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - \color{blue}{{z}^{2}}}} \]
    6. Applied egg-rr98.0%

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

      \[\leadsto \frac{0.5}{\color{blue}{\frac{y}{{x}^{2}}}} \]
    8. Step-by-step derivation
      1. pow273.7%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x}}} \]
      2. associate-/r/73.7%

        \[\leadsto \color{blue}{\frac{0.5}{y} \cdot \left(x \cdot x\right)} \]
      3. associate-*r*73.9%

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

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

    if 1.89999999999999991e-204 < y < 5.3000000000000004e-130

    1. Initial program 99.8%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg99.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out99.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg299.8%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-199.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out99.8%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac99.8%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval99.8%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval99.8%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+99.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define99.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv99.8%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow299.8%

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

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

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

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

      \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{-1 \cdot {z}^{2}}}} \]
    8. Step-by-step derivation
      1. pow247.8%

        \[\leadsto \frac{0.5}{\frac{y}{-1 \cdot \color{blue}{\left(z \cdot z\right)}}} \]
    9. Applied egg-rr47.8%

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

    if 5.3000000000000004e-130 < y < 1.65e14

    1. Initial program 99.8%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg99.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out99.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg299.8%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-199.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out99.8%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac99.8%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval99.8%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval99.8%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+99.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define99.7%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.7%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv99.7%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow299.8%

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

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

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

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

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

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x}}} \]
      2. associate-/r/38.7%

        \[\leadsto \color{blue}{\frac{0.5}{y} \cdot \left(x \cdot x\right)} \]
      3. associate-*r*38.6%

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

      \[\leadsto \color{blue}{\left(\frac{0.5}{y} \cdot x\right) \cdot x} \]
    10. Step-by-step derivation
      1. associate-*l/38.8%

        \[\leadsto \color{blue}{\frac{0.5 \cdot x}{y}} \cdot x \]
    11. Applied egg-rr38.8%

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

    if 1.65e14 < y

    1. Initial program 45.8%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg45.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out45.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg245.8%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-145.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out45.8%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac45.8%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval45.8%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval45.8%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+45.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define45.9%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified45.9%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num45.8%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv45.8%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine45.7%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+45.7%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt45.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow245.8%

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

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

        \[\leadsto \frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - \color{blue}{{z}^{2}}}} \]
    6. Applied egg-rr45.8%

      \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - {z}^{2}}}} \]
    7. Applied egg-rr81.7%

      \[\leadsto \frac{0.5}{\color{blue}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \frac{y}{\mathsf{hypot}\left(x, y + z\right)}}} \]
    8. Taylor expanded in y around inf 63.5%

      \[\leadsto \frac{0.5}{\color{blue}{\frac{1 + -2 \cdot \frac{z}{y}}{y}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification42.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 5.5 \cdot 10^{-261}:\\ \;\;\;\;-0.5 \cdot \frac{z \cdot \left(y + z\right)}{y}\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-204}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \mathbf{elif}\;y \leq 5.3 \cdot 10^{-130}:\\ \;\;\;\;\frac{0.5}{\frac{y}{z \cdot \left(-z\right)}}\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{+14}:\\ \;\;\;\;x \cdot \frac{0.5 \cdot x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{\frac{1 + \frac{z}{y} \cdot -2}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 52.4% accurate, 0.6× speedup?

\[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;y\_m \leq 3 \cdot 10^{-261}:\\ \;\;\;\;-0.5 \cdot \frac{z \cdot \left(y\_m + z\right)}{y\_m}\\ \mathbf{elif}\;y\_m \leq 5.6 \cdot 10^{-204}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y\_m}\right)\\ \mathbf{elif}\;y\_m \leq 4.1 \cdot 10^{-131}:\\ \;\;\;\;\frac{0.5}{\frac{y\_m}{z \cdot \left(-z\right)}}\\ \mathbf{elif}\;y\_m \leq 51000000000000:\\ \;\;\;\;x \cdot \frac{0.5 \cdot x}{y\_m}\\ \mathbf{else}:\\ \;\;\;\;y\_m \cdot 0.5\\ \end{array} \end{array} \]
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
 :precision binary64
 (*
  y_s
  (if (<= y_m 3e-261)
    (* -0.5 (/ (* z (+ y_m z)) y_m))
    (if (<= y_m 5.6e-204)
      (* x (* x (/ 0.5 y_m)))
      (if (<= y_m 4.1e-131)
        (/ 0.5 (/ y_m (* z (- z))))
        (if (<= y_m 51000000000000.0) (* x (/ (* 0.5 x) y_m)) (* y_m 0.5)))))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (y_m <= 3e-261) {
		tmp = -0.5 * ((z * (y_m + z)) / y_m);
	} else if (y_m <= 5.6e-204) {
		tmp = x * (x * (0.5 / y_m));
	} else if (y_m <= 4.1e-131) {
		tmp = 0.5 / (y_m / (z * -z));
	} else if (y_m <= 51000000000000.0) {
		tmp = x * ((0.5 * x) / y_m);
	} else {
		tmp = y_m * 0.5;
	}
	return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y_m <= 3d-261) then
        tmp = (-0.5d0) * ((z * (y_m + z)) / y_m)
    else if (y_m <= 5.6d-204) then
        tmp = x * (x * (0.5d0 / y_m))
    else if (y_m <= 4.1d-131) then
        tmp = 0.5d0 / (y_m / (z * -z))
    else if (y_m <= 51000000000000.0d0) then
        tmp = x * ((0.5d0 * x) / y_m)
    else
        tmp = y_m * 0.5d0
    end if
    code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (y_m <= 3e-261) {
		tmp = -0.5 * ((z * (y_m + z)) / y_m);
	} else if (y_m <= 5.6e-204) {
		tmp = x * (x * (0.5 / y_m));
	} else if (y_m <= 4.1e-131) {
		tmp = 0.5 / (y_m / (z * -z));
	} else if (y_m <= 51000000000000.0) {
		tmp = x * ((0.5 * x) / y_m);
	} else {
		tmp = y_m * 0.5;
	}
	return y_s * tmp;
}
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
def code(y_s, x, y_m, z):
	tmp = 0
	if y_m <= 3e-261:
		tmp = -0.5 * ((z * (y_m + z)) / y_m)
	elif y_m <= 5.6e-204:
		tmp = x * (x * (0.5 / y_m))
	elif y_m <= 4.1e-131:
		tmp = 0.5 / (y_m / (z * -z))
	elif y_m <= 51000000000000.0:
		tmp = x * ((0.5 * x) / y_m)
	else:
		tmp = y_m * 0.5
	return y_s * tmp
y\_m = abs(y)
y\_s = copysign(1.0, y)
function code(y_s, x, y_m, z)
	tmp = 0.0
	if (y_m <= 3e-261)
		tmp = Float64(-0.5 * Float64(Float64(z * Float64(y_m + z)) / y_m));
	elseif (y_m <= 5.6e-204)
		tmp = Float64(x * Float64(x * Float64(0.5 / y_m)));
	elseif (y_m <= 4.1e-131)
		tmp = Float64(0.5 / Float64(y_m / Float64(z * Float64(-z))));
	elseif (y_m <= 51000000000000.0)
		tmp = Float64(x * Float64(Float64(0.5 * x) / y_m));
	else
		tmp = Float64(y_m * 0.5);
	end
	return Float64(y_s * tmp)
end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
function tmp_2 = code(y_s, x, y_m, z)
	tmp = 0.0;
	if (y_m <= 3e-261)
		tmp = -0.5 * ((z * (y_m + z)) / y_m);
	elseif (y_m <= 5.6e-204)
		tmp = x * (x * (0.5 / y_m));
	elseif (y_m <= 4.1e-131)
		tmp = 0.5 / (y_m / (z * -z));
	elseif (y_m <= 51000000000000.0)
		tmp = x * ((0.5 * x) / y_m);
	else
		tmp = y_m * 0.5;
	end
	tmp_2 = y_s * tmp;
end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 3e-261], N[(-0.5 * N[(N[(z * N[(y$95$m + z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 5.6e-204], N[(x * N[(x * N[(0.5 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 4.1e-131], N[(0.5 / N[(y$95$m / N[(z * (-z)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 51000000000000.0], N[(x * N[(N[(0.5 * x), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], N[(y$95$m * 0.5), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 3 \cdot 10^{-261}:\\
\;\;\;\;-0.5 \cdot \frac{z \cdot \left(y\_m + z\right)}{y\_m}\\

\mathbf{elif}\;y\_m \leq 5.6 \cdot 10^{-204}:\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y\_m}\right)\\

\mathbf{elif}\;y\_m \leq 4.1 \cdot 10^{-131}:\\
\;\;\;\;\frac{0.5}{\frac{y\_m}{z \cdot \left(-z\right)}}\\

\mathbf{elif}\;y\_m \leq 51000000000000:\\
\;\;\;\;x \cdot \frac{0.5 \cdot x}{y\_m}\\

\mathbf{else}:\\
\;\;\;\;y\_m \cdot 0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < 3.0000000000000001e-261

    1. Initial program 69.4%

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

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out69.4%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg269.4%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-169.4%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out69.4%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac69.4%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval69.4%

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

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+69.4%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define72.3%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified72.3%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num72.1%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv72.1%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine69.2%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+69.2%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt69.2%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow269.2%

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

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

        \[\leadsto \frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - \color{blue}{{z}^{2}}}} \]
    6. Applied egg-rr69.2%

      \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - {z}^{2}}}} \]
    7. Applied egg-rr65.4%

      \[\leadsto \frac{0.5}{\color{blue}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \frac{y}{\mathsf{hypot}\left(x, y + z\right)}}} \]
    8. Taylor expanded in z around -inf 21.5%

      \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\left(-1 \cdot \frac{y}{z}\right)}} \]
    9. Step-by-step derivation
      1. associate-*r/21.5%

        \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\frac{-1 \cdot y}{z}}} \]
      2. neg-mul-121.5%

        \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \frac{\color{blue}{-y}}{z}} \]
    10. Simplified21.5%

      \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\frac{-y}{z}}} \]
    11. Taylor expanded in x around 0 29.9%

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

    if 3.0000000000000001e-261 < y < 5.60000000000000001e-204

    1. Initial program 98.1%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg98.1%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out98.1%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg298.1%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-198.1%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out98.1%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{-y \cdot 2}} \]
      7. *-commutative98.1%

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac98.1%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval98.1%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval98.1%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+98.1%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define98.2%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified98.2%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num98.1%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv98.1%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine98.0%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+98.0%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt98.0%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow298.0%

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

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

        \[\leadsto \frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - \color{blue}{{z}^{2}}}} \]
    6. Applied egg-rr98.0%

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

      \[\leadsto \frac{0.5}{\color{blue}{\frac{y}{{x}^{2}}}} \]
    8. Step-by-step derivation
      1. pow273.7%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x}}} \]
      2. associate-/r/73.7%

        \[\leadsto \color{blue}{\frac{0.5}{y} \cdot \left(x \cdot x\right)} \]
      3. associate-*r*73.9%

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

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

    if 5.60000000000000001e-204 < y < 4.1000000000000002e-131

    1. Initial program 99.8%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg99.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out99.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg299.8%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-199.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out99.8%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac99.8%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval99.8%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval99.8%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+99.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define99.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv99.8%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow299.8%

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

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

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

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

      \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{-1 \cdot {z}^{2}}}} \]
    8. Step-by-step derivation
      1. pow247.8%

        \[\leadsto \frac{0.5}{\frac{y}{-1 \cdot \color{blue}{\left(z \cdot z\right)}}} \]
    9. Applied egg-rr47.8%

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

    if 4.1000000000000002e-131 < y < 5.1e13

    1. Initial program 99.8%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg99.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out99.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg299.8%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-199.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out99.8%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac99.8%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval99.8%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval99.8%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+99.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define99.7%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.7%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv99.7%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow299.8%

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

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

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

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

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

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x}}} \]
      2. associate-/r/38.7%

        \[\leadsto \color{blue}{\frac{0.5}{y} \cdot \left(x \cdot x\right)} \]
      3. associate-*r*38.6%

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

      \[\leadsto \color{blue}{\left(\frac{0.5}{y} \cdot x\right) \cdot x} \]
    10. Step-by-step derivation
      1. associate-*l/38.8%

        \[\leadsto \color{blue}{\frac{0.5 \cdot x}{y}} \cdot x \]
    11. Applied egg-rr38.8%

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

    if 5.1e13 < y

    1. Initial program 45.8%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg45.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out45.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg245.8%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-145.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out45.8%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac45.8%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval45.8%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval45.8%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+45.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define45.9%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified45.9%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 63.4%

      \[\leadsto \color{blue}{0.5 \cdot y} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification42.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3 \cdot 10^{-261}:\\ \;\;\;\;-0.5 \cdot \frac{z \cdot \left(y + z\right)}{y}\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{-204}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{-131}:\\ \;\;\;\;\frac{0.5}{\frac{y}{z \cdot \left(-z\right)}}\\ \mathbf{elif}\;y \leq 51000000000000:\\ \;\;\;\;x \cdot \frac{0.5 \cdot x}{y}\\ \mathbf{else}:\\ \;\;\;\;y \cdot 0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 52.4% accurate, 0.6× speedup?

\[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;y\_m \leq 4.6 \cdot 10^{-261}:\\ \;\;\;\;-0.5 \cdot \frac{z \cdot \left(y\_m + z\right)}{y\_m}\\ \mathbf{elif}\;y\_m \leq 2.1 \cdot 10^{-204}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y\_m}\right)\\ \mathbf{elif}\;y\_m \leq 1.26 \cdot 10^{-131}:\\ \;\;\;\;-0.5 \cdot \left(z \cdot \frac{y\_m + z}{y\_m}\right)\\ \mathbf{elif}\;y\_m \leq 2.05 \cdot 10^{+14}:\\ \;\;\;\;x \cdot \frac{0.5 \cdot x}{y\_m}\\ \mathbf{else}:\\ \;\;\;\;y\_m \cdot 0.5\\ \end{array} \end{array} \]
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
 :precision binary64
 (*
  y_s
  (if (<= y_m 4.6e-261)
    (* -0.5 (/ (* z (+ y_m z)) y_m))
    (if (<= y_m 2.1e-204)
      (* x (* x (/ 0.5 y_m)))
      (if (<= y_m 1.26e-131)
        (* -0.5 (* z (/ (+ y_m z) y_m)))
        (if (<= y_m 2.05e+14) (* x (/ (* 0.5 x) y_m)) (* y_m 0.5)))))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (y_m <= 4.6e-261) {
		tmp = -0.5 * ((z * (y_m + z)) / y_m);
	} else if (y_m <= 2.1e-204) {
		tmp = x * (x * (0.5 / y_m));
	} else if (y_m <= 1.26e-131) {
		tmp = -0.5 * (z * ((y_m + z) / y_m));
	} else if (y_m <= 2.05e+14) {
		tmp = x * ((0.5 * x) / y_m);
	} else {
		tmp = y_m * 0.5;
	}
	return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y_m <= 4.6d-261) then
        tmp = (-0.5d0) * ((z * (y_m + z)) / y_m)
    else if (y_m <= 2.1d-204) then
        tmp = x * (x * (0.5d0 / y_m))
    else if (y_m <= 1.26d-131) then
        tmp = (-0.5d0) * (z * ((y_m + z) / y_m))
    else if (y_m <= 2.05d+14) then
        tmp = x * ((0.5d0 * x) / y_m)
    else
        tmp = y_m * 0.5d0
    end if
    code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (y_m <= 4.6e-261) {
		tmp = -0.5 * ((z * (y_m + z)) / y_m);
	} else if (y_m <= 2.1e-204) {
		tmp = x * (x * (0.5 / y_m));
	} else if (y_m <= 1.26e-131) {
		tmp = -0.5 * (z * ((y_m + z) / y_m));
	} else if (y_m <= 2.05e+14) {
		tmp = x * ((0.5 * x) / y_m);
	} else {
		tmp = y_m * 0.5;
	}
	return y_s * tmp;
}
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
def code(y_s, x, y_m, z):
	tmp = 0
	if y_m <= 4.6e-261:
		tmp = -0.5 * ((z * (y_m + z)) / y_m)
	elif y_m <= 2.1e-204:
		tmp = x * (x * (0.5 / y_m))
	elif y_m <= 1.26e-131:
		tmp = -0.5 * (z * ((y_m + z) / y_m))
	elif y_m <= 2.05e+14:
		tmp = x * ((0.5 * x) / y_m)
	else:
		tmp = y_m * 0.5
	return y_s * tmp
y\_m = abs(y)
y\_s = copysign(1.0, y)
function code(y_s, x, y_m, z)
	tmp = 0.0
	if (y_m <= 4.6e-261)
		tmp = Float64(-0.5 * Float64(Float64(z * Float64(y_m + z)) / y_m));
	elseif (y_m <= 2.1e-204)
		tmp = Float64(x * Float64(x * Float64(0.5 / y_m)));
	elseif (y_m <= 1.26e-131)
		tmp = Float64(-0.5 * Float64(z * Float64(Float64(y_m + z) / y_m)));
	elseif (y_m <= 2.05e+14)
		tmp = Float64(x * Float64(Float64(0.5 * x) / y_m));
	else
		tmp = Float64(y_m * 0.5);
	end
	return Float64(y_s * tmp)
end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
function tmp_2 = code(y_s, x, y_m, z)
	tmp = 0.0;
	if (y_m <= 4.6e-261)
		tmp = -0.5 * ((z * (y_m + z)) / y_m);
	elseif (y_m <= 2.1e-204)
		tmp = x * (x * (0.5 / y_m));
	elseif (y_m <= 1.26e-131)
		tmp = -0.5 * (z * ((y_m + z) / y_m));
	elseif (y_m <= 2.05e+14)
		tmp = x * ((0.5 * x) / y_m);
	else
		tmp = y_m * 0.5;
	end
	tmp_2 = y_s * tmp;
end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 4.6e-261], N[(-0.5 * N[(N[(z * N[(y$95$m + z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 2.1e-204], N[(x * N[(x * N[(0.5 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 1.26e-131], N[(-0.5 * N[(z * N[(N[(y$95$m + z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 2.05e+14], N[(x * N[(N[(0.5 * x), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], N[(y$95$m * 0.5), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 4.6 \cdot 10^{-261}:\\
\;\;\;\;-0.5 \cdot \frac{z \cdot \left(y\_m + z\right)}{y\_m}\\

\mathbf{elif}\;y\_m \leq 2.1 \cdot 10^{-204}:\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y\_m}\right)\\

\mathbf{elif}\;y\_m \leq 1.26 \cdot 10^{-131}:\\
\;\;\;\;-0.5 \cdot \left(z \cdot \frac{y\_m + z}{y\_m}\right)\\

\mathbf{elif}\;y\_m \leq 2.05 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \frac{0.5 \cdot x}{y\_m}\\

\mathbf{else}:\\
\;\;\;\;y\_m \cdot 0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < 4.6e-261

    1. Initial program 69.4%

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

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out69.4%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg269.4%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-169.4%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out69.4%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac69.4%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval69.4%

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

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+69.4%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define72.3%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified72.3%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num72.1%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv72.1%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine69.2%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+69.2%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt69.2%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow269.2%

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

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

        \[\leadsto \frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - \color{blue}{{z}^{2}}}} \]
    6. Applied egg-rr69.2%

      \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - {z}^{2}}}} \]
    7. Applied egg-rr65.4%

      \[\leadsto \frac{0.5}{\color{blue}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \frac{y}{\mathsf{hypot}\left(x, y + z\right)}}} \]
    8. Taylor expanded in z around -inf 21.5%

      \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\left(-1 \cdot \frac{y}{z}\right)}} \]
    9. Step-by-step derivation
      1. associate-*r/21.5%

        \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\frac{-1 \cdot y}{z}}} \]
      2. neg-mul-121.5%

        \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \frac{\color{blue}{-y}}{z}} \]
    10. Simplified21.5%

      \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\frac{-y}{z}}} \]
    11. Taylor expanded in x around 0 29.9%

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

    if 4.6e-261 < y < 2.10000000000000009e-204

    1. Initial program 98.1%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg98.1%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out98.1%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg298.1%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-198.1%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out98.1%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{-y \cdot 2}} \]
      7. *-commutative98.1%

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac98.1%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval98.1%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval98.1%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+98.1%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define98.2%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified98.2%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num98.1%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv98.1%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine98.0%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+98.0%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt98.0%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow298.0%

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

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

        \[\leadsto \frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - \color{blue}{{z}^{2}}}} \]
    6. Applied egg-rr98.0%

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

      \[\leadsto \frac{0.5}{\color{blue}{\frac{y}{{x}^{2}}}} \]
    8. Step-by-step derivation
      1. pow273.7%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x}}} \]
      2. associate-/r/73.7%

        \[\leadsto \color{blue}{\frac{0.5}{y} \cdot \left(x \cdot x\right)} \]
      3. associate-*r*73.9%

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

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

    if 2.10000000000000009e-204 < y < 1.26e-131

    1. Initial program 99.8%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg99.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out99.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg299.8%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-199.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out99.8%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac99.8%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval99.8%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval99.8%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+99.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define99.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv99.8%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow299.8%

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

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

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

      \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - {z}^{2}}}} \]
    7. Applied egg-rr53.0%

      \[\leadsto \frac{0.5}{\color{blue}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \frac{y}{\mathsf{hypot}\left(x, y + z\right)}}} \]
    8. Taylor expanded in z around -inf 30.4%

      \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\left(-1 \cdot \frac{y}{z}\right)}} \]
    9. Step-by-step derivation
      1. associate-*r/30.4%

        \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\frac{-1 \cdot y}{z}}} \]
      2. neg-mul-130.4%

        \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \frac{\color{blue}{-y}}{z}} \]
    10. Simplified30.4%

      \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\frac{-y}{z}}} \]
    11. Taylor expanded in x around 0 47.8%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{z \cdot \left(y + z\right)}{y}} \]
    12. Step-by-step derivation
      1. associate-/l*47.9%

        \[\leadsto -0.5 \cdot \color{blue}{\left(z \cdot \frac{y + z}{y}\right)} \]
    13. Simplified47.9%

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

    if 1.26e-131 < y < 2.05e14

    1. Initial program 99.8%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg99.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out99.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg299.8%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-199.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out99.8%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac99.8%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval99.8%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval99.8%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+99.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define99.7%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.7%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv99.7%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow299.8%

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

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

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

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

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

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x}}} \]
      2. associate-/r/38.7%

        \[\leadsto \color{blue}{\frac{0.5}{y} \cdot \left(x \cdot x\right)} \]
      3. associate-*r*38.6%

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

      \[\leadsto \color{blue}{\left(\frac{0.5}{y} \cdot x\right) \cdot x} \]
    10. Step-by-step derivation
      1. associate-*l/38.8%

        \[\leadsto \color{blue}{\frac{0.5 \cdot x}{y}} \cdot x \]
    11. Applied egg-rr38.8%

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

    if 2.05e14 < y

    1. Initial program 45.8%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg45.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out45.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg245.8%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-145.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out45.8%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac45.8%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval45.8%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval45.8%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+45.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define45.9%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified45.9%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 63.4%

      \[\leadsto \color{blue}{0.5 \cdot y} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification42.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4.6 \cdot 10^{-261}:\\ \;\;\;\;-0.5 \cdot \frac{z \cdot \left(y + z\right)}{y}\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-204}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \mathbf{elif}\;y \leq 1.26 \cdot 10^{-131}:\\ \;\;\;\;-0.5 \cdot \left(z \cdot \frac{y + z}{y}\right)\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{+14}:\\ \;\;\;\;x \cdot \frac{0.5 \cdot x}{y}\\ \mathbf{else}:\\ \;\;\;\;y \cdot 0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 52.7% accurate, 0.6× speedup?

\[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ \begin{array}{l} t_0 := -0.5 \cdot \left(z \cdot \frac{y\_m + z}{y\_m}\right)\\ y\_s \cdot \begin{array}{l} \mathbf{if}\;y\_m \leq 1.75 \cdot 10^{-261}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y\_m \leq 8 \cdot 10^{-205}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y\_m}\right)\\ \mathbf{elif}\;y\_m \leq 3.15 \cdot 10^{-130}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y\_m \leq 2.4 \cdot 10^{+14}:\\ \;\;\;\;x \cdot \frac{0.5 \cdot x}{y\_m}\\ \mathbf{else}:\\ \;\;\;\;y\_m \cdot 0.5\\ \end{array} \end{array} \end{array} \]
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
 :precision binary64
 (let* ((t_0 (* -0.5 (* z (/ (+ y_m z) y_m)))))
   (*
    y_s
    (if (<= y_m 1.75e-261)
      t_0
      (if (<= y_m 8e-205)
        (* x (* x (/ 0.5 y_m)))
        (if (<= y_m 3.15e-130)
          t_0
          (if (<= y_m 2.4e+14) (* x (/ (* 0.5 x) y_m)) (* y_m 0.5))))))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
	double t_0 = -0.5 * (z * ((y_m + z) / y_m));
	double tmp;
	if (y_m <= 1.75e-261) {
		tmp = t_0;
	} else if (y_m <= 8e-205) {
		tmp = x * (x * (0.5 / y_m));
	} else if (y_m <= 3.15e-130) {
		tmp = t_0;
	} else if (y_m <= 2.4e+14) {
		tmp = x * ((0.5 * x) / y_m);
	} else {
		tmp = y_m * 0.5;
	}
	return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-0.5d0) * (z * ((y_m + z) / y_m))
    if (y_m <= 1.75d-261) then
        tmp = t_0
    else if (y_m <= 8d-205) then
        tmp = x * (x * (0.5d0 / y_m))
    else if (y_m <= 3.15d-130) then
        tmp = t_0
    else if (y_m <= 2.4d+14) then
        tmp = x * ((0.5d0 * x) / y_m)
    else
        tmp = y_m * 0.5d0
    end if
    code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
	double t_0 = -0.5 * (z * ((y_m + z) / y_m));
	double tmp;
	if (y_m <= 1.75e-261) {
		tmp = t_0;
	} else if (y_m <= 8e-205) {
		tmp = x * (x * (0.5 / y_m));
	} else if (y_m <= 3.15e-130) {
		tmp = t_0;
	} else if (y_m <= 2.4e+14) {
		tmp = x * ((0.5 * x) / y_m);
	} else {
		tmp = y_m * 0.5;
	}
	return y_s * tmp;
}
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
def code(y_s, x, y_m, z):
	t_0 = -0.5 * (z * ((y_m + z) / y_m))
	tmp = 0
	if y_m <= 1.75e-261:
		tmp = t_0
	elif y_m <= 8e-205:
		tmp = x * (x * (0.5 / y_m))
	elif y_m <= 3.15e-130:
		tmp = t_0
	elif y_m <= 2.4e+14:
		tmp = x * ((0.5 * x) / y_m)
	else:
		tmp = y_m * 0.5
	return y_s * tmp
y\_m = abs(y)
y\_s = copysign(1.0, y)
function code(y_s, x, y_m, z)
	t_0 = Float64(-0.5 * Float64(z * Float64(Float64(y_m + z) / y_m)))
	tmp = 0.0
	if (y_m <= 1.75e-261)
		tmp = t_0;
	elseif (y_m <= 8e-205)
		tmp = Float64(x * Float64(x * Float64(0.5 / y_m)));
	elseif (y_m <= 3.15e-130)
		tmp = t_0;
	elseif (y_m <= 2.4e+14)
		tmp = Float64(x * Float64(Float64(0.5 * x) / y_m));
	else
		tmp = Float64(y_m * 0.5);
	end
	return Float64(y_s * tmp)
end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
function tmp_2 = code(y_s, x, y_m, z)
	t_0 = -0.5 * (z * ((y_m + z) / y_m));
	tmp = 0.0;
	if (y_m <= 1.75e-261)
		tmp = t_0;
	elseif (y_m <= 8e-205)
		tmp = x * (x * (0.5 / y_m));
	elseif (y_m <= 3.15e-130)
		tmp = t_0;
	elseif (y_m <= 2.4e+14)
		tmp = x * ((0.5 * x) / y_m);
	else
		tmp = y_m * 0.5;
	end
	tmp_2 = y_s * tmp;
end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := Block[{t$95$0 = N[(-0.5 * N[(z * N[(N[(y$95$m + z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * If[LessEqual[y$95$m, 1.75e-261], t$95$0, If[LessEqual[y$95$m, 8e-205], N[(x * N[(x * N[(0.5 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 3.15e-130], t$95$0, If[LessEqual[y$95$m, 2.4e+14], N[(x * N[(N[(0.5 * x), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], N[(y$95$m * 0.5), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)

\\
\begin{array}{l}
t_0 := -0.5 \cdot \left(z \cdot \frac{y\_m + z}{y\_m}\right)\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 1.75 \cdot 10^{-261}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y\_m \leq 8 \cdot 10^{-205}:\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y\_m}\right)\\

\mathbf{elif}\;y\_m \leq 3.15 \cdot 10^{-130}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y\_m \leq 2.4 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \frac{0.5 \cdot x}{y\_m}\\

\mathbf{else}:\\
\;\;\;\;y\_m \cdot 0.5\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 1.7499999999999999e-261 or 8e-205 < y < 3.1499999999999998e-130

    1. Initial program 72.7%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg72.7%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out72.7%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg272.7%

        \[\leadsto \color{blue}{-\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\left(-y\right) \cdot 2}} \]
      4. distribute-frac-neg72.7%

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-172.7%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out72.7%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{-y \cdot 2}} \]
      7. *-commutative72.7%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{-\color{blue}{2 \cdot y}} \]
      8. distribute-lft-neg-in72.7%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac72.7%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval72.7%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval72.7%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+72.7%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define75.3%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified75.3%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num75.1%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv75.1%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine72.5%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+72.5%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt72.5%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow272.5%

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

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

        \[\leadsto \frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - \color{blue}{{z}^{2}}}} \]
    6. Applied egg-rr72.5%

      \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - {z}^{2}}}} \]
    7. Applied egg-rr64.1%

      \[\leadsto \frac{0.5}{\color{blue}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \frac{y}{\mathsf{hypot}\left(x, y + z\right)}}} \]
    8. Taylor expanded in z around -inf 22.5%

      \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\left(-1 \cdot \frac{y}{z}\right)}} \]
    9. Step-by-step derivation
      1. associate-*r/22.5%

        \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\frac{-1 \cdot y}{z}}} \]
      2. neg-mul-122.5%

        \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \frac{\color{blue}{-y}}{z}} \]
    10. Simplified22.5%

      \[\leadsto \frac{0.5}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \color{blue}{\frac{-y}{z}}} \]
    11. Taylor expanded in x around 0 31.8%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{z \cdot \left(y + z\right)}{y}} \]
    12. Step-by-step derivation
      1. associate-/l*36.1%

        \[\leadsto -0.5 \cdot \color{blue}{\left(z \cdot \frac{y + z}{y}\right)} \]
    13. Simplified36.1%

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

    if 1.7499999999999999e-261 < y < 8e-205

    1. Initial program 98.1%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg98.1%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out98.1%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg298.1%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-198.1%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out98.1%

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{-y \cdot 2}} \]
      7. *-commutative98.1%

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac98.1%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval98.1%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval98.1%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+98.1%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define98.2%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified98.2%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num98.1%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv98.1%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine98.0%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+98.0%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt98.0%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow298.0%

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

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

        \[\leadsto \frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - \color{blue}{{z}^{2}}}} \]
    6. Applied egg-rr98.0%

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

      \[\leadsto \frac{0.5}{\color{blue}{\frac{y}{{x}^{2}}}} \]
    8. Step-by-step derivation
      1. pow273.7%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x}}} \]
      2. associate-/r/73.7%

        \[\leadsto \color{blue}{\frac{0.5}{y} \cdot \left(x \cdot x\right)} \]
      3. associate-*r*73.9%

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

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

    if 3.1499999999999998e-130 < y < 2.4e14

    1. Initial program 99.8%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg99.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out99.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg299.8%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-199.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out99.8%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac99.8%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval99.8%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval99.8%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+99.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define99.7%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.7%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv99.7%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt99.8%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow299.8%

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

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

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

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

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

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x}}} \]
      2. associate-/r/38.7%

        \[\leadsto \color{blue}{\frac{0.5}{y} \cdot \left(x \cdot x\right)} \]
      3. associate-*r*38.6%

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

      \[\leadsto \color{blue}{\left(\frac{0.5}{y} \cdot x\right) \cdot x} \]
    10. Step-by-step derivation
      1. associate-*l/38.8%

        \[\leadsto \color{blue}{\frac{0.5 \cdot x}{y}} \cdot x \]
    11. Applied egg-rr38.8%

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

    if 2.4e14 < y

    1. Initial program 45.8%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg45.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out45.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg245.8%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-145.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out45.8%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac45.8%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval45.8%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval45.8%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+45.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define45.9%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified45.9%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 63.4%

      \[\leadsto \color{blue}{0.5 \cdot y} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification45.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.75 \cdot 10^{-261}:\\ \;\;\;\;-0.5 \cdot \left(z \cdot \frac{y + z}{y}\right)\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-205}:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \mathbf{elif}\;y \leq 3.15 \cdot 10^{-130}:\\ \;\;\;\;-0.5 \cdot \left(z \cdot \frac{y + z}{y}\right)\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+14}:\\ \;\;\;\;x \cdot \frac{0.5 \cdot x}{y}\\ \mathbf{else}:\\ \;\;\;\;y \cdot 0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 85.7% accurate, 0.7× speedup?

\[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;y\_m \leq 1.3 \cdot 10^{+157}:\\ \;\;\;\;\frac{\left(y\_m \cdot y\_m + x \cdot x\right) - z \cdot z}{y\_m \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{\frac{1 + \frac{z}{y\_m} \cdot -2}{y\_m}}\\ \end{array} \end{array} \]
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
 :precision binary64
 (*
  y_s
  (if (<= y_m 1.3e+157)
    (/ (- (+ (* y_m y_m) (* x x)) (* z z)) (* y_m 2.0))
    (/ 0.5 (/ (+ 1.0 (* (/ z y_m) -2.0)) y_m)))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (y_m <= 1.3e+157) {
		tmp = (((y_m * y_m) + (x * x)) - (z * z)) / (y_m * 2.0);
	} else {
		tmp = 0.5 / ((1.0 + ((z / y_m) * -2.0)) / y_m);
	}
	return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y_m <= 1.3d+157) then
        tmp = (((y_m * y_m) + (x * x)) - (z * z)) / (y_m * 2.0d0)
    else
        tmp = 0.5d0 / ((1.0d0 + ((z / y_m) * (-2.0d0))) / y_m)
    end if
    code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (y_m <= 1.3e+157) {
		tmp = (((y_m * y_m) + (x * x)) - (z * z)) / (y_m * 2.0);
	} else {
		tmp = 0.5 / ((1.0 + ((z / y_m) * -2.0)) / y_m);
	}
	return y_s * tmp;
}
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
def code(y_s, x, y_m, z):
	tmp = 0
	if y_m <= 1.3e+157:
		tmp = (((y_m * y_m) + (x * x)) - (z * z)) / (y_m * 2.0)
	else:
		tmp = 0.5 / ((1.0 + ((z / y_m) * -2.0)) / y_m)
	return y_s * tmp
y\_m = abs(y)
y\_s = copysign(1.0, y)
function code(y_s, x, y_m, z)
	tmp = 0.0
	if (y_m <= 1.3e+157)
		tmp = Float64(Float64(Float64(Float64(y_m * y_m) + Float64(x * x)) - Float64(z * z)) / Float64(y_m * 2.0));
	else
		tmp = Float64(0.5 / Float64(Float64(1.0 + Float64(Float64(z / y_m) * -2.0)) / y_m));
	end
	return Float64(y_s * tmp)
end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
function tmp_2 = code(y_s, x, y_m, z)
	tmp = 0.0;
	if (y_m <= 1.3e+157)
		tmp = (((y_m * y_m) + (x * x)) - (z * z)) / (y_m * 2.0);
	else
		tmp = 0.5 / ((1.0 + ((z / y_m) * -2.0)) / y_m);
	end
	tmp_2 = y_s * tmp;
end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 1.3e+157], N[(N[(N[(N[(y$95$m * y$95$m), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y$95$m * 2.0), $MachinePrecision]), $MachinePrecision], N[(0.5 / N[(N[(1.0 + N[(N[(z / y$95$m), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 1.3 \cdot 10^{+157}:\\
\;\;\;\;\frac{\left(y\_m \cdot y\_m + x \cdot x\right) - z \cdot z}{y\_m \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{0.5}{\frac{1 + \frac{z}{y\_m} \cdot -2}{y\_m}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.30000000000000005e157

    1. Initial program 78.9%

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

    if 1.30000000000000005e157 < y

    1. Initial program 11.4%

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

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out11.4%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg211.4%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-111.4%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out11.4%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac11.4%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval11.4%

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

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+11.4%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define11.4%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified11.4%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num11.4%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv11.4%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine11.4%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+11.4%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt11.4%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow211.4%

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

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

        \[\leadsto \frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - \color{blue}{{z}^{2}}}} \]
    6. Applied egg-rr11.4%

      \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - {z}^{2}}}} \]
    7. Applied egg-rr87.6%

      \[\leadsto \frac{0.5}{\color{blue}{\frac{1}{\mathsf{hypot}\left(x, y + z\right)} \cdot \frac{y}{\mathsf{hypot}\left(x, y + z\right)}}} \]
    8. Taylor expanded in y around inf 71.3%

      \[\leadsto \frac{0.5}{\color{blue}{\frac{1 + -2 \cdot \frac{z}{y}}{y}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification77.9%

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

Alternative 10: 53.3% accurate, 1.2× speedup?

\[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;y\_m \leq 1.26 \cdot 10^{+14}:\\ \;\;\;\;x \cdot \frac{0.5 \cdot x}{y\_m}\\ \mathbf{else}:\\ \;\;\;\;y\_m \cdot 0.5\\ \end{array} \end{array} \]
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
 :precision binary64
 (* y_s (if (<= y_m 1.26e+14) (* x (/ (* 0.5 x) y_m)) (* y_m 0.5))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (y_m <= 1.26e+14) {
		tmp = x * ((0.5 * x) / y_m);
	} else {
		tmp = y_m * 0.5;
	}
	return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y_m <= 1.26d+14) then
        tmp = x * ((0.5d0 * x) / y_m)
    else
        tmp = y_m * 0.5d0
    end if
    code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (y_m <= 1.26e+14) {
		tmp = x * ((0.5 * x) / y_m);
	} else {
		tmp = y_m * 0.5;
	}
	return y_s * tmp;
}
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
def code(y_s, x, y_m, z):
	tmp = 0
	if y_m <= 1.26e+14:
		tmp = x * ((0.5 * x) / y_m)
	else:
		tmp = y_m * 0.5
	return y_s * tmp
y\_m = abs(y)
y\_s = copysign(1.0, y)
function code(y_s, x, y_m, z)
	tmp = 0.0
	if (y_m <= 1.26e+14)
		tmp = Float64(x * Float64(Float64(0.5 * x) / y_m));
	else
		tmp = Float64(y_m * 0.5);
	end
	return Float64(y_s * tmp)
end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
function tmp_2 = code(y_s, x, y_m, z)
	tmp = 0.0;
	if (y_m <= 1.26e+14)
		tmp = x * ((0.5 * x) / y_m);
	else
		tmp = y_m * 0.5;
	end
	tmp_2 = y_s * tmp;
end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 1.26e+14], N[(x * N[(N[(0.5 * x), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], N[(y$95$m * 0.5), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 1.26 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \frac{0.5 \cdot x}{y\_m}\\

\mathbf{else}:\\
\;\;\;\;y\_m \cdot 0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.26e14

    1. Initial program 77.8%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg77.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out77.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg277.8%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-177.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out77.8%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac77.8%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval77.8%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval77.8%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+77.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define79.9%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified79.9%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num79.8%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv79.8%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine77.7%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+77.7%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt77.7%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow277.7%

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

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

        \[\leadsto \frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - \color{blue}{{z}^{2}}}} \]
    6. Applied egg-rr77.7%

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

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

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x}}} \]
      2. associate-/r/34.2%

        \[\leadsto \color{blue}{\frac{0.5}{y} \cdot \left(x \cdot x\right)} \]
      3. associate-*r*34.6%

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

      \[\leadsto \color{blue}{\left(\frac{0.5}{y} \cdot x\right) \cdot x} \]
    10. Step-by-step derivation
      1. associate-*l/34.6%

        \[\leadsto \color{blue}{\frac{0.5 \cdot x}{y}} \cdot x \]
    11. Applied egg-rr34.6%

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

    if 1.26e14 < y

    1. Initial program 45.8%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg45.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out45.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg245.8%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-145.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out45.8%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac45.8%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval45.8%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval45.8%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+45.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define45.9%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified45.9%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 63.4%

      \[\leadsto \color{blue}{0.5 \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification41.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.26 \cdot 10^{+14}:\\ \;\;\;\;x \cdot \frac{0.5 \cdot x}{y}\\ \mathbf{else}:\\ \;\;\;\;y \cdot 0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 53.2% accurate, 1.2× speedup?

\[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;y\_m \leq 27000000000000:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y\_m}\right)\\ \mathbf{else}:\\ \;\;\;\;y\_m \cdot 0.5\\ \end{array} \end{array} \]
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
 :precision binary64
 (* y_s (if (<= y_m 27000000000000.0) (* x (* x (/ 0.5 y_m))) (* y_m 0.5))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (y_m <= 27000000000000.0) {
		tmp = x * (x * (0.5 / y_m));
	} else {
		tmp = y_m * 0.5;
	}
	return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y_m <= 27000000000000.0d0) then
        tmp = x * (x * (0.5d0 / y_m))
    else
        tmp = y_m * 0.5d0
    end if
    code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (y_m <= 27000000000000.0) {
		tmp = x * (x * (0.5 / y_m));
	} else {
		tmp = y_m * 0.5;
	}
	return y_s * tmp;
}
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
def code(y_s, x, y_m, z):
	tmp = 0
	if y_m <= 27000000000000.0:
		tmp = x * (x * (0.5 / y_m))
	else:
		tmp = y_m * 0.5
	return y_s * tmp
y\_m = abs(y)
y\_s = copysign(1.0, y)
function code(y_s, x, y_m, z)
	tmp = 0.0
	if (y_m <= 27000000000000.0)
		tmp = Float64(x * Float64(x * Float64(0.5 / y_m)));
	else
		tmp = Float64(y_m * 0.5);
	end
	return Float64(y_s * tmp)
end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
function tmp_2 = code(y_s, x, y_m, z)
	tmp = 0.0;
	if (y_m <= 27000000000000.0)
		tmp = x * (x * (0.5 / y_m));
	else
		tmp = y_m * 0.5;
	end
	tmp_2 = y_s * tmp;
end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 27000000000000.0], N[(x * N[(x * N[(0.5 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m * 0.5), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 27000000000000:\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y\_m}\right)\\

\mathbf{else}:\\
\;\;\;\;y\_m \cdot 0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 2.7e13

    1. Initial program 77.8%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg77.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out77.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg277.8%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-177.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out77.8%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac77.8%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval77.8%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval77.8%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+77.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define79.9%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified79.9%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num79.8%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      2. un-div-inv79.8%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{y}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}} \]
      3. fma-undefine77.7%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}} \]
      4. associate--l+77.7%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\left(x \cdot x + y \cdot y\right) - z \cdot z}}} \]
      5. add-sqr-sqrt77.7%

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}} - z \cdot z}} \]
      6. pow277.7%

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

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

        \[\leadsto \frac{0.5}{\frac{y}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} - \color{blue}{{z}^{2}}}} \]
    6. Applied egg-rr77.7%

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

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

        \[\leadsto \frac{0.5}{\frac{y}{\color{blue}{x \cdot x}}} \]
      2. associate-/r/34.2%

        \[\leadsto \color{blue}{\frac{0.5}{y} \cdot \left(x \cdot x\right)} \]
      3. associate-*r*34.6%

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

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

    if 2.7e13 < y

    1. Initial program 45.8%

      \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
    2. Step-by-step derivation
      1. remove-double-neg45.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
      2. distribute-lft-neg-out45.8%

        \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
      3. distribute-frac-neg245.8%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
      5. neg-mul-145.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
      6. distribute-lft-neg-out45.8%

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

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

        \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
      9. times-frac45.8%

        \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
      10. metadata-eval45.8%

        \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      11. metadata-eval45.8%

        \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
      12. associate--l+45.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
      13. fma-define45.9%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
    3. Simplified45.9%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 63.4%

      \[\leadsto \color{blue}{0.5 \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification41.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 27000000000000:\\ \;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 35.7% accurate, 5.0× speedup?

\[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \left(y\_m \cdot 0.5\right) \end{array} \]
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z) :precision binary64 (* y_s (* y_m 0.5)))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
	return y_s * (y_m * 0.5);
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    code = y_s * (y_m * 0.5d0)
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
	return y_s * (y_m * 0.5);
}
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
def code(y_s, x, y_m, z):
	return y_s * (y_m * 0.5)
y\_m = abs(y)
y\_s = copysign(1.0, y)
function code(y_s, x, y_m, z)
	return Float64(y_s * Float64(y_m * 0.5))
end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
function tmp = code(y_s, x, y_m, z)
	tmp = y_s * (y_m * 0.5);
end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * N[(y$95$m * 0.5), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \left(y\_m \cdot 0.5\right)
\end{array}
Derivation
  1. Initial program 70.2%

    \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2} \]
  2. Step-by-step derivation
    1. remove-double-neg70.2%

      \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{\color{blue}{-\left(-y \cdot 2\right)}} \]
    2. distribute-lft-neg-out70.2%

      \[\leadsto \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{-\color{blue}{\left(-y\right) \cdot 2}} \]
    3. distribute-frac-neg270.2%

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

      \[\leadsto \color{blue}{\frac{-\left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\left(-y\right) \cdot 2}} \]
    5. neg-mul-170.2%

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}}{\left(-y\right) \cdot 2} \]
    6. distribute-lft-neg-out70.2%

      \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{-y \cdot 2}} \]
    7. *-commutative70.2%

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

      \[\leadsto \frac{-1 \cdot \left(\left(x \cdot x + y \cdot y\right) - z \cdot z\right)}{\color{blue}{\left(-2\right) \cdot y}} \]
    9. times-frac70.2%

      \[\leadsto \color{blue}{\frac{-1}{-2} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y}} \]
    10. metadata-eval70.2%

      \[\leadsto \frac{-1}{\color{blue}{-2}} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
    11. metadata-eval70.2%

      \[\leadsto \color{blue}{0.5} \cdot \frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y} \]
    12. associate--l+70.2%

      \[\leadsto 0.5 \cdot \frac{\color{blue}{x \cdot x + \left(y \cdot y - z \cdot z\right)}}{y} \]
    13. fma-define71.8%

      \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}}{y} \]
  3. Simplified71.8%

    \[\leadsto \color{blue}{0.5 \cdot \frac{\mathsf{fma}\left(x, x, y \cdot y - z \cdot z\right)}{y}} \]
  4. Add Preprocessing
  5. Taylor expanded in y around inf 39.6%

    \[\leadsto \color{blue}{0.5 \cdot y} \]
  6. Final simplification39.6%

    \[\leadsto y \cdot 0.5 \]
  7. Add Preprocessing

Developer Target 1: 99.8% accurate, 1.0× speedup?

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

\\
y \cdot 0.5 - \left(\frac{0.5}{y} \cdot \left(z + x\right)\right) \cdot \left(z - x\right)
\end{array}

Reproduce

?
herbie shell --seed 2024130 
(FPCore (x y z)
  :name "Diagrams.TwoD.Apollonian:initialConfig from diagrams-contrib-1.3.0.5, A"
  :precision binary64

  :alt
  (! :herbie-platform default (- (* y 1/2) (* (* (/ 1/2 y) (+ z x)) (- z x))))

  (/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0)))