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

Percentage Accurate: 90.9% → 98.0%
Time: 14.2s
Alternatives: 10
Speedup: 0.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

\[\begin{array}{l} z_m = \left|z\right| \\ y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ \begin{array}{l} t_0 := y_m \cdot \left(1 + z_m \cdot z_m\right)\\ y_s \cdot \begin{array}{l} \mathbf{if}\;t_0 \leq 5 \cdot 10^{+298}:\\ \;\;\;\;\frac{1}{x \cdot t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{hypot}\left(1, z_m\right) \cdot \left(y_m \cdot \left(z_m \cdot x\right)\right)}\\ \end{array} \end{array} \end{array} \]
z_m = (fabs.f64 z)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x y_m z_m)
 :precision binary64
 (let* ((t_0 (* y_m (+ 1.0 (* z_m z_m)))))
   (*
    y_s
    (if (<= t_0 5e+298)
      (/ 1.0 (* x t_0))
      (/ 1.0 (* (hypot 1.0 z_m) (* y_m (* z_m x))))))))
z_m = fabs(z);
y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z_m) {
	double t_0 = y_m * (1.0 + (z_m * z_m));
	double tmp;
	if (t_0 <= 5e+298) {
		tmp = 1.0 / (x * t_0);
	} else {
		tmp = 1.0 / (hypot(1.0, z_m) * (y_m * (z_m * x)));
	}
	return y_s * tmp;
}
z_m = Math.abs(z);
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_m) {
	double t_0 = y_m * (1.0 + (z_m * z_m));
	double tmp;
	if (t_0 <= 5e+298) {
		tmp = 1.0 / (x * t_0);
	} else {
		tmp = 1.0 / (Math.hypot(1.0, z_m) * (y_m * (z_m * x)));
	}
	return y_s * tmp;
}
z_m = math.fabs(z)
y_m = math.fabs(y)
y_s = math.copysign(1.0, y)
def code(y_s, x, y_m, z_m):
	t_0 = y_m * (1.0 + (z_m * z_m))
	tmp = 0
	if t_0 <= 5e+298:
		tmp = 1.0 / (x * t_0)
	else:
		tmp = 1.0 / (math.hypot(1.0, z_m) * (y_m * (z_m * x)))
	return y_s * tmp
z_m = abs(z)
y_m = abs(y)
y_s = copysign(1.0, y)
function code(y_s, x, y_m, z_m)
	t_0 = Float64(y_m * Float64(1.0 + Float64(z_m * z_m)))
	tmp = 0.0
	if (t_0 <= 5e+298)
		tmp = Float64(1.0 / Float64(x * t_0));
	else
		tmp = Float64(1.0 / Float64(hypot(1.0, z_m) * Float64(y_m * Float64(z_m * x))));
	end
	return Float64(y_s * tmp)
end
z_m = abs(z);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
function tmp_2 = code(y_s, x, y_m, z_m)
	t_0 = y_m * (1.0 + (z_m * z_m));
	tmp = 0.0;
	if (t_0 <= 5e+298)
		tmp = 1.0 / (x * t_0);
	else
		tmp = 1.0 / (hypot(1.0, z_m) * (y_m * (z_m * x)));
	end
	tmp_2 = y_s * tmp;
end
z_m = N[Abs[z], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z$95$m_] := Block[{t$95$0 = N[(y$95$m * N[(1.0 + N[(z$95$m * z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * If[LessEqual[t$95$0, 5e+298], N[(1.0 / N[(x * t$95$0), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[1.0 ^ 2 + z$95$m ^ 2], $MachinePrecision] * N[(y$95$m * N[(z$95$m * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)

\\
\begin{array}{l}
t_0 := y_m \cdot \left(1 + z_m \cdot z_m\right)\\
y_s \cdot \begin{array}{l}
\mathbf{if}\;t_0 \leq 5 \cdot 10^{+298}:\\
\;\;\;\;\frac{1}{x \cdot t_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(1, z_m\right) \cdot \left(y_m \cdot \left(z_m \cdot x\right)\right)}\\


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

    1. Initial program 96.5%

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

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

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

    if 5.0000000000000003e298 < (*.f64 y (+.f64 1 (*.f64 z z)))

    1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.6% accurate, 0.0× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ \begin{array}{l} t_0 := \mathsf{hypot}\left(1, z_m\right) \cdot \sqrt{y_m}\\ y_s \cdot \frac{1}{\frac{t_0}{\frac{\frac{1}{x}}{t_0}}} \end{array} \end{array} \]
z_m = (fabs.f64 z)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x y_m z_m)
 :precision binary64
 (let* ((t_0 (* (hypot 1.0 z_m) (sqrt y_m))))
   (* y_s (/ 1.0 (/ t_0 (/ (/ 1.0 x) t_0))))))
z_m = fabs(z);
y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z_m) {
	double t_0 = hypot(1.0, z_m) * sqrt(y_m);
	return y_s * (1.0 / (t_0 / ((1.0 / x) / t_0)));
}
z_m = Math.abs(z);
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_m) {
	double t_0 = Math.hypot(1.0, z_m) * Math.sqrt(y_m);
	return y_s * (1.0 / (t_0 / ((1.0 / x) / t_0)));
}
z_m = math.fabs(z)
y_m = math.fabs(y)
y_s = math.copysign(1.0, y)
def code(y_s, x, y_m, z_m):
	t_0 = math.hypot(1.0, z_m) * math.sqrt(y_m)
	return y_s * (1.0 / (t_0 / ((1.0 / x) / t_0)))
z_m = abs(z)
y_m = abs(y)
y_s = copysign(1.0, y)
function code(y_s, x, y_m, z_m)
	t_0 = Float64(hypot(1.0, z_m) * sqrt(y_m))
	return Float64(y_s * Float64(1.0 / Float64(t_0 / Float64(Float64(1.0 / x) / t_0))))
end
z_m = abs(z);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
function tmp = code(y_s, x, y_m, z_m)
	t_0 = hypot(1.0, z_m) * sqrt(y_m);
	tmp = y_s * (1.0 / (t_0 / ((1.0 / x) / t_0)));
end
z_m = N[Abs[z], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z$95$m_] := Block[{t$95$0 = N[(N[Sqrt[1.0 ^ 2 + z$95$m ^ 2], $MachinePrecision] * N[Sqrt[y$95$m], $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * N[(1.0 / N[(t$95$0 / N[(N[(1.0 / x), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)

\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(1, z_m\right) \cdot \sqrt{y_m}\\
y_s \cdot \frac{1}{\frac{t_0}{\frac{\frac{1}{x}}{t_0}}}
\end{array}
\end{array}
Derivation
  1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 49.8% accurate, 0.0× speedup?

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

\\
y_s \cdot {\left(\frac{{x}^{-0.5}}{\mathsf{hypot}\left(1, z_m\right) \cdot \sqrt{y_m}}\right)}^{2}
\end{array}
Derivation
  1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 47.4% accurate, 0.0× speedup?

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

\\
y_s \cdot \frac{{\left(\frac{{x}^{-0.5}}{\mathsf{hypot}\left(1, z_m\right)}\right)}^{2}}{y_m}
\end{array}
Derivation
  1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\frac{y}{\frac{\frac{1}{x}}{\color{blue}{z \cdot z + 1}}}} \]
    9. fma-udef92.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 94.5% accurate, 0.1× speedup?

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

\\
y_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \cdot z_m \leq 5 \cdot 10^{+65}:\\
\;\;\;\;\frac{1}{x \cdot \mathsf{fma}\left(z_m \cdot y_m, z_m, y_m\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z_m} \cdot \frac{\frac{1}{x}}{z_m}}{y_m}\\


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

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

    if 4.99999999999999973e65 < (*.f64 z z)

    1. Initial program 85.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 98.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_0 := y_m \cdot \left(1 + z_m \cdot z_m\right)\\
y_s \cdot \begin{array}{l}
\mathbf{if}\;t_0 \leq 10^{+305}:\\
\;\;\;\;\frac{1}{x \cdot t_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z_m}}{y_m} \cdot \frac{\frac{1}{z_m}}{x}\\


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

    1. Initial program 96.5%

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

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

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

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

    1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{{z}^{-2}} \cdot \sqrt{{z}^{-2}}}{\color{blue}{y \cdot x}} \]
      3. times-frac81.9%

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

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

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

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

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

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

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

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

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

Alternative 7: 94.5% accurate, 0.6× speedup?

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

\\
y_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \cdot z_m \leq 1.5 \cdot 10^{+69}:\\
\;\;\;\;\frac{1}{x \cdot \left(y_m \cdot \left(1 + z_m \cdot z_m\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z_m} \cdot \frac{\frac{1}{x}}{z_m}}{y_m}\\


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

    1. Initial program 99.6%

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

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

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

    if 1.49999999999999992e69 < (*.f64 z z)

    1. Initial program 85.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 97.0% accurate, 0.7× speedup?

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

\\
y_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 0.52:\\
\;\;\;\;\frac{1}{y_m \cdot x}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z_m}}{y_m} \cdot \frac{\frac{1}{z_m}}{x}\\


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

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.52000000000000002 < z

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 70.1% accurate, 0.9× speedup?

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

\\
y_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 0.52:\\
\;\;\;\;\frac{1}{y_m \cdot x}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \left(z_m \cdot y_m\right)}\\


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

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.52000000000000002 < z

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{x \cdot \left(y \cdot z\right)}} \]
    9. Step-by-step derivation
      1. *-commutative37.9%

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

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

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

Alternative 10: 58.7% accurate, 2.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 93.0% 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 2024021 
(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)))))