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

Percentage Accurate: 90.5% → 98.9%
Time: 8.9s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 90.5% 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.9% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \cdot \left(1 + z \cdot z\right) \leq 5 \cdot 10^{+307}:\\ \;\;\;\;\frac{\frac{1}{y + z \cdot \left(y \cdot z\right)}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{1}{y}}{z \cdot x}}{z}\\ \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))) 5e+307)
   (/ (/ 1.0 (+ y (* z (* y z)))) x)
   (/ (/ (/ 1.0 y) (* z x)) z)))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if ((y * (1.0 + (z * z))) <= 5e+307) {
		tmp = (1.0 / (y + (z * (y * z)))) / x;
	} else {
		tmp = ((1.0 / y) / (z * x)) / 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 ((y * (1.0d0 + (z * z))) <= 5d+307) then
        tmp = (1.0d0 / (y + (z * (y * z)))) / x
    else
        tmp = ((1.0d0 / y) / (z * x)) / z
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
	double tmp;
	if ((y * (1.0 + (z * z))) <= 5e+307) {
		tmp = (1.0 / (y + (z * (y * z)))) / x;
	} else {
		tmp = ((1.0 / y) / (z * x)) / z;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if (y * (1.0 + (z * z))) <= 5e+307:
		tmp = (1.0 / (y + (z * (y * z)))) / x
	else:
		tmp = ((1.0 / y) / (z * x)) / z
	return tmp
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (Float64(y * Float64(1.0 + Float64(z * z))) <= 5e+307)
		tmp = Float64(Float64(1.0 / Float64(y + Float64(z * Float64(y * z)))) / x);
	else
		tmp = Float64(Float64(Float64(1.0 / y) / Float64(z * x)) / z);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y * (1.0 + (z * z))) <= 5e+307)
		tmp = (1.0 / (y + (z * (y * z)))) / x;
	else
		tmp = ((1.0 / y) / (z * x)) / 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[(y * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+307], N[(N[(1.0 / N[(y + N[(z * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(1.0 / y), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot \left(1 + z \cdot z\right) \leq 5 \cdot 10^{+307}:\\
\;\;\;\;\frac{\frac{1}{y + z \cdot \left(y \cdot z\right)}}{x}\\

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


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

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{{z}^{2} + 1}}{y \cdot x}} \]
      5. unpow295.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5e307 < (*.f64 y (+.f64 1 (*.f64 z z)))

    1. Initial program 76.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{x}}{y} \cdot \color{blue}{\frac{1}{z \cdot z}} \]
    9. Step-by-step derivation
      1. un-div-inv81.1%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{z \cdot x}}{z}} \]
  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 5 \cdot 10^{+307}:\\ \;\;\;\;\frac{\frac{1}{y + z \cdot \left(y \cdot z\right)}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{1}{y}}{z \cdot x}}{z}\\ \end{array} \]

Alternative 2: 97.1% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 0.5:\\ \;\;\;\;\frac{\frac{1}{x}}{y} \cdot \left(1 - z \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{1}{y}}{z \cdot x}}{z}\\ \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.5)
   (* (/ (/ 1.0 x) y) (- 1.0 (* z z)))
   (/ (/ (/ 1.0 y) (* z x)) z)))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.5) {
		tmp = ((1.0 / x) / y) * (1.0 - (z * z));
	} else {
		tmp = ((1.0 / y) / (z * x)) / 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.5d0) then
        tmp = ((1.0d0 / x) / y) * (1.0d0 - (z * z))
    else
        tmp = ((1.0d0 / y) / (z * x)) / 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.5) {
		tmp = ((1.0 / x) / y) * (1.0 - (z * z));
	} else {
		tmp = ((1.0 / y) / (z * x)) / z;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if (z * z) <= 0.5:
		tmp = ((1.0 / x) / y) * (1.0 - (z * z))
	else:
		tmp = ((1.0 / y) / (z * x)) / z
	return tmp
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (Float64(z * z) <= 0.5)
		tmp = Float64(Float64(Float64(1.0 / x) / y) * Float64(1.0 - Float64(z * z)));
	else
		tmp = Float64(Float64(Float64(1.0 / y) / Float64(z * x)) / 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.5)
		tmp = ((1.0 / x) / y) * (1.0 - (z * z));
	else
		tmp = ((1.0 / y) / (z * x)) / 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.5], N[(N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision] * N[(1.0 - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / y), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 0.5:\\
\;\;\;\;\frac{\frac{1}{x}}{y} \cdot \left(1 - z \cdot z\right)\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.5 < (*.f64 z z)

    1. Initial program 83.9%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{x}}{y} \cdot \color{blue}{\frac{1}{{z}^{2}}} \]
    7. Step-by-step derivation
      1. unpow283.3%

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

      \[\leadsto \frac{\frac{1}{x}}{y} \cdot \color{blue}{\frac{1}{z \cdot z}} \]
    9. Step-by-step derivation
      1. un-div-inv83.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.5% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+21}:\\ \;\;\;\;\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{1}{y}}{z \cdot x}}{z}\\ \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) 2e+21)
   (/ (/ 1.0 x) (* y (+ 1.0 (* z z))))
   (/ (/ (/ 1.0 y) (* z x)) z)))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 2e+21) {
		tmp = (1.0 / x) / (y * (1.0 + (z * z)));
	} else {
		tmp = ((1.0 / y) / (z * x)) / 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) <= 2d+21) then
        tmp = (1.0d0 / x) / (y * (1.0d0 + (z * z)))
    else
        tmp = ((1.0d0 / y) / (z * x)) / 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) <= 2e+21) {
		tmp = (1.0 / x) / (y * (1.0 + (z * z)));
	} else {
		tmp = ((1.0 / y) / (z * x)) / z;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if (z * z) <= 2e+21:
		tmp = (1.0 / x) / (y * (1.0 + (z * z)))
	else:
		tmp = ((1.0 / y) / (z * x)) / z
	return tmp
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (Float64(z * z) <= 2e+21)
		tmp = Float64(Float64(1.0 / x) / Float64(y * Float64(1.0 + Float64(z * z))));
	else
		tmp = Float64(Float64(Float64(1.0 / y) / Float64(z * x)) / z);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z * z) <= 2e+21)
		tmp = (1.0 / x) / (y * (1.0 + (z * z)));
	else
		tmp = ((1.0 / y) / (z * x)) / 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], 2e+21], 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] / N[(z * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+21}:\\
\;\;\;\;\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\\

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


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

    1. Initial program 99.7%

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

    if 2e21 < (*.f64 z z)

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 89.7% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot 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 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 * 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 * 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 * 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 * 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 (Float64(z * 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 * 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[N[(z * z), $MachinePrecision], 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 \cdot 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 (*.f64 z z) < 1

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{y}} \]
      2. add-cube-cbrt97.6%

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

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{\frac{1}{x}}{y}}\right)}^{3}} \]
      4. associate-/l/97.2%

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

        \[\leadsto {\left(\sqrt[3]{\frac{1}{\color{blue}{x \cdot y}}}\right)}^{3} \]
      6. cbrt-div97.0%

        \[\leadsto {\color{blue}{\left(\frac{\sqrt[3]{1}}{\sqrt[3]{x \cdot y}}\right)}}^{3} \]
      7. metadata-eval97.0%

        \[\leadsto {\left(\frac{\color{blue}{1}}{\sqrt[3]{x \cdot y}}\right)}^{3} \]
      8. *-commutative97.0%

        \[\leadsto {\left(\frac{1}{\sqrt[3]{\color{blue}{y \cdot x}}}\right)}^{3} \]
    6. Applied egg-rr97.0%

      \[\leadsto \color{blue}{{\left(\frac{1}{\sqrt[3]{y \cdot x}}\right)}^{3}} \]
    7. Step-by-step derivation
      1. metadata-eval97.0%

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

        \[\leadsto {\color{blue}{\left(\sqrt[3]{\frac{1}{y \cdot x}}\right)}}^{3} \]
      3. rem-cube-cbrt98.3%

        \[\leadsto \color{blue}{\frac{1}{y \cdot x}} \]
      4. *-commutative98.3%

        \[\leadsto \frac{1}{\color{blue}{x \cdot y}} \]
      5. associate-/r*98.9%

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

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

    if 1 < (*.f64 z z)

    1. Initial program 83.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot 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 5: 93.5% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 0.5:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(z \cdot \left(y \cdot z\right)\right) \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.5) (/ (/ 1.0 x) y) (/ 1.0 (* (* z (* y z)) x))))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.5) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / ((z * (y * 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.5d0) then
        tmp = (1.0d0 / x) / y
    else
        tmp = 1.0d0 / ((z * (y * 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.5) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / ((z * (y * z)) * x);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if (z * z) <= 0.5:
		tmp = (1.0 / x) / y
	else:
		tmp = 1.0 / ((z * (y * z)) * x)
	return tmp
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (Float64(z * z) <= 0.5)
		tmp = Float64(Float64(1.0 / x) / y);
	else
		tmp = Float64(1.0 / Float64(Float64(z * Float64(y * 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.5)
		tmp = (1.0 / x) / y;
	else
		tmp = 1.0 / ((z * (y * 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.5], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(N[(z * N[(y * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 0.5:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\

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


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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{y}} \]
      2. add-cube-cbrt97.6%

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

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{\frac{1}{x}}{y}}\right)}^{3}} \]
      4. associate-/l/97.2%

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

        \[\leadsto {\left(\sqrt[3]{\frac{1}{\color{blue}{x \cdot y}}}\right)}^{3} \]
      6. cbrt-div97.0%

        \[\leadsto {\color{blue}{\left(\frac{\sqrt[3]{1}}{\sqrt[3]{x \cdot y}}\right)}}^{3} \]
      7. metadata-eval97.0%

        \[\leadsto {\left(\frac{\color{blue}{1}}{\sqrt[3]{x \cdot y}}\right)}^{3} \]
      8. *-commutative97.0%

        \[\leadsto {\left(\frac{1}{\sqrt[3]{\color{blue}{y \cdot x}}}\right)}^{3} \]
    6. Applied egg-rr97.0%

      \[\leadsto \color{blue}{{\left(\frac{1}{\sqrt[3]{y \cdot x}}\right)}^{3}} \]
    7. Step-by-step derivation
      1. metadata-eval97.0%

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

        \[\leadsto {\color{blue}{\left(\sqrt[3]{\frac{1}{y \cdot x}}\right)}}^{3} \]
      3. rem-cube-cbrt98.3%

        \[\leadsto \color{blue}{\frac{1}{y \cdot x}} \]
      4. *-commutative98.3%

        \[\leadsto \frac{1}{\color{blue}{x \cdot y}} \]
      5. associate-/r*98.9%

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

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

    if 0.5 < (*.f64 z z)

    1. Initial program 83.9%

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

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

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

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

      \[\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 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)} \]
      2. *-commutative83.5%

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

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

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

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

Alternative 6: 93.5% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 0.5:\\ \;\;\;\;\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.5) (/ (/ 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.5) {
		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.5d0) 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.5) {
		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.5:
		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.5)
		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.5)
		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.5], 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.5:\\
\;\;\;\;\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.5

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{y}} \]
      2. add-cube-cbrt97.6%

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

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{\frac{1}{x}}{y}}\right)}^{3}} \]
      4. associate-/l/97.2%

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

        \[\leadsto {\left(\sqrt[3]{\frac{1}{\color{blue}{x \cdot y}}}\right)}^{3} \]
      6. cbrt-div97.0%

        \[\leadsto {\color{blue}{\left(\frac{\sqrt[3]{1}}{\sqrt[3]{x \cdot y}}\right)}}^{3} \]
      7. metadata-eval97.0%

        \[\leadsto {\left(\frac{\color{blue}{1}}{\sqrt[3]{x \cdot y}}\right)}^{3} \]
      8. *-commutative97.0%

        \[\leadsto {\left(\frac{1}{\sqrt[3]{\color{blue}{y \cdot x}}}\right)}^{3} \]
    6. Applied egg-rr97.0%

      \[\leadsto \color{blue}{{\left(\frac{1}{\sqrt[3]{y \cdot x}}\right)}^{3}} \]
    7. Step-by-step derivation
      1. metadata-eval97.0%

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

        \[\leadsto {\color{blue}{\left(\sqrt[3]{\frac{1}{y \cdot x}}\right)}}^{3} \]
      3. rem-cube-cbrt98.3%

        \[\leadsto \color{blue}{\frac{1}{y \cdot x}} \]
      4. *-commutative98.3%

        \[\leadsto \frac{1}{\color{blue}{x \cdot y}} \]
      5. associate-/r*98.9%

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

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

    if 0.5 < (*.f64 z z)

    1. Initial program 83.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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}}} \]
    6. Step-by-step derivation
      1. associate-*l/53.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot z \leq 0.5:\\ \;\;\;\;\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.8% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 0.5:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z \cdot \left(\left(y \cdot z\right) \cdot x\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.5) (/ (/ 1.0 x) y) (/ 1.0 (* z (* (* y z) x)))))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.5) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / (z * ((y * 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.5d0) then
        tmp = (1.0d0 / x) / y
    else
        tmp = 1.0d0 / (z * ((y * 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.5) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / (z * ((y * z) * x));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if (z * z) <= 0.5:
		tmp = (1.0 / x) / y
	else:
		tmp = 1.0 / (z * ((y * z) * x))
	return tmp
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (Float64(z * z) <= 0.5)
		tmp = Float64(Float64(1.0 / x) / y);
	else
		tmp = Float64(1.0 / Float64(z * Float64(Float64(y * 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.5)
		tmp = (1.0 / x) / y;
	else
		tmp = 1.0 / (z * ((y * 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.5], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(z * N[(N[(y * z), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 0.5:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\

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


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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{y}} \]
      2. add-cube-cbrt97.6%

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

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{\frac{1}{x}}{y}}\right)}^{3}} \]
      4. associate-/l/97.2%

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

        \[\leadsto {\left(\sqrt[3]{\frac{1}{\color{blue}{x \cdot y}}}\right)}^{3} \]
      6. cbrt-div97.0%

        \[\leadsto {\color{blue}{\left(\frac{\sqrt[3]{1}}{\sqrt[3]{x \cdot y}}\right)}}^{3} \]
      7. metadata-eval97.0%

        \[\leadsto {\left(\frac{\color{blue}{1}}{\sqrt[3]{x \cdot y}}\right)}^{3} \]
      8. *-commutative97.0%

        \[\leadsto {\left(\frac{1}{\sqrt[3]{\color{blue}{y \cdot x}}}\right)}^{3} \]
    6. Applied egg-rr97.0%

      \[\leadsto \color{blue}{{\left(\frac{1}{\sqrt[3]{y \cdot x}}\right)}^{3}} \]
    7. Step-by-step derivation
      1. metadata-eval97.0%

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

        \[\leadsto {\color{blue}{\left(\sqrt[3]{\frac{1}{y \cdot x}}\right)}}^{3} \]
      3. rem-cube-cbrt98.3%

        \[\leadsto \color{blue}{\frac{1}{y \cdot x}} \]
      4. *-commutative98.3%

        \[\leadsto \frac{1}{\color{blue}{x \cdot y}} \]
      5. associate-/r*98.9%

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

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

    if 0.5 < (*.f64 z z)

    1. Initial program 83.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 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.5:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{1}{y}}{z \cdot x}}{z}\\ \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.5) (/ (/ 1.0 x) y) (/ (/ (/ 1.0 y) (* z x)) z)))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 0.5) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = ((1.0 / y) / (z * x)) / 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.5d0) then
        tmp = (1.0d0 / x) / y
    else
        tmp = ((1.0d0 / y) / (z * x)) / 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.5) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = ((1.0 / y) / (z * x)) / z;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if (z * z) <= 0.5:
		tmp = (1.0 / x) / y
	else:
		tmp = ((1.0 / y) / (z * x)) / z
	return tmp
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (Float64(z * z) <= 0.5)
		tmp = Float64(Float64(1.0 / x) / y);
	else
		tmp = Float64(Float64(Float64(1.0 / y) / Float64(z * x)) / 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.5)
		tmp = (1.0 / x) / y;
	else
		tmp = ((1.0 / y) / (z * x)) / 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.5], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(N[(N[(1.0 / y), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 0.5:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\

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


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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{y}} \]
      2. add-cube-cbrt97.6%

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

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{\frac{1}{x}}{y}}\right)}^{3}} \]
      4. associate-/l/97.2%

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

        \[\leadsto {\left(\sqrt[3]{\frac{1}{\color{blue}{x \cdot y}}}\right)}^{3} \]
      6. cbrt-div97.0%

        \[\leadsto {\color{blue}{\left(\frac{\sqrt[3]{1}}{\sqrt[3]{x \cdot y}}\right)}}^{3} \]
      7. metadata-eval97.0%

        \[\leadsto {\left(\frac{\color{blue}{1}}{\sqrt[3]{x \cdot y}}\right)}^{3} \]
      8. *-commutative97.0%

        \[\leadsto {\left(\frac{1}{\sqrt[3]{\color{blue}{y \cdot x}}}\right)}^{3} \]
    6. Applied egg-rr97.0%

      \[\leadsto \color{blue}{{\left(\frac{1}{\sqrt[3]{y \cdot x}}\right)}^{3}} \]
    7. Step-by-step derivation
      1. metadata-eval97.0%

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

        \[\leadsto {\color{blue}{\left(\sqrt[3]{\frac{1}{y \cdot x}}\right)}}^{3} \]
      3. rem-cube-cbrt98.3%

        \[\leadsto \color{blue}{\frac{1}{y \cdot x}} \]
      4. *-commutative98.3%

        \[\leadsto \frac{1}{\color{blue}{x \cdot y}} \]
      5. associate-/r*98.9%

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

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

    if 0.5 < (*.f64 z z)

    1. Initial program 83.9%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{x}}{y} \cdot \color{blue}{\frac{1}{{z}^{2}}} \]
    7. Step-by-step derivation
      1. unpow283.3%

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

      \[\leadsto \frac{\frac{1}{x}}{y} \cdot \color{blue}{\frac{1}{z \cdot z}} \]
    9. Step-by-step derivation
      1. un-div-inv83.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 58.5% 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 92.9%

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

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

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

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

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

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

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

Alternative 10: 58.5% 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 92.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1}{x}}{y}} \]
    2. add-cube-cbrt65.0%

      \[\leadsto \color{blue}{\left(\sqrt[3]{\frac{\frac{1}{x}}{y}} \cdot \sqrt[3]{\frac{\frac{1}{x}}{y}}\right) \cdot \sqrt[3]{\frac{\frac{1}{x}}{y}}} \]
    3. pow365.0%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{\frac{1}{x}}{y}}\right)}^{3}} \]
    4. associate-/l/65.2%

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

      \[\leadsto {\left(\sqrt[3]{\frac{1}{\color{blue}{x \cdot y}}}\right)}^{3} \]
    6. cbrt-div65.0%

      \[\leadsto {\color{blue}{\left(\frac{\sqrt[3]{1}}{\sqrt[3]{x \cdot y}}\right)}}^{3} \]
    7. metadata-eval65.0%

      \[\leadsto {\left(\frac{\color{blue}{1}}{\sqrt[3]{x \cdot y}}\right)}^{3} \]
    8. *-commutative65.0%

      \[\leadsto {\left(\frac{1}{\sqrt[3]{\color{blue}{y \cdot x}}}\right)}^{3} \]
  6. Applied egg-rr65.0%

    \[\leadsto \color{blue}{{\left(\frac{1}{\sqrt[3]{y \cdot x}}\right)}^{3}} \]
  7. Step-by-step derivation
    1. metadata-eval65.0%

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

      \[\leadsto {\color{blue}{\left(\sqrt[3]{\frac{1}{y \cdot x}}\right)}}^{3} \]
    3. rem-cube-cbrt65.8%

      \[\leadsto \color{blue}{\frac{1}{y \cdot x}} \]
    4. *-commutative65.8%

      \[\leadsto \frac{1}{\color{blue}{x \cdot y}} \]
    5. associate-/r*65.8%

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

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

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

Developer target: 92.5% 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 2023181 
(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)))))