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

Percentage Accurate: 89.0% → 99.2%
Time: 15.0s
Alternatives: 15
Speedup: 1.0×

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 15 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: 89.0% 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.2% accurate, 0.1× speedup?

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

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


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

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{y \cdot \left(x \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}\right)} \]
    3. Simplified91.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. fma-udef91.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999991e127 < z

    1. Initial program 65.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{y \cdot \left(x \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}\right)} \]
    3. Simplified67.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. fma-udef67.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{{x}^{-1}}}{\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-eval38.7%

        \[\leadsto \frac{{x}^{\color{blue}{\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)} \]
      5. pow-prod-up28.6%

        \[\leadsto \frac{\color{blue}{{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)} \]
      6. frac-times32.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. associate-/r*32.3%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\frac{{x}^{\color{blue}{-1}}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}}{y} \]
      5. unpow-186.4%

        \[\leadsto \frac{\frac{\frac{\color{blue}{\frac{1}{x}}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}}{y} \]
      6. *-rgt-identity86.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.3% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{y \cdot \left(x \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}\right)} \]
  3. Simplified87.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. fma-udef87.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.2% accurate, 0.0× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ 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_m] = \mathsf{sort}([x_m, y_m, z_m])\\ \\ y\_s \cdot \left(x\_s \cdot {\left(\frac{{x\_m}^{-0.5}}{\mathsf{hypot}\left(1, z\_m\right) \cdot \sqrt{y\_m}}\right)}^{2}\right) \end{array} \]
z_m = (fabs.f64 z)
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z_m should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z_m)
 :precision binary64
 (* y_s (* x_s (pow (/ (pow x_m -0.5) (* (hypot 1.0 z_m) (sqrt y_m))) 2.0))))
z_m = fabs(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_m);
double code(double y_s, double x_s, double x_m, double y_m, double z_m) {
	return y_s * (x_s * pow((pow(x_m, -0.5) / (hypot(1.0, z_m) * sqrt(y_m))), 2.0));
}
z_m = Math.abs(z);
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_m;
public static double code(double y_s, double x_s, double x_m, double y_m, double z_m) {
	return y_s * (x_s * Math.pow((Math.pow(x_m, -0.5) / (Math.hypot(1.0, z_m) * Math.sqrt(y_m))), 2.0));
}
z_m = math.fabs(z)
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_m] = sort([x_m, y_m, z_m])
def code(y_s, x_s, x_m, y_m, z_m):
	return y_s * (x_s * math.pow((math.pow(x_m, -0.5) / (math.hypot(1.0, z_m) * math.sqrt(y_m))), 2.0))
z_m = abs(z)
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_m = sort([x_m, y_m, z_m])
function code(y_s, x_s, x_m, y_m, z_m)
	return Float64(y_s * Float64(x_s * (Float64((x_m ^ -0.5) / Float64(hypot(1.0, z_m) * sqrt(y_m))) ^ 2.0)))
end
z_m = abs(z);
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_m = num2cell(sort([x_m, y_m, z_m])){:}
function tmp = code(y_s, x_s, x_m, y_m, z_m)
	tmp = y_s * (x_s * (((x_m ^ -0.5) / (hypot(1.0, z_m) * sqrt(y_m))) ^ 2.0));
end
z_m = N[Abs[z], $MachinePrecision]
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_m should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := 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$95$m ^ 2], $MachinePrecision] * N[Sqrt[y$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
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_m] = \mathsf{sort}([x_m, y_m, z_m])\\
\\
y\_s \cdot \left(x\_s \cdot {\left(\frac{{x\_m}^{-0.5}}{\mathsf{hypot}\left(1, z\_m\right) \cdot \sqrt{y\_m}}\right)}^{2}\right)
\end{array}
Derivation
  1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{y \cdot \left(x \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}\right)} \]
  3. Simplified87.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. fma-udef87.8%

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

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

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

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

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

      \[\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-div28.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-pow28.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-pow128.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-eval28.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. *-commutative28.3%

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

      \[\leadsto \frac{{x}^{-0.5}}{\color{blue}{\sqrt{1 + z \cdot z} \cdot \sqrt{y}}} \cdot \sqrt{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
    13. hypot-1-def28.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)}} \]
    14. sqrt-div28.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)}}} \]
    15. inv-pow28.2%

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

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

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

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

    \[\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. unpow231.7%

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

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

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

Alternative 4: 98.4% accurate, 0.1× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ 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_m] = \mathsf{sort}([x_m, y_m, z_m])\\ \\ y\_s \cdot \left(x\_s \cdot \left(\frac{1}{\mathsf{hypot}\left(1, z\_m\right)} \cdot \frac{1}{y\_m \cdot \left(\mathsf{hypot}\left(1, z\_m\right) \cdot x\_m\right)}\right)\right) \end{array} \]
z_m = (fabs.f64 z)
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z_m should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  y_s
  (* x_s (* (/ 1.0 (hypot 1.0 z_m)) (/ 1.0 (* y_m (* (hypot 1.0 z_m) x_m)))))))
z_m = fabs(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_m);
double code(double y_s, double x_s, double x_m, double y_m, double z_m) {
	return y_s * (x_s * ((1.0 / hypot(1.0, z_m)) * (1.0 / (y_m * (hypot(1.0, z_m) * x_m)))));
}
z_m = Math.abs(z);
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_m;
public static double code(double y_s, double x_s, double x_m, double y_m, double z_m) {
	return y_s * (x_s * ((1.0 / Math.hypot(1.0, z_m)) * (1.0 / (y_m * (Math.hypot(1.0, z_m) * x_m)))));
}
z_m = math.fabs(z)
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_m] = sort([x_m, y_m, z_m])
def code(y_s, x_s, x_m, y_m, z_m):
	return y_s * (x_s * ((1.0 / math.hypot(1.0, z_m)) * (1.0 / (y_m * (math.hypot(1.0, z_m) * x_m)))))
z_m = abs(z)
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_m = sort([x_m, y_m, z_m])
function code(y_s, x_s, x_m, y_m, z_m)
	return Float64(y_s * Float64(x_s * Float64(Float64(1.0 / hypot(1.0, z_m)) * Float64(1.0 / Float64(y_m * Float64(hypot(1.0, z_m) * x_m))))))
end
z_m = abs(z);
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_m = num2cell(sort([x_m, y_m, z_m])){:}
function tmp = code(y_s, x_s, x_m, y_m, z_m)
	tmp = y_s * (x_s * ((1.0 / hypot(1.0, z_m)) * (1.0 / (y_m * (hypot(1.0, z_m) * x_m)))));
end
z_m = N[Abs[z], $MachinePrecision]
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_m should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(y$95$s * N[(x$95$s * N[(N[(1.0 / N[Sqrt[1.0 ^ 2 + z$95$m ^ 2], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(y$95$m * N[(N[Sqrt[1.0 ^ 2 + z$95$m ^ 2], $MachinePrecision] * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
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_m] = \mathsf{sort}([x_m, y_m, z_m])\\
\\
y\_s \cdot \left(x\_s \cdot \left(\frac{1}{\mathsf{hypot}\left(1, z\_m\right)} \cdot \frac{1}{y\_m \cdot \left(\mathsf{hypot}\left(1, z\_m\right) \cdot x\_m\right)}\right)\right)
\end{array}
Derivation
  1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{y \cdot \left(x \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}\right)} \]
  3. Simplified87.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. fma-udef87.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{{x}^{-1}}}{\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-eval48.5%

      \[\leadsto \frac{{x}^{\color{blue}{\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)} \]
    5. pow-prod-up30.5%

      \[\leadsto \frac{\color{blue}{{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)} \]
    6. frac-times31.7%

      \[\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. associate-/r*31.7%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{\frac{{x}^{\color{blue}{-1}}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}}{y} \]
    5. unpow-193.2%

      \[\leadsto \frac{\frac{\frac{\color{blue}{\frac{1}{x}}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}}{y} \]
    6. *-rgt-identity93.2%

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{\frac{1}{\mathsf{hypot}\left(1, z\right)} \cdot 1}{\mathsf{hypot}\left(1, z\right) \cdot x}}}{y} \]
    11. *-rgt-identity93.2%

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

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

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

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

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

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

Alternative 5: 98.9% accurate, 0.1× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ 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_m] = \mathsf{sort}([x_m, y_m, z_m])\\ \\ y\_s \cdot \left(x\_s \cdot \frac{\frac{\frac{1}{\mathsf{hypot}\left(1, z\_m\right)}}{\mathsf{hypot}\left(1, z\_m\right) \cdot x\_m}}{y\_m}\right) \end{array} \]
z_m = (fabs.f64 z)
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z_m should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z_m)
 :precision binary64
 (* y_s (* x_s (/ (/ (/ 1.0 (hypot 1.0 z_m)) (* (hypot 1.0 z_m) x_m)) y_m))))
z_m = fabs(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_m);
double code(double y_s, double x_s, double x_m, double y_m, double z_m) {
	return y_s * (x_s * (((1.0 / hypot(1.0, z_m)) / (hypot(1.0, z_m) * x_m)) / y_m));
}
z_m = Math.abs(z);
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_m;
public static double code(double y_s, double x_s, double x_m, double y_m, double z_m) {
	return y_s * (x_s * (((1.0 / Math.hypot(1.0, z_m)) / (Math.hypot(1.0, z_m) * x_m)) / y_m));
}
z_m = math.fabs(z)
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_m] = sort([x_m, y_m, z_m])
def code(y_s, x_s, x_m, y_m, z_m):
	return y_s * (x_s * (((1.0 / math.hypot(1.0, z_m)) / (math.hypot(1.0, z_m) * x_m)) / y_m))
z_m = abs(z)
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_m = sort([x_m, y_m, z_m])
function code(y_s, x_s, x_m, y_m, z_m)
	return Float64(y_s * Float64(x_s * Float64(Float64(Float64(1.0 / hypot(1.0, z_m)) / Float64(hypot(1.0, z_m) * x_m)) / y_m)))
end
z_m = abs(z);
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_m = num2cell(sort([x_m, y_m, z_m])){:}
function tmp = code(y_s, x_s, x_m, y_m, z_m)
	tmp = y_s * (x_s * (((1.0 / hypot(1.0, z_m)) / (hypot(1.0, z_m) * x_m)) / y_m));
end
z_m = N[Abs[z], $MachinePrecision]
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_m should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(y$95$s * N[(x$95$s * N[(N[(N[(1.0 / N[Sqrt[1.0 ^ 2 + z$95$m ^ 2], $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[1.0 ^ 2 + z$95$m ^ 2], $MachinePrecision] * x$95$m), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
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_m] = \mathsf{sort}([x_m, y_m, z_m])\\
\\
y\_s \cdot \left(x\_s \cdot \frac{\frac{\frac{1}{\mathsf{hypot}\left(1, z\_m\right)}}{\mathsf{hypot}\left(1, z\_m\right) \cdot x\_m}}{y\_m}\right)
\end{array}
Derivation
  1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{y \cdot \left(x \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}\right)} \]
  3. Simplified87.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. fma-udef87.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{{x}^{-1}}}{\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-eval48.5%

      \[\leadsto \frac{{x}^{\color{blue}{\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)} \]
    5. pow-prod-up30.5%

      \[\leadsto \frac{\color{blue}{{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)} \]
    6. frac-times31.7%

      \[\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. associate-/r*31.7%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{\frac{{x}^{\color{blue}{-1}}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}}{y} \]
    5. unpow-193.2%

      \[\leadsto \frac{\frac{\frac{\color{blue}{\frac{1}{x}}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}}{y} \]
    6. *-rgt-identity93.2%

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{\frac{1}{\mathsf{hypot}\left(1, z\right)} \cdot 1}{\mathsf{hypot}\left(1, z\right) \cdot x}}}{y} \]
    11. *-rgt-identity93.2%

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

    \[\leadsto \color{blue}{\frac{\frac{\frac{1}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right) \cdot x}}{y}} \]
  11. Final simplification93.2%

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

Alternative 6: 98.5% accurate, 0.1× speedup?

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

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


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

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. fma-udef95.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000009e264 < (*.f64 z z)

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. fma-udef68.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{{x}^{-1}}}{\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.0%

        \[\leadsto \frac{{x}^{\color{blue}{\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)} \]
      5. pow-prod-up24.7%

        \[\leadsto \frac{\color{blue}{{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)} \]
      6. frac-times29.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. associate-/r*29.4%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\frac{{x}^{\color{blue}{-1}}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}}{y} \]
      5. unpow-187.1%

        \[\leadsto \frac{\frac{\frac{\color{blue}{\frac{1}{x}}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}}{y} \]
      6. *-rgt-identity87.1%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 98.6% accurate, 0.1× speedup?

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

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


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

    1. Initial program 99.6%

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

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

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

    if 1.00000000000000009e25 < (*.f64 z z)

    1. Initial program 79.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. fma-udef74.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{x}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right)}} \]
      2. *-un-lft-identity49.2%

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

        \[\leadsto \frac{\color{blue}{{x}^{-1}}}{\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-eval49.2%

        \[\leadsto \frac{{x}^{\color{blue}{\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)} \]
      5. pow-prod-up31.7%

        \[\leadsto \frac{\color{blue}{{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)} \]
      6. frac-times34.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. associate-/r*34.4%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\frac{{x}^{\color{blue}{-1}}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}}{y} \]
      5. unpow-186.0%

        \[\leadsto \frac{\frac{\frac{\color{blue}{\frac{1}{x}}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}}{y} \]
      6. *-rgt-identity86.0%

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

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

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

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

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

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

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

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

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

Alternative 8: 93.7% accurate, 0.1× speedup?

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

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


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

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000009e264 < (*.f64 z z)

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 94.7% accurate, 0.1× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ 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_m] = \mathsf{sort}([x_m, y_m, z_m])\\ \\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;y\_m \leq 6.6 \cdot 10^{+39}:\\ \;\;\;\;\frac{1}{x\_m \cdot \mathsf{fma}\left(z\_m \cdot y\_m, z\_m, y\_m\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{y\_m}}{x\_m \cdot \left(1 + {z\_m}^{2}\right)}\\ \end{array}\right) \end{array} \]
z_m = (fabs.f64 z)
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z_m should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  y_s
  (*
   x_s
   (if (<= y_m 6.6e+39)
     (/ 1.0 (* x_m (fma (* z_m y_m) z_m y_m)))
     (/ (/ 1.0 y_m) (* x_m (+ 1.0 (pow z_m 2.0))))))))
z_m = fabs(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_m);
double code(double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (y_m <= 6.6e+39) {
		tmp = 1.0 / (x_m * fma((z_m * y_m), z_m, y_m));
	} else {
		tmp = (1.0 / y_m) / (x_m * (1.0 + pow(z_m, 2.0)));
	}
	return y_s * (x_s * tmp);
}
z_m = abs(z)
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_m = sort([x_m, y_m, z_m])
function code(y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (y_m <= 6.6e+39)
		tmp = Float64(1.0 / Float64(x_m * fma(Float64(z_m * y_m), z_m, y_m)));
	else
		tmp = Float64(Float64(1.0 / y_m) / Float64(x_m * Float64(1.0 + (z_m ^ 2.0))));
	end
	return Float64(y_s * Float64(x_s * tmp))
end
z_m = N[Abs[z], $MachinePrecision]
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_m should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(y$95$s * N[(x$95$s * If[LessEqual[y$95$m, 6.6e+39], N[(1.0 / N[(x$95$m * N[(N[(z$95$m * y$95$m), $MachinePrecision] * z$95$m + y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y$95$m), $MachinePrecision] / N[(x$95$m * N[(1.0 + N[Power[z$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
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_m] = \mathsf{sort}([x_m, y_m, z_m])\\
\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 6.6 \cdot 10^{+39}:\\
\;\;\;\;\frac{1}{x\_m \cdot \mathsf{fma}\left(z\_m \cdot y\_m, z\_m, y\_m\right)}\\

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


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

    1. Initial program 87.9%

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

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

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

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

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

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

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

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

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

    if 6.60000000000000042e39 < y

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{y \cdot \left(x \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}\right)} \]
    3. Simplified97.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. fma-udef97.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{y \cdot \left({\left(\mathsf{hypot}\left(1, z\right)\right)}^{2} \cdot x\right)}} \]
      10. add-sqr-sqrt64.7%

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

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

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

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

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

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

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

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

Alternative 10: 92.4% accurate, 0.1× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ 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_m] = \mathsf{sort}([x_m, y_m, z_m])\\ \\ y\_s \cdot \left(x\_s \cdot \frac{1}{y\_m \cdot \left(x\_m \cdot \mathsf{fma}\left(z\_m, z\_m, 1\right)\right)}\right) \end{array} \]
z_m = (fabs.f64 z)
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z_m should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z_m)
 :precision binary64
 (* y_s (* x_s (/ 1.0 (* y_m (* x_m (fma z_m z_m 1.0)))))))
z_m = fabs(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_m);
double code(double y_s, double x_s, double x_m, double y_m, double z_m) {
	return y_s * (x_s * (1.0 / (y_m * (x_m * fma(z_m, z_m, 1.0)))));
}
z_m = abs(z)
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_m = sort([x_m, y_m, z_m])
function code(y_s, x_s, x_m, y_m, z_m)
	return Float64(y_s * Float64(x_s * Float64(1.0 / Float64(y_m * Float64(x_m * fma(z_m, z_m, 1.0))))))
end
z_m = N[Abs[z], $MachinePrecision]
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_m should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(y$95$s * N[(x$95$s * N[(1.0 / N[(y$95$m * N[(x$95$m * N[(z$95$m * z$95$m + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
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_m] = \mathsf{sort}([x_m, y_m, z_m])\\
\\
y\_s \cdot \left(x\_s \cdot \frac{1}{y\_m \cdot \left(x\_m \cdot \mathsf{fma}\left(z\_m, z\_m, 1\right)\right)}\right)
\end{array}
Derivation
  1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 92.6% accurate, 0.5× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ 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_m] = \mathsf{sort}([x_m, y_m, z_m])\\ \\ \begin{array}{l} t_0 := y\_m \cdot \left(1 + z\_m \cdot z\_m\right)\\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 10^{+307}:\\ \;\;\;\;\frac{\frac{1}{x\_m}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{x\_m}}{y\_m} \cdot \left(\frac{1}{z\_m} \cdot \frac{1}{z\_m}\right)\\ \end{array}\right) \end{array} \end{array} \]
z_m = (fabs.f64 z)
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z_m should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z_m)
 :precision binary64
 (let* ((t_0 (* y_m (+ 1.0 (* z_m z_m)))))
   (*
    y_s
    (*
     x_s
     (if (<= t_0 1e+307)
       (/ (/ 1.0 x_m) t_0)
       (* (/ (/ 1.0 x_m) y_m) (* (/ 1.0 z_m) (/ 1.0 z_m))))))))
z_m = fabs(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_m);
double code(double y_s, double x_s, double x_m, double y_m, double z_m) {
	double t_0 = y_m * (1.0 + (z_m * z_m));
	double tmp;
	if (t_0 <= 1e+307) {
		tmp = (1.0 / x_m) / t_0;
	} else {
		tmp = ((1.0 / x_m) / y_m) * ((1.0 / z_m) * (1.0 / z_m));
	}
	return y_s * (x_s * tmp);
}
z_m = abs(z)
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_m should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z_m)
    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_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = y_m * (1.0d0 + (z_m * z_m))
    if (t_0 <= 1d+307) then
        tmp = (1.0d0 / x_m) / t_0
    else
        tmp = ((1.0d0 / x_m) / y_m) * ((1.0d0 / z_m) * (1.0d0 / z_m))
    end if
    code = y_s * (x_s * tmp)
end function
z_m = Math.abs(z);
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_m;
public static double code(double y_s, double x_s, double x_m, double y_m, double z_m) {
	double t_0 = y_m * (1.0 + (z_m * z_m));
	double tmp;
	if (t_0 <= 1e+307) {
		tmp = (1.0 / x_m) / t_0;
	} else {
		tmp = ((1.0 / x_m) / y_m) * ((1.0 / z_m) * (1.0 / z_m));
	}
	return y_s * (x_s * tmp);
}
z_m = math.fabs(z)
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_m] = sort([x_m, y_m, z_m])
def code(y_s, x_s, x_m, y_m, z_m):
	t_0 = y_m * (1.0 + (z_m * z_m))
	tmp = 0
	if t_0 <= 1e+307:
		tmp = (1.0 / x_m) / t_0
	else:
		tmp = ((1.0 / x_m) / y_m) * ((1.0 / z_m) * (1.0 / z_m))
	return y_s * (x_s * tmp)
z_m = abs(z)
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_m = sort([x_m, y_m, z_m])
function code(y_s, x_s, x_m, y_m, z_m)
	t_0 = Float64(y_m * Float64(1.0 + Float64(z_m * z_m)))
	tmp = 0.0
	if (t_0 <= 1e+307)
		tmp = Float64(Float64(1.0 / x_m) / t_0);
	else
		tmp = Float64(Float64(Float64(1.0 / x_m) / y_m) * Float64(Float64(1.0 / z_m) * Float64(1.0 / z_m)));
	end
	return Float64(y_s * Float64(x_s * tmp))
end
z_m = abs(z);
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_m = num2cell(sort([x_m, y_m, z_m])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z_m)
	t_0 = y_m * (1.0 + (z_m * z_m));
	tmp = 0.0;
	if (t_0 <= 1e+307)
		tmp = (1.0 / x_m) / t_0;
	else
		tmp = ((1.0 / x_m) / y_m) * ((1.0 / z_m) * (1.0 / z_m));
	end
	tmp_2 = y_s * (x_s * tmp);
end
z_m = N[Abs[z], $MachinePrecision]
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_m should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := Block[{t$95$0 = N[(y$95$m * N[(1.0 + N[(z$95$m * z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * N[(x$95$s * If[LessEqual[t$95$0, 1e+307], N[(N[(1.0 / x$95$m), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[(1.0 / x$95$m), $MachinePrecision] / y$95$m), $MachinePrecision] * N[(N[(1.0 / z$95$m), $MachinePrecision] * N[(1.0 / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|
\\
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_m] = \mathsf{sort}([x_m, y_m, z_m])\\
\\
\begin{array}{l}
t_0 := y\_m \cdot \left(1 + z\_m \cdot z\_m\right)\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 10^{+307}:\\
\;\;\;\;\frac{\frac{1}{x\_m}}{t\_0}\\

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


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

    1. Initial program 94.8%

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

    if 9.99999999999999986e306 < (*.f64 y (+.f64 1 (*.f64 z z)))

    1. Initial program 63.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. fma-udef66.0%

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

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

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

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

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

        \[\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-div36.1%

        \[\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-pow36.1%

        \[\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-pow136.1%

        \[\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-eval36.1%

        \[\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. *-commutative36.1%

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

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

        \[\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)}} \]
      14. sqrt-div36.1%

        \[\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)}}} \]
      15. inv-pow36.1%

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

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

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

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

      \[\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. unpow258.3%

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

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

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

        \[\leadsto {\color{blue}{\left(\frac{\frac{{x}^{-0.5}}{\sqrt{y}}}{z}\right)}}^{2} \]
      2. div-inv58.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{x \cdot y}}}{z} \cdot \frac{\frac{1}{\sqrt{x \cdot y}}}{z}} \]
      2. div-inv48.8%

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

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

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

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

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

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

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

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

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

Alternative 12: 67.8% accurate, 0.9× speedup?

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

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


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

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.00121999999999999995 < z

    1. Initial program 79.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{y \cdot \left(x \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}\right)} \]
    3. Simplified73.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. fma-udef73.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{x}}{\left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right) \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\right)}} \]
      2. *-un-lft-identity46.2%

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

        \[\leadsto \frac{\color{blue}{{x}^{-1}}}{\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.2%

        \[\leadsto \frac{{x}^{\color{blue}{\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)} \]
      5. pow-prod-up37.3%

        \[\leadsto \frac{\color{blue}{{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)} \]
      6. frac-times39.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. associate-/r*39.5%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\frac{{x}^{\color{blue}{-1}}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}}{y} \]
      5. unpow-184.9%

        \[\leadsto \frac{\frac{\frac{\color{blue}{\frac{1}{x}}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}}{y} \]
      6. *-rgt-identity84.9%

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{\mathsf{hypot}\left(1, z\right)} \cdot 1}{\mathsf{hypot}\left(1, z\right) \cdot x}}}{y} \]
      11. *-rgt-identity84.9%

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

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

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

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

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

Alternative 13: 88.7% accurate, 1.0× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ 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_m] = \mathsf{sort}([x_m, y_m, z_m])\\ \\ y\_s \cdot \left(x\_s \cdot \frac{1}{x\_m \cdot \left(y\_m \cdot \left(1 + z\_m \cdot z\_m\right)\right)}\right) \end{array} \]
z_m = (fabs.f64 z)
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z_m should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z_m)
 :precision binary64
 (* y_s (* x_s (/ 1.0 (* x_m (* y_m (+ 1.0 (* z_m z_m))))))))
z_m = fabs(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_m);
double code(double y_s, double x_s, double x_m, double y_m, double z_m) {
	return y_s * (x_s * (1.0 / (x_m * (y_m * (1.0 + (z_m * z_m))))));
}
z_m = abs(z)
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_m should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z_m)
    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_m
    code = y_s * (x_s * (1.0d0 / (x_m * (y_m * (1.0d0 + (z_m * z_m))))))
end function
z_m = Math.abs(z);
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_m;
public static double code(double y_s, double x_s, double x_m, double y_m, double z_m) {
	return y_s * (x_s * (1.0 / (x_m * (y_m * (1.0 + (z_m * z_m))))));
}
z_m = math.fabs(z)
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_m] = sort([x_m, y_m, z_m])
def code(y_s, x_s, x_m, y_m, z_m):
	return y_s * (x_s * (1.0 / (x_m * (y_m * (1.0 + (z_m * z_m))))))
z_m = abs(z)
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_m = sort([x_m, y_m, z_m])
function code(y_s, x_s, x_m, y_m, z_m)
	return Float64(y_s * Float64(x_s * Float64(1.0 / Float64(x_m * Float64(y_m * Float64(1.0 + Float64(z_m * z_m)))))))
end
z_m = abs(z);
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_m = num2cell(sort([x_m, y_m, z_m])){:}
function tmp = code(y_s, x_s, x_m, y_m, z_m)
	tmp = y_s * (x_s * (1.0 / (x_m * (y_m * (1.0 + (z_m * z_m))))));
end
z_m = N[Abs[z], $MachinePrecision]
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_m should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(y$95$s * N[(x$95$s * N[(1.0 / N[(x$95$m * N[(y$95$m * N[(1.0 + N[(z$95$m * z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
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_m] = \mathsf{sort}([x_m, y_m, z_m])\\
\\
y\_s \cdot \left(x\_s \cdot \frac{1}{x\_m \cdot \left(y\_m \cdot \left(1 + z\_m \cdot z\_m\right)\right)}\right)
\end{array}
Derivation
  1. Initial program 89.8%

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

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

    \[\leadsto \color{blue}{\frac{1}{\left(y \cdot \left(1 + z \cdot z\right)\right) \cdot x}} \]
  4. Add Preprocessing
  5. Final simplification89.7%

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

Alternative 14: 89.0% accurate, 1.0× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ 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_m] = \mathsf{sort}([x_m, y_m, z_m])\\ \\ y\_s \cdot \left(x\_s \cdot \frac{\frac{1}{x\_m}}{y\_m \cdot \left(1 + z\_m \cdot z\_m\right)}\right) \end{array} \]
z_m = (fabs.f64 z)
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z_m should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z_m)
 :precision binary64
 (* y_s (* x_s (/ (/ 1.0 x_m) (* y_m (+ 1.0 (* z_m z_m)))))))
z_m = fabs(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_m);
double code(double y_s, double x_s, double x_m, double y_m, double z_m) {
	return y_s * (x_s * ((1.0 / x_m) / (y_m * (1.0 + (z_m * z_m)))));
}
z_m = abs(z)
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_m should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z_m)
    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_m
    code = y_s * (x_s * ((1.0d0 / x_m) / (y_m * (1.0d0 + (z_m * z_m)))))
end function
z_m = Math.abs(z);
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_m;
public static double code(double y_s, double x_s, double x_m, double y_m, double z_m) {
	return y_s * (x_s * ((1.0 / x_m) / (y_m * (1.0 + (z_m * z_m)))));
}
z_m = math.fabs(z)
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_m] = sort([x_m, y_m, z_m])
def code(y_s, x_s, x_m, y_m, z_m):
	return y_s * (x_s * ((1.0 / x_m) / (y_m * (1.0 + (z_m * z_m)))))
z_m = abs(z)
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_m = sort([x_m, y_m, z_m])
function code(y_s, x_s, x_m, y_m, z_m)
	return Float64(y_s * Float64(x_s * Float64(Float64(1.0 / x_m) / Float64(y_m * Float64(1.0 + Float64(z_m * z_m))))))
end
z_m = abs(z);
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_m = num2cell(sort([x_m, y_m, z_m])){:}
function tmp = code(y_s, x_s, x_m, y_m, z_m)
	tmp = y_s * (x_s * ((1.0 / x_m) / (y_m * (1.0 + (z_m * z_m)))));
end
z_m = N[Abs[z], $MachinePrecision]
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_m should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(y$95$s * N[(x$95$s * N[(N[(1.0 / x$95$m), $MachinePrecision] / N[(y$95$m * N[(1.0 + N[(z$95$m * z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
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_m] = \mathsf{sort}([x_m, y_m, z_m])\\
\\
y\_s \cdot \left(x\_s \cdot \frac{\frac{1}{x\_m}}{y\_m \cdot \left(1 + z\_m \cdot z\_m\right)}\right)
\end{array}
Derivation
  1. Initial program 89.8%

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

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

Alternative 15: 60.0% accurate, 2.2× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ 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_m] = \mathsf{sort}([x_m, y_m, z_m])\\ \\ y\_s \cdot \left(x\_s \cdot \frac{1}{y\_m \cdot x\_m}\right) \end{array} \]
z_m = (fabs.f64 z)
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z_m should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z_m)
 :precision binary64
 (* y_s (* x_s (/ 1.0 (* y_m x_m)))))
z_m = fabs(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_m);
double code(double y_s, double x_s, double x_m, double y_m, double z_m) {
	return y_s * (x_s * (1.0 / (y_m * x_m)));
}
z_m = abs(z)
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_m should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z_m)
    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_m
    code = y_s * (x_s * (1.0d0 / (y_m * x_m)))
end function
z_m = Math.abs(z);
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_m;
public static double code(double y_s, double x_s, double x_m, double y_m, double z_m) {
	return y_s * (x_s * (1.0 / (y_m * x_m)));
}
z_m = math.fabs(z)
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_m] = sort([x_m, y_m, z_m])
def code(y_s, x_s, x_m, y_m, z_m):
	return y_s * (x_s * (1.0 / (y_m * x_m)))
z_m = abs(z)
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_m = sort([x_m, y_m, z_m])
function code(y_s, x_s, x_m, y_m, z_m)
	return Float64(y_s * Float64(x_s * Float64(1.0 / Float64(y_m * x_m))))
end
z_m = abs(z);
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_m = num2cell(sort([x_m, y_m, z_m])){:}
function tmp = code(y_s, x_s, x_m, y_m, z_m)
	tmp = y_s * (x_s * (1.0 / (y_m * x_m)));
end
z_m = N[Abs[z], $MachinePrecision]
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_m should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(y$95$s * N[(x$95$s * N[(1.0 / N[(y$95$m * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
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_m] = \mathsf{sort}([x_m, y_m, z_m])\\
\\
y\_s \cdot \left(x\_s \cdot \frac{1}{y\_m \cdot x\_m}\right)
\end{array}
Derivation
  1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{y \cdot \left(x \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}\right)} \]
  3. Simplified87.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 59.7%

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

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

Developer target: 92.7% 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 2024041 
(FPCore (x y z)
  :name "Statistics.Distribution.CauchyLorentz:$cdensity from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (if (< (* y (+ 1.0 (* z z))) (- INFINITY)) (/ (/ 1.0 y) (* (+ 1.0 (* z z)) x)) (if (< (* y (+ 1.0 (* z z))) 8.680743250567252e+305) (/ (/ 1.0 x) (* (+ 1.0 (* z z)) y)) (/ (/ 1.0 y) (* (+ 1.0 (* z z)) x))))

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