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

Percentage Accurate: 89.8% → 99.3%
Time: 12.8s
Alternatives: 14
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 14 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 89.8% 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.3% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{1 \cdot \frac{1}{x}}}{\sqrt{y \cdot \left(1 + z \cdot z\right)} \cdot \sqrt{y \cdot \left(1 + z \cdot z\right)}} \]
    8. times-frac50.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. *-commutative50.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-prod50.1%

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

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

      \[\leadsto \frac{1}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}} \cdot \frac{\frac{1}{x}}{\sqrt{\color{blue}{\left(1 + z \cdot z\right) \cdot y}}} \]
    13. sqrt-prod51.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-def55.5%

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

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

    \[\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 2: 49.7% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.2% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 97.5% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 92.1% accurate, 0.1× speedup?

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

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


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

    1. Initial program 96.3%

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

    if 2.0000000000000002e302 < (*.f64 y (+.f64 1 (*.f64 z z)))

    1. Initial program 72.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 92.2% accurate, 0.1× speedup?

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

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


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

    1. Initial program 96.3%

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

    if 2.0000000000000002e302 < (*.f64 y (+.f64 1 (*.f64 z z)))

    1. Initial program 72.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}} \]
      6. add-sqr-sqrt72.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-identity72.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-frac72.6%

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

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}} \cdot \frac{\frac{1}{x}}{\color{blue}{\sqrt{1 + z \cdot z} \cdot \sqrt{y}}} \]
      14. hypot-1-def99.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-rr99.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. Taylor expanded in y around 0 72.6%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 92.4% accurate, 0.1× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{{z}^{-2}}{y \cdot x\_m}\\


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

    1. Initial program 96.3%

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

    if 2.0000000000000002e302 < (*.f64 y (+.f64 1 (*.f64 z z)))

    1. Initial program 72.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{\frac{1}{{z}^{2}}}{x \cdot y}}\right)} - 1 \]
      4. pow-flip72.4%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{{z}^{\left(-2\right)}}}{x \cdot y}\right)} - 1 \]
      5. metadata-eval72.4%

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{{z}^{-2}}{x \cdot y}\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def79.7%

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

        \[\leadsto \color{blue}{\frac{{z}^{-2}}{x \cdot y}} \]
    11. Simplified79.7%

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

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

Alternative 8: 92.0% accurate, 0.1× speedup?

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

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


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

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{1 \cdot \frac{1}{x}}}{\sqrt{y \cdot \left(1 + z \cdot z\right)} \cdot \sqrt{y \cdot \left(1 + z \cdot z\right)}} \]
      8. times-frac50.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. *-commutative50.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-prod50.1%

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

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

        \[\leadsto \frac{1}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}} \cdot \frac{\frac{1}{x}}{\sqrt{\color{blue}{\left(1 + z \cdot z\right) \cdot y}}} \]
      13. sqrt-prod51.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-def55.5%

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

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

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

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

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

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

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

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

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

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

    if +inf.0 < (*.f64 z z)

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 95.1% accurate, 0.1× speedup?

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

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


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

    1. Initial program 91.4%

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

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

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

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

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

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

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

    if 2.49999999999999989e110 < y

    1. Initial program 91.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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-frac91.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. *-commutative91.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-prod91.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-def91.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. *-commutative91.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-prod98.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-def99.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 91.5% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 89.4% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 12: 89.8% accurate, 1.0× speedup?

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

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

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

Alternative 13: 58.4% accurate, 2.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 58.5% accurate, 2.2× speedup?

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

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

    \[\leadsto \frac{\frac{1}{x}}{\color{blue}{y}} \]
  4. Final simplification61.0%

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

Developer target: 92.9% 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 2024031 
(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)))))