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

Percentage Accurate: 89.3% → 99.4%
Time: 11.8s
Alternatives: 11
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 11 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.3% accurate, 1.0× speedup?

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

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

Alternative 1: 99.4% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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/47.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{\frac{1}{y}}{1 + z \cdot z}} \]
    6. metadata-eval90.8%

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

      \[\leadsto \frac{1}{x} \cdot \frac{\frac{1 \cdot 1}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}}{1 + z \cdot z} \]
    8. frac-times42.8%

      \[\leadsto \frac{1}{x} \cdot \frac{\color{blue}{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}}{1 + z \cdot z} \]
    9. add-sqr-sqrt42.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.1% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{\frac{1}{y}}{1 + z \cdot z}} \]
    6. metadata-eval90.8%

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

      \[\leadsto \frac{1}{x} \cdot \frac{\frac{1 \cdot 1}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}}{1 + z \cdot z} \]
    8. frac-times42.8%

      \[\leadsto \frac{1}{x} \cdot \frac{\color{blue}{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}}{1 + z \cdot z} \]
    9. add-sqr-sqrt42.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 49.8% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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/47.8%

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

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

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

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

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

    \[\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. Step-by-step derivation
    1. *-un-lft-identity47.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{y}}{\sqrt{1 + z \cdot z} \cdot \color{blue}{\sqrt{1 + z \cdot z}}} \]
    11. add-sqr-sqrt90.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 91.5% accurate, 0.1× speedup?

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

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


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

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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/47.8%

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

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

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

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

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

      \[\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. Step-by-step derivation
      1. *-un-lft-identity47.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{y}}{\sqrt{1 + z \cdot z} \cdot \color{blue}{\sqrt{1 + z \cdot z}}} \]
      11. add-sqr-sqrt90.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{x}}{1 + {z}^{2}}}}{y} \]
      2. +-commutative89.3%

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

        \[\leadsto \frac{\frac{\frac{1}{x}}{\color{blue}{z \cdot z} + 1}}{y} \]
      4. fma-define89.3%

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

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

    if +inf.0 < (+.f64 #s(literal 1 binary64) (*.f64 z z))

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1 \cdot \frac{{z}^{-2}}{x \cdot y}} \]
    8. Step-by-step derivation
      1. *-lft-identity59.4%

        \[\leadsto \color{blue}{\frac{{z}^{-2}}{x \cdot y}} \]
    9. Simplified59.4%

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

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

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

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

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

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

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

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

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

Alternative 6: 90.9% accurate, 0.1× speedup?

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

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


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

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1 \cdot \frac{{z}^{-2}}{x \cdot y}} \]
    8. Step-by-step derivation
      1. *-lft-identity59.4%

        \[\leadsto \color{blue}{\frac{{z}^{-2}}{x \cdot y}} \]
    9. Simplified59.4%

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

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

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

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

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

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

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

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

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

Alternative 7: 77.1% accurate, 0.4× speedup?

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (/.f64 #s(literal 1 binary64) x) (*.f64 y (+.f64 #s(literal 1 binary64) (*.f64 z z)))) < 4.99999999999999965e-273

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1 \cdot \frac{{z}^{-2}}{x \cdot y}} \]
    8. Step-by-step derivation
      1. *-lft-identity66.6%

        \[\leadsto \color{blue}{\frac{{z}^{-2}}{x \cdot y}} \]
    9. Simplified66.6%

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

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

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

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

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

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

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

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

    if 4.99999999999999965e-273 < (/.f64 (/.f64 #s(literal 1 binary64) x) (*.f64 y (+.f64 #s(literal 1 binary64) (*.f64 z z))))

    1. Initial program 99.6%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification83.4%

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

Alternative 8: 90.4% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{y \cdot \color{blue}{x}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt59.4%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{y \cdot x}} \cdot \sqrt{\frac{1}{y \cdot x}}} \]
      2. pow259.4%

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

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

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

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

        \[\leadsto {\left({\left(x \cdot y\right)}^{\color{blue}{-0.5}}\right)}^{2} \]
    7. Applied egg-rr59.4%

      \[\leadsto \color{blue}{{\left({\left(x \cdot y\right)}^{-0.5}\right)}^{2}} \]
    8. Step-by-step derivation
      1. pow-pow99.0%

        \[\leadsto \color{blue}{{\left(x \cdot y\right)}^{\left(-0.5 \cdot 2\right)}} \]
      2. metadata-eval99.0%

        \[\leadsto {\left(x \cdot y\right)}^{\color{blue}{-1}} \]
      3. inv-pow99.0%

        \[\leadsto \color{blue}{\frac{1}{x \cdot y}} \]
      4. *-commutative99.0%

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

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x}} \]
    9. Applied egg-rr98.9%

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

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

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1 \cdot \frac{{z}^{-2}}{x \cdot y}} \]
    8. Step-by-step derivation
      1. *-lft-identity59.4%

        \[\leadsto \color{blue}{\frac{{z}^{-2}}{x \cdot y}} \]
    9. Simplified59.4%

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

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

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

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

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

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

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

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

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

Alternative 9: 94.4% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{y \cdot \color{blue}{x}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt59.4%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{y \cdot x}} \cdot \sqrt{\frac{1}{y \cdot x}}} \]
      2. pow259.4%

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

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

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

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

        \[\leadsto {\left({\left(x \cdot y\right)}^{\color{blue}{-0.5}}\right)}^{2} \]
    7. Applied egg-rr59.4%

      \[\leadsto \color{blue}{{\left({\left(x \cdot y\right)}^{-0.5}\right)}^{2}} \]
    8. Step-by-step derivation
      1. pow-pow99.0%

        \[\leadsto \color{blue}{{\left(x \cdot y\right)}^{\left(-0.5 \cdot 2\right)}} \]
      2. metadata-eval99.0%

        \[\leadsto {\left(x \cdot y\right)}^{\color{blue}{-1}} \]
      3. inv-pow99.0%

        \[\leadsto \color{blue}{\frac{1}{x \cdot y}} \]
      4. *-commutative99.0%

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

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x}} \]
    9. Applied egg-rr98.9%

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

    if 0.0100000000000000002 < (*.f64 z z) < 4.9999999999999996e248

    1. Initial program 88.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999996e248 < (*.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. remove-double-neg79.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 \cdot \color{blue}{\frac{\frac{1}{z \cdot z}}{x \cdot y}} \]
      4. pow278.7%

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

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

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

      \[\leadsto \color{blue}{1 \cdot \frac{{z}^{-2}}{x \cdot y}} \]
    8. Step-by-step derivation
      1. *-lft-identity78.8%

        \[\leadsto \color{blue}{\frac{{z}^{-2}}{x \cdot y}} \]
    9. Simplified78.8%

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

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

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

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

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

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

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

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

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

Alternative 10: 90.4% accurate, 0.7× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{y\_m \cdot \left(x \cdot \left(z \cdot z\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. Step-by-step derivation
      1. associate-/l/99.7%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{y \cdot \color{blue}{x}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt59.4%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{y \cdot x}} \cdot \sqrt{\frac{1}{y \cdot x}}} \]
      2. pow259.4%

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

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

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

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

        \[\leadsto {\left({\left(x \cdot y\right)}^{\color{blue}{-0.5}}\right)}^{2} \]
    7. Applied egg-rr59.4%

      \[\leadsto \color{blue}{{\left({\left(x \cdot y\right)}^{-0.5}\right)}^{2}} \]
    8. Step-by-step derivation
      1. pow-pow99.0%

        \[\leadsto \color{blue}{{\left(x \cdot y\right)}^{\left(-0.5 \cdot 2\right)}} \]
      2. metadata-eval99.0%

        \[\leadsto {\left(x \cdot y\right)}^{\color{blue}{-1}} \]
      3. inv-pow99.0%

        \[\leadsto \color{blue}{\frac{1}{x \cdot y}} \]
      4. *-commutative99.0%

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

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x}} \]
    9. Applied egg-rr98.9%

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

    if 1 < (*.f64 z z)

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 11: 58.4% accurate, 2.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}

Reproduce

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

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

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