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

Percentage Accurate: 90.9% → 97.5%
Time: 8.0s
Alternatives: 11
Speedup: 0.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 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: 97.5% accurate, 0.1× speedup?

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

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


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

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e214 < (*.f64 z z)

    1. Initial program 75.5%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Taylor expanded in z around inf 75.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{x}}{{z}^{2}}} \]
    5. Step-by-step derivation
      1. div-inv77.3%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.5% accurate, 0.1× speedup?

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

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


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

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e214 < (*.f64 z z)

    1. Initial program 75.5%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Taylor expanded in z around inf 75.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{x}}{{z}^{2}}} \]
    5. Step-by-step derivation
      1. div-inv77.3%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.6% accurate, 0.5× speedup?

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

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


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

    1. Initial program 96.9%

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

    if 4.99999999999999993e306 < (*.f64 y (+.f64 1 (*.f64 z z)))

    1. Initial program 59.4%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Taylor expanded in z around inf 59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 97.8% accurate, 0.7× speedup?

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

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


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

    1. Initial program 99.7%

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

    if 4.99999999999999957e28 < (*.f64 z z)

    1. Initial program 83.4%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Taylor expanded in z around inf 83.4%

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

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

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

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

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

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

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

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

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

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

Alternative 5: 77.8% accurate, 0.8× 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{\frac{1}{x}}{z} \cdot \frac{\frac{1}{y}}{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 1.0) (/ (/ 1.0 x) y) (* (/ (/ 1.0 x) z) (/ (/ 1.0 y) 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) / z) * ((1.0 / 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 <= 1.0d0) then
        tmp = (1.0d0 / x) / y
    else
        tmp = ((1.0d0 / x) / z) * ((1.0d0 / 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 <= 1.0) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = ((1.0 / x) / z) * ((1.0 / y) / 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) / z) * ((1.0 / y) / 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(Float64(Float64(1.0 / x) / z) * Float64(Float64(1.0 / y) / 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) / z) * ((1.0 / 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[z, 1.0], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(N[(N[(1.0 / x), $MachinePrecision] / z), $MachinePrecision] * N[(N[(1.0 / y), $MachinePrecision] / z), $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{\frac{1}{x}}{z} \cdot \frac{\frac{1}{y}}{z}\\


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

    1. Initial program 95.2%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Taylor expanded in z around 0 72.3%

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

    if 1 < z

    1. Initial program 83.5%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Taylor expanded in z around inf 81.4%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{y}}{x}}}{{z}^{2}} \]
    4. Simplified85.0%

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{x}}{{z}^{2}}} \]
    5. Step-by-step derivation
      1. div-inv84.9%

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

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

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

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

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

Alternative 6: 76.0% 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{\frac{1}{y}}{z \cdot \left(z \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 1.0) (/ (/ 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 <= 1.0) {
		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 <= 1.0d0) 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 <= 1.0) {
		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 <= 1.0:
		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 (z <= 1.0)
		tmp = Float64(Float64(1.0 / x) / y);
	else
		tmp = Float64(Float64(1.0 / 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 <= 1.0)
		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[z, 1.0], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] / N[(z * N[(z * x), $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{\frac{1}{y}}{z \cdot \left(z \cdot x\right)}\\


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

    1. Initial program 95.2%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Taylor expanded in z around 0 72.3%

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

    if 1 < z

    1. Initial program 83.5%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Taylor expanded in z around inf 81.4%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{y}}{x}}}{{z}^{2}} \]
    4. Simplified85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 76.3% 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{\frac{1}{z}}{z \cdot \left(y \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 1.0) (/ (/ 1.0 x) y) (/ (/ 1.0 z) (* z (* y x)))))
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 / z) / (z * (y * 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 <= 1.0d0) then
        tmp = (1.0d0 / x) / y
    else
        tmp = (1.0d0 / z) / (z * (y * x))
    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 / z) / (z * (y * x));
	}
	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 / z) / (z * (y * x))
	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(Float64(1.0 / z) / Float64(z * Float64(y * x)));
	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 / z) / (z * (y * 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[z, 1.0], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(N[(1.0 / z), $MachinePrecision] / N[(z * N[(y * x), $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{\frac{1}{z}}{z \cdot \left(y \cdot x\right)}\\


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

    1. Initial program 95.2%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Taylor expanded in z around 0 72.3%

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

    if 1 < z

    1. Initial program 83.5%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Taylor expanded in z around inf 81.4%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{y}}{x}}}{{z}^{2}} \]
    4. Simplified85.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{1}{z}}{\frac{z}{\color{blue}{\frac{1}{x \cdot y}}}} \]
      4. associate-/r/93.7%

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

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

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

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

Alternative 8: 77.5% 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{\frac{1}{z \cdot y}}{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 1.0) (/ (/ 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 <= 1.0) {
		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 <= 1.0d0) 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 <= 1.0) {
		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 <= 1.0:
		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 (z <= 1.0)
		tmp = Float64(Float64(1.0 / x) / y);
	else
		tmp = Float64(Float64(1.0 / Float64(z * y)) / 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 <= 1.0)
		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[z, 1.0], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(N[(1.0 / N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(z * x), $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{\frac{1}{z \cdot y}}{z \cdot x}\\


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

    1. Initial program 95.2%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Taylor expanded in z around 0 72.3%

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

    if 1 < z

    1. Initial program 83.5%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Taylor expanded in z around inf 81.4%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{y}}{x}}}{{z}^{2}} \]
    4. Simplified85.0%

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{x}}{{z}^{2}}} \]
    5. Step-by-step derivation
      1. div-inv84.9%

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

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

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

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

        \[\leadsto \frac{\frac{1}{y}}{z} \cdot \color{blue}{\frac{1}{z \cdot x}} \]
      2. un-div-inv92.9%

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

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

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

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

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

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

Alternative 9: 77.7% 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{\frac{\frac{1}{x}}{z}}{z \cdot y}\\ \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) z) (* z y))))
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) / z) / (z * y);
	}
	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) / z) / (z * y)
    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) / z) / (z * y);
	}
	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) / z) / (z * y)
	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(Float64(Float64(1.0 / x) / z) / Float64(z * y));
	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) / z) / (z * y);
	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[(N[(N[(1.0 / x), $MachinePrecision] / z), $MachinePrecision] / N[(z * y), $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{\frac{\frac{1}{x}}{z}}{z \cdot y}\\


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

    1. Initial program 95.2%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Taylor expanded in z around 0 72.3%

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

    if 1 < z

    1. Initial program 83.5%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Taylor expanded in z around inf 81.4%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{y}}{x}}}{{z}^{2}} \]
    4. Simplified85.0%

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{y}}{x}}{{z}^{2}}} \]
    5. Step-by-step derivation
      1. div-inv84.9%

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

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

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

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

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

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

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

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

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

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

Alternative 10: 58.2% 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.8%

    \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
  2. Taylor expanded in z around 0 55.6%

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

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

Alternative 11: 58.2% 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.8%

    \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
  2. Taylor expanded in z around 0 55.7%

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

    \[\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 2023336 
(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)))))