Statistics.Distribution.CauchyLorentz:$cdensity from math-functions-0.1.5.2

Percentage Accurate: 88.3% → 99.6%
Time: 12.6s
Alternatives: 10
Speedup: 0.7×

Specification

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

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

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

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

Alternative 1: 99.6% accurate, 0.1× speedup?

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

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


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 4.9999999999999999e-17

    1. Initial program 86.7%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/86.1%

        \[\leadsto \color{blue}{\frac{1}{\left(y \cdot \left(1 + z \cdot z\right)\right) \cdot x}} \]
      2. remove-double-neg86.1%

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

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

        \[\leadsto \frac{1}{-\color{blue}{\left(-\left(y \cdot \left(1 + z \cdot z\right)\right) \cdot x\right)}} \]
      5. remove-double-neg86.1%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{y \cdot \color{blue}{\left(\mathsf{fma}\left(z, z, 1\right) \cdot x\right)}} \]
      2. associate-*r*86.1%

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

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

        \[\leadsto \frac{1}{\left(y \cdot \color{blue}{\left(1 + z \cdot z\right)}\right) \cdot x} \]
      5. associate-/l/86.7%

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

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

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

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

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

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

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{y \cdot \color{blue}{\left(z \cdot z + 1\right)}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      12. fma-undefine13.5%

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{y \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      13. *-commutative13.5%

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{\color{blue}{\mathsf{fma}\left(z, z, 1\right) \cdot y}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      14. sqrt-prod13.5%

        \[\leadsto \frac{{x}^{-0.5}}{\color{blue}{\sqrt{\mathsf{fma}\left(z, z, 1\right)} \cdot \sqrt{y}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      15. fma-undefine13.5%

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{\color{blue}{z \cdot z + 1}} \cdot \sqrt{y}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      16. +-commutative13.5%

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

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

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

      \[\leadsto \color{blue}{\frac{{x}^{-0.5}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}} \cdot \frac{{x}^{-0.5}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}}} \]
    7. Step-by-step derivation
      1. unpow215.0%

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

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

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

        \[\leadsto \color{blue}{\frac{{x}^{-0.5} \cdot {x}^{-0.5}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right)}} \]
      3. pow-prod-up25.3%

        \[\leadsto \frac{\color{blue}{{x}^{\left(-0.5 + -0.5\right)}}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right)} \]
      4. metadata-eval25.3%

        \[\leadsto \frac{{x}^{\color{blue}{-1}}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right)} \]
      5. metadata-eval25.3%

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

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

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

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

        \[\leadsto \frac{\frac{{x}^{\color{blue}{-1}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}} \]
      10. inv-pow26.3%

        \[\leadsto \frac{\frac{\color{blue}{\frac{1}{x}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}} \]
    10. Applied egg-rr26.3%

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right)}}{\sqrt{y}}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}} \]
      2. associate-/l/25.2%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right)}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \sqrt{y}}} \]
      3. div-inv25.2%

        \[\leadsto \frac{\color{blue}{\frac{1}{x} \cdot \frac{1}{\mathsf{hypot}\left(1, z\right)}}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \sqrt{y}} \]
      4. associate-*r*25.2%

        \[\leadsto \frac{\frac{1}{x} \cdot \frac{1}{\mathsf{hypot}\left(1, z\right)}}{\color{blue}{\mathsf{hypot}\left(1, z\right) \cdot \left(\sqrt{y} \cdot \sqrt{y}\right)}} \]
      5. add-sqr-sqrt96.9%

        \[\leadsto \frac{\frac{1}{x} \cdot \frac{1}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right) \cdot \color{blue}{y}} \]
      6. associate-*l/98.0%

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right) \cdot y} \cdot \frac{1}{\mathsf{hypot}\left(1, z\right)}} \]
      7. associate-/l/92.3%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{y}}{\mathsf{hypot}\left(1, z\right)}} \cdot \frac{1}{\mathsf{hypot}\left(1, z\right)} \]
      8. div-inv92.3%

        \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{1}{x}}{y}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}} \]
      9. associate-/l/86.9%

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

        \[\leadsto \frac{\color{blue}{\frac{1}{x} \cdot \frac{1}{y}}}{\mathsf{hypot}\left(1, z\right) \cdot \mathsf{hypot}\left(1, z\right)} \]
      11. times-frac97.0%

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right)} \cdot \frac{\frac{1}{y}}{\mathsf{hypot}\left(1, z\right)}} \]
      12. associate-/l/96.5%

        \[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(1, z\right) \cdot x}} \cdot \frac{\frac{1}{y}}{\mathsf{hypot}\left(1, z\right)} \]
    12. Applied egg-rr96.5%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(1, z\right) \cdot x} \cdot \frac{\frac{1}{y}}{\mathsf{hypot}\left(1, z\right)}} \]

    if 4.9999999999999999e-17 < y

    1. Initial program 91.9%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/91.8%

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

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

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

        \[\leadsto \frac{1}{-\color{blue}{\left(-\left(y \cdot \left(1 + z \cdot z\right)\right) \cdot x\right)}} \]
      5. remove-double-neg91.8%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{y \cdot \color{blue}{\left(\mathsf{fma}\left(z, z, 1\right) \cdot x\right)}} \]
      2. associate-*r*91.8%

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

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

        \[\leadsto \frac{1}{\left(y \cdot \color{blue}{\left(1 + z \cdot z\right)}\right) \cdot x} \]
      5. associate-/l/91.9%

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

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

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

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

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

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

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

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{y \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      13. *-commutative46.7%

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{\color{blue}{\mathsf{fma}\left(z, z, 1\right) \cdot y}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      14. sqrt-prod46.6%

        \[\leadsto \frac{{x}^{-0.5}}{\color{blue}{\sqrt{\mathsf{fma}\left(z, z, 1\right)} \cdot \sqrt{y}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      15. fma-undefine46.6%

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

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

        \[\leadsto \frac{{x}^{-0.5}}{\color{blue}{\mathsf{hypot}\left(1, z\right)} \cdot \sqrt{y}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      18. sqrt-div46.6%

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

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

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

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

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

        \[\leadsto {\left(\frac{\color{blue}{\sqrt{{x}^{-1}}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}}\right)}^{2} \]
      3. metadata-eval51.8%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\sqrt{{x}^{-2}}}{y}}{1 + z \cdot z}} \]
      12. sqrt-pow197.1%

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

        \[\leadsto \frac{\frac{{x}^{\color{blue}{-1}}}{y}}{1 + z \cdot z} \]
      14. inv-pow97.1%

        \[\leadsto \frac{\frac{\color{blue}{\frac{1}{x}}}{y}}{1 + z \cdot z} \]
      15. associate-/l/97.1%

        \[\leadsto \frac{\color{blue}{\frac{1}{y \cdot x}}}{1 + z \cdot z} \]
      16. add-sqr-sqrt97.1%

        \[\leadsto \frac{\frac{1}{y \cdot x}}{\color{blue}{\sqrt{1 + z \cdot z} \cdot \sqrt{1 + z \cdot z}}} \]
      17. hypot-1-def97.1%

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

        \[\leadsto \frac{\frac{1}{y \cdot x}}{\mathsf{hypot}\left(1, z\right) \cdot \color{blue}{\mathsf{hypot}\left(1, z\right)}} \]
      19. associate-/r*99.8%

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

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

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

Alternative 2: 99.4% accurate, 0.0× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ \begin{array}{l} t_0 := \mathsf{hypot}\left(1, z\right) \cdot \sqrt{y\_m}\\ y\_s \cdot \left(x\_s \cdot \frac{\frac{\frac{1}{x\_m}}{t\_0}}{t\_0}\right) \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (let* ((t_0 (* (hypot 1.0 z) (sqrt y_m))))
   (* y_s (* x_s (/ (/ (/ 1.0 x_m) t_0) t_0)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double t_0 = hypot(1.0, z) * sqrt(y_m);
	return y_s * (x_s * (((1.0 / x_m) / t_0) / t_0));
}
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double t_0 = Math.hypot(1.0, z) * Math.sqrt(y_m);
	return y_s * (x_s * (((1.0 / x_m) / t_0) / t_0));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	t_0 = math.hypot(1.0, z) * math.sqrt(y_m)
	return y_s * (x_s * (((1.0 / x_m) / t_0) / t_0))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	t_0 = Float64(hypot(1.0, z) * sqrt(y_m))
	return Float64(y_s * Float64(x_s * Float64(Float64(Float64(1.0 / x_m) / t_0) / t_0)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp = code(y_s, x_s, x_m, y_m, z)
	t_0 = hypot(1.0, z) * sqrt(y_m);
	tmp = y_s * (x_s * (((1.0 / x_m) / t_0) / t_0));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := Block[{t$95$0 = N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * N[Sqrt[y$95$m], $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * N[(x$95$s * N[(N[(N[(1.0 / x$95$m), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(1, z\right) \cdot \sqrt{y\_m}\\
y\_s \cdot \left(x\_s \cdot \frac{\frac{\frac{1}{x\_m}}{t\_0}}{t\_0}\right)
\end{array}
\end{array}
Derivation
  1. Initial program 88.1%

    \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
  2. Step-by-step derivation
    1. associate-/l/87.7%

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

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

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

      \[\leadsto \frac{1}{-\color{blue}{\left(-\left(y \cdot \left(1 + z \cdot z\right)\right) \cdot x\right)}} \]
    5. remove-double-neg87.7%

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

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

      \[\leadsto \frac{1}{y \cdot \color{blue}{\left(x \cdot \left(1 + z \cdot z\right)\right)}} \]
    8. sqr-neg88.8%

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

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

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

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

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

      \[\leadsto \frac{1}{y \cdot \color{blue}{\left(\mathsf{fma}\left(z, z, 1\right) \cdot x\right)}} \]
    2. associate-*r*87.7%

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

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

      \[\leadsto \frac{1}{\left(y \cdot \color{blue}{\left(1 + z \cdot z\right)}\right) \cdot x} \]
    5. associate-/l/88.1%

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

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

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

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

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

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

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

      \[\leadsto \frac{{x}^{-0.5}}{\sqrt{y \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
    13. *-commutative22.7%

      \[\leadsto \frac{{x}^{-0.5}}{\sqrt{\color{blue}{\mathsf{fma}\left(z, z, 1\right) \cdot y}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
    14. sqrt-prod22.7%

      \[\leadsto \frac{{x}^{-0.5}}{\color{blue}{\sqrt{\mathsf{fma}\left(z, z, 1\right)} \cdot \sqrt{y}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
    15. fma-undefine22.7%

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

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

      \[\leadsto \frac{{x}^{-0.5}}{\color{blue}{\mathsf{hypot}\left(1, z\right)} \cdot \sqrt{y}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
    18. sqrt-div22.7%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{{x}^{-0.5} \cdot {x}^{-0.5}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right)}} \]
    3. pow-prod-up43.7%

      \[\leadsto \frac{\color{blue}{{x}^{\left(-0.5 + -0.5\right)}}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right)} \]
    4. metadata-eval43.7%

      \[\leadsto \frac{{x}^{\color{blue}{-1}}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right)} \]
    5. metadata-eval43.7%

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

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

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

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

      \[\leadsto \frac{\frac{{x}^{\color{blue}{-1}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}} \]
    10. inv-pow46.6%

      \[\leadsto \frac{\frac{\color{blue}{\frac{1}{x}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}} \]
  10. Applied egg-rr46.6%

    \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}}} \]
  11. Add Preprocessing

Alternative 3: 99.2% accurate, 0.0× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ y\_s \cdot \left(x\_s \cdot {\left(\frac{{x\_m}^{-0.5}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y\_m}}\right)}^{2}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (* y_s (* x_s (pow (/ (pow x_m -0.5) (* (hypot 1.0 z) (sqrt y_m))) 2.0))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * pow((pow(x_m, -0.5) / (hypot(1.0, z) * sqrt(y_m))), 2.0));
}
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * Math.pow((Math.pow(x_m, -0.5) / (Math.hypot(1.0, z) * Math.sqrt(y_m))), 2.0));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	return y_s * (x_s * math.pow((math.pow(x_m, -0.5) / (math.hypot(1.0, z) * math.sqrt(y_m))), 2.0))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	return Float64(y_s * Float64(x_s * (Float64((x_m ^ -0.5) / Float64(hypot(1.0, z) * sqrt(y_m))) ^ 2.0)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp = code(y_s, x_s, x_m, y_m, z)
	tmp = y_s * (x_s * (((x_m ^ -0.5) / (hypot(1.0, z) * sqrt(y_m))) ^ 2.0));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[Power[N[(N[Power[x$95$m, -0.5], $MachinePrecision] / N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * N[Sqrt[y$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y\_s \cdot \left(x\_s \cdot {\left(\frac{{x\_m}^{-0.5}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y\_m}}\right)}^{2}\right)
\end{array}
Derivation
  1. Initial program 88.1%

    \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
  2. Step-by-step derivation
    1. associate-/l/87.7%

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

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

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

      \[\leadsto \frac{1}{-\color{blue}{\left(-\left(y \cdot \left(1 + z \cdot z\right)\right) \cdot x\right)}} \]
    5. remove-double-neg87.7%

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

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

      \[\leadsto \frac{1}{y \cdot \color{blue}{\left(x \cdot \left(1 + z \cdot z\right)\right)}} \]
    8. sqr-neg88.8%

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

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

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

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

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

      \[\leadsto \frac{1}{y \cdot \color{blue}{\left(\mathsf{fma}\left(z, z, 1\right) \cdot x\right)}} \]
    2. associate-*r*87.7%

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

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

      \[\leadsto \frac{1}{\left(y \cdot \color{blue}{\left(1 + z \cdot z\right)}\right) \cdot x} \]
    5. associate-/l/88.1%

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

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

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

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

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

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

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

      \[\leadsto \frac{{x}^{-0.5}}{\sqrt{y \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
    13. *-commutative22.7%

      \[\leadsto \frac{{x}^{-0.5}}{\sqrt{\color{blue}{\mathsf{fma}\left(z, z, 1\right) \cdot y}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
    14. sqrt-prod22.7%

      \[\leadsto \frac{{x}^{-0.5}}{\color{blue}{\sqrt{\mathsf{fma}\left(z, z, 1\right)} \cdot \sqrt{y}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
    15. fma-undefine22.7%

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

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

      \[\leadsto \frac{{x}^{-0.5}}{\color{blue}{\mathsf{hypot}\left(1, z\right)} \cdot \sqrt{y}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
    18. sqrt-div22.7%

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

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

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

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

Alternative 4: 99.1% accurate, 0.1× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+18}:\\ \;\;\;\;\frac{\frac{1}{x\_m}}{y\_m \cdot \left(1 + z \cdot z\right)}\\ \mathbf{elif}\;z \cdot z \leq 10^{+295}:\\ \;\;\;\;\frac{\frac{{z}^{-2}}{x\_m}}{y\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{x\_m \cdot z}}{z \cdot y\_m}\\ \end{array}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (*
  y_s
  (*
   x_s
   (if (<= (* z z) 2e+18)
     (/ (/ 1.0 x_m) (* y_m (+ 1.0 (* z z))))
     (if (<= (* z z) 1e+295)
       (/ (/ (pow z -2.0) x_m) y_m)
       (/ (/ 1.0 (* x_m z)) (* z y_m)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z * z) <= 2e+18) {
		tmp = (1.0 / x_m) / (y_m * (1.0 + (z * z)));
	} else if ((z * z) <= 1e+295) {
		tmp = (pow(z, -2.0) / x_m) / y_m;
	} else {
		tmp = (1.0 / (x_m * z)) / (z * y_m);
	}
	return y_s * (x_s * tmp);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z * z) <= 2d+18) then
        tmp = (1.0d0 / x_m) / (y_m * (1.0d0 + (z * z)))
    else if ((z * z) <= 1d+295) then
        tmp = ((z ** (-2.0d0)) / x_m) / y_m
    else
        tmp = (1.0d0 / (x_m * z)) / (z * y_m)
    end if
    code = y_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z * z) <= 2e+18) {
		tmp = (1.0 / x_m) / (y_m * (1.0 + (z * z)));
	} else if ((z * z) <= 1e+295) {
		tmp = (Math.pow(z, -2.0) / x_m) / y_m;
	} else {
		tmp = (1.0 / (x_m * z)) / (z * y_m);
	}
	return y_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	tmp = 0
	if (z * z) <= 2e+18:
		tmp = (1.0 / x_m) / (y_m * (1.0 + (z * z)))
	elif (z * z) <= 1e+295:
		tmp = (math.pow(z, -2.0) / x_m) / y_m
	else:
		tmp = (1.0 / (x_m * z)) / (z * y_m)
	return y_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0
	if (Float64(z * z) <= 2e+18)
		tmp = Float64(Float64(1.0 / x_m) / Float64(y_m * Float64(1.0 + Float64(z * z))));
	elseif (Float64(z * z) <= 1e+295)
		tmp = Float64(Float64((z ^ -2.0) / x_m) / y_m);
	else
		tmp = Float64(Float64(1.0 / Float64(x_m * z)) / Float64(z * y_m));
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0;
	if ((z * z) <= 2e+18)
		tmp = (1.0 / x_m) / (y_m * (1.0 + (z * z)));
	elseif ((z * z) <= 1e+295)
		tmp = ((z ^ -2.0) / x_m) / y_m;
	else
		tmp = (1.0 / (x_m * z)) / (z * y_m);
	end
	tmp_2 = y_s * (x_s * tmp);
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[N[(z * z), $MachinePrecision], 2e+18], N[(N[(1.0 / x$95$m), $MachinePrecision] / N[(y$95$m * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * z), $MachinePrecision], 1e+295], N[(N[(N[Power[z, -2.0], $MachinePrecision] / x$95$m), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(1.0 / N[(x$95$m * z), $MachinePrecision]), $MachinePrecision] / N[(z * y$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+18}:\\
\;\;\;\;\frac{\frac{1}{x\_m}}{y\_m \cdot \left(1 + z \cdot z\right)}\\

\mathbf{elif}\;z \cdot z \leq 10^{+295}:\\
\;\;\;\;\frac{\frac{{z}^{-2}}{x\_m}}{y\_m}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x\_m \cdot z}}{z \cdot y\_m}\\


\end{array}\right)
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 z z) < 2e18

    1. Initial program 99.7%

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

    if 2e18 < (*.f64 z z) < 9.9999999999999998e294

    1. Initial program 86.8%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/85.5%

        \[\leadsto \color{blue}{\frac{1}{\left(y \cdot \left(1 + z \cdot z\right)\right) \cdot x}} \]
      2. remove-double-neg85.5%

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

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

        \[\leadsto \frac{1}{-\color{blue}{\left(-\left(y \cdot \left(1 + z \cdot z\right)\right) \cdot x\right)}} \]
      5. remove-double-neg85.5%

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

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

        \[\leadsto \frac{1}{y \cdot \color{blue}{\left(x \cdot \left(1 + z \cdot z\right)\right)}} \]
      8. sqr-neg91.0%

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{x \cdot \left(y \cdot {z}^{2}\right)}} \]
    6. Step-by-step derivation
      1. *-commutative85.5%

        \[\leadsto \frac{1}{\color{blue}{\left(y \cdot {z}^{2}\right) \cdot x}} \]
      2. associate-*r*91.0%

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

        \[\leadsto \frac{1}{y \cdot \color{blue}{\left(x \cdot {z}^{2}\right)}} \]
    7. Simplified91.0%

      \[\leadsto \frac{1}{\color{blue}{y \cdot \left(x \cdot {z}^{2}\right)}} \]
    8. Step-by-step derivation
      1. add-sqr-sqrt66.0%

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

        \[\leadsto \color{blue}{\frac{\sqrt{1}}{\sqrt{y \cdot \left(x \cdot {z}^{2}\right)}}} \cdot \sqrt{\frac{1}{y \cdot \left(x \cdot {z}^{2}\right)}} \]
      3. metadata-eval55.7%

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

        \[\leadsto \frac{1}{\sqrt{y \cdot \left(x \cdot \color{blue}{\left(z \cdot z\right)}\right)}} \cdot \sqrt{\frac{1}{y \cdot \left(x \cdot {z}^{2}\right)}} \]
      5. associate-*r*53.9%

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

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

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

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

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

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

        \[\leadsto \frac{1}{\sqrt{x \cdot y} \cdot z} \cdot \frac{\color{blue}{1}}{\sqrt{y \cdot \left(x \cdot {z}^{2}\right)}} \]
      12. pow235.1%

        \[\leadsto \frac{1}{\sqrt{x \cdot y} \cdot z} \cdot \frac{1}{\sqrt{y \cdot \left(x \cdot \color{blue}{\left(z \cdot z\right)}\right)}} \]
      13. associate-*r*38.6%

        \[\leadsto \frac{1}{\sqrt{x \cdot y} \cdot z} \cdot \frac{1}{\sqrt{\color{blue}{\left(y \cdot x\right) \cdot \left(z \cdot z\right)}}} \]
      14. sqrt-prod38.6%

        \[\leadsto \frac{1}{\sqrt{x \cdot y} \cdot z} \cdot \frac{1}{\color{blue}{\sqrt{y \cdot x} \cdot \sqrt{z \cdot z}}} \]
      15. *-commutative38.6%

        \[\leadsto \frac{1}{\sqrt{x \cdot y} \cdot z} \cdot \frac{1}{\sqrt{\color{blue}{x \cdot y}} \cdot \sqrt{z \cdot z}} \]
      16. sqrt-prod30.5%

        \[\leadsto \frac{1}{\sqrt{x \cdot y} \cdot z} \cdot \frac{1}{\sqrt{x \cdot y} \cdot \color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)}} \]
      17. add-sqr-sqrt57.4%

        \[\leadsto \frac{1}{\sqrt{x \cdot y} \cdot z} \cdot \frac{1}{\sqrt{x \cdot y} \cdot \color{blue}{z}} \]
    9. Applied egg-rr57.4%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{x \cdot y} \cdot z} \cdot \frac{1}{\sqrt{x \cdot y} \cdot z}} \]
    10. Step-by-step derivation
      1. unpow-157.4%

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

        \[\leadsto {\left(\sqrt{x \cdot y} \cdot z\right)}^{-1} \cdot \color{blue}{{\left(\sqrt{x \cdot y} \cdot z\right)}^{-1}} \]
      3. pow-sqr57.3%

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

        \[\leadsto {\color{blue}{\left(z \cdot \sqrt{x \cdot y}\right)}}^{\left(2 \cdot -1\right)} \]
      5. metadata-eval57.3%

        \[\leadsto {\left(z \cdot \sqrt{x \cdot y}\right)}^{\color{blue}{-2}} \]
    11. Simplified57.3%

      \[\leadsto \color{blue}{{\left(z \cdot \sqrt{x \cdot y}\right)}^{-2}} \]
    12. Step-by-step derivation
      1. unpow-prod-down57.4%

        \[\leadsto \color{blue}{{z}^{-2} \cdot {\left(\sqrt{x \cdot y}\right)}^{-2}} \]
      2. sqrt-pow296.0%

        \[\leadsto {z}^{-2} \cdot \color{blue}{{\left(x \cdot y\right)}^{\left(\frac{-2}{2}\right)}} \]
      3. metadata-eval96.0%

        \[\leadsto {z}^{-2} \cdot {\left(x \cdot y\right)}^{\color{blue}{-1}} \]
      4. inv-pow96.0%

        \[\leadsto {z}^{-2} \cdot \color{blue}{\frac{1}{x \cdot y}} \]
      5. div-inv96.1%

        \[\leadsto \color{blue}{\frac{{z}^{-2}}{x \cdot y}} \]
      6. associate-/r*92.5%

        \[\leadsto \color{blue}{\frac{\frac{{z}^{-2}}{x}}{y}} \]
    13. Applied egg-rr92.5%

      \[\leadsto \color{blue}{\frac{\frac{{z}^{-2}}{x}}{y}} \]

    if 9.9999999999999998e294 < (*.f64 z z)

    1. Initial program 70.7%

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

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

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

        \[\leadsto \frac{\frac{1}{x}}{\color{blue}{\left(-y\right) \cdot \left(-\left(1 + z \cdot z\right)\right)}} \]
      4. associate-/r*70.2%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{-y}}{-\left(1 + z \cdot z\right)}} \]
      5. associate-/l/70.2%

        \[\leadsto \frac{\color{blue}{\frac{1}{\left(-y\right) \cdot x}}}{-\left(1 + z \cdot z\right)} \]
      6. associate-/l/70.2%

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\left(\color{blue}{z \cdot z} + 1\right) \cdot \left(y \cdot x\right)} \]
      14. fma-define70.2%

        \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(z, z, 1\right)} \cdot \left(y \cdot x\right)} \]
      15. *-commutative70.2%

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

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

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

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

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

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

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

        \[\leadsto {\left(z \cdot \color{blue}{\left(\left(x \cdot y\right) \cdot z\right)}\right)}^{-1} \]
      4. unpow-prod-down85.1%

        \[\leadsto \color{blue}{{z}^{-1} \cdot {\left(\left(x \cdot y\right) \cdot z\right)}^{-1}} \]
      5. inv-pow85.1%

        \[\leadsto {z}^{-1} \cdot \color{blue}{\frac{1}{\left(x \cdot y\right) \cdot z}} \]
      6. pow185.1%

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

        \[\leadsto {z}^{-1} \cdot \frac{1}{\color{blue}{\left(x \cdot y\right) \cdot z}} \]
      8. associate-*l*98.2%

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

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

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

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

        \[\leadsto \frac{\color{blue}{{z}^{-1}}}{x \cdot \left(z \cdot y\right)} \]
      3. associate-/r*99.4%

        \[\leadsto \color{blue}{\frac{\frac{{z}^{-1}}{x}}{z \cdot y}} \]
      4. unpow-199.4%

        \[\leadsto \frac{\frac{\color{blue}{\frac{1}{z}}}{x}}{z \cdot y} \]
      5. associate-/r*99.5%

        \[\leadsto \frac{\color{blue}{\frac{1}{z \cdot x}}}{z \cdot y} \]
      6. *-commutative99.5%

        \[\leadsto \frac{\frac{1}{\color{blue}{x \cdot z}}}{z \cdot y} \]
      7. *-commutative99.5%

        \[\leadsto \frac{\frac{1}{x \cdot z}}{\color{blue}{y \cdot z}} \]
    11. Simplified99.5%

      \[\leadsto \color{blue}{\frac{\frac{1}{x \cdot z}}{y \cdot z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification98.2%

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

Alternative 5: 98.7% accurate, 0.1× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z \cdot z \leq 10^{+295}:\\ \;\;\;\;\frac{1}{y\_m \cdot \left(x\_m \cdot \mathsf{fma}\left(z, z, 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{x\_m \cdot z}}{z \cdot y\_m}\\ \end{array}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (*
  y_s
  (*
   x_s
   (if (<= (* z z) 1e+295)
     (/ 1.0 (* y_m (* x_m (fma z z 1.0))))
     (/ (/ 1.0 (* x_m z)) (* z y_m))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z * z) <= 1e+295) {
		tmp = 1.0 / (y_m * (x_m * fma(z, z, 1.0)));
	} else {
		tmp = (1.0 / (x_m * z)) / (z * y_m);
	}
	return y_s * (x_s * tmp);
}
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0
	if (Float64(z * z) <= 1e+295)
		tmp = Float64(1.0 / Float64(y_m * Float64(x_m * fma(z, z, 1.0))));
	else
		tmp = Float64(Float64(1.0 / Float64(x_m * z)) / Float64(z * y_m));
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[N[(z * z), $MachinePrecision], 1e+295], N[(1.0 / N[(y$95$m * N[(x$95$m * N[(z * z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(x$95$m * z), $MachinePrecision]), $MachinePrecision] / N[(z * y$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{+295}:\\
\;\;\;\;\frac{1}{y\_m \cdot \left(x\_m \cdot \mathsf{fma}\left(z, z, 1\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x\_m \cdot z}}{z \cdot y\_m}\\


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z z) < 9.9999999999999998e294

    1. Initial program 95.9%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/95.3%

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

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

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

        \[\leadsto \frac{1}{-\color{blue}{\left(-\left(y \cdot \left(1 + z \cdot z\right)\right) \cdot x\right)}} \]
      5. remove-double-neg95.3%

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

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

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

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

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

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

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

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

    if 9.9999999999999998e294 < (*.f64 z z)

    1. Initial program 70.7%

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

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

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

        \[\leadsto \frac{\frac{1}{x}}{\color{blue}{\left(-y\right) \cdot \left(-\left(1 + z \cdot z\right)\right)}} \]
      4. associate-/r*70.2%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{-y}}{-\left(1 + z \cdot z\right)}} \]
      5. associate-/l/70.2%

        \[\leadsto \frac{\color{blue}{\frac{1}{\left(-y\right) \cdot x}}}{-\left(1 + z \cdot z\right)} \]
      6. associate-/l/70.2%

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\left(\color{blue}{z \cdot z} + 1\right) \cdot \left(y \cdot x\right)} \]
      14. fma-define70.2%

        \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(z, z, 1\right)} \cdot \left(y \cdot x\right)} \]
      15. *-commutative70.2%

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

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

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

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

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

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

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

        \[\leadsto {\left(z \cdot \color{blue}{\left(\left(x \cdot y\right) \cdot z\right)}\right)}^{-1} \]
      4. unpow-prod-down85.1%

        \[\leadsto \color{blue}{{z}^{-1} \cdot {\left(\left(x \cdot y\right) \cdot z\right)}^{-1}} \]
      5. inv-pow85.1%

        \[\leadsto {z}^{-1} \cdot \color{blue}{\frac{1}{\left(x \cdot y\right) \cdot z}} \]
      6. pow185.1%

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

        \[\leadsto {z}^{-1} \cdot \frac{1}{\color{blue}{\left(x \cdot y\right) \cdot z}} \]
      8. associate-*l*98.2%

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

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

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

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

        \[\leadsto \frac{\color{blue}{{z}^{-1}}}{x \cdot \left(z \cdot y\right)} \]
      3. associate-/r*99.4%

        \[\leadsto \color{blue}{\frac{\frac{{z}^{-1}}{x}}{z \cdot y}} \]
      4. unpow-199.4%

        \[\leadsto \frac{\frac{\color{blue}{\frac{1}{z}}}{x}}{z \cdot y} \]
      5. associate-/r*99.5%

        \[\leadsto \frac{\color{blue}{\frac{1}{z \cdot x}}}{z \cdot y} \]
      6. *-commutative99.5%

        \[\leadsto \frac{\frac{1}{\color{blue}{x \cdot z}}}{z \cdot y} \]
      7. *-commutative99.5%

        \[\leadsto \frac{\frac{1}{x \cdot z}}{\color{blue}{y \cdot z}} \]
    11. Simplified99.5%

      \[\leadsto \color{blue}{\frac{\frac{1}{x \cdot z}}{y \cdot z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.7%

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

Alternative 6: 99.0% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z \cdot z \leq 50000000000000:\\ \;\;\;\;\frac{\frac{1}{x\_m}}{y\_m \cdot \left(1 + z \cdot z\right)}\\ \mathbf{elif}\;z \cdot z \leq 10^{+295}:\\ \;\;\;\;\frac{1}{y\_m \cdot \left(x\_m \cdot \left(z \cdot z\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{x\_m \cdot z}}{z \cdot y\_m}\\ \end{array}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (*
  y_s
  (*
   x_s
   (if (<= (* z z) 50000000000000.0)
     (/ (/ 1.0 x_m) (* y_m (+ 1.0 (* z z))))
     (if (<= (* z z) 1e+295)
       (/ 1.0 (* y_m (* x_m (* z z))))
       (/ (/ 1.0 (* x_m z)) (* z y_m)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z * z) <= 50000000000000.0) {
		tmp = (1.0 / x_m) / (y_m * (1.0 + (z * z)));
	} else if ((z * z) <= 1e+295) {
		tmp = 1.0 / (y_m * (x_m * (z * z)));
	} else {
		tmp = (1.0 / (x_m * z)) / (z * y_m);
	}
	return y_s * (x_s * tmp);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z * z) <= 50000000000000.0d0) then
        tmp = (1.0d0 / x_m) / (y_m * (1.0d0 + (z * z)))
    else if ((z * z) <= 1d+295) then
        tmp = 1.0d0 / (y_m * (x_m * (z * z)))
    else
        tmp = (1.0d0 / (x_m * z)) / (z * y_m)
    end if
    code = y_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z * z) <= 50000000000000.0) {
		tmp = (1.0 / x_m) / (y_m * (1.0 + (z * z)));
	} else if ((z * z) <= 1e+295) {
		tmp = 1.0 / (y_m * (x_m * (z * z)));
	} else {
		tmp = (1.0 / (x_m * z)) / (z * y_m);
	}
	return y_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	tmp = 0
	if (z * z) <= 50000000000000.0:
		tmp = (1.0 / x_m) / (y_m * (1.0 + (z * z)))
	elif (z * z) <= 1e+295:
		tmp = 1.0 / (y_m * (x_m * (z * z)))
	else:
		tmp = (1.0 / (x_m * z)) / (z * y_m)
	return y_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0
	if (Float64(z * z) <= 50000000000000.0)
		tmp = Float64(Float64(1.0 / x_m) / Float64(y_m * Float64(1.0 + Float64(z * z))));
	elseif (Float64(z * z) <= 1e+295)
		tmp = Float64(1.0 / Float64(y_m * Float64(x_m * Float64(z * z))));
	else
		tmp = Float64(Float64(1.0 / Float64(x_m * z)) / Float64(z * y_m));
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0;
	if ((z * z) <= 50000000000000.0)
		tmp = (1.0 / x_m) / (y_m * (1.0 + (z * z)));
	elseif ((z * z) <= 1e+295)
		tmp = 1.0 / (y_m * (x_m * (z * z)));
	else
		tmp = (1.0 / (x_m * z)) / (z * y_m);
	end
	tmp_2 = y_s * (x_s * tmp);
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[N[(z * z), $MachinePrecision], 50000000000000.0], N[(N[(1.0 / x$95$m), $MachinePrecision] / N[(y$95$m * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * z), $MachinePrecision], 1e+295], N[(1.0 / N[(y$95$m * N[(x$95$m * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(x$95$m * z), $MachinePrecision]), $MachinePrecision] / N[(z * y$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot z \leq 50000000000000:\\
\;\;\;\;\frac{\frac{1}{x\_m}}{y\_m \cdot \left(1 + z \cdot z\right)}\\

\mathbf{elif}\;z \cdot z \leq 10^{+295}:\\
\;\;\;\;\frac{1}{y\_m \cdot \left(x\_m \cdot \left(z \cdot z\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x\_m \cdot z}}{z \cdot y\_m}\\


\end{array}\right)
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 z z) < 5e13

    1. Initial program 99.7%

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

    if 5e13 < (*.f64 z z) < 9.9999999999999998e294

    1. Initial program 87.0%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/85.8%

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

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

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

        \[\leadsto \frac{1}{-\color{blue}{\left(-\left(y \cdot \left(1 + z \cdot z\right)\right) \cdot x\right)}} \]
      5. remove-double-neg85.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\left(y \cdot {z}^{2}\right) \cdot x}} \]
      2. associate-*r*91.2%

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\left(z \cdot z\right)} \cdot \left(x \cdot y\right)} \]
    9. Applied egg-rr91.2%

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

    if 9.9999999999999998e294 < (*.f64 z z)

    1. Initial program 70.7%

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

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

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

        \[\leadsto \frac{\frac{1}{x}}{\color{blue}{\left(-y\right) \cdot \left(-\left(1 + z \cdot z\right)\right)}} \]
      4. associate-/r*70.2%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{-y}}{-\left(1 + z \cdot z\right)}} \]
      5. associate-/l/70.2%

        \[\leadsto \frac{\color{blue}{\frac{1}{\left(-y\right) \cdot x}}}{-\left(1 + z \cdot z\right)} \]
      6. associate-/l/70.2%

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\left(\color{blue}{z \cdot z} + 1\right) \cdot \left(y \cdot x\right)} \]
      14. fma-define70.2%

        \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(z, z, 1\right)} \cdot \left(y \cdot x\right)} \]
      15. *-commutative70.2%

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

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

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

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

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

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

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

        \[\leadsto {\left(z \cdot \color{blue}{\left(\left(x \cdot y\right) \cdot z\right)}\right)}^{-1} \]
      4. unpow-prod-down85.1%

        \[\leadsto \color{blue}{{z}^{-1} \cdot {\left(\left(x \cdot y\right) \cdot z\right)}^{-1}} \]
      5. inv-pow85.1%

        \[\leadsto {z}^{-1} \cdot \color{blue}{\frac{1}{\left(x \cdot y\right) \cdot z}} \]
      6. pow185.1%

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

        \[\leadsto {z}^{-1} \cdot \frac{1}{\color{blue}{\left(x \cdot y\right) \cdot z}} \]
      8. associate-*l*98.2%

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

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

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

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

        \[\leadsto \frac{\color{blue}{{z}^{-1}}}{x \cdot \left(z \cdot y\right)} \]
      3. associate-/r*99.4%

        \[\leadsto \color{blue}{\frac{\frac{{z}^{-1}}{x}}{z \cdot y}} \]
      4. unpow-199.4%

        \[\leadsto \frac{\frac{\color{blue}{\frac{1}{z}}}{x}}{z \cdot y} \]
      5. associate-/r*99.5%

        \[\leadsto \frac{\color{blue}{\frac{1}{z \cdot x}}}{z \cdot y} \]
      6. *-commutative99.5%

        \[\leadsto \frac{\frac{1}{\color{blue}{x \cdot z}}}{z \cdot y} \]
      7. *-commutative99.5%

        \[\leadsto \frac{\frac{1}{x \cdot z}}{\color{blue}{y \cdot z}} \]
    11. Simplified99.5%

      \[\leadsto \color{blue}{\frac{\frac{1}{x \cdot z}}{y \cdot z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification97.9%

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

Alternative 7: 98.2% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z \cdot z \leq 0.005:\\ \;\;\;\;\frac{\frac{1}{y\_m}}{x\_m}\\ \mathbf{elif}\;z \cdot z \leq 10^{+295}:\\ \;\;\;\;\frac{1}{y\_m \cdot \left(x\_m \cdot \left(z \cdot z\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{x\_m \cdot z}}{z \cdot y\_m}\\ \end{array}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (*
  y_s
  (*
   x_s
   (if (<= (* z z) 0.005)
     (/ (/ 1.0 y_m) x_m)
     (if (<= (* z z) 1e+295)
       (/ 1.0 (* y_m (* x_m (* z z))))
       (/ (/ 1.0 (* x_m z)) (* z y_m)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z * z) <= 0.005) {
		tmp = (1.0 / y_m) / x_m;
	} else if ((z * z) <= 1e+295) {
		tmp = 1.0 / (y_m * (x_m * (z * z)));
	} else {
		tmp = (1.0 / (x_m * z)) / (z * y_m);
	}
	return y_s * (x_s * tmp);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z * z) <= 0.005d0) then
        tmp = (1.0d0 / y_m) / x_m
    else if ((z * z) <= 1d+295) then
        tmp = 1.0d0 / (y_m * (x_m * (z * z)))
    else
        tmp = (1.0d0 / (x_m * z)) / (z * y_m)
    end if
    code = y_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z * z) <= 0.005) {
		tmp = (1.0 / y_m) / x_m;
	} else if ((z * z) <= 1e+295) {
		tmp = 1.0 / (y_m * (x_m * (z * z)));
	} else {
		tmp = (1.0 / (x_m * z)) / (z * y_m);
	}
	return y_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	tmp = 0
	if (z * z) <= 0.005:
		tmp = (1.0 / y_m) / x_m
	elif (z * z) <= 1e+295:
		tmp = 1.0 / (y_m * (x_m * (z * z)))
	else:
		tmp = (1.0 / (x_m * z)) / (z * y_m)
	return y_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0
	if (Float64(z * z) <= 0.005)
		tmp = Float64(Float64(1.0 / y_m) / x_m);
	elseif (Float64(z * z) <= 1e+295)
		tmp = Float64(1.0 / Float64(y_m * Float64(x_m * Float64(z * z))));
	else
		tmp = Float64(Float64(1.0 / Float64(x_m * z)) / Float64(z * y_m));
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0;
	if ((z * z) <= 0.005)
		tmp = (1.0 / y_m) / x_m;
	elseif ((z * z) <= 1e+295)
		tmp = 1.0 / (y_m * (x_m * (z * z)));
	else
		tmp = (1.0 / (x_m * z)) / (z * y_m);
	end
	tmp_2 = y_s * (x_s * tmp);
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[N[(z * z), $MachinePrecision], 0.005], N[(N[(1.0 / y$95$m), $MachinePrecision] / x$95$m), $MachinePrecision], If[LessEqual[N[(z * z), $MachinePrecision], 1e+295], N[(1.0 / N[(y$95$m * N[(x$95$m * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(x$95$m * z), $MachinePrecision]), $MachinePrecision] / N[(z * y$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot z \leq 0.005:\\
\;\;\;\;\frac{\frac{1}{y\_m}}{x\_m}\\

\mathbf{elif}\;z \cdot z \leq 10^{+295}:\\
\;\;\;\;\frac{1}{y\_m \cdot \left(x\_m \cdot \left(z \cdot z\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x\_m \cdot z}}{z \cdot y\_m}\\


\end{array}\right)
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 z z) < 0.0050000000000000001

    1. Initial program 99.7%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/99.3%

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

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

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

        \[\leadsto \frac{1}{-\color{blue}{\left(-\left(y \cdot \left(1 + z \cdot z\right)\right) \cdot x\right)}} \]
      5. remove-double-neg99.3%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{y \cdot \color{blue}{\left(\mathsf{fma}\left(z, z, 1\right) \cdot x\right)}} \]
      2. associate-*r*99.3%

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

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

        \[\leadsto \frac{1}{\left(y \cdot \color{blue}{\left(1 + z \cdot z\right)}\right) \cdot x} \]
      5. associate-/l/99.7%

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

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}}} \]
      7. sqrt-div26.3%

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

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

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

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

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{y \cdot \color{blue}{\left(z \cdot z + 1\right)}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      12. fma-undefine26.3%

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{y \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      13. *-commutative26.3%

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

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

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{\color{blue}{z \cdot z + 1}} \cdot \sqrt{y}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      16. +-commutative26.3%

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + z \cdot z}} \cdot \sqrt{y}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      17. hypot-1-def26.3%

        \[\leadsto \frac{{x}^{-0.5}}{\color{blue}{\mathsf{hypot}\left(1, z\right)} \cdot \sqrt{y}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      18. sqrt-div26.2%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{x}^{-0.5} \cdot {x}^{-0.5}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right)}} \]
      3. pow-prod-up46.0%

        \[\leadsto \frac{\color{blue}{{x}^{\left(-0.5 + -0.5\right)}}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right)} \]
      4. metadata-eval46.0%

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

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

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

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

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

        \[\leadsto \frac{\frac{{x}^{\color{blue}{-1}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}} \]
      10. inv-pow46.0%

        \[\leadsto \frac{\frac{\color{blue}{\frac{1}{x}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}} \]
    10. Applied egg-rr46.0%

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right)}}{\sqrt{y}}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}} \]
      2. associate-/l/46.0%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right)}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \sqrt{y}}} \]
      3. div-inv46.0%

        \[\leadsto \frac{\color{blue}{\frac{1}{x} \cdot \frac{1}{\mathsf{hypot}\left(1, z\right)}}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \sqrt{y}} \]
      4. associate-*r*46.0%

        \[\leadsto \frac{\frac{1}{x} \cdot \frac{1}{\mathsf{hypot}\left(1, z\right)}}{\color{blue}{\mathsf{hypot}\left(1, z\right) \cdot \left(\sqrt{y} \cdot \sqrt{y}\right)}} \]
      5. add-sqr-sqrt99.7%

        \[\leadsto \frac{\frac{1}{x} \cdot \frac{1}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right) \cdot \color{blue}{y}} \]
      6. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right) \cdot y} \cdot \frac{1}{\mathsf{hypot}\left(1, z\right)}} \]
      7. associate-/l/99.7%

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{1}{x}}{y}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}} \]
      9. associate-/l/99.7%

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

        \[\leadsto \frac{\color{blue}{\frac{1}{x} \cdot \frac{1}{y}}}{\mathsf{hypot}\left(1, z\right) \cdot \mathsf{hypot}\left(1, z\right)} \]
      11. times-frac99.5%

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right)} \cdot \frac{\frac{1}{y}}{\mathsf{hypot}\left(1, z\right)}} \]
      12. associate-/l/99.5%

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

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

      \[\leadsto \color{blue}{\frac{1}{x \cdot y}} \]
    14. Step-by-step derivation
      1. associate-/l/98.7%

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x}} \]
    15. Simplified98.7%

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

    if 0.0050000000000000001 < (*.f64 z z) < 9.9999999999999998e294

    1. Initial program 87.7%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/86.6%

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

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

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

        \[\leadsto \frac{1}{-\color{blue}{\left(-\left(y \cdot \left(1 + z \cdot z\right)\right) \cdot x\right)}} \]
      5. remove-double-neg86.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\left(y \cdot {z}^{2}\right) \cdot x}} \]
      2. associate-*r*90.4%

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

        \[\leadsto \frac{1}{y \cdot \color{blue}{\left(x \cdot {z}^{2}\right)}} \]
    7. Simplified90.4%

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

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

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

    if 9.9999999999999998e294 < (*.f64 z z)

    1. Initial program 70.7%

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

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

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

        \[\leadsto \frac{\frac{1}{x}}{\color{blue}{\left(-y\right) \cdot \left(-\left(1 + z \cdot z\right)\right)}} \]
      4. associate-/r*70.2%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{-y}}{-\left(1 + z \cdot z\right)}} \]
      5. associate-/l/70.2%

        \[\leadsto \frac{\color{blue}{\frac{1}{\left(-y\right) \cdot x}}}{-\left(1 + z \cdot z\right)} \]
      6. associate-/l/70.2%

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\left(\color{blue}{z \cdot z} + 1\right) \cdot \left(y \cdot x\right)} \]
      14. fma-define70.2%

        \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(z, z, 1\right)} \cdot \left(y \cdot x\right)} \]
      15. *-commutative70.2%

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

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

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

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

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

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

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

        \[\leadsto {\left(z \cdot \color{blue}{\left(\left(x \cdot y\right) \cdot z\right)}\right)}^{-1} \]
      4. unpow-prod-down85.1%

        \[\leadsto \color{blue}{{z}^{-1} \cdot {\left(\left(x \cdot y\right) \cdot z\right)}^{-1}} \]
      5. inv-pow85.1%

        \[\leadsto {z}^{-1} \cdot \color{blue}{\frac{1}{\left(x \cdot y\right) \cdot z}} \]
      6. pow185.1%

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

        \[\leadsto {z}^{-1} \cdot \frac{1}{\color{blue}{\left(x \cdot y\right) \cdot z}} \]
      8. associate-*l*98.2%

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

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

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

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

        \[\leadsto \frac{\color{blue}{{z}^{-1}}}{x \cdot \left(z \cdot y\right)} \]
      3. associate-/r*99.4%

        \[\leadsto \color{blue}{\frac{\frac{{z}^{-1}}{x}}{z \cdot y}} \]
      4. unpow-199.4%

        \[\leadsto \frac{\frac{\color{blue}{\frac{1}{z}}}{x}}{z \cdot y} \]
      5. associate-/r*99.5%

        \[\leadsto \frac{\color{blue}{\frac{1}{z \cdot x}}}{z \cdot y} \]
      6. *-commutative99.5%

        \[\leadsto \frac{\frac{1}{\color{blue}{x \cdot z}}}{z \cdot y} \]
      7. *-commutative99.5%

        \[\leadsto \frac{\frac{1}{x \cdot z}}{\color{blue}{y \cdot z}} \]
    11. Simplified99.5%

      \[\leadsto \color{blue}{\frac{\frac{1}{x \cdot z}}{y \cdot z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification97.1%

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

Alternative 8: 91.5% accurate, 0.7× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z \cdot z \leq 0.005:\\ \;\;\;\;\frac{\frac{1}{y\_m}}{x\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y\_m \cdot \left(x\_m \cdot \left(z \cdot z\right)\right)}\\ \end{array}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (*
  y_s
  (*
   x_s
   (if (<= (* z z) 0.005)
     (/ (/ 1.0 y_m) x_m)
     (/ 1.0 (* y_m (* x_m (* z z))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z * z) <= 0.005) {
		tmp = (1.0 / y_m) / x_m;
	} else {
		tmp = 1.0 / (y_m * (x_m * (z * z)));
	}
	return y_s * (x_s * tmp);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z * z) <= 0.005d0) then
        tmp = (1.0d0 / y_m) / x_m
    else
        tmp = 1.0d0 / (y_m * (x_m * (z * z)))
    end if
    code = y_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z * z) <= 0.005) {
		tmp = (1.0 / y_m) / x_m;
	} else {
		tmp = 1.0 / (y_m * (x_m * (z * z)));
	}
	return y_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	tmp = 0
	if (z * z) <= 0.005:
		tmp = (1.0 / y_m) / x_m
	else:
		tmp = 1.0 / (y_m * (x_m * (z * z)))
	return y_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0
	if (Float64(z * z) <= 0.005)
		tmp = Float64(Float64(1.0 / y_m) / x_m);
	else
		tmp = Float64(1.0 / Float64(y_m * Float64(x_m * Float64(z * z))));
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0;
	if ((z * z) <= 0.005)
		tmp = (1.0 / y_m) / x_m;
	else
		tmp = 1.0 / (y_m * (x_m * (z * z)));
	end
	tmp_2 = y_s * (x_s * tmp);
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[N[(z * z), $MachinePrecision], 0.005], N[(N[(1.0 / y$95$m), $MachinePrecision] / x$95$m), $MachinePrecision], N[(1.0 / N[(y$95$m * N[(x$95$m * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot z \leq 0.005:\\
\;\;\;\;\frac{\frac{1}{y\_m}}{x\_m}\\

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


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z z) < 0.0050000000000000001

    1. Initial program 99.7%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/99.3%

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

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

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

        \[\leadsto \frac{1}{-\color{blue}{\left(-\left(y \cdot \left(1 + z \cdot z\right)\right) \cdot x\right)}} \]
      5. remove-double-neg99.3%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{y \cdot \color{blue}{\left(\mathsf{fma}\left(z, z, 1\right) \cdot x\right)}} \]
      2. associate-*r*99.3%

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

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

        \[\leadsto \frac{1}{\left(y \cdot \color{blue}{\left(1 + z \cdot z\right)}\right) \cdot x} \]
      5. associate-/l/99.7%

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

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}}} \]
      7. sqrt-div26.3%

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

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

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

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

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{y \cdot \color{blue}{\left(z \cdot z + 1\right)}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      12. fma-undefine26.3%

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{y \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      13. *-commutative26.3%

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

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

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{\color{blue}{z \cdot z + 1}} \cdot \sqrt{y}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      16. +-commutative26.3%

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{\color{blue}{1 + z \cdot z}} \cdot \sqrt{y}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      17. hypot-1-def26.3%

        \[\leadsto \frac{{x}^{-0.5}}{\color{blue}{\mathsf{hypot}\left(1, z\right)} \cdot \sqrt{y}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      18. sqrt-div26.2%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{x}^{-0.5} \cdot {x}^{-0.5}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right)}} \]
      3. pow-prod-up46.0%

        \[\leadsto \frac{\color{blue}{{x}^{\left(-0.5 + -0.5\right)}}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right)} \]
      4. metadata-eval46.0%

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

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

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

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

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

        \[\leadsto \frac{\frac{{x}^{\color{blue}{-1}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}} \]
      10. inv-pow46.0%

        \[\leadsto \frac{\frac{\color{blue}{\frac{1}{x}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}} \]
    10. Applied egg-rr46.0%

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right)}}{\sqrt{y}}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}} \]
      2. associate-/l/46.0%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right)}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \sqrt{y}}} \]
      3. div-inv46.0%

        \[\leadsto \frac{\color{blue}{\frac{1}{x} \cdot \frac{1}{\mathsf{hypot}\left(1, z\right)}}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \sqrt{y}} \]
      4. associate-*r*46.0%

        \[\leadsto \frac{\frac{1}{x} \cdot \frac{1}{\mathsf{hypot}\left(1, z\right)}}{\color{blue}{\mathsf{hypot}\left(1, z\right) \cdot \left(\sqrt{y} \cdot \sqrt{y}\right)}} \]
      5. add-sqr-sqrt99.7%

        \[\leadsto \frac{\frac{1}{x} \cdot \frac{1}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right) \cdot \color{blue}{y}} \]
      6. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right) \cdot y} \cdot \frac{1}{\mathsf{hypot}\left(1, z\right)}} \]
      7. associate-/l/99.7%

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{1}{x}}{y}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}} \]
      9. associate-/l/99.7%

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

        \[\leadsto \frac{\color{blue}{\frac{1}{x} \cdot \frac{1}{y}}}{\mathsf{hypot}\left(1, z\right) \cdot \mathsf{hypot}\left(1, z\right)} \]
      11. times-frac99.5%

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right)} \cdot \frac{\frac{1}{y}}{\mathsf{hypot}\left(1, z\right)}} \]
      12. associate-/l/99.5%

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

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

      \[\leadsto \color{blue}{\frac{1}{x \cdot y}} \]
    14. Step-by-step derivation
      1. associate-/l/98.7%

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x}} \]
    15. Simplified98.7%

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

    if 0.0050000000000000001 < (*.f64 z z)

    1. Initial program 77.8%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/77.3%

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

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

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

        \[\leadsto \frac{1}{-\color{blue}{\left(-\left(y \cdot \left(1 + z \cdot z\right)\right) \cdot x\right)}} \]
      5. remove-double-neg77.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\left(y \cdot {z}^{2}\right) \cdot x}} \]
      2. associate-*r*78.9%

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

        \[\leadsto \frac{1}{y \cdot \color{blue}{\left(x \cdot {z}^{2}\right)}} \]
    7. Simplified78.9%

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

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

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

Alternative 9: 66.3% accurate, 0.9× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq 1:\\ \;\;\;\;\frac{\frac{1}{y\_m}}{x\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x\_m \cdot \left(z \cdot y\_m\right)}\\ \end{array}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (* y_s (* x_s (if (<= z 1.0) (/ (/ 1.0 y_m) x_m) (/ 1.0 (* x_m (* z y_m)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if (z <= 1.0) {
		tmp = (1.0 / y_m) / x_m;
	} else {
		tmp = 1.0 / (x_m * (z * y_m));
	}
	return y_s * (x_s * tmp);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z <= 1.0d0) then
        tmp = (1.0d0 / y_m) / x_m
    else
        tmp = 1.0d0 / (x_m * (z * y_m))
    end if
    code = y_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if (z <= 1.0) {
		tmp = (1.0 / y_m) / x_m;
	} else {
		tmp = 1.0 / (x_m * (z * y_m));
	}
	return y_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	tmp = 0
	if z <= 1.0:
		tmp = (1.0 / y_m) / x_m
	else:
		tmp = 1.0 / (x_m * (z * y_m))
	return y_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0
	if (z <= 1.0)
		tmp = Float64(Float64(1.0 / y_m) / x_m);
	else
		tmp = Float64(1.0 / Float64(x_m * Float64(z * y_m)));
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0;
	if (z <= 1.0)
		tmp = (1.0 / y_m) / x_m;
	else
		tmp = 1.0 / (x_m * (z * y_m));
	end
	tmp_2 = y_s * (x_s * tmp);
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[z, 1.0], N[(N[(1.0 / y$95$m), $MachinePrecision] / x$95$m), $MachinePrecision], N[(1.0 / N[(x$95$m * N[(z * y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 1:\\
\;\;\;\;\frac{\frac{1}{y\_m}}{x\_m}\\

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


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1

    1. Initial program 90.9%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/90.3%

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

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

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

        \[\leadsto \frac{1}{-\color{blue}{\left(-\left(y \cdot \left(1 + z \cdot z\right)\right) \cdot x\right)}} \]
      5. remove-double-neg90.3%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{y \cdot \color{blue}{\left(\mathsf{fma}\left(z, z, 1\right) \cdot x\right)}} \]
      2. associate-*r*90.3%

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

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

        \[\leadsto \frac{1}{\left(y \cdot \color{blue}{\left(1 + z \cdot z\right)}\right) \cdot x} \]
      5. associate-/l/90.9%

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

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

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

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

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

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

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{y \cdot \color{blue}{\left(z \cdot z + 1\right)}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      12. fma-undefine24.0%

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{y \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      13. *-commutative24.0%

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{\color{blue}{\mathsf{fma}\left(z, z, 1\right) \cdot y}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      14. sqrt-prod24.0%

        \[\leadsto \frac{{x}^{-0.5}}{\color{blue}{\sqrt{\mathsf{fma}\left(z, z, 1\right)} \cdot \sqrt{y}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      15. fma-undefine24.0%

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

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

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

        \[\leadsto \frac{{x}^{-0.5}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}} \cdot \color{blue}{\frac{\sqrt{\frac{1}{x}}}{\sqrt{y \cdot \left(1 + z \cdot z\right)}}} \]
    6. Applied egg-rr25.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{{x}^{-0.5} \cdot {x}^{-0.5}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right)}} \]
      3. pow-prod-up44.4%

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

        \[\leadsto \frac{{x}^{\color{blue}{-1}}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right)} \]
      5. metadata-eval44.4%

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

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

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

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

        \[\leadsto \frac{\frac{{x}^{\color{blue}{-1}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}} \]
      10. inv-pow45.9%

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right)}}{\sqrt{y}}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}} \]
      2. associate-/l/45.4%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right)}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \sqrt{y}}} \]
      3. div-inv45.4%

        \[\leadsto \frac{\color{blue}{\frac{1}{x} \cdot \frac{1}{\mathsf{hypot}\left(1, z\right)}}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \sqrt{y}} \]
      4. associate-*r*45.4%

        \[\leadsto \frac{\frac{1}{x} \cdot \frac{1}{\mathsf{hypot}\left(1, z\right)}}{\color{blue}{\mathsf{hypot}\left(1, z\right) \cdot \left(\sqrt{y} \cdot \sqrt{y}\right)}} \]
      5. add-sqr-sqrt97.6%

        \[\leadsto \frac{\frac{1}{x} \cdot \frac{1}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right) \cdot \color{blue}{y}} \]
      6. associate-*l/97.6%

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right) \cdot y} \cdot \frac{1}{\mathsf{hypot}\left(1, z\right)}} \]
      7. associate-/l/95.5%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{y}}{\mathsf{hypot}\left(1, z\right)}} \cdot \frac{1}{\mathsf{hypot}\left(1, z\right)} \]
      8. div-inv95.5%

        \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{1}{x}}{y}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}} \]
      9. associate-/l/92.8%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{y}}{\mathsf{hypot}\left(1, z\right) \cdot \mathsf{hypot}\left(1, z\right)}} \]
      10. div-inv92.7%

        \[\leadsto \frac{\color{blue}{\frac{1}{x} \cdot \frac{1}{y}}}{\mathsf{hypot}\left(1, z\right) \cdot \mathsf{hypot}\left(1, z\right)} \]
      11. times-frac97.5%

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right)} \cdot \frac{\frac{1}{y}}{\mathsf{hypot}\left(1, z\right)}} \]
      12. associate-/l/97.5%

        \[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(1, z\right) \cdot x}} \cdot \frac{\frac{1}{y}}{\mathsf{hypot}\left(1, z\right)} \]
    12. Applied egg-rr97.5%

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

      \[\leadsto \color{blue}{\frac{1}{x \cdot y}} \]
    14. Step-by-step derivation
      1. associate-/l/70.6%

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x}} \]
    15. Simplified70.6%

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

    if 1 < z

    1. Initial program 81.0%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/81.0%

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

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

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

        \[\leadsto \frac{1}{-\color{blue}{\left(-\left(y \cdot \left(1 + z \cdot z\right)\right) \cdot x\right)}} \]
      5. remove-double-neg81.0%

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

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

        \[\leadsto \frac{1}{y \cdot \color{blue}{\left(x \cdot \left(1 + z \cdot z\right)\right)}} \]
      8. sqr-neg79.8%

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

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

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

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

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

        \[\leadsto \frac{1}{y \cdot \color{blue}{\left(\mathsf{fma}\left(z, z, 1\right) \cdot x\right)}} \]
      2. associate-*r*81.0%

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

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

        \[\leadsto \frac{1}{\left(y \cdot \color{blue}{\left(1 + z \cdot z\right)}\right) \cdot x} \]
      5. associate-/l/81.0%

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

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

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

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

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

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

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{y \cdot \color{blue}{\left(z \cdot z + 1\right)}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      12. fma-undefine19.6%

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{y \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      13. *-commutative19.6%

        \[\leadsto \frac{{x}^{-0.5}}{\sqrt{\color{blue}{\mathsf{fma}\left(z, z, 1\right) \cdot y}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      14. sqrt-prod19.6%

        \[\leadsto \frac{{x}^{-0.5}}{\color{blue}{\sqrt{\mathsf{fma}\left(z, z, 1\right)} \cdot \sqrt{y}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      15. fma-undefine19.6%

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

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

        \[\leadsto \frac{{x}^{-0.5}}{\color{blue}{\mathsf{hypot}\left(1, z\right)} \cdot \sqrt{y}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      18. sqrt-div19.6%

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

      \[\leadsto \color{blue}{\frac{{x}^{-0.5}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}} \cdot \frac{{x}^{-0.5}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}}} \]
    7. Step-by-step derivation
      1. unpow223.4%

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

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

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

        \[\leadsto {\left(\frac{\color{blue}{\sqrt{{x}^{-1}}}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}}\right)}^{2} \]
      3. metadata-eval23.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{{x}^{-2}}}{y \cdot \left(1 + z \cdot z\right)}} \cdot \sqrt{\frac{\sqrt{{x}^{-2}}}{y \cdot \left(1 + z \cdot z\right)}}} \]
      10. add-sqr-sqrt55.3%

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

        \[\leadsto \color{blue}{\frac{\frac{\sqrt{{x}^{-2}}}{y}}{1 + z \cdot z}} \]
      12. sqrt-pow182.0%

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

        \[\leadsto \frac{\frac{{x}^{\color{blue}{-1}}}{y}}{1 + z \cdot z} \]
      14. inv-pow82.0%

        \[\leadsto \frac{\frac{\color{blue}{\frac{1}{x}}}{y}}{1 + z \cdot z} \]
      15. associate-/l/82.0%

        \[\leadsto \frac{\color{blue}{\frac{1}{y \cdot x}}}{1 + z \cdot z} \]
      16. add-sqr-sqrt82.0%

        \[\leadsto \frac{\frac{1}{y \cdot x}}{\color{blue}{\sqrt{1 + z \cdot z} \cdot \sqrt{1 + z \cdot z}}} \]
      17. hypot-1-def82.0%

        \[\leadsto \frac{\frac{1}{y \cdot x}}{\color{blue}{\mathsf{hypot}\left(1, z\right)} \cdot \sqrt{1 + z \cdot z}} \]
      18. hypot-1-def82.0%

        \[\leadsto \frac{\frac{1}{y \cdot x}}{\mathsf{hypot}\left(1, z\right) \cdot \color{blue}{\mathsf{hypot}\left(1, z\right)}} \]
      19. associate-/r*91.7%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y \cdot x}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}} \]
    10. Applied egg-rr91.7%

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

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

        \[\leadsto \frac{\frac{1}{\color{blue}{\left(x \cdot y\right) \cdot z}}}{\mathsf{hypot}\left(1, z\right)} \]
    13. Simplified90.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 1:\\ \;\;\;\;\frac{\frac{1}{y}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot \left(z \cdot y\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 58.9% accurate, 2.2× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ y\_s \cdot \left(x\_s \cdot \frac{1}{x\_m \cdot y\_m}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (* y_s (* x_s (/ 1.0 (* x_m y_m)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * (1.0 / (x_m * y_m)));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    code = y_s * (x_s * (1.0d0 / (x_m * y_m)))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * (1.0 / (x_m * y_m)));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	return y_s * (x_s * (1.0 / (x_m * y_m)))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	return Float64(y_s * Float64(x_s * Float64(1.0 / Float64(x_m * y_m))))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp = code(y_s, x_s, x_m, y_m, z)
	tmp = y_s * (x_s * (1.0 / (x_m * y_m)));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[(1.0 / N[(x$95$m * y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y\_s \cdot \left(x\_s \cdot \frac{1}{x\_m \cdot y\_m}\right)
\end{array}
Derivation
  1. Initial program 88.1%

    \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
  2. Step-by-step derivation
    1. associate-/l/87.7%

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

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

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

      \[\leadsto \frac{1}{-\color{blue}{\left(-\left(y \cdot \left(1 + z \cdot z\right)\right) \cdot x\right)}} \]
    5. remove-double-neg87.7%

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

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

      \[\leadsto \frac{1}{y \cdot \color{blue}{\left(x \cdot \left(1 + z \cdot z\right)\right)}} \]
    8. sqr-neg88.8%

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

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

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

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

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

    \[\leadsto \frac{1}{y \cdot \color{blue}{x}} \]
  6. Final simplification55.6%

    \[\leadsto \frac{1}{x \cdot y} \]
  7. Add Preprocessing

Developer Target 1: 92.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 + z \cdot z\\ t_1 := y \cdot t\_0\\ t_2 := \frac{\frac{1}{y}}{t\_0 \cdot x}\\ \mathbf{if}\;t\_1 < -\infty:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 < 8.680743250567252 \cdot 10^{+305}:\\ \;\;\;\;\frac{\frac{1}{x}}{t\_0 \cdot y}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ 1.0 (* z z))) (t_1 (* y t_0)) (t_2 (/ (/ 1.0 y) (* t_0 x))))
   (if (< t_1 (- INFINITY))
     t_2
     (if (< t_1 8.680743250567252e+305) (/ (/ 1.0 x) (* t_0 y)) t_2))))
double code(double x, double y, double z) {
	double t_0 = 1.0 + (z * z);
	double t_1 = y * t_0;
	double t_2 = (1.0 / y) / (t_0 * x);
	double tmp;
	if (t_1 < -((double) INFINITY)) {
		tmp = t_2;
	} else if (t_1 < 8.680743250567252e+305) {
		tmp = (1.0 / x) / (t_0 * y);
	} else {
		tmp = t_2;
	}
	return tmp;
}
public static double code(double x, double y, double z) {
	double t_0 = 1.0 + (z * z);
	double t_1 = y * t_0;
	double t_2 = (1.0 / y) / (t_0 * x);
	double tmp;
	if (t_1 < -Double.POSITIVE_INFINITY) {
		tmp = t_2;
	} else if (t_1 < 8.680743250567252e+305) {
		tmp = (1.0 / x) / (t_0 * y);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 1.0 + (z * z)
	t_1 = y * t_0
	t_2 = (1.0 / y) / (t_0 * x)
	tmp = 0
	if t_1 < -math.inf:
		tmp = t_2
	elif t_1 < 8.680743250567252e+305:
		tmp = (1.0 / x) / (t_0 * y)
	else:
		tmp = t_2
	return tmp
function code(x, y, z)
	t_0 = Float64(1.0 + Float64(z * z))
	t_1 = Float64(y * t_0)
	t_2 = Float64(Float64(1.0 / y) / Float64(t_0 * x))
	tmp = 0.0
	if (t_1 < Float64(-Inf))
		tmp = t_2;
	elseif (t_1 < 8.680743250567252e+305)
		tmp = Float64(Float64(1.0 / x) / Float64(t_0 * y));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 1.0 + (z * z);
	t_1 = y * t_0;
	t_2 = (1.0 / y) / (t_0 * x);
	tmp = 0.0;
	if (t_1 < -Inf)
		tmp = t_2;
	elseif (t_1 < 8.680743250567252e+305)
		tmp = (1.0 / x) / (t_0 * y);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / y), $MachinePrecision] / N[(t$95$0 * x), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$1, (-Infinity)], t$95$2, If[Less[t$95$1, 8.680743250567252e+305], N[(N[(1.0 / x), $MachinePrecision] / N[(t$95$0 * y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 1 + z \cdot z\\
t_1 := y \cdot t\_0\\
t_2 := \frac{\frac{1}{y}}{t\_0 \cdot x}\\
\mathbf{if}\;t\_1 < -\infty:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 < 8.680743250567252 \cdot 10^{+305}:\\
\;\;\;\;\frac{\frac{1}{x}}{t\_0 \cdot y}\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024130 
(FPCore (x y z)
  :name "Statistics.Distribution.CauchyLorentz:$cdensity from math-functions-0.1.5.2"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< (* y (+ 1 (* z z))) -inf.0) (/ (/ 1 y) (* (+ 1 (* z z)) x)) (if (< (* y (+ 1 (* z z))) 868074325056725200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (/ 1 x) (* (+ 1 (* z z)) y)) (/ (/ 1 y) (* (+ 1 (* z z)) x)))))

  (/ (/ 1.0 x) (* y (+ 1.0 (* z z)))))