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

Percentage Accurate: 90.9% → 99.4%
Time: 11.9s
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.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: 99.4% accurate, 0.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \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^{+305}:\\ \;\;\;\;\frac{\frac{1}{x}}{\mathsf{fma}\left(y \cdot z, z, y\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t_0} \cdot \frac{\frac{1}{x}}{t_0}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* (hypot 1.0 z) (sqrt y))))
   (if (<= (* y (+ 1.0 (* z z))) 2e+305)
     (/ (/ 1.0 x) (fma (* y z) z y))
     (* (/ 1.0 t_0) (/ (/ 1.0 x) t_0)))))
assert(x < y);
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+305) {
		tmp = (1.0 / x) / fma((y * z), z, y);
	} else {
		tmp = (1.0 / t_0) * ((1.0 / x) / t_0);
	}
	return tmp;
}
x, y = sort([x, y])
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+305)
		tmp = Float64(Float64(1.0 / x) / fma(Float64(y * z), z, y));
	else
		tmp = Float64(Float64(1.0 / t_0) * Float64(Float64(1.0 / x) / t_0));
	end
	return tmp
end
NOTE: x and y should be sorted in increasing order before calling this function.
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+305], N[(N[(1.0 / x), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / t$95$0), $MachinePrecision] * N[(N[(1.0 / x), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\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^{+305}:\\
\;\;\;\;\frac{\frac{1}{x}}{\mathsf{fma}\left(y \cdot z, z, y\right)}\\

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


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

    1. Initial program 96.2%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-in96.2%

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

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

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

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

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

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

    if 1.9999999999999999e305 < (*.f64 y (+.f64 1 (*.f64 z z)))

    1. Initial program 66.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.2% accurate, 0.1× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \cdot \left(1 + z \cdot z\right) \leq 4 \cdot 10^{+305}:\\ \;\;\;\;\frac{\frac{1}{x}}{\mathsf{fma}\left(y \cdot z, z, y\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot {\left(z \cdot \left(z \cdot x\right)\right)}^{-1}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (if (<= (* y (+ 1.0 (* z z))) 4e+305)
   (/ (/ 1.0 x) (fma (* y z) z y))
   (* (/ 1.0 y) (pow (* z (* z x)) -1.0))))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if ((y * (1.0 + (z * z))) <= 4e+305) {
		tmp = (1.0 / x) / fma((y * z), z, y);
	} else {
		tmp = (1.0 / y) * pow((z * (z * x)), -1.0);
	}
	return tmp;
}
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (Float64(y * Float64(1.0 + Float64(z * z))) <= 4e+305)
		tmp = Float64(Float64(1.0 / x) / fma(Float64(y * z), z, y));
	else
		tmp = Float64(Float64(1.0 / y) * (Float64(z * Float64(z * x)) ^ -1.0));
	end
	return tmp
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := If[LessEqual[N[(y * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 4e+305], N[(N[(1.0 / x), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[Power[N[(z * N[(z * x), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot \left(1 + z \cdot z\right) \leq 4 \cdot 10^{+305}:\\
\;\;\;\;\frac{\frac{1}{x}}{\mathsf{fma}\left(y \cdot z, z, y\right)}\\

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


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

    1. Initial program 96.3%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-in96.3%

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

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

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

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

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

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

    if 3.9999999999999998e305 < (*.f64 y (+.f64 1 (*.f64 z z)))

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.1% accurate, 0.1× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \cdot \left(1 + z \cdot z\right) \leq 4 \cdot 10^{+305}:\\ \;\;\;\;\frac{\frac{1}{x}}{\mathsf{fma}\left(y \cdot z, z, y\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{1}{y}}{z}}{z \cdot x}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (if (<= (* y (+ 1.0 (* z z))) 4e+305)
   (/ (/ 1.0 x) (fma (* y z) z y))
   (/ (/ (/ 1.0 y) z) (* z x))))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if ((y * (1.0 + (z * z))) <= 4e+305) {
		tmp = (1.0 / x) / fma((y * z), z, y);
	} else {
		tmp = ((1.0 / y) / z) / (z * x);
	}
	return tmp;
}
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (Float64(y * Float64(1.0 + Float64(z * z))) <= 4e+305)
		tmp = Float64(Float64(1.0 / x) / fma(Float64(y * z), z, y));
	else
		tmp = Float64(Float64(Float64(1.0 / y) / z) / Float64(z * x));
	end
	return tmp
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := If[LessEqual[N[(y * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 4e+305], N[(N[(1.0 / x), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / y), $MachinePrecision] / z), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot \left(1 + z \cdot z\right) \leq 4 \cdot 10^{+305}:\\
\;\;\;\;\frac{\frac{1}{x}}{\mathsf{fma}\left(y \cdot z, z, y\right)}\\

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


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

    1. Initial program 96.3%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-in96.3%

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

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

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

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

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

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

    if 3.9999999999999998e305 < (*.f64 y (+.f64 1 (*.f64 z z)))

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{x}}{y}}}{z \cdot z} \]
      3. un-div-inv71.1%

        \[\leadsto \frac{\color{blue}{\frac{1}{x} \cdot \frac{1}{y}}}{z \cdot z} \]
      4. *-un-lft-identity71.1%

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{\frac{1}{x \cdot y}}{z}} \]
    9. Step-by-step derivation
      1. associate-/l/90.2%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{z}}{z \cdot x}} \]
      8. *-commutative94.0%

        \[\leadsto \frac{\frac{\frac{1}{y}}{z}}{\color{blue}{x \cdot z}} \]
    10. Applied egg-rr94.0%

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

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

Alternative 4: 97.7% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 4 \cdot 10^{+62}:\\ \;\;\;\;\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{1}{y}}{z}}{z \cdot x}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (if (<= (* z z) 4e+62)
   (/ (/ 1.0 x) (* y (+ 1.0 (* z z))))
   (/ (/ (/ 1.0 y) z) (* z x))))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 4e+62) {
		tmp = (1.0 / x) / (y * (1.0 + (z * z)));
	} else {
		tmp = ((1.0 / y) / z) / (z * x);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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) <= 4d+62) then
        tmp = (1.0d0 / x) / (y * (1.0d0 + (z * z)))
    else
        tmp = ((1.0d0 / y) / z) / (z * x)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 4e+62) {
		tmp = (1.0 / x) / (y * (1.0 + (z * z)));
	} else {
		tmp = ((1.0 / y) / z) / (z * x);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if (z * z) <= 4e+62:
		tmp = (1.0 / x) / (y * (1.0 + (z * z)))
	else:
		tmp = ((1.0 / y) / z) / (z * x)
	return tmp
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (Float64(z * z) <= 4e+62)
		tmp = Float64(Float64(1.0 / x) / Float64(y * Float64(1.0 + Float64(z * z))));
	else
		tmp = Float64(Float64(Float64(1.0 / y) / z) / Float64(z * x));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z * z) <= 4e+62)
		tmp = (1.0 / x) / (y * (1.0 + (z * z)));
	else
		tmp = ((1.0 / y) / z) / (z * x);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 4e+62], N[(N[(1.0 / x), $MachinePrecision] / N[(y * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / y), $MachinePrecision] / z), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 4 \cdot 10^{+62}:\\
\;\;\;\;\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\\

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


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

    1. Initial program 99.7%

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

    if 4.00000000000000014e62 < (*.f64 z z)

    1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{x}}{y}}}{z \cdot z} \]
      3. un-div-inv75.7%

        \[\leadsto \frac{\color{blue}{\frac{1}{x} \cdot \frac{1}{y}}}{z \cdot z} \]
      4. *-un-lft-identity75.7%

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

        \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{\frac{1}{x} \cdot \frac{1}{y}}{z}} \]
      6. frac-times83.0%

        \[\leadsto \frac{1}{z} \cdot \frac{\color{blue}{\frac{1 \cdot 1}{x \cdot y}}}{z} \]
      7. metadata-eval83.0%

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

      \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{\frac{1}{x \cdot y}}{z}} \]
    9. Step-by-step derivation
      1. associate-/l/84.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{z}}{z \cdot x}} \]
      8. *-commutative95.9%

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

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

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

Alternative 5: 93.7% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 0.2:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot \left(z \cdot \left(y \cdot z\right)\right)}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (if (<= (* z z) 0.2) (/ (/ 1.0 x) y) (/ 1.0 (* x (* z (* y z))))))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.2) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / (x * (z * (y * z)));
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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.2d0) then
        tmp = (1.0d0 / x) / y
    else
        tmp = 1.0d0 / (x * (z * (y * z)))
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.2) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / (x * (z * (y * z)));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if (z * z) <= 0.2:
		tmp = (1.0 / x) / y
	else:
		tmp = 1.0 / (x * (z * (y * z)))
	return tmp
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (Float64(z * z) <= 0.2)
		tmp = Float64(Float64(1.0 / x) / y);
	else
		tmp = Float64(1.0 / Float64(x * Float64(z * Float64(y * z))));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z * z) <= 0.2)
		tmp = (1.0 / x) / y;
	else
		tmp = 1.0 / (x * (z * (y * z)));
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 0.2], 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}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 0.2:\\
\;\;\;\;\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.20000000000000001

    1. Initial program 99.7%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-in99.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{y}} \]
    6. Simplified99.1%

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

    if 0.20000000000000001 < (*.f64 z z)

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 93.8% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 0.2:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y \cdot \left(z \cdot \left(z \cdot x\right)\right)}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (if (<= (* z z) 0.2) (/ (/ 1.0 x) y) (/ 1.0 (* y (* z (* z x))))))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.2) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / (y * (z * (z * x)));
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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.2d0) then
        tmp = (1.0d0 / x) / y
    else
        tmp = 1.0d0 / (y * (z * (z * x)))
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.2) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / (y * (z * (z * x)));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if (z * z) <= 0.2:
		tmp = (1.0 / x) / y
	else:
		tmp = 1.0 / (y * (z * (z * x)))
	return tmp
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (Float64(z * z) <= 0.2)
		tmp = Float64(Float64(1.0 / x) / y);
	else
		tmp = Float64(1.0 / Float64(y * Float64(z * Float64(z * x))));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z * z) <= 0.2)
		tmp = (1.0 / x) / y;
	else
		tmp = 1.0 / (y * (z * (z * x)));
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 0.2], 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}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 0.2:\\
\;\;\;\;\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.20000000000000001

    1. Initial program 99.7%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-in99.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{y}} \]
    6. Simplified99.1%

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

    if 0.20000000000000001 < (*.f64 z z)

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 96.9% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 0.2:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{y \cdot z}}{z \cdot x}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (if (<= (* z z) 0.2) (/ (/ 1.0 x) y) (/ (/ 1.0 (* y z)) (* z x))))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.2) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = (1.0 / (y * z)) / (z * x);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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.2d0) then
        tmp = (1.0d0 / x) / y
    else
        tmp = (1.0d0 / (y * z)) / (z * x)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.2) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = (1.0 / (y * z)) / (z * x);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if (z * z) <= 0.2:
		tmp = (1.0 / x) / y
	else:
		tmp = (1.0 / (y * z)) / (z * x)
	return tmp
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (Float64(z * z) <= 0.2)
		tmp = Float64(Float64(1.0 / x) / y);
	else
		tmp = Float64(Float64(1.0 / Float64(y * z)) / Float64(z * x));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z * z) <= 0.2)
		tmp = (1.0 / x) / y;
	else
		tmp = (1.0 / (y * z)) / (z * x);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 0.2], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(N[(1.0 / N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 0.2:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\

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


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

    1. Initial program 99.7%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-in99.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{y}} \]
    6. Simplified99.1%

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

    if 0.20000000000000001 < (*.f64 z z)

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{x}}{y}}}{z \cdot z} \]
      3. un-div-inv78.8%

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

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

        \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{\frac{1}{x} \cdot \frac{1}{y}}{z}} \]
      6. frac-times85.0%

        \[\leadsto \frac{1}{z} \cdot \frac{\color{blue}{\frac{1 \cdot 1}{x \cdot y}}}{z} \]
      7. metadata-eval85.0%

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

      \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{\frac{1}{x \cdot y}}{z}} \]
    9. Step-by-step derivation
      1. associate-/l/86.3%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot z \leq 0.2:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{y \cdot z}}{z \cdot x}\\ \end{array} \]

Alternative 8: 97.0% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 0.2:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{1}{y}}{z}}{z \cdot x}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (if (<= (* z z) 0.2) (/ (/ 1.0 x) y) (/ (/ (/ 1.0 y) z) (* z x))))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.2) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = ((1.0 / y) / z) / (z * x);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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.2d0) then
        tmp = (1.0d0 / x) / y
    else
        tmp = ((1.0d0 / y) / z) / (z * x)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.2) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = ((1.0 / y) / z) / (z * x);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if (z * z) <= 0.2:
		tmp = (1.0 / x) / y
	else:
		tmp = ((1.0 / y) / z) / (z * x)
	return tmp
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (Float64(z * z) <= 0.2)
		tmp = Float64(Float64(1.0 / x) / y);
	else
		tmp = Float64(Float64(Float64(1.0 / y) / z) / Float64(z * x));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z * z) <= 0.2)
		tmp = (1.0 / x) / y;
	else
		tmp = ((1.0 / y) / z) / (z * x);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 0.2], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(N[(N[(1.0 / y), $MachinePrecision] / z), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 0.2:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\

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


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

    1. Initial program 99.7%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-in99.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{y}} \]
    6. Simplified99.1%

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

    if 0.20000000000000001 < (*.f64 z z)

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{x}}{y}}}{z \cdot z} \]
      3. un-div-inv78.8%

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

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

        \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{\frac{1}{x} \cdot \frac{1}{y}}{z}} \]
      6. frac-times85.0%

        \[\leadsto \frac{1}{z} \cdot \frac{\color{blue}{\frac{1 \cdot 1}{x \cdot y}}}{z} \]
      7. metadata-eval85.0%

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

      \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{\frac{1}{x \cdot y}}{z}} \]
    9. Step-by-step derivation
      1. associate-/l/86.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{z}}{z \cdot x}} \]
      8. *-commutative96.0%

        \[\leadsto \frac{\frac{\frac{1}{y}}{z}}{\color{blue}{x \cdot z}} \]
    10. Applied egg-rr96.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot z \leq 0.2:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{1}{y}}{z}}{z \cdot x}\\ \end{array} \]

Alternative 9: 74.8% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq 1:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot \left(y \cdot \left(z \cdot z\right)\right)}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (if (<= z 1.0) (/ (/ 1.0 x) y) (/ 1.0 (* x (* y (* z z))))))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if (z <= 1.0) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / (x * (y * (z * z)));
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= 1.0d0) then
        tmp = (1.0d0 / x) / y
    else
        tmp = 1.0d0 / (x * (y * (z * z)))
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= 1.0) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / (x * (y * (z * z)));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if z <= 1.0:
		tmp = (1.0 / x) / y
	else:
		tmp = 1.0 / (x * (y * (z * z)))
	return tmp
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (z <= 1.0)
		tmp = Float64(Float64(1.0 / x) / y);
	else
		tmp = Float64(1.0 / Float64(x * Float64(y * Float64(z * z))));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= 1.0)
		tmp = (1.0 / x) / y;
	else
		tmp = 1.0 / (x * (y * (z * z)));
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := If[LessEqual[z, 1.0], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(x * N[(y * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\

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


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

    1. Initial program 93.3%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-in93.3%

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

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

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

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

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

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

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

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

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

    if 1 < z

    1. Initial program 84.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 58.7% accurate, 2.2× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{1}{y \cdot x} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z) :precision binary64 (/ 1.0 (* y x)))
assert(x < y);
double code(double x, double y, double z) {
	return 1.0 / (y * x);
}
NOTE: x and y should be sorted in increasing order before calling this function.
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
assert x < y;
public static double code(double x, double y, double z) {
	return 1.0 / (y * x);
}
[x, y] = sort([x, y])
def code(x, y, z):
	return 1.0 / (y * x)
x, y = sort([x, y])
function code(x, y, z)
	return Float64(1.0 / Float64(y * x))
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
	tmp = 1.0 / (y * x);
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := N[(1.0 / N[(y * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\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*90.7%

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\color{blue}{x \cdot y}} \]
  5. Step-by-step derivation
    1. *-commutative58.7%

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

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

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

Alternative 11: 58.7% accurate, 2.2× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{\frac{1}{x}}{y} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z) :precision binary64 (/ (/ 1.0 x) y))
assert(x < y);
double code(double x, double y, double z) {
	return (1.0 / x) / y;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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
end function
assert x < y;
public static double code(double x, double y, double z) {
	return (1.0 / x) / y;
}
[x, y] = sort([x, y])
def code(x, y, z):
	return (1.0 / x) / y
x, y = sort([x, y])
function code(x, y, z)
	return Float64(Float64(1.0 / x) / y)
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
	tmp = (1.0 / x) / y;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{1}{x}}{y}
\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. distribute-lft-in91.4%

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

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

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

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

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

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

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

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

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

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

Developer target: 92.9% 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 2023287 
(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)))))