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

Percentage Accurate: 90.8% → 99.2%
Time: 13.8s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

Alternative 1: 99.2% accurate, 0.0× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \left(x\_s \cdot {\left(\frac{{x\_m}^{-0.5}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y\_m}}\right)}^{2}\right) \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (* y_s (* x_s (pow (/ (pow x_m -0.5) (* (hypot 1.0 z) (sqrt y_m))) 2.0))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * pow((pow(x_m, -0.5) / (hypot(1.0, z) * sqrt(y_m))), 2.0));
}
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * Math.pow((Math.pow(x_m, -0.5) / (Math.hypot(1.0, z) * Math.sqrt(y_m))), 2.0));
}
x_m = math.fabs(x)
x_s = math.copysign(1.0, x)
y_m = math.fabs(y)
y_s = math.copysign(1.0, y)
def code(y_s, x_s, x_m, y_m, z):
	return y_s * (x_s * math.pow((math.pow(x_m, -0.5) / (math.hypot(1.0, z) * math.sqrt(y_m))), 2.0))
x_m = abs(x)
x_s = copysign(1.0, x)
y_m = abs(y)
y_s = copysign(1.0, y)
function code(y_s, x_s, x_m, y_m, z)
	return Float64(y_s * Float64(x_s * (Float64((x_m ^ -0.5) / Float64(hypot(1.0, z) * sqrt(y_m))) ^ 2.0)))
end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
function tmp = code(y_s, x_s, x_m, y_m, z)
	tmp = y_s * (x_s * (((x_m ^ -0.5) / (hypot(1.0, z) * sqrt(y_m))) ^ 2.0));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[Power[N[(N[Power[x$95$m, -0.5], $MachinePrecision] / N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * N[Sqrt[y$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \left(x\_s \cdot {\left(\frac{{x\_m}^{-0.5}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y\_m}}\right)}^{2}\right)
\end{array}
Derivation
  1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 95.0% accurate, 0.1× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \left(x\_s \cdot \frac{\frac{\frac{\frac{1}{x\_m}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}}{y\_m}\right) \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (* y_s (* x_s (/ (/ (/ (/ 1.0 x_m) (hypot 1.0 z)) (hypot 1.0 z)) y_m))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * ((((1.0 / x_m) / hypot(1.0, z)) / hypot(1.0, z)) / y_m));
}
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * ((((1.0 / x_m) / Math.hypot(1.0, z)) / Math.hypot(1.0, z)) / y_m));
}
x_m = math.fabs(x)
x_s = math.copysign(1.0, x)
y_m = math.fabs(y)
y_s = math.copysign(1.0, y)
def code(y_s, x_s, x_m, y_m, z):
	return y_s * (x_s * ((((1.0 / x_m) / math.hypot(1.0, z)) / math.hypot(1.0, z)) / y_m))
x_m = abs(x)
x_s = copysign(1.0, x)
y_m = abs(y)
y_s = copysign(1.0, y)
function code(y_s, x_s, x_m, y_m, z)
	return Float64(y_s * Float64(x_s * Float64(Float64(Float64(Float64(1.0 / x_m) / hypot(1.0, z)) / hypot(1.0, z)) / y_m)))
end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
function tmp = code(y_s, x_s, x_m, y_m, z)
	tmp = y_s * (x_s * ((((1.0 / x_m) / hypot(1.0, z)) / hypot(1.0, z)) / y_m));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[(N[(N[(N[(1.0 / x$95$m), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \left(x\_s \cdot \frac{\frac{\frac{\frac{1}{x\_m}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}}{y\_m}\right)
\end{array}
Derivation
  1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 95.0% accurate, 0.1× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z \cdot z \leq 10^{+15}:\\ \;\;\;\;\frac{\frac{1}{x\_m}}{y\_m \cdot \left(1 + z \cdot z\right)}\\ \mathbf{elif}\;z \cdot z \leq 5 \cdot 10^{+305}:\\ \;\;\;\;\frac{1}{y\_m \cdot \left(x\_m \cdot {z}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{z} \cdot \frac{\frac{1}{y\_m}}{z}}{x\_m}\\ \end{array}\right) \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (*
  y_s
  (*
   x_s
   (if (<= (* z z) 1e+15)
     (/ (/ 1.0 x_m) (* y_m (+ 1.0 (* z z))))
     (if (<= (* z z) 5e+305)
       (/ 1.0 (* y_m (* x_m (pow z 2.0))))
       (/ (* (/ 1.0 z) (/ (/ 1.0 y_m) z)) x_m))))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z * z) <= 1e+15) {
		tmp = (1.0 / x_m) / (y_m * (1.0 + (z * z)));
	} else if ((z * z) <= 5e+305) {
		tmp = 1.0 / (y_m * (x_m * pow(z, 2.0)));
	} else {
		tmp = ((1.0 / z) * ((1.0 / y_m) / z)) / x_m;
	}
	return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z * z) <= 1d+15) then
        tmp = (1.0d0 / x_m) / (y_m * (1.0d0 + (z * z)))
    else if ((z * z) <= 5d+305) then
        tmp = 1.0d0 / (y_m * (x_m * (z ** 2.0d0)))
    else
        tmp = ((1.0d0 / z) * ((1.0d0 / y_m) / z)) / x_m
    end if
    code = y_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z * z) <= 1e+15) {
		tmp = (1.0 / x_m) / (y_m * (1.0 + (z * z)));
	} else if ((z * z) <= 5e+305) {
		tmp = 1.0 / (y_m * (x_m * Math.pow(z, 2.0)));
	} else {
		tmp = ((1.0 / z) * ((1.0 / y_m) / z)) / x_m;
	}
	return y_s * (x_s * tmp);
}
x_m = math.fabs(x)
x_s = math.copysign(1.0, x)
y_m = math.fabs(y)
y_s = math.copysign(1.0, y)
def code(y_s, x_s, x_m, y_m, z):
	tmp = 0
	if (z * z) <= 1e+15:
		tmp = (1.0 / x_m) / (y_m * (1.0 + (z * z)))
	elif (z * z) <= 5e+305:
		tmp = 1.0 / (y_m * (x_m * math.pow(z, 2.0)))
	else:
		tmp = ((1.0 / z) * ((1.0 / y_m) / z)) / x_m
	return y_s * (x_s * tmp)
x_m = abs(x)
x_s = copysign(1.0, x)
y_m = abs(y)
y_s = copysign(1.0, y)
function code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0
	if (Float64(z * z) <= 1e+15)
		tmp = Float64(Float64(1.0 / x_m) / Float64(y_m * Float64(1.0 + Float64(z * z))));
	elseif (Float64(z * z) <= 5e+305)
		tmp = Float64(1.0 / Float64(y_m * Float64(x_m * (z ^ 2.0))));
	else
		tmp = Float64(Float64(Float64(1.0 / z) * Float64(Float64(1.0 / y_m) / z)) / x_m);
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0;
	if ((z * z) <= 1e+15)
		tmp = (1.0 / x_m) / (y_m * (1.0 + (z * z)));
	elseif ((z * z) <= 5e+305)
		tmp = 1.0 / (y_m * (x_m * (z ^ 2.0)));
	else
		tmp = ((1.0 / z) * ((1.0 / y_m) / z)) / x_m;
	end
	tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[N[(z * z), $MachinePrecision], 1e+15], N[(N[(1.0 / x$95$m), $MachinePrecision] / N[(y$95$m * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * z), $MachinePrecision], 5e+305], N[(1.0 / N[(y$95$m * N[(x$95$m * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / z), $MachinePrecision] * N[(N[(1.0 / y$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / x$95$m), $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{+15}:\\
\;\;\;\;\frac{\frac{1}{x\_m}}{y\_m \cdot \left(1 + z \cdot z\right)}\\

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

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


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

    1. Initial program 99.0%

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

    if 1e15 < (*.f64 z z) < 5.00000000000000009e305

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000009e305 < (*.f64 z z)

    1. Initial program 72.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{y \cdot \left(1 - {z}^{4}\right)} \cdot \left(y - y \cdot {z}^{2}\right)}{x}} \]
    11. Taylor expanded in z around inf 72.0%

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

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

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

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

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

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

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

Alternative 4: 91.1% accurate, 0.1× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;y\_m \cdot \left(1 + z \cdot z\right) \leq 10^{+305}:\\ \;\;\;\;\frac{\frac{1}{x\_m \cdot \left(1 + {z}^{2}\right)}}{y\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{1}{x\_m \cdot z}}{\mathsf{hypot}\left(1, z\right)}}{y\_m}\\ \end{array}\right) \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (*
  y_s
  (*
   x_s
   (if (<= (* y_m (+ 1.0 (* z z))) 1e+305)
     (/ (/ 1.0 (* x_m (+ 1.0 (pow z 2.0)))) y_m)
     (/ (/ (/ 1.0 (* x_m z)) (hypot 1.0 z)) y_m)))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((y_m * (1.0 + (z * z))) <= 1e+305) {
		tmp = (1.0 / (x_m * (1.0 + pow(z, 2.0)))) / y_m;
	} else {
		tmp = ((1.0 / (x_m * z)) / hypot(1.0, z)) / y_m;
	}
	return y_s * (x_s * tmp);
}
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((y_m * (1.0 + (z * z))) <= 1e+305) {
		tmp = (1.0 / (x_m * (1.0 + Math.pow(z, 2.0)))) / y_m;
	} else {
		tmp = ((1.0 / (x_m * z)) / Math.hypot(1.0, z)) / y_m;
	}
	return y_s * (x_s * tmp);
}
x_m = math.fabs(x)
x_s = math.copysign(1.0, x)
y_m = math.fabs(y)
y_s = math.copysign(1.0, y)
def code(y_s, x_s, x_m, y_m, z):
	tmp = 0
	if (y_m * (1.0 + (z * z))) <= 1e+305:
		tmp = (1.0 / (x_m * (1.0 + math.pow(z, 2.0)))) / y_m
	else:
		tmp = ((1.0 / (x_m * z)) / math.hypot(1.0, z)) / y_m
	return y_s * (x_s * tmp)
x_m = abs(x)
x_s = copysign(1.0, x)
y_m = abs(y)
y_s = copysign(1.0, y)
function code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0
	if (Float64(y_m * Float64(1.0 + Float64(z * z))) <= 1e+305)
		tmp = Float64(Float64(1.0 / Float64(x_m * Float64(1.0 + (z ^ 2.0)))) / y_m);
	else
		tmp = Float64(Float64(Float64(1.0 / Float64(x_m * z)) / hypot(1.0, z)) / y_m);
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0;
	if ((y_m * (1.0 + (z * z))) <= 1e+305)
		tmp = (1.0 / (x_m * (1.0 + (z ^ 2.0)))) / y_m;
	else
		tmp = ((1.0 / (x_m * z)) / hypot(1.0, z)) / y_m;
	end
	tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[N[(y$95$m * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+305], N[(N[(1.0 / N[(x$95$m * N[(1.0 + N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(N[(1.0 / N[(x$95$m * z), $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \cdot \left(1 + z \cdot z\right) \leq 10^{+305}:\\
\;\;\;\;\frac{\frac{1}{x\_m \cdot \left(1 + {z}^{2}\right)}}{y\_m}\\

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


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

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999994e304 < (*.f64 y (+.f64 1 (*.f64 z z)))

    1. Initial program 70.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 85.6% accurate, 0.1× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+29}:\\ \;\;\;\;\frac{1}{x\_m \cdot y\_m} \cdot \frac{1}{\mathsf{fma}\left(z, z, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{1}{x\_m \cdot z}}{\mathsf{hypot}\left(1, z\right)}}{y\_m}\\ \end{array}\right) \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (*
  y_s
  (*
   x_s
   (if (<= (* z z) 2e+29)
     (* (/ 1.0 (* x_m y_m)) (/ 1.0 (fma z z 1.0)))
     (/ (/ (/ 1.0 (* x_m z)) (hypot 1.0 z)) y_m)))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z * z) <= 2e+29) {
		tmp = (1.0 / (x_m * y_m)) * (1.0 / fma(z, z, 1.0));
	} else {
		tmp = ((1.0 / (x_m * z)) / hypot(1.0, z)) / y_m;
	}
	return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0, x)
y_m = abs(y)
y_s = copysign(1.0, y)
function code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0
	if (Float64(z * z) <= 2e+29)
		tmp = Float64(Float64(1.0 / Float64(x_m * y_m)) * Float64(1.0 / fma(z, z, 1.0)));
	else
		tmp = Float64(Float64(Float64(1.0 / Float64(x_m * z)) / hypot(1.0, z)) / y_m);
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[N[(z * z), $MachinePrecision], 2e+29], N[(N[(1.0 / N[(x$95$m * y$95$m), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(z * z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(x$95$m * z), $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+29}:\\
\;\;\;\;\frac{1}{x\_m \cdot y\_m} \cdot \frac{1}{\mathsf{fma}\left(z, z, 1\right)}\\

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


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

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{z \cdot z + 1}} \cdot \frac{\frac{1}{x}}{y} \]
      10. fma-udef99.0%

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

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

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

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

    if 1.99999999999999983e29 < (*.f64 z z)

    1. Initial program 79.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 95.1% accurate, 0.1× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+305}:\\ \;\;\;\;\frac{\frac{1}{x\_m \cdot \left(1 + {z}^{2}\right)}}{y\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{z} \cdot \frac{\frac{1}{y\_m}}{z}}{x\_m}\\ \end{array}\right) \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (*
  y_s
  (*
   x_s
   (if (<= (* z z) 5e+305)
     (/ (/ 1.0 (* x_m (+ 1.0 (pow z 2.0)))) y_m)
     (/ (* (/ 1.0 z) (/ (/ 1.0 y_m) z)) x_m)))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z * z) <= 5e+305) {
		tmp = (1.0 / (x_m * (1.0 + pow(z, 2.0)))) / y_m;
	} else {
		tmp = ((1.0 / z) * ((1.0 / y_m) / z)) / x_m;
	}
	return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z * z) <= 5d+305) then
        tmp = (1.0d0 / (x_m * (1.0d0 + (z ** 2.0d0)))) / y_m
    else
        tmp = ((1.0d0 / z) * ((1.0d0 / y_m) / z)) / x_m
    end if
    code = y_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z * z) <= 5e+305) {
		tmp = (1.0 / (x_m * (1.0 + Math.pow(z, 2.0)))) / y_m;
	} else {
		tmp = ((1.0 / z) * ((1.0 / y_m) / z)) / x_m;
	}
	return y_s * (x_s * tmp);
}
x_m = math.fabs(x)
x_s = math.copysign(1.0, x)
y_m = math.fabs(y)
y_s = math.copysign(1.0, y)
def code(y_s, x_s, x_m, y_m, z):
	tmp = 0
	if (z * z) <= 5e+305:
		tmp = (1.0 / (x_m * (1.0 + math.pow(z, 2.0)))) / y_m
	else:
		tmp = ((1.0 / z) * ((1.0 / y_m) / z)) / x_m
	return y_s * (x_s * tmp)
x_m = abs(x)
x_s = copysign(1.0, x)
y_m = abs(y)
y_s = copysign(1.0, y)
function code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0
	if (Float64(z * z) <= 5e+305)
		tmp = Float64(Float64(1.0 / Float64(x_m * Float64(1.0 + (z ^ 2.0)))) / y_m);
	else
		tmp = Float64(Float64(Float64(1.0 / z) * Float64(Float64(1.0 / y_m) / z)) / x_m);
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0;
	if ((z * z) <= 5e+305)
		tmp = (1.0 / (x_m * (1.0 + (z ^ 2.0)))) / y_m;
	else
		tmp = ((1.0 / z) * ((1.0 / y_m) / z)) / x_m;
	end
	tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[N[(z * z), $MachinePrecision], 5e+305], N[(N[(1.0 / N[(x$95$m * N[(1.0 + N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(N[(1.0 / z), $MachinePrecision] * N[(N[(1.0 / y$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+305}:\\
\;\;\;\;\frac{\frac{1}{x\_m \cdot \left(1 + {z}^{2}\right)}}{y\_m}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000009e305 < (*.f64 z z)

    1. Initial program 72.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{y \cdot \left(1 - {z}^{4}\right)} \cdot \left(y - y \cdot {z}^{2}\right)}{x}} \]
    11. Taylor expanded in z around inf 72.0%

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

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

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

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

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

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

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

Alternative 7: 85.6% accurate, 0.1× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+29}:\\ \;\;\;\;\frac{\frac{1}{x\_m \cdot y\_m}}{\mathsf{fma}\left(z, z, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{1}{x\_m \cdot z}}{\mathsf{hypot}\left(1, z\right)}}{y\_m}\\ \end{array}\right) \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (*
  y_s
  (*
   x_s
   (if (<= (* z z) 2e+29)
     (/ (/ 1.0 (* x_m y_m)) (fma z z 1.0))
     (/ (/ (/ 1.0 (* x_m z)) (hypot 1.0 z)) y_m)))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z * z) <= 2e+29) {
		tmp = (1.0 / (x_m * y_m)) / fma(z, z, 1.0);
	} else {
		tmp = ((1.0 / (x_m * z)) / hypot(1.0, z)) / y_m;
	}
	return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0, x)
y_m = abs(y)
y_s = copysign(1.0, y)
function code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0
	if (Float64(z * z) <= 2e+29)
		tmp = Float64(Float64(1.0 / Float64(x_m * y_m)) / fma(z, z, 1.0));
	else
		tmp = Float64(Float64(Float64(1.0 / Float64(x_m * z)) / hypot(1.0, z)) / y_m);
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[N[(z * z), $MachinePrecision], 2e+29], N[(N[(1.0 / N[(x$95$m * y$95$m), $MachinePrecision]), $MachinePrecision] / N[(z * z + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(x$95$m * z), $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+29}:\\
\;\;\;\;\frac{\frac{1}{x\_m \cdot y\_m}}{\mathsf{fma}\left(z, z, 1\right)}\\

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


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

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{y}}{\mathsf{fma}\left(z, z, 1\right)}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity99.0%

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

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

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

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

    if 1.99999999999999983e29 < (*.f64 z z)

    1. Initial program 79.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 94.8% accurate, 0.1× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+305}:\\ \;\;\;\;\frac{1}{y\_m \cdot \left(x\_m \cdot \mathsf{fma}\left(z, z, 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{z} \cdot \frac{\frac{1}{y\_m}}{z}}{x\_m}\\ \end{array}\right) \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (*
  y_s
  (*
   x_s
   (if (<= (* z z) 5e+305)
     (/ 1.0 (* y_m (* x_m (fma z z 1.0))))
     (/ (* (/ 1.0 z) (/ (/ 1.0 y_m) z)) x_m)))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z * z) <= 5e+305) {
		tmp = 1.0 / (y_m * (x_m * fma(z, z, 1.0)));
	} else {
		tmp = ((1.0 / z) * ((1.0 / y_m) / z)) / x_m;
	}
	return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0, x)
y_m = abs(y)
y_s = copysign(1.0, y)
function code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0
	if (Float64(z * z) <= 5e+305)
		tmp = Float64(1.0 / Float64(y_m * Float64(x_m * fma(z, z, 1.0))));
	else
		tmp = Float64(Float64(Float64(1.0 / z) * Float64(Float64(1.0 / y_m) / z)) / x_m);
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[N[(z * z), $MachinePrecision], 5e+305], N[(1.0 / N[(y$95$m * N[(x$95$m * N[(z * z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / z), $MachinePrecision] * N[(N[(1.0 / y$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+305}:\\
\;\;\;\;\frac{1}{y\_m \cdot \left(x\_m \cdot \mathsf{fma}\left(z, z, 1\right)\right)}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000009e305 < (*.f64 z z)

    1. Initial program 72.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{y \cdot \left(1 - {z}^{4}\right)} \cdot \left(y - y \cdot {z}^{2}\right)}{x}} \]
    11. Taylor expanded in z around inf 72.0%

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

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

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

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

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

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

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

Alternative 9: 90.6% accurate, 1.0× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \left(x\_s \cdot \frac{1}{x\_m \cdot \left(y\_m \cdot \left(1 + z \cdot z\right)\right)}\right) \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (* y_s (* x_s (/ 1.0 (* x_m (* y_m (+ 1.0 (* z z))))))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * (1.0 / (x_m * (y_m * (1.0 + (z * z))))));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    code = y_s * (x_s * (1.0d0 / (x_m * (y_m * (1.0d0 + (z * z))))))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * (1.0 / (x_m * (y_m * (1.0 + (z * z))))));
}
x_m = math.fabs(x)
x_s = math.copysign(1.0, x)
y_m = math.fabs(y)
y_s = math.copysign(1.0, y)
def code(y_s, x_s, x_m, y_m, z):
	return y_s * (x_s * (1.0 / (x_m * (y_m * (1.0 + (z * z))))))
x_m = abs(x)
x_s = copysign(1.0, x)
y_m = abs(y)
y_s = copysign(1.0, y)
function code(y_s, x_s, x_m, y_m, z)
	return Float64(y_s * Float64(x_s * Float64(1.0 / Float64(x_m * Float64(y_m * Float64(1.0 + Float64(z * z)))))))
end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
function tmp = code(y_s, x_s, x_m, y_m, z)
	tmp = y_s * (x_s * (1.0 / (x_m * (y_m * (1.0 + (z * z))))));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[(1.0 / N[(x$95$m * N[(y$95$m * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \left(x\_s \cdot \frac{1}{x\_m \cdot \left(y\_m \cdot \left(1 + z \cdot z\right)\right)}\right)
\end{array}
Derivation
  1. Initial program 89.8%

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

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

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

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

Alternative 10: 94.6% accurate, 1.0× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \left(x\_s \cdot \frac{1}{x\_m \cdot \left(y\_m + z \cdot \left(z \cdot y\_m\right)\right)}\right) \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (* y_s (* x_s (/ 1.0 (* x_m (+ y_m (* z (* z y_m))))))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * (1.0 / (x_m * (y_m + (z * (z * y_m))))));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    code = y_s * (x_s * (1.0d0 / (x_m * (y_m + (z * (z * y_m))))))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * (1.0 / (x_m * (y_m + (z * (z * y_m))))));
}
x_m = math.fabs(x)
x_s = math.copysign(1.0, x)
y_m = math.fabs(y)
y_s = math.copysign(1.0, y)
def code(y_s, x_s, x_m, y_m, z):
	return y_s * (x_s * (1.0 / (x_m * (y_m + (z * (z * y_m))))))
x_m = abs(x)
x_s = copysign(1.0, x)
y_m = abs(y)
y_s = copysign(1.0, y)
function code(y_s, x_s, x_m, y_m, z)
	return Float64(y_s * Float64(x_s * Float64(1.0 / Float64(x_m * Float64(y_m + Float64(z * Float64(z * y_m)))))))
end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
function tmp = code(y_s, x_s, x_m, y_m, z)
	tmp = y_s * (x_s * (1.0 / (x_m * (y_m + (z * (z * y_m))))));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[(1.0 / N[(x$95$m * N[(y$95$m + N[(z * N[(z * y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \left(x\_s \cdot \frac{1}{x\_m \cdot \left(y\_m + z \cdot \left(z \cdot y\_m\right)\right)}\right)
\end{array}
Derivation
  1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 58.6% accurate, 2.2× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \left(x\_s \cdot \frac{1}{x\_m \cdot y\_m}\right) \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (* y_s (* x_s (/ 1.0 (* x_m y_m)))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * (1.0 / (x_m * y_m)));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    code = y_s * (x_s * (1.0d0 / (x_m * y_m)))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * (1.0 / (x_m * y_m)));
}
x_m = math.fabs(x)
x_s = math.copysign(1.0, x)
y_m = math.fabs(y)
y_s = math.copysign(1.0, y)
def code(y_s, x_s, x_m, y_m, z):
	return y_s * (x_s * (1.0 / (x_m * y_m)))
x_m = abs(x)
x_s = copysign(1.0, x)
y_m = abs(y)
y_s = copysign(1.0, y)
function code(y_s, x_s, x_m, y_m, z)
	return Float64(y_s * Float64(x_s * Float64(1.0 / Float64(x_m * y_m))))
end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
function tmp = code(y_s, x_s, x_m, y_m, z)
	tmp = y_s * (x_s * (1.0 / (x_m * y_m)));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[(1.0 / N[(x$95$m * y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \left(x\_s \cdot \frac{1}{x\_m \cdot y\_m}\right)
\end{array}
Derivation
  1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 58.6% accurate, 2.2× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \left(x\_s \cdot \frac{\frac{1}{y\_m}}{x\_m}\right) \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (* y_s (* x_s (/ (/ 1.0 y_m) x_m))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * ((1.0 / y_m) / x_m));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    code = y_s * (x_s * ((1.0d0 / y_m) / x_m))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * ((1.0 / y_m) / x_m));
}
x_m = math.fabs(x)
x_s = math.copysign(1.0, x)
y_m = math.fabs(y)
y_s = math.copysign(1.0, y)
def code(y_s, x_s, x_m, y_m, z):
	return y_s * (x_s * ((1.0 / y_m) / x_m))
x_m = abs(x)
x_s = copysign(1.0, x)
y_m = abs(y)
y_s = copysign(1.0, y)
function code(y_s, x_s, x_m, y_m, z)
	return Float64(y_s * Float64(x_s * Float64(Float64(1.0 / y_m) / x_m)))
end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
function tmp = code(y_s, x_s, x_m, y_m, z)
	tmp = y_s * (x_s * ((1.0 / y_m) / x_m));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[(N[(1.0 / y$95$m), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \left(x\_s \cdot \frac{\frac{1}{y\_m}}{x\_m}\right)
\end{array}
Derivation
  1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{\frac{1}{y}}{y - \color{blue}{{z}^{4} \cdot y}} \cdot \left(y - y \cdot {z}^{2}\right)}{x} \]
    6. cancel-sign-sub-inv46.9%

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{y \cdot \left(1 - {z}^{4}\right)} \cdot \left(y - y \cdot {z}^{2}\right)}{x}} \]
  11. Taylor expanded in z around 0 57.8%

    \[\leadsto \frac{\color{blue}{\frac{1}{y}}}{x} \]
  12. Final simplification57.8%

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

Developer target: 92.8% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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

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

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