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

Percentage Accurate: 91.0% → 98.1%
Time: 10.9s
Alternatives: 16
Speedup: 1.0×

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 16 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: 91.0% 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.1% accurate, 0.1× speedup?

\[\begin{array}{l} z = |z|\\ [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 10^{+112}:\\ \;\;\;\;\frac{\frac{\frac{-1}{x}}{-1 - z \cdot z}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{{z}^{-1}}{x}}{y}}{\mathsf{hypot}\left(1, z\right)}\\ \end{array} \end{array} \]
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (if (<= (* z z) 1e+112)
   (/ (/ (/ -1.0 x) (- -1.0 (* z z))) y)
   (/ (/ (/ (pow z -1.0) x) y) (hypot 1.0 z))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 1e+112) {
		tmp = ((-1.0 / x) / (-1.0 - (z * z))) / y;
	} else {
		tmp = ((pow(z, -1.0) / x) / y) / hypot(1.0, z);
	}
	return tmp;
}
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
	double tmp;
	if ((z * z) <= 1e+112) {
		tmp = ((-1.0 / x) / (-1.0 - (z * z))) / y;
	} else {
		tmp = ((Math.pow(z, -1.0) / x) / y) / Math.hypot(1.0, z);
	}
	return tmp;
}
z = abs(z)
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if (z * z) <= 1e+112:
		tmp = ((-1.0 / x) / (-1.0 - (z * z))) / y
	else:
		tmp = ((math.pow(z, -1.0) / x) / y) / math.hypot(1.0, z)
	return tmp
z = abs(z)
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (Float64(z * z) <= 1e+112)
		tmp = Float64(Float64(Float64(-1.0 / x) / Float64(-1.0 - Float64(z * z))) / y);
	else
		tmp = Float64(Float64(Float64((z ^ -1.0) / x) / y) / hypot(1.0, z));
	end
	return tmp
end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z * z) <= 1e+112)
		tmp = ((-1.0 / x) / (-1.0 - (z * z))) / y;
	else
		tmp = (((z ^ -1.0) / x) / y) / hypot(1.0, z);
	end
	tmp_2 = tmp;
end
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 1e+112], N[(N[(N[(-1.0 / x), $MachinePrecision] / N[(-1.0 - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(N[(N[Power[z, -1.0], $MachinePrecision] / x), $MachinePrecision] / y), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{+112}:\\
\;\;\;\;\frac{\frac{\frac{-1}{x}}{-1 - z \cdot z}}{y}\\

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


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

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\frac{-1}{x}}{0 - \color{blue}{\left(1 + {z}^{2}\right)}}}{y} \]
      7. associate--r+99.0%

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

        \[\leadsto \frac{\frac{\frac{-1}{x}}{\color{blue}{-1} - {z}^{2}}}{y} \]
      9. unpow299.0%

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

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

    if 9.9999999999999993e111 < (*.f64 z z)

    1. Initial program 70.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{hypot}\left(1, z\right)} \cdot \frac{\frac{\color{blue}{-1}}{x \cdot \left(-y\right)}}{\mathsf{hypot}\left(1, z\right)} \]
      13. distribute-rgt-neg-out86.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{\frac{\frac{1}{z}}{x}}}{y}}{\mathsf{hypot}\left(1, z\right)} \]
      6. unpow-172.4%

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

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

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

Alternative 2: 98.0% accurate, 0.1× speedup?

\[\begin{array}{l} z = |z|\\ [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{\frac{\frac{1}{y}}{x \cdot \mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)} \end{array} \]
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (/ (/ (/ 1.0 y) (* x (hypot 1.0 z))) (hypot 1.0 z)))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
	return ((1.0 / y) / (x * hypot(1.0, z))) / hypot(1.0, z);
}
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
	return ((1.0 / y) / (x * Math.hypot(1.0, z))) / Math.hypot(1.0, z);
}
z = abs(z)
[x, y] = sort([x, y])
def code(x, y, z):
	return ((1.0 / y) / (x * math.hypot(1.0, z))) / math.hypot(1.0, z)
z = abs(z)
x, y = sort([x, y])
function code(x, y, z)
	return Float64(Float64(Float64(1.0 / y) / Float64(x * hypot(1.0, z))) / hypot(1.0, z))
end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
	tmp = ((1.0 / y) / (x * hypot(1.0, z))) / hypot(1.0, z);
end
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := N[(N[(N[(1.0 / y), $MachinePrecision] / N[(x * N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{\frac{1}{y}}{x \cdot \mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}
\end{array}
Derivation
  1. Initial program 85.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.6% accurate, 0.1× speedup?

\[\begin{array}{l} z = |z|\\ [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{1}{\mathsf{hypot}\left(1, z\right) \cdot \left(y \cdot \left(x \cdot \mathsf{hypot}\left(1, z\right)\right)\right)} \end{array} \]
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (/ 1.0 (* (hypot 1.0 z) (* y (* x (hypot 1.0 z))))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
	return 1.0 / (hypot(1.0, z) * (y * (x * hypot(1.0, z))));
}
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
	return 1.0 / (Math.hypot(1.0, z) * (y * (x * Math.hypot(1.0, z))));
}
z = abs(z)
[x, y] = sort([x, y])
def code(x, y, z):
	return 1.0 / (math.hypot(1.0, z) * (y * (x * math.hypot(1.0, z))))
z = abs(z)
x, y = sort([x, y])
function code(x, y, z)
	return Float64(1.0 / Float64(hypot(1.0, z) * Float64(y * Float64(x * hypot(1.0, z)))))
end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
	tmp = 1.0 / (hypot(1.0, z) * (y * (x * hypot(1.0, z))));
end
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := N[(1.0 / N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * N[(y * N[(x * N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{\mathsf{hypot}\left(1, z\right) \cdot \left(y \cdot \left(x \cdot \mathsf{hypot}\left(1, z\right)\right)\right)}
\end{array}
Derivation
  1. Initial program 85.7%

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

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

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

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

    \[\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*85.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1 \cdot \frac{-1}{-\color{blue}{x \cdot y}}}{\mathsf{fma}\left(z, z, 1\right)} \]
    5. distribute-rgt-neg-out87.3%

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\mathsf{hypot}\left(1, z\right)} \cdot \frac{\frac{\color{blue}{-1}}{x \cdot \left(-y\right)}}{\mathsf{hypot}\left(1, z\right)} \]
    13. distribute-rgt-neg-out93.5%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 98.0% accurate, 0.1× speedup?

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

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


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

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\frac{-1}{x}}{0 - \color{blue}{\left(1 + {z}^{2}\right)}}}{y} \]
      7. associate--r+98.4%

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

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

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

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

    if 1.00000000000000004e121 < (*.f64 z z)

    1. Initial program 69.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{\frac{1}{y}}{z \cdot x}} \]
      5. inv-pow96.4%

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

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

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

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

Alternative 5: 97.8% accurate, 0.1× speedup?

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

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


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

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\frac{-1}{x}}{0 - \color{blue}{\left(1 + {z}^{2}\right)}}}{y} \]
      7. associate--r+99.0%

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

        \[\leadsto \frac{\frac{\frac{-1}{x}}{\color{blue}{-1} - {z}^{2}}}{y} \]
      9. unpow299.0%

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

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

    if 5.0000000000000001e94 < (*.f64 z z)

    1. Initial program 70.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1 \cdot \frac{-1}{-\color{blue}{x \cdot y}}}{\mathsf{fma}\left(z, z, 1\right)} \]
      5. distribute-rgt-neg-out73.3%

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{hypot}\left(1, z\right)} \cdot \frac{\frac{\color{blue}{-1}}{x \cdot \left(-y\right)}}{\mathsf{hypot}\left(1, z\right)} \]
      13. distribute-rgt-neg-out86.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 98.2% accurate, 0.1× speedup?

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

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


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

    1. Initial program 96.8%

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{y}}{1 + z \cdot z}} \]
    4. Step-by-step derivation
      1. *-un-lft-identity99.0%

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{y}} \cdot \frac{\frac{1}{x}}{\sqrt{y}}}}{1 + z \cdot z} \]
    6. Step-by-step derivation
      1. frac-times49.3%

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

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

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

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

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

        \[\leadsto \frac{{x}^{-1} \cdot \color{blue}{{y}^{-1}}}{1 + z \cdot z} \]
      7. unpow-prod-down98.7%

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

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

        \[\leadsto \frac{\color{blue}{\frac{1}{y \cdot x}}}{1 + z \cdot z} \]
      10. associate-/r*99.0%

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

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

    if 2.00000000000000003e151 < (*.f64 z z)

    1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{hypot}\left(1, z\right)} \cdot \frac{\frac{\color{blue}{-1}}{x \cdot \left(-y\right)}}{\mathsf{hypot}\left(1, z\right)} \]
      13. distribute-rgt-neg-out85.8%

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{hypot}\left(1, z\right)} \cdot \color{blue}{\frac{\frac{1}{y}}{x \cdot \mathsf{hypot}\left(1, z\right)}} \]
      18. times-frac85.3%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{y}}{\mathsf{hypot}\left(1, z\right) \cdot \left(x \cdot \mathsf{hypot}\left(1, z\right)\right)}} \]
      19. *-un-lft-identity85.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{{z}^{-1}}}{x}}{z \cdot y} \]
    10. Simplified95.5%

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

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

Alternative 7: 97.2% accurate, 0.4× speedup?

\[\begin{array}{l} z = |z|\\ [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := y \cdot \left(1 + z \cdot z\right)\\ \mathbf{if}\;t_0 \leq -\infty:\\ \;\;\;\;\frac{1}{x \cdot \left(z \cdot \left(y \cdot z\right)\right)}\\ \mathbf{elif}\;t_0 \leq 2 \cdot 10^{+302}:\\ \;\;\;\;\frac{\frac{1}{x}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y \cdot \left(z \cdot \left(x \cdot z\right)\right)}\\ \end{array} \end{array} \]
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (+ 1.0 (* z z)))))
   (if (<= t_0 (- INFINITY))
     (/ 1.0 (* x (* z (* y z))))
     (if (<= t_0 2e+302) (/ (/ 1.0 x) t_0) (/ 1.0 (* y (* z (* x z))))))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
	double t_0 = y * (1.0 + (z * z));
	double tmp;
	if (t_0 <= -((double) INFINITY)) {
		tmp = 1.0 / (x * (z * (y * z)));
	} else if (t_0 <= 2e+302) {
		tmp = (1.0 / x) / t_0;
	} else {
		tmp = 1.0 / (y * (z * (x * z)));
	}
	return tmp;
}
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
	double t_0 = y * (1.0 + (z * z));
	double tmp;
	if (t_0 <= -Double.POSITIVE_INFINITY) {
		tmp = 1.0 / (x * (z * (y * z)));
	} else if (t_0 <= 2e+302) {
		tmp = (1.0 / x) / t_0;
	} else {
		tmp = 1.0 / (y * (z * (x * z)));
	}
	return tmp;
}
z = abs(z)
[x, y] = sort([x, y])
def code(x, y, z):
	t_0 = y * (1.0 + (z * z))
	tmp = 0
	if t_0 <= -math.inf:
		tmp = 1.0 / (x * (z * (y * z)))
	elif t_0 <= 2e+302:
		tmp = (1.0 / x) / t_0
	else:
		tmp = 1.0 / (y * (z * (x * z)))
	return tmp
z = abs(z)
x, y = sort([x, y])
function code(x, y, z)
	t_0 = Float64(y * Float64(1.0 + Float64(z * z)))
	tmp = 0.0
	if (t_0 <= Float64(-Inf))
		tmp = Float64(1.0 / Float64(x * Float64(z * Float64(y * z))));
	elseif (t_0 <= 2e+302)
		tmp = Float64(Float64(1.0 / x) / t_0);
	else
		tmp = Float64(1.0 / Float64(y * Float64(z * Float64(x * z))));
	end
	return tmp
end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
	t_0 = y * (1.0 + (z * z));
	tmp = 0.0;
	if (t_0 <= -Inf)
		tmp = 1.0 / (x * (z * (y * z)));
	elseif (t_0 <= 2e+302)
		tmp = (1.0 / x) / t_0;
	else
		tmp = 1.0 / (y * (z * (x * z)));
	end
	tmp_2 = tmp;
end
NOTE: z should be positive before calling this function
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[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(1.0 / N[(x * N[(z * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+302], N[(N[(1.0 / x), $MachinePrecision] / t$95$0), $MachinePrecision], N[(1.0 / N[(y * N[(z * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y \cdot \left(1 + z \cdot z\right)\\
\mathbf{if}\;t_0 \leq -\infty:\\
\;\;\;\;\frac{1}{x \cdot \left(z \cdot \left(y \cdot z\right)\right)}\\

\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+302}:\\
\;\;\;\;\frac{\frac{1}{x}}{t_0}\\

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


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

    1. Initial program 58.1%

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 y (+.f64 1 (*.f64 z z))) < 2.0000000000000002e302

    1. Initial program 99.6%

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

    if 2.0000000000000002e302 < (*.f64 y (+.f64 1 (*.f64 z z)))

    1. Initial program 64.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{hypot}\left(1, z\right)} \cdot \frac{\frac{\color{blue}{-1}}{x \cdot \left(-y\right)}}{\mathsf{hypot}\left(1, z\right)} \]
      13. distribute-rgt-neg-out90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 97.9% accurate, 0.7× speedup?

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

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


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

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\frac{-1}{x}}{0 - \color{blue}{\left(1 + {z}^{2}\right)}}}{y} \]
      7. associate--r+99.0%

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

        \[\leadsto \frac{\frac{\frac{-1}{x}}{\color{blue}{-1} - {z}^{2}}}{y} \]
      9. unpow299.0%

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

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

    if 4.9999999999999998e86 < (*.f64 z z)

    1. Initial program 70.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{hypot}\left(1, z\right)} \cdot \frac{\frac{\color{blue}{-1}}{x \cdot \left(-y\right)}}{\mathsf{hypot}\left(1, z\right)} \]
      13. distribute-rgt-neg-out86.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{y \cdot \left(\left(z \cdot x\right) \cdot z\right)}} \]
    11. Step-by-step derivation
      1. /-rgt-identity86.5%

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

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

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

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

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

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

Alternative 9: 97.9% accurate, 0.7× speedup?

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

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


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

    1. Initial program 96.8%

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

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

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

    if 2.00000000000000003e151 < (*.f64 z z)

    1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{hypot}\left(1, z\right)} \cdot \frac{\frac{\color{blue}{-1}}{x \cdot \left(-y\right)}}{\mathsf{hypot}\left(1, z\right)} \]
      13. distribute-rgt-neg-out85.8%

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{hypot}\left(1, z\right)} \cdot \color{blue}{\frac{\frac{1}{y}}{x \cdot \mathsf{hypot}\left(1, z\right)}} \]
      18. times-frac85.3%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{y}}{\mathsf{hypot}\left(1, z\right) \cdot \left(x \cdot \mathsf{hypot}\left(1, z\right)\right)}} \]
      19. *-un-lft-identity85.3%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{y \cdot \left(\left(z \cdot x\right) \cdot z\right)}} \]
    11. Step-by-step derivation
      1. /-rgt-identity85.4%

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

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

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

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

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

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

Alternative 10: 97.9% accurate, 0.7× speedup?

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

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


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

    1. Initial program 96.8%

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{y}}{1 + z \cdot z}} \]
    4. Step-by-step derivation
      1. *-un-lft-identity99.0%

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{y}} \cdot \frac{\frac{1}{x}}{\sqrt{y}}}}{1 + z \cdot z} \]
    6. Step-by-step derivation
      1. frac-times49.3%

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

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

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

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

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

        \[\leadsto \frac{{x}^{-1} \cdot \color{blue}{{y}^{-1}}}{1 + z \cdot z} \]
      7. unpow-prod-down98.7%

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

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

        \[\leadsto \frac{\color{blue}{\frac{1}{y \cdot x}}}{1 + z \cdot z} \]
      10. associate-/r*99.0%

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

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

    if 2.00000000000000003e151 < (*.f64 z z)

    1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{hypot}\left(1, z\right)} \cdot \frac{\frac{\color{blue}{-1}}{x \cdot \left(-y\right)}}{\mathsf{hypot}\left(1, z\right)} \]
      13. distribute-rgt-neg-out85.8%

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{hypot}\left(1, z\right)} \cdot \color{blue}{\frac{\frac{1}{y}}{x \cdot \mathsf{hypot}\left(1, z\right)}} \]
      18. times-frac85.3%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{y}}{\mathsf{hypot}\left(1, z\right) \cdot \left(x \cdot \mathsf{hypot}\left(1, z\right)\right)}} \]
      19. *-un-lft-identity85.3%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{y \cdot \left(\left(z \cdot x\right) \cdot z\right)}} \]
    11. Step-by-step derivation
      1. /-rgt-identity85.4%

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

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

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

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

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

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

Alternative 11: 93.2% accurate, 0.8× speedup?

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

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


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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-1}{-\color{blue}{x \cdot y}} \]
      4. distribute-rgt-neg-out99.2%

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

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

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

        \[\leadsto {\left(\sqrt{\frac{\color{blue}{-1}}{x \cdot \left(-y\right)}}\right)}^{2} \]
      8. distribute-rgt-neg-out50.2%

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

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

        \[\leadsto {\left(\sqrt{\color{blue}{\frac{1}{y \cdot x}}}\right)}^{2} \]
      11. inv-pow50.2%

        \[\leadsto {\left(\sqrt{\color{blue}{{\left(y \cdot x\right)}^{-1}}}\right)}^{2} \]
      12. sqrt-pow150.2%

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

        \[\leadsto {\left({\left(y \cdot x\right)}^{\color{blue}{-0.5}}\right)}^{2} \]
    6. Applied egg-rr50.2%

      \[\leadsto \color{blue}{{\left({\left(y \cdot x\right)}^{-0.5}\right)}^{2}} \]
    7. Step-by-step derivation
      1. pow-pow99.2%

        \[\leadsto \color{blue}{{\left(y \cdot x\right)}^{\left(-0.5 \cdot 2\right)}} \]
      2. metadata-eval99.2%

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

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

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

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

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

    if 2.00000000000000014e-17 < (*.f64 z z)

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{hypot}\left(1, z\right)} \cdot \frac{\frac{\color{blue}{-1}}{x \cdot \left(-y\right)}}{\mathsf{hypot}\left(1, z\right)} \]
      13. distribute-rgt-neg-out88.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 93.5% accurate, 0.8× speedup?

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

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


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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-1}{-\color{blue}{x \cdot y}} \]
      4. distribute-rgt-neg-out99.2%

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

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

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

        \[\leadsto {\left(\sqrt{\frac{\color{blue}{-1}}{x \cdot \left(-y\right)}}\right)}^{2} \]
      8. distribute-rgt-neg-out50.2%

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

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

        \[\leadsto {\left(\sqrt{\color{blue}{\frac{1}{y \cdot x}}}\right)}^{2} \]
      11. inv-pow50.2%

        \[\leadsto {\left(\sqrt{\color{blue}{{\left(y \cdot x\right)}^{-1}}}\right)}^{2} \]
      12. sqrt-pow150.2%

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

        \[\leadsto {\left({\left(y \cdot x\right)}^{\color{blue}{-0.5}}\right)}^{2} \]
    6. Applied egg-rr50.2%

      \[\leadsto \color{blue}{{\left({\left(y \cdot x\right)}^{-0.5}\right)}^{2}} \]
    7. Step-by-step derivation
      1. pow-pow99.2%

        \[\leadsto \color{blue}{{\left(y \cdot x\right)}^{\left(-0.5 \cdot 2\right)}} \]
      2. metadata-eval99.2%

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

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

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

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

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

    if 2.00000000000000014e-17 < (*.f64 z z)

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 96.4% accurate, 0.8× speedup?

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

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


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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-1}{-\color{blue}{x \cdot y}} \]
      4. distribute-rgt-neg-out99.2%

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

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

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

        \[\leadsto {\left(\sqrt{\frac{\color{blue}{-1}}{x \cdot \left(-y\right)}}\right)}^{2} \]
      8. distribute-rgt-neg-out50.2%

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

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

        \[\leadsto {\left(\sqrt{\color{blue}{\frac{1}{y \cdot x}}}\right)}^{2} \]
      11. inv-pow50.2%

        \[\leadsto {\left(\sqrt{\color{blue}{{\left(y \cdot x\right)}^{-1}}}\right)}^{2} \]
      12. sqrt-pow150.2%

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

        \[\leadsto {\left({\left(y \cdot x\right)}^{\color{blue}{-0.5}}\right)}^{2} \]
    6. Applied egg-rr50.2%

      \[\leadsto \color{blue}{{\left({\left(y \cdot x\right)}^{-0.5}\right)}^{2}} \]
    7. Step-by-step derivation
      1. pow-pow99.2%

        \[\leadsto \color{blue}{{\left(y \cdot x\right)}^{\left(-0.5 \cdot 2\right)}} \]
      2. metadata-eval99.2%

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

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

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

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

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

    if 2.00000000000000014e-17 < (*.f64 z z)

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{hypot}\left(1, z\right)} \cdot \frac{\frac{\color{blue}{-1}}{x \cdot \left(-y\right)}}{\mathsf{hypot}\left(1, z\right)} \]
      13. distribute-rgt-neg-out88.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{y \cdot \left(\left(z \cdot x\right) \cdot z\right)}} \]
    11. Step-by-step derivation
      1. /-rgt-identity87.3%

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{\left(x \cdot z\right) \cdot \left(z \cdot y\right)}{1}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot z \leq 2 \cdot 10^{-17}:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(x \cdot z\right) \cdot \left(y \cdot z\right)}\\ \end{array} \]

Alternative 14: 93.7% accurate, 1.0× speedup?

\[\begin{array}{l} z = |z|\\ [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq 2.5 \cdot 10^{-5}:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot \left(z \cdot \left(y \cdot z\right)\right)}\\ \end{array} \end{array} \]
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (if (<= z 2.5e-5) (/ (/ 1.0 x) y) (/ 1.0 (* x (* z (* y z))))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if (z <= 2.5e-5) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / (x * (z * (y * z)));
	}
	return tmp;
}
NOTE: z should be positive before calling this function
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 <= 2.5d-5) then
        tmp = (1.0d0 / x) / y
    else
        tmp = 1.0d0 / (x * (z * (y * z)))
    end if
    code = tmp
end function
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= 2.5e-5) {
		tmp = (1.0 / x) / y;
	} else {
		tmp = 1.0 / (x * (z * (y * z)));
	}
	return tmp;
}
z = abs(z)
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if z <= 2.5e-5:
		tmp = (1.0 / x) / y
	else:
		tmp = 1.0 / (x * (z * (y * z)))
	return tmp
z = abs(z)
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (z <= 2.5e-5)
		tmp = Float64(Float64(1.0 / x) / y);
	else
		tmp = Float64(1.0 / Float64(x * Float64(z * Float64(y * z))));
	end
	return tmp
end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= 2.5e-5)
		tmp = (1.0 / x) / y;
	else
		tmp = 1.0 / (x * (z * (y * z)));
	end
	tmp_2 = tmp;
end
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := If[LessEqual[z, 2.5e-5], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(x * N[(z * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \left(z \cdot \left(y \cdot z\right)\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 2.50000000000000012e-5

    1. Initial program 89.9%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. associate-/r*89.6%

        \[\leadsto \color{blue}{\frac{1}{x \cdot \left(y \cdot \left(1 + z \cdot z\right)\right)}} \]
      2. +-commutative89.6%

        \[\leadsto \frac{1}{x \cdot \left(y \cdot \color{blue}{\left(z \cdot z + 1\right)}\right)} \]
      3. fma-def89.6%

        \[\leadsto \frac{1}{x \cdot \left(y \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}\right)} \]
    3. Simplified89.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 70.1%

      \[\leadsto \frac{1}{\color{blue}{y \cdot x}} \]
    5. Step-by-step derivation
      1. frac-2neg70.1%

        \[\leadsto \color{blue}{\frac{-1}{-y \cdot x}} \]
      2. metadata-eval70.1%

        \[\leadsto \frac{\color{blue}{-1}}{-y \cdot x} \]
      3. *-commutative70.1%

        \[\leadsto \frac{-1}{-\color{blue}{x \cdot y}} \]
      4. distribute-rgt-neg-out70.1%

        \[\leadsto \frac{-1}{\color{blue}{x \cdot \left(-y\right)}} \]
      5. add-sqr-sqrt37.6%

        \[\leadsto \color{blue}{\sqrt{\frac{-1}{x \cdot \left(-y\right)}} \cdot \sqrt{\frac{-1}{x \cdot \left(-y\right)}}} \]
      6. pow237.6%

        \[\leadsto \color{blue}{{\left(\sqrt{\frac{-1}{x \cdot \left(-y\right)}}\right)}^{2}} \]
      7. metadata-eval37.6%

        \[\leadsto {\left(\sqrt{\frac{\color{blue}{-1}}{x \cdot \left(-y\right)}}\right)}^{2} \]
      8. distribute-rgt-neg-out37.6%

        \[\leadsto {\left(\sqrt{\frac{-1}{\color{blue}{-x \cdot y}}}\right)}^{2} \]
      9. *-commutative37.6%

        \[\leadsto {\left(\sqrt{\frac{-1}{-\color{blue}{y \cdot x}}}\right)}^{2} \]
      10. frac-2neg37.6%

        \[\leadsto {\left(\sqrt{\color{blue}{\frac{1}{y \cdot x}}}\right)}^{2} \]
      11. inv-pow37.6%

        \[\leadsto {\left(\sqrt{\color{blue}{{\left(y \cdot x\right)}^{-1}}}\right)}^{2} \]
      12. sqrt-pow137.6%

        \[\leadsto {\color{blue}{\left({\left(y \cdot x\right)}^{\left(\frac{-1}{2}\right)}\right)}}^{2} \]
      13. metadata-eval37.6%

        \[\leadsto {\left({\left(y \cdot x\right)}^{\color{blue}{-0.5}}\right)}^{2} \]
    6. Applied egg-rr37.6%

      \[\leadsto \color{blue}{{\left({\left(y \cdot x\right)}^{-0.5}\right)}^{2}} \]
    7. Step-by-step derivation
      1. pow-pow70.1%

        \[\leadsto \color{blue}{{\left(y \cdot x\right)}^{\left(-0.5 \cdot 2\right)}} \]
      2. metadata-eval70.1%

        \[\leadsto {\left(y \cdot x\right)}^{\color{blue}{-1}} \]
      3. inv-pow70.1%

        \[\leadsto \color{blue}{\frac{1}{y \cdot x}} \]
      4. *-commutative70.1%

        \[\leadsto \frac{1}{\color{blue}{x \cdot y}} \]
      5. associate-/r*70.4%

        \[\leadsto \color{blue}{\frac{\frac{1}{x}}{y}} \]
    8. Applied egg-rr70.4%

      \[\leadsto \color{blue}{\frac{\frac{1}{x}}{y}} \]

    if 2.50000000000000012e-5 < z

    1. Initial program 75.2%

      \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
    2. Step-by-step derivation
      1. associate-/r*75.2%

        \[\leadsto \color{blue}{\frac{1}{x \cdot \left(y \cdot \left(1 + z \cdot z\right)\right)}} \]
      2. +-commutative75.2%

        \[\leadsto \frac{1}{x \cdot \left(y \cdot \color{blue}{\left(z \cdot z + 1\right)}\right)} \]
      3. fma-def75.2%

        \[\leadsto \frac{1}{x \cdot \left(y \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}\right)} \]
    3. Simplified75.2%

      \[\leadsto \color{blue}{\frac{1}{x \cdot \left(y \cdot \mathsf{fma}\left(z, z, 1\right)\right)}} \]
    4. Taylor expanded in z around inf 75.2%

      \[\leadsto \frac{1}{x \cdot \color{blue}{\left(y \cdot {z}^{2}\right)}} \]
    5. Step-by-step derivation
      1. unpow275.2%

        \[\leadsto \frac{1}{x \cdot \left(y \cdot \color{blue}{\left(z \cdot z\right)}\right)} \]
      2. associate-*r*89.1%

        \[\leadsto \frac{1}{x \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot z\right)}} \]
      3. *-commutative89.1%

        \[\leadsto \frac{1}{x \cdot \left(\color{blue}{\left(z \cdot y\right)} \cdot z\right)} \]
    6. Simplified89.1%

      \[\leadsto \frac{1}{x \cdot \color{blue}{\left(\left(z \cdot y\right) \cdot z\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 2.5 \cdot 10^{-5}:\\ \;\;\;\;\frac{\frac{1}{x}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot \left(z \cdot \left(y \cdot z\right)\right)}\\ \end{array} \]

Alternative 15: 58.1% accurate, 2.2× speedup?

\[\begin{array}{l} z = |z|\\ [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{1}{y \cdot x} \end{array} \]
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z) :precision binary64 (/ 1.0 (* y x)))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
	return 1.0 / (y * x);
}
NOTE: z should be positive before calling this function
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
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
	return 1.0 / (y * x);
}
z = abs(z)
[x, y] = sort([x, y])
def code(x, y, z):
	return 1.0 / (y * x)
z = abs(z)
x, y = sort([x, y])
function code(x, y, z)
	return Float64(1.0 / Float64(y * x))
end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
	tmp = 1.0 / (y * x);
end
NOTE: z should be positive before calling this function
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}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{y \cdot x}
\end{array}
Derivation
  1. Initial program 85.7%

    \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
  2. Step-by-step derivation
    1. associate-/r*85.5%

      \[\leadsto \color{blue}{\frac{1}{x \cdot \left(y \cdot \left(1 + z \cdot z\right)\right)}} \]
    2. +-commutative85.5%

      \[\leadsto \frac{1}{x \cdot \left(y \cdot \color{blue}{\left(z \cdot z + 1\right)}\right)} \]
    3. fma-def85.5%

      \[\leadsto \frac{1}{x \cdot \left(y \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}\right)} \]
  3. Simplified85.5%

    \[\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 54.6%

    \[\leadsto \frac{1}{\color{blue}{y \cdot x}} \]
  5. Final simplification54.6%

    \[\leadsto \frac{1}{y \cdot x} \]

Alternative 16: 58.1% accurate, 2.2× speedup?

\[\begin{array}{l} z = |z|\\ [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{\frac{1}{x}}{y} \end{array} \]
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z) :precision binary64 (/ (/ 1.0 x) y))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
	return (1.0 / x) / y;
}
NOTE: z should be positive before calling this function
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
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
	return (1.0 / x) / y;
}
z = abs(z)
[x, y] = sort([x, y])
def code(x, y, z):
	return (1.0 / x) / y
z = abs(z)
x, y = sort([x, y])
function code(x, y, z)
	return Float64(Float64(1.0 / x) / y)
end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
	tmp = (1.0 / x) / y;
end
NOTE: z should be positive before calling this function
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}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{1}{x}}{y}
\end{array}
Derivation
  1. Initial program 85.7%

    \[\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)} \]
  2. Step-by-step derivation
    1. associate-/r*85.5%

      \[\leadsto \color{blue}{\frac{1}{x \cdot \left(y \cdot \left(1 + z \cdot z\right)\right)}} \]
    2. +-commutative85.5%

      \[\leadsto \frac{1}{x \cdot \left(y \cdot \color{blue}{\left(z \cdot z + 1\right)}\right)} \]
    3. fma-def85.5%

      \[\leadsto \frac{1}{x \cdot \left(y \cdot \color{blue}{\mathsf{fma}\left(z, z, 1\right)}\right)} \]
  3. Simplified85.5%

    \[\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 54.6%

    \[\leadsto \frac{1}{\color{blue}{y \cdot x}} \]
  5. Step-by-step derivation
    1. frac-2neg54.6%

      \[\leadsto \color{blue}{\frac{-1}{-y \cdot x}} \]
    2. metadata-eval54.6%

      \[\leadsto \frac{\color{blue}{-1}}{-y \cdot x} \]
    3. *-commutative54.6%

      \[\leadsto \frac{-1}{-\color{blue}{x \cdot y}} \]
    4. distribute-rgt-neg-out54.6%

      \[\leadsto \frac{-1}{\color{blue}{x \cdot \left(-y\right)}} \]
    5. add-sqr-sqrt30.8%

      \[\leadsto \color{blue}{\sqrt{\frac{-1}{x \cdot \left(-y\right)}} \cdot \sqrt{\frac{-1}{x \cdot \left(-y\right)}}} \]
    6. pow230.8%

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{-1}{x \cdot \left(-y\right)}}\right)}^{2}} \]
    7. metadata-eval30.8%

      \[\leadsto {\left(\sqrt{\frac{\color{blue}{-1}}{x \cdot \left(-y\right)}}\right)}^{2} \]
    8. distribute-rgt-neg-out30.8%

      \[\leadsto {\left(\sqrt{\frac{-1}{\color{blue}{-x \cdot y}}}\right)}^{2} \]
    9. *-commutative30.8%

      \[\leadsto {\left(\sqrt{\frac{-1}{-\color{blue}{y \cdot x}}}\right)}^{2} \]
    10. frac-2neg30.8%

      \[\leadsto {\left(\sqrt{\color{blue}{\frac{1}{y \cdot x}}}\right)}^{2} \]
    11. inv-pow30.8%

      \[\leadsto {\left(\sqrt{\color{blue}{{\left(y \cdot x\right)}^{-1}}}\right)}^{2} \]
    12. sqrt-pow130.8%

      \[\leadsto {\color{blue}{\left({\left(y \cdot x\right)}^{\left(\frac{-1}{2}\right)}\right)}}^{2} \]
    13. metadata-eval30.8%

      \[\leadsto {\left({\left(y \cdot x\right)}^{\color{blue}{-0.5}}\right)}^{2} \]
  6. Applied egg-rr30.8%

    \[\leadsto \color{blue}{{\left({\left(y \cdot x\right)}^{-0.5}\right)}^{2}} \]
  7. Step-by-step derivation
    1. pow-pow54.6%

      \[\leadsto \color{blue}{{\left(y \cdot x\right)}^{\left(-0.5 \cdot 2\right)}} \]
    2. metadata-eval54.6%

      \[\leadsto {\left(y \cdot x\right)}^{\color{blue}{-1}} \]
    3. inv-pow54.6%

      \[\leadsto \color{blue}{\frac{1}{y \cdot x}} \]
    4. *-commutative54.6%

      \[\leadsto \frac{1}{\color{blue}{x \cdot y}} \]
    5. associate-/r*54.8%

      \[\leadsto \color{blue}{\frac{\frac{1}{x}}{y}} \]
  8. Applied egg-rr54.8%

    \[\leadsto \color{blue}{\frac{\frac{1}{x}}{y}} \]
  9. Final simplification54.8%

    \[\leadsto \frac{\frac{1}{x}}{y} \]

Developer target: 92.8% 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 2023230 
(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)))))