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

Percentage Accurate: 88.9% → 99.6%
Time: 14.9s
Alternatives: 15
Speedup: 0.6×

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: 88.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.1× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{\frac{1}{x_m}}{y_m}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}\\


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

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\left(x \cdot y\right) \cdot \mathsf{fma}\left(z, z, 1\right)}} \]
    8. Step-by-step derivation
      1. associate-*l*90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.5999999999999998e55 < y

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      6. add-sqr-sqrt85.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-identity85.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-frac85.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. *-commutative85.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-prod85.2%

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

        \[\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. *-commutative85.2%

        \[\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-prod95.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-def99.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-rr99.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-times85.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-identity85.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. swap-sqr85.2%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\frac{1}{x}}{\color{blue}{1 + z \cdot z}}}{y} \]
      12. +-commutative95.6%

        \[\leadsto \frac{\frac{\frac{1}{x}}{\color{blue}{z \cdot z + 1}}}{y} \]
      13. fma-udef95.6%

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

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

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

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

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

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

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

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

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

Alternative 2: 99.3% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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-prod42.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-def45.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. *-commutative19.9%

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

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

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

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

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

Alternative 4: 98.2% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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 y around 0 89.1%

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

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

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

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

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

    \[\leadsto \frac{1}{\color{blue}{\left(x \cdot y\right) \cdot \mathsf{fma}\left(z, z, 1\right)}} \]
  8. Step-by-step derivation
    1. associate-*l*89.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 97.5% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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 y around 0 89.1%

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

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

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

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

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

    \[\leadsto \frac{1}{\color{blue}{\left(x \cdot y\right) \cdot \mathsf{fma}\left(z, z, 1\right)}} \]
  8. Step-by-step derivation
    1. associate-*l*89.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 99.2% accurate, 0.1× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y_m}}{z} \cdot \frac{\frac{1}{x_m}}{z}\\


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

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999999e294 < (*.f64 z z)

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\left(x \cdot y\right) \cdot \mathsf{fma}\left(z, z, 1\right)}} \]
    8. Step-by-step derivation
      1. associate-*l*73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x \cdot {z}^{2}}} \]
    14. Simplified73.0%

      \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x \cdot {z}^{2}}} \]
    15. Step-by-step derivation
      1. associate-/r*71.3%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{x}}{{z}^{2}}} \]
      2. un-div-inv71.3%

        \[\leadsto \frac{\color{blue}{\frac{1}{y} \cdot \frac{1}{x}}}{{z}^{2}} \]
      3. unpow271.3%

        \[\leadsto \frac{\frac{1}{y} \cdot \frac{1}{x}}{\color{blue}{z \cdot z}} \]
      4. times-frac98.5%

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{z} \cdot \frac{\frac{1}{x}}{z}} \]
    16. Applied egg-rr98.5%

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

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

Alternative 7: 98.9% accurate, 0.1× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y_m}}{z} \cdot \frac{\frac{1}{x_m}}{z}\\


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

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999999e294 < (*.f64 z z)

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\left(x \cdot y\right) \cdot \mathsf{fma}\left(z, z, 1\right)}} \]
    8. Step-by-step derivation
      1. associate-*l*73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x \cdot {z}^{2}}} \]
    14. Simplified73.0%

      \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x \cdot {z}^{2}}} \]
    15. Step-by-step derivation
      1. associate-/r*71.3%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{x}}{{z}^{2}}} \]
      2. un-div-inv71.3%

        \[\leadsto \frac{\color{blue}{\frac{1}{y} \cdot \frac{1}{x}}}{{z}^{2}} \]
      3. unpow271.3%

        \[\leadsto \frac{\frac{1}{y} \cdot \frac{1}{x}}{\color{blue}{z \cdot z}} \]
      4. times-frac98.5%

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{z} \cdot \frac{\frac{1}{x}}{z}} \]
    16. Applied egg-rr98.5%

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

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

Alternative 8: 99.3% accurate, 0.1× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y_m}}{z} \cdot \frac{\frac{1}{x_m}}{z}\\


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

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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-frac44.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. *-commutative44.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-prod44.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-def44.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. *-commutative44.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-prod47.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-def47.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-rr47.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-times44.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-identity44.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. swap-sqr44.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\frac{1}{x}}{\color{blue}{z \cdot z + 1}}}{y} \]
      13. fma-udef97.6%

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{y}}{\mathsf{fma}\left(z, z, 1\right) \cdot x}} \]
      17. *-un-lft-identity97.6%

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

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

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

    if 4.9999999999999999e294 < (*.f64 z z)

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\left(x \cdot y\right) \cdot \mathsf{fma}\left(z, z, 1\right)}} \]
    8. Step-by-step derivation
      1. associate-*l*73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x \cdot {z}^{2}}} \]
    14. Simplified73.0%

      \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x \cdot {z}^{2}}} \]
    15. Step-by-step derivation
      1. associate-/r*71.3%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{x}}{{z}^{2}}} \]
      2. un-div-inv71.3%

        \[\leadsto \frac{\color{blue}{\frac{1}{y} \cdot \frac{1}{x}}}{{z}^{2}} \]
      3. unpow271.3%

        \[\leadsto \frac{\frac{1}{y} \cdot \frac{1}{x}}{\color{blue}{z \cdot z}} \]
      4. times-frac98.5%

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{z} \cdot \frac{\frac{1}{x}}{z}} \]
    16. Applied egg-rr98.5%

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

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

Alternative 9: 99.3% accurate, 0.1× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y_m}}{z} \cdot \frac{\frac{1}{x_m}}{z}\\


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

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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-frac44.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. *-commutative44.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-prod44.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-def44.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. *-commutative44.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-prod47.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-def47.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-rr47.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-times44.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-identity44.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. swap-sqr44.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\frac{1}{x}}{\color{blue}{z \cdot z + 1}}}{y} \]
      13. fma-udef97.6%

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

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

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

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

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

    if 4.9999999999999999e294 < (*.f64 z z)

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\left(x \cdot y\right) \cdot \mathsf{fma}\left(z, z, 1\right)}} \]
    8. Step-by-step derivation
      1. associate-*l*73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x \cdot {z}^{2}}} \]
    14. Simplified73.0%

      \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x \cdot {z}^{2}}} \]
    15. Step-by-step derivation
      1. associate-/r*71.3%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{x}}{{z}^{2}}} \]
      2. un-div-inv71.3%

        \[\leadsto \frac{\color{blue}{\frac{1}{y} \cdot \frac{1}{x}}}{{z}^{2}} \]
      3. unpow271.3%

        \[\leadsto \frac{\frac{1}{y} \cdot \frac{1}{x}}{\color{blue}{z \cdot z}} \]
      4. times-frac98.5%

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{z} \cdot \frac{\frac{1}{x}}{z}} \]
    16. Applied egg-rr98.5%

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

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

Alternative 10: 97.4% accurate, 0.5× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y_m}}{z} \cdot \frac{\frac{1}{x_m}}{z}\\


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

    1. Initial program 93.6%

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

    if 5.0000000000000004e301 < (*.f64 y (+.f64 1 (*.f64 z z)))

    1. Initial program 64.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 y around 0 64.1%

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\left(x \cdot y\right) \cdot \mathsf{fma}\left(z, z, 1\right)}} \]
    8. Step-by-step derivation
      1. associate-*l*64.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x \cdot {z}^{2}}} \]
    14. Simplified76.9%

      \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x \cdot {z}^{2}}} \]
    15. Step-by-step derivation
      1. associate-/r*76.5%

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

        \[\leadsto \frac{\color{blue}{\frac{1}{y} \cdot \frac{1}{x}}}{{z}^{2}} \]
      3. unpow276.5%

        \[\leadsto \frac{\frac{1}{y} \cdot \frac{1}{x}}{\color{blue}{z \cdot z}} \]
      4. times-frac97.2%

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{z} \cdot \frac{\frac{1}{x}}{z}} \]
    16. Applied egg-rr97.2%

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

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

Alternative 11: 98.0% accurate, 0.6× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y_m}}{z} \cdot \frac{\frac{1}{x_m}}{z}\\


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

    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.4%

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

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

    if 5e13 < (*.f64 z z)

    1. Initial program 79.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 y around 0 78.9%

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\left(x \cdot y\right) \cdot \mathsf{fma}\left(z, z, 1\right)}} \]
    8. Step-by-step derivation
      1. associate-*l*78.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x \cdot {z}^{2}}} \]
    14. Simplified82.0%

      \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x \cdot {z}^{2}}} \]
    15. Step-by-step derivation
      1. associate-/r*79.7%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{x}}{{z}^{2}}} \]
      2. un-div-inv79.7%

        \[\leadsto \frac{\color{blue}{\frac{1}{y} \cdot \frac{1}{x}}}{{z}^{2}} \]
      3. unpow279.7%

        \[\leadsto \frac{\frac{1}{y} \cdot \frac{1}{x}}{\color{blue}{z \cdot z}} \]
      4. times-frac96.9%

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

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

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

Alternative 12: 77.7% accurate, 0.7× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{\frac{1}{x_m}}{z \cdot y_m}\\


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

    1. Initial program 91.9%

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

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

    if 1 < z

    1. Initial program 81.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 y around 0 81.3%

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\left(x \cdot y\right) \cdot \mathsf{fma}\left(z, z, 1\right)}} \]
    8. Step-by-step derivation
      1. associate-*l*81.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x \cdot {z}^{2}}} \]
    14. Simplified86.0%

      \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x \cdot {z}^{2}}} \]
    15. Step-by-step derivation
      1. associate-/r*81.2%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{x}}{{z}^{2}}} \]
      2. un-div-inv81.1%

        \[\leadsto \frac{\color{blue}{\frac{1}{y} \cdot \frac{1}{x}}}{{z}^{2}} \]
      3. *-un-lft-identity81.1%

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

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

        \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{\frac{1}{y} \cdot \frac{1}{x}}{z}} \]
      6. associate-*l/91.8%

        \[\leadsto \frac{1}{z} \cdot \frac{\color{blue}{\frac{1 \cdot \frac{1}{x}}{y}}}{z} \]
      7. *-un-lft-identity91.8%

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

        \[\leadsto \frac{1}{z} \cdot \color{blue}{\frac{\frac{1}{x}}{y \cdot z}} \]
      9. *-commutative94.9%

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

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

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

Alternative 13: 78.3% accurate, 0.7× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y_m}}{z} \cdot \frac{\frac{1}{x_m}}{z}\\


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

    1. Initial program 91.9%

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

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

    if 1 < z

    1. Initial program 81.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 y around 0 81.3%

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\left(x \cdot y\right) \cdot \mathsf{fma}\left(z, z, 1\right)}} \]
    8. Step-by-step derivation
      1. associate-*l*81.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x \cdot {z}^{2}}} \]
    14. Simplified86.0%

      \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x \cdot {z}^{2}}} \]
    15. Step-by-step derivation
      1. associate-/r*81.2%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{x}}{{z}^{2}}} \]
      2. un-div-inv81.1%

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

        \[\leadsto \frac{\frac{1}{y} \cdot \frac{1}{x}}{\color{blue}{z \cdot z}} \]
      4. times-frac96.6%

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{z} \cdot \frac{\frac{1}{x}}{z}} \]
    16. Applied egg-rr96.6%

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

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

Alternative 14: 65.9% accurate, 0.9× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{x_m \cdot \left(z \cdot y_m\right)}\\


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

    1. Initial program 91.9%

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

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

    if 1 < z

    1. Initial program 81.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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-frac36.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. *-commutative36.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-prod36.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-def36.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. *-commutative36.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-prod39.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-def45.6%

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

      \[\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-times39.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-identity39.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. swap-sqr36.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\frac{1}{x}}{\color{blue}{z \cdot z + 1}}}{y} \]
      13. fma-udef86.0%

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

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

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

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

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

        \[\leadsto \frac{\frac{1}{\color{blue}{y \cdot x}}}{\mathsf{fma}\left(z, z, 1\right)} \]
      19. add-sqr-sqrt81.2%

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

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

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

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

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

Alternative 15: 58.9% accurate, 2.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 92.8% 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 2024020 
(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)))))