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

Percentage Accurate: 89.7% → 99.6%
Time: 10.2s
Alternatives: 9
Speedup: 0.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 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.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.0× speedup?

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y (+.f64 #s(literal 1 binary64) (*.f64 z z))) < 5e307

    1. Initial program 94.3%

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

    if 5e307 < (*.f64 y (+.f64 #s(literal 1 binary64) (*.f64 z z)))

    1. Initial program 61.4%

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

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

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

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

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

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

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

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

      \[\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*73.4%

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

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

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

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

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

        \[\leadsto \frac{\frac{\frac{1}{x}}{y}}{\color{blue}{z \cdot z + 1}} \]
      7. +-commutative73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.4% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 83.2% accurate, 0.0× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{1}{y}}{t\_0}}{t\_0}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y (+.f64 #s(literal 1 binary64) (*.f64 z z))) < 5e307

    1. Initial program 94.3%

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

    if 5e307 < (*.f64 y (+.f64 #s(literal 1 binary64) (*.f64 z z)))

    1. Initial program 61.4%

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

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

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

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

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

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

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

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

      \[\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*73.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x \cdot {z}^{2}}} \]
      12. add-sqr-sqrt49.6%

        \[\leadsto \frac{\frac{1}{y}}{\color{blue}{\sqrt{x \cdot {z}^{2}} \cdot \sqrt{x \cdot {z}^{2}}}} \]
      13. associate-/r*49.6%

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{\sqrt{x \cdot {z}^{2}}}}{\sqrt{x \cdot {z}^{2}}}} \]
      14. *-commutative49.6%

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

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

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

        \[\leadsto \frac{\frac{\frac{1}{y}}{{z}^{\color{blue}{1}} \cdot \sqrt{x}}}{\sqrt{x \cdot {z}^{2}}} \]
      18. pow141.8%

        \[\leadsto \frac{\frac{\frac{1}{y}}{\color{blue}{z} \cdot \sqrt{x}}}{\sqrt{x \cdot {z}^{2}}} \]
    9. Applied egg-rr70.0%

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

Alternative 4: 97.7% accurate, 0.1× speedup?

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

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


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

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

    if 3.9999999999999998e298 < (*.f64 z z)

    1. Initial program 70.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 96.9% accurate, 0.6× speedup?

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

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


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

    1. Initial program 99.7%

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

    if 1e30 < (*.f64 z z)

    1. Initial program 79.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{1}{z} \cdot \frac{\frac{1}{x}}{z}}}{y} \]
    11. Applied egg-rr87.3%

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

Alternative 6: 96.2% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z z) < 3.99999999999999982e-6

    1. Initial program 99.7%

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

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

    if 3.99999999999999982e-6 < (*.f64 z z)

    1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{x \cdot {z}^{2}}}{y}} \]
    9. Applied egg-rr80.0%

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

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

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

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

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

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

Alternative 7: 91.0% accurate, 0.7× speedup?

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

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


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

    1. Initial program 99.7%

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

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

    if 1 < (*.f64 z z)

    1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{x \cdot {z}^{2}}}{y}} \]
    9. Applied egg-rr80.0%

      \[\leadsto \color{blue}{\frac{\frac{1}{x \cdot {z}^{2}}}{y}} \]
    10. Step-by-step derivation
      1. unpow280.0%

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

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

Alternative 8: 90.8% accurate, 0.7× speedup?

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

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


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

    1. Initial program 99.7%

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

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

    if 1 < (*.f64 z z)

    1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 58.4% accurate, 2.2× speedup?

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{y \cdot \color{blue}{x}} \]
  6. Add Preprocessing

Developer target: 92.7% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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

  :alt
  (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)))))