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

Percentage Accurate: 90.2% → 99.4%
Time: 12.1s
Alternatives: 11
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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


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

    1. Initial program 94.7%

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

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

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

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

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

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

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

    if 9.999999999999999e258 < (*.f64 y (+.f64 #s(literal 1 binary64) (*.f64 z z)))

    1. Initial program 66.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{1 + z \cdot z}} \]
      13. metadata-eval66.2%

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{1 \cdot 1} + z \cdot z} \]
      14. rem-square-sqrt66.2%

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{\sqrt{1 \cdot 1 + z \cdot z} \cdot \sqrt{1 \cdot 1 + z \cdot z}}} \]
      15. hypot-undefine66.2%

        \[\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 \cdot 1 + z \cdot z}} \]
      16. hypot-undefine66.2%

        \[\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)}} \]
      17. frac-times75.3%

        \[\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)} \]
      18. associate-/l/75.3%

        \[\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) \]
      19. un-div-inv75.3%

        \[\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}}} \]
    8. Applied egg-rr99.7%

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

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

Alternative 2: 99.0% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {x}^{-0.5} \cdot \frac{{x}^{-0.5}}{y \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}} \]
    19. *-commutative39.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{\sqrt{1 \cdot 1 + z \cdot z} \cdot \sqrt{1 \cdot 1 + z \cdot z}}} \]
    15. hypot-undefine48.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 \cdot 1 + z \cdot z}} \]
    16. hypot-undefine48.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)}} \]
    17. frac-times50.3%

      \[\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)} \]
    18. associate-/l/50.3%

      \[\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) \]
    19. un-div-inv50.4%

      \[\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}}} \]
  8. Applied egg-rr54.4%

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

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

Alternative 3: 94.2% accurate, 0.0× speedup?

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

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


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

    1. Initial program 94.8%

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

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

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

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

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

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

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

    if 5.0000000000000004e301 < (*.f64 y (+.f64 #s(literal 1 binary64) (*.f64 z z)))

    1. Initial program 64.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {x}^{-0.5} \cdot \frac{{x}^{-0.5}}{y \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}} \]
      19. *-commutative30.9%

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

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

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

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

        \[\leadsto \color{blue}{{x}^{\left(-0.5 + -0.5\right)}} \cdot \frac{1}{\mathsf{fma}\left(z, z, 1\right) \cdot y} \]
      4. metadata-eval64.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{1 \cdot 1} + z \cdot z} \]
      14. rem-square-sqrt64.6%

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{\sqrt{1 \cdot 1 + z \cdot z} \cdot \sqrt{1 \cdot 1 + z \cdot z}}} \]
      15. hypot-undefine64.6%

        \[\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 \cdot 1 + z \cdot z}} \]
      16. hypot-undefine64.6%

        \[\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)}} \]
      17. frac-times74.1%

        \[\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)} \]
      18. associate-/l/74.1%

        \[\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) \]
      19. un-div-inv74.1%

        \[\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}}} \]
    8. Applied egg-rr99.6%

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

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

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

Alternative 4: 83.5% accurate, 0.0× speedup?

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

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


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

    1. Initial program 94.8%

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

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

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

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

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

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

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

    if 5.0000000000000004e301 < (*.f64 y (+.f64 #s(literal 1 binary64) (*.f64 z z)))

    1. Initial program 64.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {x}^{-0.5} \cdot \frac{{x}^{-0.5}}{y \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}} \]
      19. *-commutative30.9%

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

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

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

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

        \[\leadsto \color{blue}{{x}^{\left(-0.5 + -0.5\right)}} \cdot \frac{1}{\mathsf{fma}\left(z, z, 1\right) \cdot y} \]
      4. metadata-eval64.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{1 \cdot 1} + z \cdot z} \]
      14. rem-square-sqrt64.6%

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{\sqrt{1 \cdot 1 + z \cdot z} \cdot \sqrt{1 \cdot 1 + z \cdot z}}} \]
      15. hypot-undefine64.6%

        \[\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 \cdot 1 + z \cdot z}} \]
      16. hypot-undefine64.6%

        \[\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)}} \]
      17. frac-times74.1%

        \[\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)} \]
      18. associate-/l/74.1%

        \[\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) \]
      19. un-div-inv74.1%

        \[\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}}} \]
    8. Applied egg-rr99.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{{z}^{2}}}{y}} \]
    11. Simplified73.8%

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{{z}^{2}}}{y}} \]
    12. Step-by-step derivation
      1. add-sqr-sqrt68.9%

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

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

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

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

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

        \[\leadsto \frac{{x}^{\color{blue}{-0.5}}}{\sqrt{{z}^{2}}} \cdot \frac{\sqrt{\frac{\frac{1}{x}}{{z}^{2}}}}{y} \]
      7. sqrt-pow133.2%

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

        \[\leadsto \frac{{x}^{-0.5}}{{z}^{\color{blue}{1}}} \cdot \frac{\sqrt{\frac{\frac{1}{x}}{{z}^{2}}}}{y} \]
      9. pow133.2%

        \[\leadsto \frac{{x}^{-0.5}}{\color{blue}{z}} \cdot \frac{\sqrt{\frac{\frac{1}{x}}{{z}^{2}}}}{y} \]
      10. sqrt-div33.2%

        \[\leadsto \frac{{x}^{-0.5}}{z} \cdot \frac{\color{blue}{\frac{\sqrt{\frac{1}{x}}}{\sqrt{{z}^{2}}}}}{y} \]
      11. inv-pow33.2%

        \[\leadsto \frac{{x}^{-0.5}}{z} \cdot \frac{\frac{\sqrt{\color{blue}{{x}^{-1}}}}{\sqrt{{z}^{2}}}}{y} \]
      12. sqrt-pow133.2%

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

        \[\leadsto \frac{{x}^{-0.5}}{z} \cdot \frac{\frac{{x}^{\color{blue}{-0.5}}}{\sqrt{{z}^{2}}}}{y} \]
      14. sqrt-pow147.2%

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

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

        \[\leadsto \frac{{x}^{-0.5}}{z} \cdot \frac{\frac{{x}^{-0.5}}{\color{blue}{z}}}{y} \]
    13. Applied egg-rr47.2%

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

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

Alternative 5: 97.8% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 97.0% accurate, 0.1× speedup?

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

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


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

    1. Initial program 94.8%

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

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

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

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

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

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

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

    if 5.0000000000000004e301 < (*.f64 y (+.f64 #s(literal 1 binary64) (*.f64 z z)))

    1. Initial program 64.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {x}^{-0.5} \cdot \frac{{x}^{-0.5}}{y \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}} \]
      19. *-commutative30.9%

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

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

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

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

        \[\leadsto \color{blue}{{x}^{\left(-0.5 + -0.5\right)}} \cdot \frac{1}{\mathsf{fma}\left(z, z, 1\right) \cdot y} \]
      4. metadata-eval64.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{1 \cdot 1} + z \cdot z} \]
      14. rem-square-sqrt64.6%

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{\sqrt{1 \cdot 1 + z \cdot z} \cdot \sqrt{1 \cdot 1 + z \cdot z}}} \]
      15. hypot-undefine64.6%

        \[\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 \cdot 1 + z \cdot z}} \]
      16. hypot-undefine64.6%

        \[\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)}} \]
      17. frac-times74.1%

        \[\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)} \]
      18. associate-/l/74.1%

        \[\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) \]
      19. un-div-inv74.1%

        \[\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}}} \]
    8. Applied egg-rr99.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{{z}^{2}}}{y}} \]
    11. Simplified73.8%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{1}{z} \cdot \frac{\frac{1}{x}}{z}}}{y} \]
    13. Applied egg-rr89.6%

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

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

Alternative 7: 94.5% accurate, 0.1× speedup?

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

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


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

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0000000000000001e300 < (*.f64 z z)

    1. Initial program 71.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{x}^{\left(-0.5 + -0.5\right)}} \cdot \frac{1}{\mathsf{fma}\left(z, z, 1\right) \cdot y} \]
      4. metadata-eval71.3%

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{z \cdot z + 1}} \]
      12. +-commutative35.9%

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{1 + z \cdot z}} \]
      13. metadata-eval35.9%

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{1 \cdot 1} + z \cdot z} \]
      14. rem-square-sqrt35.9%

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{\sqrt{1 \cdot 1 + z \cdot z} \cdot \sqrt{1 \cdot 1 + z \cdot z}}} \]
      15. hypot-undefine35.9%

        \[\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 \cdot 1 + z \cdot z}} \]
      16. hypot-undefine35.9%

        \[\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)}} \]
      17. frac-times42.3%

        \[\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)} \]
      18. associate-/l/42.3%

        \[\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) \]
      19. un-div-inv42.3%

        \[\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}}} \]
    8. Applied egg-rr53.1%

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

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

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

Alternative 8: 96.8% accurate, 0.1× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {x}^{-0.5} \cdot \frac{{x}^{-0.5}}{y \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}} \]
      19. *-commutative42.9%

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

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

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

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

        \[\leadsto \frac{\color{blue}{{x}^{\left(-0.5 + -0.5\right)}}}{y \cdot \mathsf{fma}\left(z, z, 1\right)} \]
      4. metadata-eval99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999978e34 < (*.f64 z z)

    1. Initial program 79.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{x}^{\left(-0.5 + -0.5\right)}} \cdot \frac{1}{\mathsf{fma}\left(z, z, 1\right) \cdot y} \]
      4. metadata-eval79.7%

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{z \cdot z + 1}} \]
      12. +-commutative38.4%

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{1 + z \cdot z}} \]
      13. metadata-eval38.4%

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{1 \cdot 1} + z \cdot z} \]
      14. rem-square-sqrt38.4%

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{\sqrt{1 \cdot 1 + z \cdot z} \cdot \sqrt{1 \cdot 1 + z \cdot z}}} \]
      15. hypot-undefine38.4%

        \[\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 \cdot 1 + z \cdot z}} \]
      16. hypot-undefine38.4%

        \[\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)}} \]
      17. frac-times41.5%

        \[\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)} \]
      18. associate-/l/41.5%

        \[\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) \]
      19. un-div-inv41.5%

        \[\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}}} \]
    8. Applied egg-rr49.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{{z}^{2}}}{y}} \]
    11. Simplified83.2%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{1}{z} \cdot \frac{\frac{1}{x}}{z}}}{y} \]
    13. Applied egg-rr90.4%

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

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

Alternative 9: 96.8% accurate, 0.6× speedup?

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

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


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

    1. Initial program 99.7%

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

    if 3.99999999999999978e34 < (*.f64 z z)

    1. Initial program 79.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{x}^{\left(-0.5 + -0.5\right)}} \cdot \frac{1}{\mathsf{fma}\left(z, z, 1\right) \cdot y} \]
      4. metadata-eval79.7%

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{z \cdot z + 1}} \]
      12. +-commutative38.4%

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{1 + z \cdot z}} \]
      13. metadata-eval38.4%

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{1 \cdot 1} + z \cdot z} \]
      14. rem-square-sqrt38.4%

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{\sqrt{1 \cdot 1 + z \cdot z} \cdot \sqrt{1 \cdot 1 + z \cdot z}}} \]
      15. hypot-undefine38.4%

        \[\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 \cdot 1 + z \cdot z}} \]
      16. hypot-undefine38.4%

        \[\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)}} \]
      17. frac-times41.5%

        \[\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)} \]
      18. associate-/l/41.5%

        \[\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) \]
      19. un-div-inv41.5%

        \[\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}}} \]
    8. Applied egg-rr49.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{{z}^{2}}}{y}} \]
    11. Simplified83.2%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{1}{z} \cdot \frac{\frac{1}{x}}{z}}}{y} \]
    13. Applied egg-rr90.4%

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

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

Alternative 10: 77.9% accurate, 0.7× speedup?

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

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


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

    1. Initial program 92.0%

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

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

    if 0.69999999999999996 < z

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{x}^{\left(-0.5 + -0.5\right)}} \cdot \frac{1}{\mathsf{fma}\left(z, z, 1\right) \cdot y} \]
      4. metadata-eval83.5%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{1 + z \cdot z}} \]
      13. metadata-eval40.2%

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{1 \cdot 1} + z \cdot z} \]
      14. rem-square-sqrt40.2%

        \[\leadsto \frac{1}{x} \cdot \frac{\frac{1}{\sqrt{y}} \cdot \frac{1}{\sqrt{y}}}{\color{blue}{\sqrt{1 \cdot 1 + z \cdot z} \cdot \sqrt{1 \cdot 1 + z \cdot z}}} \]
      15. hypot-undefine40.2%

        \[\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 \cdot 1 + z \cdot z}} \]
      16. hypot-undefine40.3%

        \[\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)}} \]
      17. frac-times41.9%

        \[\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)} \]
      18. associate-/l/41.9%

        \[\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) \]
      19. un-div-inv42.0%

        \[\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}}} \]
    8. Applied egg-rr53.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{{z}^{2}}}{y}} \]
    12. Step-by-step derivation
      1. *-un-lft-identity86.0%

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

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

        \[\leadsto \frac{\color{blue}{\frac{1}{z} \cdot \frac{\frac{1}{x}}{z}}}{y} \]
    13. Applied egg-rr90.8%

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

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

Alternative 11: 59.9% accurate, 2.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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