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

Percentage Accurate: 90.3% → 98.8%
Time: 14.2s
Alternatives: 9
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 90.3% accurate, 1.0× speedup?

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

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

Alternative 1: 98.8% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 95.8%

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

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

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

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

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

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

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

    if 1.00000000000000005e301 < (*.f64 y (+.f64 1 (*.f64 z z)))

    1. Initial program 76.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1}{z}}{1} \cdot \frac{\frac{1}{z}}{x \cdot y}} \]
    14. Step-by-step derivation
      1. /-rgt-identity92.4%

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

        \[\leadsto \frac{1}{z} \cdot \color{blue}{\frac{1}{\left(x \cdot y\right) \cdot z}} \]
      3. un-div-inv92.4%

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

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

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

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

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

Alternative 2: 98.7% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\frac{{x}^{-0.5}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}}\right)}^{2}} \]
  8. Simplified25.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. unpow225.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. div-inv25.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 49.8% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\frac{{x}^{-0.5}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}}\right)}^{2}} \]
  8. Simplified25.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. expm1-log1p-u24.8%

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

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

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

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

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

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

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

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

Alternative 4: 47.4% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 98.5% accurate, 0.5× speedup?

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

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

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


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

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

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

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

    if 1.00000000000000005e301 < (*.f64 y (+.f64 1 (*.f64 z z)))

    1. Initial program 76.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1}{z}}{1} \cdot \frac{\frac{1}{z}}{x \cdot y}} \]
    14. Step-by-step derivation
      1. /-rgt-identity92.4%

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

        \[\leadsto \frac{1}{z} \cdot \color{blue}{\frac{1}{\left(x \cdot y\right) \cdot z}} \]
      3. un-div-inv92.4%

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

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

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

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

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

Alternative 6: 98.8% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 95.8%

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

    if 1.00000000000000005e301 < (*.f64 y (+.f64 1 (*.f64 z z)))

    1. Initial program 76.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1}{z}}{1} \cdot \frac{\frac{1}{z}}{x \cdot y}} \]
    14. Step-by-step derivation
      1. /-rgt-identity92.4%

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

        \[\leadsto \frac{1}{z} \cdot \color{blue}{\frac{1}{\left(x \cdot y\right) \cdot z}} \]
      3. un-div-inv92.4%

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

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

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

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

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

Alternative 7: 77.0% accurate, 0.8× speedup?

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

\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 0.019:\\
\;\;\;\;\frac{\frac{-1}{y\_m}}{-x}\\

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


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

    1. Initial program 94.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{y} \cdot \color{blue}{\frac{1}{x}} \]
    8. Step-by-step derivation
      1. un-div-inv67.5%

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x}} \]
      2. frac-2neg67.5%

        \[\leadsto \color{blue}{\frac{-\frac{1}{y}}{-x}} \]
      3. neg-mul-167.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot \frac{1}{y}}}{-x} \]
      4. un-div-inv67.5%

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

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

    if 0.0189999999999999995 < z

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1}{z}}{1} \cdot \frac{\frac{1}{z}}{x \cdot y}} \]
    14. Step-by-step derivation
      1. /-rgt-identity88.4%

        \[\leadsto \color{blue}{\frac{1}{z}} \cdot \frac{\frac{1}{z}}{x \cdot y} \]
      2. *-commutative88.4%

        \[\leadsto \color{blue}{\frac{\frac{1}{z}}{x \cdot y} \cdot \frac{1}{z}} \]
      3. clear-num88.3%

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

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

        \[\leadsto \frac{\color{blue}{1}}{\frac{x \cdot y}{\frac{1}{z}} \cdot z} \]
      6. div-inv88.4%

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

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

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

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

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

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

Alternative 8: 77.1% accurate, 0.8× speedup?

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

\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 0.019:\\
\;\;\;\;\frac{\frac{-1}{y\_m}}{-x}\\

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


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

    1. Initial program 94.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{y} \cdot \color{blue}{\frac{1}{x}} \]
    8. Step-by-step derivation
      1. un-div-inv67.5%

        \[\leadsto \color{blue}{\frac{\frac{1}{y}}{x}} \]
      2. frac-2neg67.5%

        \[\leadsto \color{blue}{\frac{-\frac{1}{y}}{-x}} \]
      3. neg-mul-167.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot \frac{1}{y}}}{-x} \]
      4. un-div-inv67.5%

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

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

    if 0.0189999999999999995 < z

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1}{z}}{1} \cdot \frac{\frac{1}{z}}{x \cdot y}} \]
    14. Step-by-step derivation
      1. /-rgt-identity88.4%

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

        \[\leadsto \frac{1}{z} \cdot \color{blue}{\frac{1}{\left(x \cdot y\right) \cdot z}} \]
      3. un-div-inv88.5%

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

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

        \[\leadsto \frac{\frac{1}{z}}{\color{blue}{y \cdot \left(x \cdot z\right)}} \]
    15. Applied egg-rr95.5%

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

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

Alternative 9: 58.2% accurate, 2.2× speedup?

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

\\
y\_s \cdot \frac{1}{y\_m \cdot x}
\end{array}
Derivation
  1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 92.3% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024026 
(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)))))