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

Percentage Accurate: 90.6% → 98.3%
Time: 10.6s
Alternatives: 11
Speedup: 0.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 90.6% 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.3% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\\ \mathbf{if}\;y \cdot \left(1 + z \cdot z\right) \leq 2 \cdot 10^{-231}:\\ \;\;\;\;{\left(\frac{\mathsf{hypot}\left(1, z\right)}{\frac{1}{y \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot x\right)}}\right)}^{-1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{x}}{t_0} \cdot \frac{1}{t_0}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* (hypot 1.0 z) (sqrt y))))
   (if (<= (* y (+ 1.0 (* z z))) 2e-231)
     (pow (/ (hypot 1.0 z) (/ 1.0 (* y (* (hypot 1.0 z) x)))) -1.0)
     (* (/ (/ 1.0 x) t_0) (/ 1.0 t_0)))))
double code(double x, double y, double z) {
	double t_0 = hypot(1.0, z) * sqrt(y);
	double tmp;
	if ((y * (1.0 + (z * z))) <= 2e-231) {
		tmp = pow((hypot(1.0, z) / (1.0 / (y * (hypot(1.0, z) * x)))), -1.0);
	} else {
		tmp = ((1.0 / x) / t_0) * (1.0 / t_0);
	}
	return tmp;
}
public static double code(double x, double y, double z) {
	double t_0 = Math.hypot(1.0, z) * Math.sqrt(y);
	double tmp;
	if ((y * (1.0 + (z * z))) <= 2e-231) {
		tmp = Math.pow((Math.hypot(1.0, z) / (1.0 / (y * (Math.hypot(1.0, z) * x)))), -1.0);
	} else {
		tmp = ((1.0 / x) / t_0) * (1.0 / t_0);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = math.hypot(1.0, z) * math.sqrt(y)
	tmp = 0
	if (y * (1.0 + (z * z))) <= 2e-231:
		tmp = math.pow((math.hypot(1.0, z) / (1.0 / (y * (math.hypot(1.0, z) * x)))), -1.0)
	else:
		tmp = ((1.0 / x) / t_0) * (1.0 / t_0)
	return tmp
function code(x, y, z)
	t_0 = Float64(hypot(1.0, z) * sqrt(y))
	tmp = 0.0
	if (Float64(y * Float64(1.0 + Float64(z * z))) <= 2e-231)
		tmp = Float64(hypot(1.0, z) / Float64(1.0 / Float64(y * Float64(hypot(1.0, z) * x)))) ^ -1.0;
	else
		tmp = Float64(Float64(Float64(1.0 / x) / t_0) * Float64(1.0 / t_0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = hypot(1.0, z) * sqrt(y);
	tmp = 0.0;
	if ((y * (1.0 + (z * z))) <= 2e-231)
		tmp = (hypot(1.0, z) / (1.0 / (y * (hypot(1.0, z) * x)))) ^ -1.0;
	else
		tmp = ((1.0 / x) / t_0) * (1.0 / t_0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e-231], N[Power[N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] / N[(1.0 / N[(y * N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], N[(N[(N[(1.0 / x), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(1, z\right) \cdot \sqrt{y}\\
\mathbf{if}\;y \cdot \left(1 + z \cdot z\right) \leq 2 \cdot 10^{-231}:\\
\;\;\;\;{\left(\frac{\mathsf{hypot}\left(1, z\right)}{\frac{1}{y \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot x\right)}}\right)}^{-1}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x}}{t_0} \cdot \frac{1}{t_0}\\


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

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\frac{1}{x}}{y}}{\color{blue}{\sqrt{1 + z \cdot z} \cdot \sqrt{1 + z \cdot z}}} \]
      6. *-un-lft-identity94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e-231 < (*.f64 y (+.f64 1 (*.f64 z z)))

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 95.7% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{+29}:\\ \;\;\;\;\frac{\frac{-1}{y \cdot \left(-x\right)}}{1 + z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{y}}{\mathsf{hypot}\left(1, z\right) \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot x\right)}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -4e+29)
   (/ (/ -1.0 (* y (- x))) (+ 1.0 (* z z)))
   (/ (/ 1.0 y) (* (hypot 1.0 z) (* (hypot 1.0 z) x)))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -4e+29) {
		tmp = (-1.0 / (y * -x)) / (1.0 + (z * z));
	} else {
		tmp = (1.0 / y) / (hypot(1.0, z) * (hypot(1.0, z) * x));
	}
	return tmp;
}
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -4e+29) {
		tmp = (-1.0 / (y * -x)) / (1.0 + (z * z));
	} else {
		tmp = (1.0 / y) / (Math.hypot(1.0, z) * (Math.hypot(1.0, z) * x));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -4e+29:
		tmp = (-1.0 / (y * -x)) / (1.0 + (z * z))
	else:
		tmp = (1.0 / y) / (math.hypot(1.0, z) * (math.hypot(1.0, z) * x))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -4e+29)
		tmp = Float64(Float64(-1.0 / Float64(y * Float64(-x))) / Float64(1.0 + Float64(z * z)));
	else
		tmp = Float64(Float64(1.0 / y) / Float64(hypot(1.0, z) * Float64(hypot(1.0, z) * x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -4e+29)
		tmp = (-1.0 / (y * -x)) / (1.0 + (z * z));
	else
		tmp = (1.0 / y) / (hypot(1.0, z) * (hypot(1.0, z) * x));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -4e+29], N[(N[(-1.0 / N[(y * (-x)), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] / N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.99999999999999966e29

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{y}}{1 + z \cdot z}} \]
    4. Step-by-step derivation
      1. frac-2neg99.7%

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-1}}{x} \cdot \frac{1}{-y}}{1 + z \cdot z} \]
    5. Applied egg-rr99.7%

      \[\leadsto \frac{\color{blue}{\frac{-1}{x} \cdot \frac{1}{-y}}}{1 + z \cdot z} \]
    6. Step-by-step derivation
      1. associate-*r/99.7%

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-\frac{1}{x}}}{-y}}{1 + z \cdot z} \]
      5. distribute-neg-frac99.7%

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-1}}{-y \cdot x}}{1 + z \cdot z} \]
      10. distribute-lft-neg-out99.8%

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

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

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

    if -3.99999999999999966e29 < x

    1. Initial program 89.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\frac{1}{x}}{y}}{\color{blue}{\sqrt{1 + z \cdot z} \cdot \sqrt{1 + z \cdot z}}} \]
      6. *-un-lft-identity88.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\frac{\frac{1}{y}}{x \cdot \mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}\right)} - 1} \]
      3. associate-/l/45.9%

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

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

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

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

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

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

Alternative 3: 90.8% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 4 \cdot 10^{+144}:\\ \;\;\;\;\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{y \cdot \left(z \cdot x\right)}}{\mathsf{hypot}\left(1, z\right)}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= (* z z) 4e+144)
   (/ (/ 1.0 x) (* y (+ 1.0 (* z z))))
   (/ (/ 1.0 (* y (* z x))) (hypot 1.0 z))))
double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 4e+144) {
		tmp = (1.0 / x) / (y * (1.0 + (z * z)));
	} else {
		tmp = (1.0 / (y * (z * x))) / hypot(1.0, z);
	}
	return tmp;
}
public static double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 4e+144) {
		tmp = (1.0 / x) / (y * (1.0 + (z * z)));
	} else {
		tmp = (1.0 / (y * (z * x))) / Math.hypot(1.0, z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z * z) <= 4e+144:
		tmp = (1.0 / x) / (y * (1.0 + (z * z)))
	else:
		tmp = (1.0 / (y * (z * x))) / math.hypot(1.0, z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (Float64(z * z) <= 4e+144)
		tmp = Float64(Float64(1.0 / x) / Float64(y * Float64(1.0 + Float64(z * z))));
	else
		tmp = Float64(Float64(1.0 / Float64(y * Float64(z * x))) / hypot(1.0, z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z * z) <= 4e+144)
		tmp = (1.0 / x) / (y * (1.0 + (z * z)));
	else
		tmp = (1.0 / (y * (z * x))) / hypot(1.0, z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 4e+144], N[(N[(1.0 / x), $MachinePrecision] / N[(y * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 98.5%

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

    if 4.00000000000000009e144 < (*.f64 z z)

    1. Initial program 79.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\frac{1}{x}}{y}}{\color{blue}{\sqrt{1 + z \cdot z} \cdot \sqrt{1 + z \cdot z}}} \]
      6. *-un-lft-identity81.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 97.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+179}:\\ \;\;\;\;\frac{1}{x \cdot \left(y + y \cdot \left(z \cdot z\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y \cdot \left(z \cdot x\right)} \cdot \frac{1}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= (* z z) 2e+179)
   (/ 1.0 (* x (+ y (* y (* z z)))))
   (* (/ 1.0 (* y (* z x))) (/ 1.0 z))))
double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 2e+179) {
		tmp = 1.0 / (x * (y + (y * (z * z))));
	} else {
		tmp = (1.0 / (y * (z * x))) * (1.0 / z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z * z) <= 2d+179) then
        tmp = 1.0d0 / (x * (y + (y * (z * z))))
    else
        tmp = (1.0d0 / (y * (z * x))) * (1.0d0 / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 2e+179) {
		tmp = 1.0 / (x * (y + (y * (z * z))));
	} else {
		tmp = (1.0 / (y * (z * x))) * (1.0 / z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z * z) <= 2e+179:
		tmp = 1.0 / (x * (y + (y * (z * z))))
	else:
		tmp = (1.0 / (y * (z * x))) * (1.0 / z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (Float64(z * z) <= 2e+179)
		tmp = Float64(1.0 / Float64(x * Float64(y + Float64(y * Float64(z * z)))));
	else
		tmp = Float64(Float64(1.0 / Float64(y * Float64(z * x))) * Float64(1.0 / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z * z) <= 2e+179)
		tmp = 1.0 / (x * (y + (y * (z * z))));
	else
		tmp = (1.0 / (y * (z * x))) * (1.0 / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e+179], N[(1.0 / N[(x * N[(y + N[(y * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

    if 1.99999999999999996e179 < (*.f64 z z)

    1. Initial program 79.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{z \cdot \left(z \cdot \left(y \cdot x\right)\right)}} \]
    7. Step-by-step derivation
      1. inv-pow87.8%

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

        \[\leadsto {\color{blue}{\left(\left(z \cdot \left(y \cdot x\right)\right) \cdot z\right)}}^{-1} \]
      3. unpow-prod-down88.2%

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

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

        \[\leadsto {\color{blue}{\left(\left(z \cdot x\right) \cdot y\right)}}^{-1} \cdot {z}^{-1} \]
      6. inv-pow96.7%

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

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

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

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

Alternative 5: 97.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 10^{+183}:\\ \;\;\;\;\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y \cdot \left(z \cdot x\right)} \cdot \frac{1}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= (* z z) 1e+183)
   (/ (/ 1.0 x) (* y (+ 1.0 (* z z))))
   (* (/ 1.0 (* y (* z x))) (/ 1.0 z))))
double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 1e+183) {
		tmp = (1.0 / x) / (y * (1.0 + (z * z)));
	} else {
		tmp = (1.0 / (y * (z * x))) * (1.0 / z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z * z) <= 1d+183) then
        tmp = (1.0d0 / x) / (y * (1.0d0 + (z * z)))
    else
        tmp = (1.0d0 / (y * (z * x))) * (1.0d0 / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 1e+183) {
		tmp = (1.0 / x) / (y * (1.0 + (z * z)));
	} else {
		tmp = (1.0 / (y * (z * x))) * (1.0 / z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z * z) <= 1e+183:
		tmp = (1.0 / x) / (y * (1.0 + (z * z)))
	else:
		tmp = (1.0 / (y * (z * x))) * (1.0 / z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (Float64(z * z) <= 1e+183)
		tmp = Float64(Float64(1.0 / x) / Float64(y * Float64(1.0 + Float64(z * z))));
	else
		tmp = Float64(Float64(1.0 / Float64(y * Float64(z * x))) * Float64(1.0 / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z * z) <= 1e+183)
		tmp = (1.0 / x) / (y * (1.0 + (z * z)));
	else
		tmp = (1.0 / (y * (z * x))) * (1.0 / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 1e+183], N[(N[(1.0 / x), $MachinePrecision] / N[(y * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 97.9%

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

    if 9.99999999999999947e182 < (*.f64 z z)

    1. Initial program 79.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\left(z \cdot \left(y \cdot x\right)\right) \cdot z\right)}}^{-1} \]
      3. unpow-prod-down88.0%

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

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

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

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

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

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

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

Alternative 6: 93.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 0.1:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot \left(z \cdot \left(y \cdot z\right)\right)}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= (* z z) 0.1) (/ (/ 1.0 x) y) (/ 1.0 (* x (* z (* y z))))))
double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.1) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / (x * (z * (y * z)));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z * z) <= 0.1d0) then
        tmp = (1.0d0 / x) / y
    else
        tmp = 1.0d0 / (x * (z * (y * z)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.1) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / (x * (z * (y * z)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z * z) <= 0.1:
		tmp = (1.0 / x) / y
	else:
		tmp = 1.0 / (x * (z * (y * z)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (Float64(z * z) <= 0.1)
		tmp = Float64(Float64(1.0 / x) / y);
	else
		tmp = Float64(1.0 / Float64(x * Float64(z * Float64(y * z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z * z) <= 0.1)
		tmp = (1.0 / x) / y;
	else
		tmp = 1.0 / (x * (z * (y * z)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 0.1], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(x * N[(z * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 0.1:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(y \cdot x\right)}^{-1}} \]
      2. unpow-prod-down98.8%

        \[\leadsto \color{blue}{{y}^{-1} \cdot {x}^{-1}} \]
      3. inv-pow98.8%

        \[\leadsto \color{blue}{\frac{1}{y}} \cdot {x}^{-1} \]
      4. inv-pow98.8%

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

      \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{1}{x}} \]
    7. Step-by-step derivation
      1. associate-*l/98.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{x}}{y}} \]
      2. *-un-lft-identity98.8%

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

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

    if 0.10000000000000001 < (*.f64 z z)

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 93.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 0.1:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y \cdot \left(z \cdot \left(z \cdot x\right)\right)}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= (* z z) 0.1) (/ (/ 1.0 x) y) (/ 1.0 (* y (* z (* z x))))))
double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.1) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / (y * (z * (z * x)));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z * z) <= 0.1d0) then
        tmp = (1.0d0 / x) / y
    else
        tmp = 1.0d0 / (y * (z * (z * x)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.1) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / (y * (z * (z * x)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z * z) <= 0.1:
		tmp = (1.0 / x) / y
	else:
		tmp = 1.0 / (y * (z * (z * x)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (Float64(z * z) <= 0.1)
		tmp = Float64(Float64(1.0 / x) / y);
	else
		tmp = Float64(1.0 / Float64(y * Float64(z * Float64(z * x))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z * z) <= 0.1)
		tmp = (1.0 / x) / y;
	else
		tmp = 1.0 / (y * (z * (z * x)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 0.1], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(y * N[(z * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 0.1:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(y \cdot x\right)}^{-1}} \]
      2. unpow-prod-down98.8%

        \[\leadsto \color{blue}{{y}^{-1} \cdot {x}^{-1}} \]
      3. inv-pow98.8%

        \[\leadsto \color{blue}{\frac{1}{y}} \cdot {x}^{-1} \]
      4. inv-pow98.8%

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

      \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{1}{x}} \]
    7. Step-by-step derivation
      1. associate-*l/98.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{x}}{y}} \]
      2. *-un-lft-identity98.8%

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

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

    if 0.10000000000000001 < (*.f64 z z)

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 97.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 0.1:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z \cdot \left(y \cdot \left(z \cdot x\right)\right)}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= (* z z) 0.1) (/ (/ 1.0 x) y) (/ 1.0 (* z (* y (* z x))))))
double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.1) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / (z * (y * (z * x)));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z * z) <= 0.1d0) then
        tmp = (1.0d0 / x) / y
    else
        tmp = 1.0d0 / (z * (y * (z * x)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.1) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / (z * (y * (z * x)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z * z) <= 0.1:
		tmp = (1.0 / x) / y
	else:
		tmp = 1.0 / (z * (y * (z * x)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (Float64(z * z) <= 0.1)
		tmp = Float64(Float64(1.0 / x) / y);
	else
		tmp = Float64(1.0 / Float64(z * Float64(y * Float64(z * x))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z * z) <= 0.1)
		tmp = (1.0 / x) / y;
	else
		tmp = 1.0 / (z * (y * (z * x)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 0.1], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(z * N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 0.1:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(y \cdot x\right)}^{-1}} \]
      2. unpow-prod-down98.8%

        \[\leadsto \color{blue}{{y}^{-1} \cdot {x}^{-1}} \]
      3. inv-pow98.8%

        \[\leadsto \color{blue}{\frac{1}{y}} \cdot {x}^{-1} \]
      4. inv-pow98.8%

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

      \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{1}{x}} \]
    7. Step-by-step derivation
      1. associate-*l/98.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{x}}{y}} \]
      2. *-un-lft-identity98.8%

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

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

    if 0.10000000000000001 < (*.f64 z z)

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 97.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 0.1:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z \cdot \left(x \cdot \left(y \cdot z\right)\right)}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= (* z z) 0.1) (/ (/ 1.0 x) y) (/ 1.0 (* z (* x (* y z))))))
double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.1) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / (z * (x * (y * z)));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z * z) <= 0.1d0) then
        tmp = (1.0d0 / x) / y
    else
        tmp = 1.0d0 / (z * (x * (y * z)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.1) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / (z * (x * (y * z)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z * z) <= 0.1:
		tmp = (1.0 / x) / y
	else:
		tmp = 1.0 / (z * (x * (y * z)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (Float64(z * z) <= 0.1)
		tmp = Float64(Float64(1.0 / x) / y);
	else
		tmp = Float64(1.0 / Float64(z * Float64(x * Float64(y * z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z * z) <= 0.1)
		tmp = (1.0 / x) / y;
	else
		tmp = 1.0 / (z * (x * (y * z)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 0.1], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(z * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 0.1:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(y \cdot x\right)}^{-1}} \]
      2. unpow-prod-down98.8%

        \[\leadsto \color{blue}{{y}^{-1} \cdot {x}^{-1}} \]
      3. inv-pow98.8%

        \[\leadsto \color{blue}{\frac{1}{y}} \cdot {x}^{-1} \]
      4. inv-pow98.8%

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

      \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{1}{x}} \]
    7. Step-by-step derivation
      1. associate-*l/98.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{x}}{y}} \]
      2. *-un-lft-identity98.8%

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

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

    if 0.10000000000000001 < (*.f64 z z)

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{z \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(y \cdot \left(z \cdot x\right)\right)} - 1\right)}} \]
      3. *-commutative37.6%

        \[\leadsto \frac{1}{z \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(z \cdot x\right) \cdot y}\right)} - 1\right)} \]
      4. associate-*l*38.3%

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

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

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

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

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

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

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

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

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

Alternative 10: 97.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 0.1:\\ \;\;\;\;\frac{1 - z \cdot z}{y \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z \cdot \left(x \cdot \left(y \cdot z\right)\right)}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= (* z z) 0.1) (/ (- 1.0 (* z z)) (* y x)) (/ 1.0 (* z (* x (* y z))))))
double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.1) {
		tmp = (1.0 - (z * z)) / (y * x);
	} else {
		tmp = 1.0 / (z * (x * (y * z)));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z * z) <= 0.1d0) then
        tmp = (1.0d0 - (z * z)) / (y * x)
    else
        tmp = 1.0d0 / (z * (x * (y * z)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.1) {
		tmp = (1.0 - (z * z)) / (y * x);
	} else {
		tmp = 1.0 / (z * (x * (y * z)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z * z) <= 0.1:
		tmp = (1.0 - (z * z)) / (y * x)
	else:
		tmp = 1.0 / (z * (x * (y * z)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (Float64(z * z) <= 0.1)
		tmp = Float64(Float64(1.0 - Float64(z * z)) / Float64(y * x));
	else
		tmp = Float64(1.0 / Float64(z * Float64(x * Float64(y * z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z * z) <= 0.1)
		tmp = (1.0 - (z * z)) / (y * x);
	else
		tmp = 1.0 / (z * (x * (y * z)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 0.1], N[(N[(1.0 - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y * x), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(z * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\frac{1}{x}}{y}}{\color{blue}{\sqrt{1 + z \cdot z} \cdot \sqrt{1 + z \cdot z}}} \]
      6. *-un-lft-identity99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\left(1 + z \cdot z\right) \cdot \left(y \cdot x\right)}} \]
    11. Taylor expanded in z around 0 88.6%

      \[\leadsto \color{blue}{\frac{1}{y \cdot x} + -1 \cdot \frac{{z}^{2}}{y \cdot x}} \]
    12. Step-by-step derivation
      1. mul-1-neg88.6%

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

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

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

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

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

    if 0.10000000000000001 < (*.f64 z z)

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{z \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(y \cdot \left(z \cdot x\right)\right)} - 1\right)}} \]
      3. *-commutative37.6%

        \[\leadsto \frac{1}{z \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(z \cdot x\right) \cdot y}\right)} - 1\right)} \]
      4. associate-*l*38.3%

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

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

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

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

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

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

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

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

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

Alternative 11: 59.0% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \frac{1}{y \cdot x} \end{array} \]
(FPCore (x y z) :precision binary64 (/ 1.0 (* y x)))
double code(double x, double y, double z) {
	return 1.0 / (y * x);
}
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 / (y * x)
end function
public static double code(double x, double y, double z) {
	return 1.0 / (y * x);
}
def code(x, y, z):
	return 1.0 / (y * x)
function code(x, y, z)
	return Float64(1.0 / Float64(y * x))
end
function tmp = code(x, y, z)
	tmp = 1.0 / (y * x);
end
code[x_, y_, z_] := N[(1.0 / N[(y * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{y \cdot x}
\end{array}
Derivation
  1. Initial program 91.4%

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

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

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

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

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

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

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

Developer target: 91.6% accurate, 0.4× 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 2023199 
(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)))))