Statistics.Distribution.Beta:$cvariance from math-functions-0.1.5.2

Percentage Accurate: 83.3% → 95.5%
Time: 14.3s
Alternatives: 19
Speedup: 1.0×

Specification

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

\\
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\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 19 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: 83.3% accurate, 1.0× speedup?

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

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

Alternative 1: 95.5% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \left(z + 1\right) \cdot \left(z \cdot z\right)\\ t_1 := \frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\ \mathbf{if}\;t_0 \leq -2 \cdot 10^{+21}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_0 \leq 2 \cdot 10^{-238}:\\ \;\;\;\;\frac{\frac{x}{z} \cdot y}{z}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+300}:\\ \;\;\;\;\frac{x \cdot y}{t_0}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* (+ z 1.0) (* z z))) (t_1 (/ (/ y z) (* z (/ z x)))))
   (if (<= t_0 -2e+21)
     t_1
     (if (<= t_0 2e-238)
       (/ (* (/ x z) y) z)
       (if (<= t_0 5e+300) (/ (* x y) t_0) t_1)))))
assert(x < y);
double code(double x, double y, double z) {
	double t_0 = (z + 1.0) * (z * z);
	double t_1 = (y / z) / (z * (z / x));
	double tmp;
	if (t_0 <= -2e+21) {
		tmp = t_1;
	} else if (t_0 <= 2e-238) {
		tmp = ((x / z) * y) / z;
	} else if (t_0 <= 5e+300) {
		tmp = (x * y) / t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (z + 1.0d0) * (z * z)
    t_1 = (y / z) / (z * (z / x))
    if (t_0 <= (-2d+21)) then
        tmp = t_1
    else if (t_0 <= 2d-238) then
        tmp = ((x / z) * y) / z
    else if (t_0 <= 5d+300) then
        tmp = (x * y) / t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
	double t_0 = (z + 1.0) * (z * z);
	double t_1 = (y / z) / (z * (z / x));
	double tmp;
	if (t_0 <= -2e+21) {
		tmp = t_1;
	} else if (t_0 <= 2e-238) {
		tmp = ((x / z) * y) / z;
	} else if (t_0 <= 5e+300) {
		tmp = (x * y) / t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	t_0 = (z + 1.0) * (z * z)
	t_1 = (y / z) / (z * (z / x))
	tmp = 0
	if t_0 <= -2e+21:
		tmp = t_1
	elif t_0 <= 2e-238:
		tmp = ((x / z) * y) / z
	elif t_0 <= 5e+300:
		tmp = (x * y) / t_0
	else:
		tmp = t_1
	return tmp
x, y = sort([x, y])
function code(x, y, z)
	t_0 = Float64(Float64(z + 1.0) * Float64(z * z))
	t_1 = Float64(Float64(y / z) / Float64(z * Float64(z / x)))
	tmp = 0.0
	if (t_0 <= -2e+21)
		tmp = t_1;
	elseif (t_0 <= 2e-238)
		tmp = Float64(Float64(Float64(x / z) * y) / z);
	elseif (t_0 <= 5e+300)
		tmp = Float64(Float64(x * y) / t_0);
	else
		tmp = t_1;
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
	t_0 = (z + 1.0) * (z * z);
	t_1 = (y / z) / (z * (z / x));
	tmp = 0.0;
	if (t_0 <= -2e+21)
		tmp = t_1;
	elseif (t_0 <= 2e-238)
		tmp = ((x / z) * y) / z;
	elseif (t_0 <= 5e+300)
		tmp = (x * y) / t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z + 1.0), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+21], t$95$1, If[LessEqual[t$95$0, 2e-238], N[(N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$0, 5e+300], N[(N[(x * y), $MachinePrecision] / t$95$0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \left(z + 1\right) \cdot \left(z \cdot z\right)\\
t_1 := \frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\mathbf{if}\;t_0 \leq -2 \cdot 10^{+21}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_0 \leq 2 \cdot 10^{-238}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot y}{z}\\

\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;\frac{x \cdot y}{t_0}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 z z) (+.f64 z 1)) < -2e21 or 5.00000000000000026e300 < (*.f64 (*.f64 z z) (+.f64 z 1))

    1. Initial program 87.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \frac{y}{z}}{\color{blue}{z \cdot z + z}} \]
      6. distribute-lft1-in95.9%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{y}{z}}{\frac{z + 1}{x} \cdot z}} \]
    6. Taylor expanded in z around inf 94.7%

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

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

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

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

    if -2e21 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 2e-238

    1. Initial program 75.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{\color{blue}{z \cdot z}} \]
    6. Simplified77.3%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \cdot y \]
      3. associate-/r/98.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{\frac{z}{y}}} \]
      4. div-inv97.5%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{\frac{z}{y}}} \]
      5. clear-num97.5%

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

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

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

    if 2e-238 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 5.00000000000000026e300

    1. Initial program 98.3%

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

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

Alternative 2: 94.8% accurate, 0.7× speedup?

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

\mathbf{elif}\;z \leq 3.4 \cdot 10^{-109}:\\
\;\;\;\;\frac{y \cdot \left(\frac{x}{z} - x\right)}{z}\\

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


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

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \frac{y}{z}}{\color{blue}{z \cdot z + z}} \]
      6. distribute-lft1-in97.4%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{y}{z}}{\frac{z + 1}{x} \cdot z}} \]
    6. Taylor expanded in z around inf 95.1%

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

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

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

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

    if -1 < z < 3.40000000000000012e-109

    1. Initial program 82.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.40000000000000012e-109 < z

    1. Initial program 90.7%

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

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

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

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

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

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

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

Alternative 3: 93.1% accurate, 0.8× speedup?

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

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


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

    1. Initial program 89.5%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{z \cdot z} \cdot \frac{x}{z + 1}} \]
    4. Taylor expanded in z around inf 96.2%

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

    if -1 < z < 1

    1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \cdot y \]
      3. associate-/r/94.5%

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{\frac{z}{y}}} \]
      5. clear-num94.1%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot y}{z}} \]
    8. Applied egg-rr94.9%

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

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

Alternative 4: 95.3% accurate, 0.8× speedup?

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

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


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

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \frac{y}{z}}{\color{blue}{z \cdot z + z}} \]
      6. distribute-lft1-in95.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{y}{z}}{\frac{z + 1}{x} \cdot z}} \]
    6. Taylor expanded in z around inf 92.9%

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

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

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

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

    if -1 < z < 0.75

    1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{y}{z}} + -1 \cdot \frac{y \cdot x}{z} \]
      4. mul-1-neg78.3%

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

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

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

        \[\leadsto \frac{x}{z} \cdot \frac{y}{z} + \color{blue}{\left(-x\right) \cdot \frac{y}{z}} \]
      8. distribute-rgt-out94.9%

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

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

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

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

Alternative 5: 92.6% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 89.7%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{z \cdot z} \cdot \frac{x}{z + 1}} \]
    4. Taylor expanded in z around inf 97.9%

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

    if -1 < z < 1

    1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \cdot y \]
      3. associate-/r/94.5%

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{\frac{z}{y}}} \]
      5. clear-num94.1%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot y}{z}} \]
    8. Applied egg-rr94.9%

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

    if 1 < z

    1. Initial program 89.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{z \cdot z} \cdot \frac{x}{z + 1}} \]
    4. Taylor expanded in z around inf 94.6%

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{y}{z \cdot z}} \]
      2. clear-num94.5%

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

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

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

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

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

Alternative 6: 93.0% accurate, 0.8× speedup?

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

\mathbf{elif}\;z \leq 0.75:\\
\;\;\;\;\frac{y \cdot \left(\frac{x}{z} - x\right)}{z}\\

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


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

    1. Initial program 89.7%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{z \cdot z} \cdot \frac{x}{z + 1}} \]
    4. Taylor expanded in z around inf 97.9%

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

    if -1 < z < 0.75

    1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{y}{z}} + -1 \cdot \frac{y \cdot x}{z} \]
      4. mul-1-neg78.3%

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

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

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

        \[\leadsto \frac{x}{z} \cdot \frac{y}{z} + \color{blue}{\left(-x\right) \cdot \frac{y}{z}} \]
      8. distribute-rgt-out94.9%

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

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

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

    if 0.75 < z

    1. Initial program 89.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{z \cdot z} \cdot \frac{x}{z + 1}} \]
    4. Taylor expanded in z around inf 94.6%

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{y}{z \cdot z}} \]
      2. clear-num94.5%

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

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

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

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

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

Alternative 7: 93.3% accurate, 0.8× speedup?

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

\mathbf{elif}\;z \leq 0.75:\\
\;\;\;\;\frac{y \cdot \left(\frac{x}{z} - x\right)}{z}\\

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


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

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \frac{y}{z}}{\color{blue}{z \cdot z + z}} \]
      6. distribute-lft1-in97.4%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{y}{z}}{\frac{z + 1}{x} \cdot z}} \]
    6. Taylor expanded in z around inf 95.1%

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

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

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

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

    if -1 < z < 0.75

    1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{y}{z}} + -1 \cdot \frac{y \cdot x}{z} \]
      4. mul-1-neg78.3%

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

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

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

        \[\leadsto \frac{x}{z} \cdot \frac{y}{z} + \color{blue}{\left(-x\right) \cdot \frac{y}{z}} \]
      8. distribute-rgt-out94.9%

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

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

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

    if 0.75 < z

    1. Initial program 89.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{z \cdot z} \cdot \frac{x}{z + 1}} \]
    4. Taylor expanded in z around inf 94.6%

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

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

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

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

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

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

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

Alternative 8: 79.1% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -9000000000:\\ \;\;\;\;x \cdot \frac{y}{z \cdot z}\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-178}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z \cdot z}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (if (<= x -9000000000.0)
   (* x (/ y (* z z)))
   (if (<= x 5.5e-178) (* (/ x z) (/ y z)) (* y (/ x (* z z))))))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if (x <= -9000000000.0) {
		tmp = x * (y / (z * z));
	} else if (x <= 5.5e-178) {
		tmp = (x / z) * (y / z);
	} else {
		tmp = y * (x / (z * z));
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-9000000000.0d0)) then
        tmp = x * (y / (z * z))
    else if (x <= 5.5d-178) then
        tmp = (x / z) * (y / z)
    else
        tmp = y * (x / (z * z))
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -9000000000.0) {
		tmp = x * (y / (z * z));
	} else if (x <= 5.5e-178) {
		tmp = (x / z) * (y / z);
	} else {
		tmp = y * (x / (z * z));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if x <= -9000000000.0:
		tmp = x * (y / (z * z))
	elif x <= 5.5e-178:
		tmp = (x / z) * (y / z)
	else:
		tmp = y * (x / (z * z))
	return tmp
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (x <= -9000000000.0)
		tmp = Float64(x * Float64(y / Float64(z * z)));
	elseif (x <= 5.5e-178)
		tmp = Float64(Float64(x / z) * Float64(y / z));
	else
		tmp = Float64(y * Float64(x / Float64(z * z)));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -9000000000.0)
		tmp = x * (y / (z * z));
	elseif (x <= 5.5e-178)
		tmp = (x / z) * (y / z);
	else
		tmp = y * (x / (z * z));
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := If[LessEqual[x, -9000000000.0], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.5e-178], N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9000000000:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\

\mathbf{elif}\;x \leq 5.5 \cdot 10^{-178}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -9e9

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9e9 < x < 5.50000000000000028e-178

    1. Initial program 78.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{z} \cdot \frac{y}{z} + \color{blue}{\left(-x\right) \cdot \frac{y}{z}} \]
      8. distribute-rgt-out71.0%

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

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

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

    if 5.50000000000000028e-178 < x

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9000000000:\\ \;\;\;\;x \cdot \frac{y}{z \cdot z}\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-178}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z \cdot z}\\ \end{array} \]

Alternative 9: 79.3% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1600000000:\\ \;\;\;\;\frac{x}{\frac{z \cdot z}{y}}\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{-178}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z \cdot z}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (if (<= x -1600000000.0)
   (/ x (/ (* z z) y))
   (if (<= x 4.2e-178) (* (/ x z) (/ y z)) (* y (/ x (* z z))))))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if (x <= -1600000000.0) {
		tmp = x / ((z * z) / y);
	} else if (x <= 4.2e-178) {
		tmp = (x / z) * (y / z);
	} else {
		tmp = y * (x / (z * z));
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-1600000000.0d0)) then
        tmp = x / ((z * z) / y)
    else if (x <= 4.2d-178) then
        tmp = (x / z) * (y / z)
    else
        tmp = y * (x / (z * z))
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -1600000000.0) {
		tmp = x / ((z * z) / y);
	} else if (x <= 4.2e-178) {
		tmp = (x / z) * (y / z);
	} else {
		tmp = y * (x / (z * z));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if x <= -1600000000.0:
		tmp = x / ((z * z) / y)
	elif x <= 4.2e-178:
		tmp = (x / z) * (y / z)
	else:
		tmp = y * (x / (z * z))
	return tmp
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (x <= -1600000000.0)
		tmp = Float64(x / Float64(Float64(z * z) / y));
	elseif (x <= 4.2e-178)
		tmp = Float64(Float64(x / z) * Float64(y / z));
	else
		tmp = Float64(y * Float64(x / Float64(z * z)));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -1600000000.0)
		tmp = x / ((z * z) / y);
	elseif (x <= 4.2e-178)
		tmp = (x / z) * (y / z);
	else
		tmp = y * (x / (z * z));
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := If[LessEqual[x, -1600000000.0], N[(x / N[(N[(z * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.2e-178], N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1600000000:\\
\;\;\;\;\frac{x}{\frac{z \cdot z}{y}}\\

\mathbf{elif}\;x \leq 4.2 \cdot 10^{-178}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.6e9

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{z \cdot z}} \]
      2. *-commutative75.8%

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

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

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

    if -1.6e9 < x < 4.2e-178

    1. Initial program 78.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{z} \cdot \frac{y}{z} + \color{blue}{\left(-x\right) \cdot \frac{y}{z}} \]
      8. distribute-rgt-out71.0%

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

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

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

    if 4.2e-178 < x

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1600000000:\\ \;\;\;\;\frac{x}{\frac{z \cdot z}{y}}\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{-178}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z \cdot z}\\ \end{array} \]

Alternative 10: 97.0% accurate, 1.0× speedup?

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot \frac{y}{z}}{z + 1}} \]
  4. Step-by-step derivation
    1. clear-num97.3%

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

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

    \[\leadsto \frac{\color{blue}{\frac{\frac{x}{z}}{\frac{z}{y}}}}{z + 1} \]
  6. Final simplification97.5%

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

Alternative 11: 97.0% accurate, 1.0× speedup?

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot \frac{y}{z}}{z + 1}} \]
  4. Final simplification97.3%

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

Alternative 12: 78.2% accurate, 1.2× speedup?

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

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


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

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{z} \cdot \frac{y}{z} + \color{blue}{\left(-x\right) \cdot \frac{y}{z}} \]
      8. distribute-rgt-out71.3%

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

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

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

    if 1e16 < y

    1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 79.5% accurate, 1.2× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{-85}:\\ \;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z \cdot \frac{z}{x}}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (if (<= x -5.5e-85) (/ x (* z (/ z y))) (/ y (* z (/ z x)))))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if (x <= -5.5e-85) {
		tmp = x / (z * (z / y));
	} else {
		tmp = y / (z * (z / x));
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-5.5d-85)) then
        tmp = x / (z * (z / y))
    else
        tmp = y / (z * (z / x))
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -5.5e-85) {
		tmp = x / (z * (z / y));
	} else {
		tmp = y / (z * (z / x));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if x <= -5.5e-85:
		tmp = x / (z * (z / y))
	else:
		tmp = y / (z * (z / x))
	return tmp
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (x <= -5.5e-85)
		tmp = Float64(x / Float64(z * Float64(z / y)));
	else
		tmp = Float64(y / Float64(z * Float64(z / x)));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -5.5e-85)
		tmp = x / (z * (z / y));
	else
		tmp = y / (z * (z / x));
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := If[LessEqual[x, -5.5e-85], N[(x / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{-85}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.4999999999999997e-85

    1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \cdot y \]
      3. associate-/r/72.5%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{\frac{z}{y}}} \]
      4. associate-/l/78.1%

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

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

    if -5.4999999999999997e-85 < x

    1. Initial program 87.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \frac{y}{z}}{\color{blue}{z \cdot z + z}} \]
      6. distribute-lft1-in95.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{y}{z}}{\frac{z + 1}{x} \cdot z}} \]
    6. Taylor expanded in z around 0 77.7%

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

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

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

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

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

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

Alternative 14: 40.7% accurate, 1.4× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{-310}:\\ \;\;\;\;y \cdot \frac{x}{-z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (if (<= z -2e-310) (* y (/ x (- z))) (/ x (/ z y))))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if (z <= -2e-310) {
		tmp = y * (x / -z);
	} else {
		tmp = x / (z / y);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z <= (-2d-310)) then
        tmp = y * (x / -z)
    else
        tmp = x / (z / y)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -2e-310) {
		tmp = y * (x / -z);
	} else {
		tmp = x / (z / y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if z <= -2e-310:
		tmp = y * (x / -z)
	else:
		tmp = x / (z / y)
	return tmp
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (z <= -2e-310)
		tmp = Float64(y * Float64(x / Float64(-z)));
	else
		tmp = Float64(x / Float64(z / y));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -2e-310)
		tmp = y * (x / -z);
	else
		tmp = x / (z / y);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := If[LessEqual[z, -2e-310], N[(y * N[(x / (-z)), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-310}:\\
\;\;\;\;y \cdot \frac{x}{-z}\\

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


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

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{y}{z}} + -1 \cdot \frac{y \cdot x}{z} \]
      4. mul-1-neg67.0%

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

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

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

        \[\leadsto \frac{x}{z} \cdot \frac{y}{z} + \color{blue}{\left(-x\right) \cdot \frac{y}{z}} \]
      8. distribute-rgt-out68.4%

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

      \[\leadsto \color{blue}{\frac{y}{z} \cdot \left(\frac{x}{z} + \left(-x\right)\right)} \]
    7. Taylor expanded in z around inf 36.2%

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

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

        \[\leadsto \color{blue}{-y \cdot \frac{x}{z}} \]
      3. distribute-rgt-neg-in41.4%

        \[\leadsto \color{blue}{y \cdot \left(-\frac{x}{z}\right)} \]
      4. neg-mul-141.4%

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

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

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

        \[\leadsto y \cdot \frac{\color{blue}{x}}{-1 \cdot z} \]
      8. neg-mul-141.4%

        \[\leadsto y \cdot \frac{x}{\color{blue}{-z}} \]
    9. Simplified41.4%

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

    if -1.999999999999994e-310 < z

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{z} \cdot \frac{y}{z} + \color{blue}{\left(-x\right) \cdot \frac{y}{z}} \]
      8. distribute-rgt-out66.4%

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

      \[\leadsto \color{blue}{\frac{y}{z} \cdot \left(\frac{x}{z} + \left(-x\right)\right)} \]
    7. Taylor expanded in z around inf 14.1%

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

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

        \[\leadsto \color{blue}{-y \cdot \frac{x}{z}} \]
      3. distribute-rgt-neg-in18.5%

        \[\leadsto \color{blue}{y \cdot \left(-\frac{x}{z}\right)} \]
      4. neg-mul-118.5%

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

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

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

        \[\leadsto y \cdot \frac{\color{blue}{x}}{-1 \cdot z} \]
      8. neg-mul-118.5%

        \[\leadsto y \cdot \frac{x}{\color{blue}{-z}} \]
    9. Simplified18.5%

      \[\leadsto \color{blue}{y \cdot \frac{x}{-z}} \]
    10. Step-by-step derivation
      1. expm1-log1p-u18.4%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{\frac{x}{-z}} \cdot \sqrt{\frac{x}{-z}}\right)}\right)} - 1 \]
      4. sqrt-unprod39.8%

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

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\color{blue}{\frac{x \cdot x}{\left(-z\right) \cdot \left(-z\right)}}}\right)} - 1 \]
      6. sqr-neg34.2%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\frac{x \cdot x}{\color{blue}{z \cdot z}}}\right)} - 1 \]
      7. frac-times39.8%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\color{blue}{\frac{x}{z} \cdot \frac{x}{z}}}\right)} - 1 \]
      8. sqrt-unprod29.1%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{\frac{x}{z}} \cdot \sqrt{\frac{x}{z}}\right)}\right)} - 1 \]
      9. add-sqr-sqrt43.2%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\frac{x}{z}}\right)} - 1 \]
      10. associate-*r/43.3%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{z}} \]
      3. *-commutative34.0%

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    13. Simplified41.4%

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

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

Alternative 15: 32.2% accurate, 1.6× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -3.2 \cdot 10^{-269}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (if (<= x -3.2e-269) (* x (/ y z)) (* (/ x z) y)))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if (x <= -3.2e-269) {
		tmp = x * (y / z);
	} else {
		tmp = (x / z) * y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-3.2d-269)) then
        tmp = x * (y / z)
    else
        tmp = (x / z) * y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -3.2e-269) {
		tmp = x * (y / z);
	} else {
		tmp = (x / z) * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if x <= -3.2e-269:
		tmp = x * (y / z)
	else:
		tmp = (x / z) * y
	return tmp
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (x <= -3.2e-269)
		tmp = Float64(x * Float64(y / z));
	else
		tmp = Float64(Float64(x / z) * y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -3.2e-269)
		tmp = x * (y / z);
	else
		tmp = (x / z) * y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := If[LessEqual[x, -3.2e-269], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{-269}:\\
\;\;\;\;x \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.2000000000000001e-269

    1. Initial program 82.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{z} \cdot \left(\frac{x}{z} + \left(-x\right)\right)} \]
    7. Taylor expanded in z around inf 21.3%

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

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

        \[\leadsto \color{blue}{-y \cdot \frac{x}{z}} \]
      3. distribute-rgt-neg-in23.9%

        \[\leadsto \color{blue}{y \cdot \left(-\frac{x}{z}\right)} \]
      4. neg-mul-123.9%

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

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

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

        \[\leadsto y \cdot \frac{\color{blue}{x}}{-1 \cdot z} \]
      8. neg-mul-123.9%

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

      \[\leadsto \color{blue}{y \cdot \frac{x}{-z}} \]
    10. Step-by-step derivation
      1. expm1-log1p-u18.8%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(y \cdot \frac{x}{-z}\right)} - 1} \]
      3. add-sqr-sqrt16.2%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{\frac{x}{-z}} \cdot \sqrt{\frac{x}{-z}}\right)}\right)} - 1 \]
      4. sqrt-unprod29.8%

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

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\color{blue}{\frac{x \cdot x}{\left(-z\right) \cdot \left(-z\right)}}}\right)} - 1 \]
      6. sqr-neg25.0%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\frac{x \cdot x}{\color{blue}{z \cdot z}}}\right)} - 1 \]
      7. frac-times29.8%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\color{blue}{\frac{x}{z} \cdot \frac{x}{z}}}\right)} - 1 \]
      8. sqrt-unprod18.2%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{\frac{x}{z}} \cdot \sqrt{\frac{x}{z}}\right)}\right)} - 1 \]
      9. add-sqr-sqrt34.7%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\frac{x}{z}}\right)} - 1 \]
      10. associate-*r/34.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    13. Simplified29.6%

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    14. Step-by-step derivation
      1. *-un-lft-identity29.6%

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

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

        \[\leadsto \color{blue}{\frac{y}{z}} \cdot x \]
    15. Applied egg-rr28.7%

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

    if -3.2000000000000001e-269 < x

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{z} \cdot \left(\frac{x}{z} + \left(-x\right)\right)} \]
    7. Taylor expanded in z around inf 28.0%

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

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

        \[\leadsto \color{blue}{-y \cdot \frac{x}{z}} \]
      3. distribute-rgt-neg-in34.4%

        \[\leadsto \color{blue}{y \cdot \left(-\frac{x}{z}\right)} \]
      4. neg-mul-134.4%

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

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

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

        \[\leadsto y \cdot \frac{\color{blue}{x}}{-1 \cdot z} \]
      8. neg-mul-134.4%

        \[\leadsto y \cdot \frac{x}{\color{blue}{-z}} \]
    9. Simplified34.4%

      \[\leadsto \color{blue}{y \cdot \frac{x}{-z}} \]
    10. Step-by-step derivation
      1. expm1-log1p-u28.4%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(y \cdot \frac{x}{-z}\right)} - 1} \]
      3. add-sqr-sqrt30.4%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{\frac{x}{-z}} \cdot \sqrt{\frac{x}{-z}}\right)}\right)} - 1 \]
      4. sqrt-unprod46.2%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\frac{x \cdot x}{\color{blue}{z \cdot z}}}\right)} - 1 \]
      7. frac-times46.2%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\color{blue}{\frac{x}{z} \cdot \frac{x}{z}}}\right)} - 1 \]
      8. sqrt-unprod31.4%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{\frac{x}{z}} \cdot \sqrt{\frac{x}{z}}\right)}\right)} - 1 \]
      9. add-sqr-sqrt43.2%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\frac{x}{z}}\right)} - 1 \]
      10. associate-*r/43.2%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    13. Simplified32.6%

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    14. Step-by-step derivation
      1. associate-/r/38.5%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
    15. Applied egg-rr38.5%

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

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

Alternative 16: 32.5% accurate, 1.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.99999999999999958e-269

    1. Initial program 82.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{z} \cdot \left(\frac{x}{z} + \left(-x\right)\right)} \]
    7. Taylor expanded in z around inf 21.3%

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

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

        \[\leadsto \color{blue}{-y \cdot \frac{x}{z}} \]
      3. distribute-rgt-neg-in23.9%

        \[\leadsto \color{blue}{y \cdot \left(-\frac{x}{z}\right)} \]
      4. neg-mul-123.9%

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

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

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

        \[\leadsto y \cdot \frac{\color{blue}{x}}{-1 \cdot z} \]
      8. neg-mul-123.9%

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

      \[\leadsto \color{blue}{y \cdot \frac{x}{-z}} \]
    10. Step-by-step derivation
      1. expm1-log1p-u18.8%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(y \cdot \frac{x}{-z}\right)} - 1} \]
      3. add-sqr-sqrt16.2%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{\frac{x}{-z}} \cdot \sqrt{\frac{x}{-z}}\right)}\right)} - 1 \]
      4. sqrt-unprod29.8%

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

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\color{blue}{\frac{x \cdot x}{\left(-z\right) \cdot \left(-z\right)}}}\right)} - 1 \]
      6. sqr-neg25.0%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\frac{x \cdot x}{\color{blue}{z \cdot z}}}\right)} - 1 \]
      7. frac-times29.8%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\color{blue}{\frac{x}{z} \cdot \frac{x}{z}}}\right)} - 1 \]
      8. sqrt-unprod18.2%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{\frac{x}{z}} \cdot \sqrt{\frac{x}{z}}\right)}\right)} - 1 \]
      9. add-sqr-sqrt34.7%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\frac{x}{z}}\right)} - 1 \]
      10. associate-*r/34.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    13. Simplified29.6%

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

    if -9.99999999999999958e-269 < x

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{z} \cdot \left(\frac{x}{z} + \left(-x\right)\right)} \]
    7. Taylor expanded in z around inf 28.0%

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

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

        \[\leadsto \color{blue}{-y \cdot \frac{x}{z}} \]
      3. distribute-rgt-neg-in34.4%

        \[\leadsto \color{blue}{y \cdot \left(-\frac{x}{z}\right)} \]
      4. neg-mul-134.4%

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

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

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

        \[\leadsto y \cdot \frac{\color{blue}{x}}{-1 \cdot z} \]
      8. neg-mul-134.4%

        \[\leadsto y \cdot \frac{x}{\color{blue}{-z}} \]
    9. Simplified34.4%

      \[\leadsto \color{blue}{y \cdot \frac{x}{-z}} \]
    10. Step-by-step derivation
      1. expm1-log1p-u28.4%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(y \cdot \frac{x}{-z}\right)} - 1} \]
      3. add-sqr-sqrt30.4%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{\frac{x}{-z}} \cdot \sqrt{\frac{x}{-z}}\right)}\right)} - 1 \]
      4. sqrt-unprod46.2%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\frac{x \cdot x}{\color{blue}{z \cdot z}}}\right)} - 1 \]
      7. frac-times46.2%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\color{blue}{\frac{x}{z} \cdot \frac{x}{z}}}\right)} - 1 \]
      8. sqrt-unprod31.4%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{\frac{x}{z}} \cdot \sqrt{\frac{x}{z}}\right)}\right)} - 1 \]
      9. add-sqr-sqrt43.2%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\frac{x}{z}}\right)} - 1 \]
      10. associate-*r/43.2%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    13. Simplified32.6%

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    14. Step-by-step derivation
      1. associate-/r/38.5%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
    15. Applied egg-rr38.5%

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

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

Alternative 17: 32.8% accurate, 1.6× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{-270}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (if (<= x -2.5e-270) (/ x (/ z y)) (/ y (/ z x))))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if (x <= -2.5e-270) {
		tmp = x / (z / y);
	} else {
		tmp = y / (z / x);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-2.5d-270)) then
        tmp = x / (z / y)
    else
        tmp = y / (z / x)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -2.5e-270) {
		tmp = x / (z / y);
	} else {
		tmp = y / (z / x);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if x <= -2.5e-270:
		tmp = x / (z / y)
	else:
		tmp = y / (z / x)
	return tmp
x, y = sort([x, y])
function code(x, y, z)
	tmp = 0.0
	if (x <= -2.5e-270)
		tmp = Float64(x / Float64(z / y));
	else
		tmp = Float64(y / Float64(z / x));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -2.5e-270)
		tmp = x / (z / y);
	else
		tmp = y / (z / x);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := If[LessEqual[x, -2.5e-270], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{-270}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.4999999999999999e-270

    1. Initial program 82.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{z} \cdot \left(\frac{x}{z} + \left(-x\right)\right)} \]
    7. Taylor expanded in z around inf 21.3%

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

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

        \[\leadsto \color{blue}{-y \cdot \frac{x}{z}} \]
      3. distribute-rgt-neg-in23.9%

        \[\leadsto \color{blue}{y \cdot \left(-\frac{x}{z}\right)} \]
      4. neg-mul-123.9%

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

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

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

        \[\leadsto y \cdot \frac{\color{blue}{x}}{-1 \cdot z} \]
      8. neg-mul-123.9%

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

      \[\leadsto \color{blue}{y \cdot \frac{x}{-z}} \]
    10. Step-by-step derivation
      1. expm1-log1p-u18.8%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(y \cdot \frac{x}{-z}\right)} - 1} \]
      3. add-sqr-sqrt16.2%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{\frac{x}{-z}} \cdot \sqrt{\frac{x}{-z}}\right)}\right)} - 1 \]
      4. sqrt-unprod29.8%

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

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\color{blue}{\frac{x \cdot x}{\left(-z\right) \cdot \left(-z\right)}}}\right)} - 1 \]
      6. sqr-neg25.0%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\frac{x \cdot x}{\color{blue}{z \cdot z}}}\right)} - 1 \]
      7. frac-times29.8%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\color{blue}{\frac{x}{z} \cdot \frac{x}{z}}}\right)} - 1 \]
      8. sqrt-unprod18.2%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{\frac{x}{z}} \cdot \sqrt{\frac{x}{z}}\right)}\right)} - 1 \]
      9. add-sqr-sqrt34.7%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\frac{x}{z}}\right)} - 1 \]
      10. associate-*r/34.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    13. Simplified29.6%

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

    if -2.4999999999999999e-270 < x

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{z} \cdot \frac{y}{z} + \left(-\color{blue}{x \cdot \frac{y}{z}}\right) \]
      7. distribute-lft-neg-in56.6%

        \[\leadsto \frac{x}{z} \cdot \frac{y}{z} + \color{blue}{\left(-x\right) \cdot \frac{y}{z}} \]
      8. distribute-rgt-out66.8%

        \[\leadsto \color{blue}{\frac{y}{z} \cdot \left(\frac{x}{z} + \left(-x\right)\right)} \]
    6. Simplified66.8%

      \[\leadsto \color{blue}{\frac{y}{z} \cdot \left(\frac{x}{z} + \left(-x\right)\right)} \]
    7. Taylor expanded in z around inf 28.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot x}{z}} \]
    8. Step-by-step derivation
      1. associate-*r/34.4%

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot \frac{x}{z}\right)} \]
      2. neg-mul-134.4%

        \[\leadsto \color{blue}{-y \cdot \frac{x}{z}} \]
      3. distribute-rgt-neg-in34.4%

        \[\leadsto \color{blue}{y \cdot \left(-\frac{x}{z}\right)} \]
      4. neg-mul-134.4%

        \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \frac{x}{z}\right)} \]
      5. metadata-eval34.4%

        \[\leadsto y \cdot \left(\color{blue}{\frac{1}{-1}} \cdot \frac{x}{z}\right) \]
      6. times-frac34.4%

        \[\leadsto y \cdot \color{blue}{\frac{1 \cdot x}{-1 \cdot z}} \]
      7. *-lft-identity34.4%

        \[\leadsto y \cdot \frac{\color{blue}{x}}{-1 \cdot z} \]
      8. neg-mul-134.4%

        \[\leadsto y \cdot \frac{x}{\color{blue}{-z}} \]
    9. Simplified34.4%

      \[\leadsto \color{blue}{y \cdot \frac{x}{-z}} \]
    10. Step-by-step derivation
      1. expm1-log1p-u28.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(y \cdot \frac{x}{-z}\right)\right)} \]
      2. expm1-udef39.9%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(y \cdot \frac{x}{-z}\right)} - 1} \]
      3. add-sqr-sqrt30.4%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{\frac{x}{-z}} \cdot \sqrt{\frac{x}{-z}}\right)}\right)} - 1 \]
      4. sqrt-unprod46.2%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\sqrt{\frac{x}{-z} \cdot \frac{x}{-z}}}\right)} - 1 \]
      5. frac-times44.6%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\color{blue}{\frac{x \cdot x}{\left(-z\right) \cdot \left(-z\right)}}}\right)} - 1 \]
      6. sqr-neg44.6%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\frac{x \cdot x}{\color{blue}{z \cdot z}}}\right)} - 1 \]
      7. frac-times46.2%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\color{blue}{\frac{x}{z} \cdot \frac{x}{z}}}\right)} - 1 \]
      8. sqrt-unprod31.4%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{\frac{x}{z}} \cdot \sqrt{\frac{x}{z}}\right)}\right)} - 1 \]
      9. add-sqr-sqrt43.2%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\frac{x}{z}}\right)} - 1 \]
      10. associate-*r/43.2%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{y \cdot x}{z}}\right)} - 1 \]
    11. Applied egg-rr43.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y \cdot x}{z}\right)} - 1} \]
    12. Step-by-step derivation
      1. expm1-def25.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y \cdot x}{z}\right)\right)} \]
      2. expm1-log1p30.8%

        \[\leadsto \color{blue}{\frac{y \cdot x}{z}} \]
      3. associate-/l*39.1%

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{x}}} \]
    13. Simplified39.1%

      \[\leadsto \color{blue}{\frac{y}{\frac{z}{x}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification35.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{-270}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \end{array} \]

Alternative 18: 72.6% accurate, 1.6× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ y \cdot \frac{x}{z \cdot z} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z) :precision binary64 (* y (/ x (* z z))))
assert(x < y);
double code(double x, double y, double z) {
	return y * (x / (z * z));
}
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 = y * (x / (z * z))
end function
assert x < y;
public static double code(double x, double y, double z) {
	return y * (x / (z * z));
}
[x, y] = sort([x, y])
def code(x, y, z):
	return y * (x / (z * z))
x, y = sort([x, y])
function code(x, y, z)
	return Float64(y * Float64(x / Float64(z * z)))
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
	tmp = y * (x / (z * z));
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
y \cdot \frac{x}{z \cdot z}
\end{array}
Derivation
  1. Initial program 86.7%

    \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
  2. Step-by-step derivation
    1. *-commutative86.7%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
    2. associate-*r/86.1%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
    3. sqr-neg86.1%

      \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\left(-z\right) \cdot \left(-z\right)\right)} \cdot \left(z + 1\right)} \]
    4. associate-*l*86.0%

      \[\leadsto y \cdot \frac{x}{\color{blue}{\left(-z\right) \cdot \left(\left(-z\right) \cdot \left(z + 1\right)\right)}} \]
    5. associate-*l*86.1%

      \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\left(-z\right) \cdot \left(-z\right)\right) \cdot \left(z + 1\right)}} \]
    6. sqr-neg86.1%

      \[\leadsto y \cdot \frac{x}{\color{blue}{\left(z \cdot z\right)} \cdot \left(z + 1\right)} \]
    7. associate-*l*86.0%

      \[\leadsto y \cdot \frac{x}{\color{blue}{z \cdot \left(z \cdot \left(z + 1\right)\right)}} \]
    8. distribute-lft-in86.0%

      \[\leadsto y \cdot \frac{x}{z \cdot \color{blue}{\left(z \cdot z + z \cdot 1\right)}} \]
    9. fma-def86.1%

      \[\leadsto y \cdot \frac{x}{z \cdot \color{blue}{\mathsf{fma}\left(z, z, z \cdot 1\right)}} \]
    10. *-rgt-identity86.1%

      \[\leadsto y \cdot \frac{x}{z \cdot \mathsf{fma}\left(z, z, \color{blue}{z}\right)} \]
  3. Simplified86.1%

    \[\leadsto \color{blue}{y \cdot \frac{x}{z \cdot \mathsf{fma}\left(z, z, z\right)}} \]
  4. Taylor expanded in z around 0 77.4%

    \[\leadsto y \cdot \color{blue}{\frac{x}{{z}^{2}}} \]
  5. Step-by-step derivation
    1. unpow277.4%

      \[\leadsto y \cdot \frac{x}{\color{blue}{z \cdot z}} \]
  6. Simplified77.4%

    \[\leadsto y \cdot \color{blue}{\frac{x}{z \cdot z}} \]
  7. Final simplification77.4%

    \[\leadsto y \cdot \frac{x}{z \cdot z} \]

Alternative 19: 31.5% accurate, 2.2× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{x}{z} \cdot y \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z) :precision binary64 (* (/ x z) y))
assert(x < y);
double code(double x, double y, double z) {
	return (x / z) * y;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x / z) * y
end function
assert x < y;
public static double code(double x, double y, double z) {
	return (x / z) * y;
}
[x, y] = sort([x, y])
def code(x, y, z):
	return (x / z) * y
x, y = sort([x, y])
function code(x, y, z)
	return Float64(Float64(x / z) * y)
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
	tmp = (x / z) * y;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{z} \cdot y
\end{array}
Derivation
  1. Initial program 86.7%

    \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
  2. Step-by-step derivation
    1. *-commutative86.7%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
    2. associate-*r/86.1%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
    3. sqr-neg86.1%

      \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\left(-z\right) \cdot \left(-z\right)\right)} \cdot \left(z + 1\right)} \]
    4. associate-*l*86.0%

      \[\leadsto y \cdot \frac{x}{\color{blue}{\left(-z\right) \cdot \left(\left(-z\right) \cdot \left(z + 1\right)\right)}} \]
    5. associate-*l*86.1%

      \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\left(-z\right) \cdot \left(-z\right)\right) \cdot \left(z + 1\right)}} \]
    6. sqr-neg86.1%

      \[\leadsto y \cdot \frac{x}{\color{blue}{\left(z \cdot z\right)} \cdot \left(z + 1\right)} \]
    7. associate-*l*86.0%

      \[\leadsto y \cdot \frac{x}{\color{blue}{z \cdot \left(z \cdot \left(z + 1\right)\right)}} \]
    8. distribute-lft-in86.0%

      \[\leadsto y \cdot \frac{x}{z \cdot \color{blue}{\left(z \cdot z + z \cdot 1\right)}} \]
    9. fma-def86.1%

      \[\leadsto y \cdot \frac{x}{z \cdot \color{blue}{\mathsf{fma}\left(z, z, z \cdot 1\right)}} \]
    10. *-rgt-identity86.1%

      \[\leadsto y \cdot \frac{x}{z \cdot \mathsf{fma}\left(z, z, \color{blue}{z}\right)} \]
  3. Simplified86.1%

    \[\leadsto \color{blue}{y \cdot \frac{x}{z \cdot \mathsf{fma}\left(z, z, z\right)}} \]
  4. Taylor expanded in z around 0 50.0%

    \[\leadsto \color{blue}{\frac{y \cdot x}{{z}^{2}} + -1 \cdot \frac{y \cdot x}{z}} \]
  5. Step-by-step derivation
    1. unpow250.0%

      \[\leadsto \frac{y \cdot x}{\color{blue}{z \cdot z}} + -1 \cdot \frac{y \cdot x}{z} \]
    2. *-commutative50.0%

      \[\leadsto \frac{\color{blue}{x \cdot y}}{z \cdot z} + -1 \cdot \frac{y \cdot x}{z} \]
    3. times-frac55.9%

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{y}{z}} + -1 \cdot \frac{y \cdot x}{z} \]
    4. mul-1-neg55.9%

      \[\leadsto \frac{x}{z} \cdot \frac{y}{z} + \color{blue}{\left(-\frac{y \cdot x}{z}\right)} \]
    5. *-commutative55.9%

      \[\leadsto \frac{x}{z} \cdot \frac{y}{z} + \left(-\frac{\color{blue}{x \cdot y}}{z}\right) \]
    6. associate-*r/57.2%

      \[\leadsto \frac{x}{z} \cdot \frac{y}{z} + \left(-\color{blue}{x \cdot \frac{y}{z}}\right) \]
    7. distribute-lft-neg-in57.2%

      \[\leadsto \frac{x}{z} \cdot \frac{y}{z} + \color{blue}{\left(-x\right) \cdot \frac{y}{z}} \]
    8. distribute-rgt-out67.4%

      \[\leadsto \color{blue}{\frac{y}{z} \cdot \left(\frac{x}{z} + \left(-x\right)\right)} \]
  6. Simplified67.4%

    \[\leadsto \color{blue}{\frac{y}{z} \cdot \left(\frac{x}{z} + \left(-x\right)\right)} \]
  7. Taylor expanded in z around inf 25.2%

    \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot x}{z}} \]
  8. Step-by-step derivation
    1. associate-*r/29.9%

      \[\leadsto -1 \cdot \color{blue}{\left(y \cdot \frac{x}{z}\right)} \]
    2. neg-mul-129.9%

      \[\leadsto \color{blue}{-y \cdot \frac{x}{z}} \]
    3. distribute-rgt-neg-in29.9%

      \[\leadsto \color{blue}{y \cdot \left(-\frac{x}{z}\right)} \]
    4. neg-mul-129.9%

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \frac{x}{z}\right)} \]
    5. metadata-eval29.9%

      \[\leadsto y \cdot \left(\color{blue}{\frac{1}{-1}} \cdot \frac{x}{z}\right) \]
    6. times-frac29.9%

      \[\leadsto y \cdot \color{blue}{\frac{1 \cdot x}{-1 \cdot z}} \]
    7. *-lft-identity29.9%

      \[\leadsto y \cdot \frac{\color{blue}{x}}{-1 \cdot z} \]
    8. neg-mul-129.9%

      \[\leadsto y \cdot \frac{x}{\color{blue}{-z}} \]
  9. Simplified29.9%

    \[\leadsto \color{blue}{y \cdot \frac{x}{-z}} \]
  10. Step-by-step derivation
    1. expm1-log1p-u24.3%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(y \cdot \frac{x}{-z}\right)\right)} \]
    2. expm1-udef37.6%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(y \cdot \frac{x}{-z}\right)} - 1} \]
    3. add-sqr-sqrt24.4%

      \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{\frac{x}{-z}} \cdot \sqrt{\frac{x}{-z}}\right)}\right)} - 1 \]
    4. sqrt-unprod39.2%

      \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\sqrt{\frac{x}{-z} \cdot \frac{x}{-z}}}\right)} - 1 \]
    5. frac-times36.2%

      \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\color{blue}{\frac{x \cdot x}{\left(-z\right) \cdot \left(-z\right)}}}\right)} - 1 \]
    6. sqr-neg36.2%

      \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\frac{x \cdot x}{\color{blue}{z \cdot z}}}\right)} - 1 \]
    7. frac-times39.2%

      \[\leadsto e^{\mathsf{log1p}\left(y \cdot \sqrt{\color{blue}{\frac{x}{z} \cdot \frac{x}{z}}}\right)} - 1 \]
    8. sqrt-unprod25.8%

      \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{\frac{x}{z}} \cdot \sqrt{\frac{x}{z}}\right)}\right)} - 1 \]
    9. add-sqr-sqrt39.6%

      \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\frac{x}{z}}\right)} - 1 \]
    10. associate-*r/39.6%

      \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{y \cdot x}{z}}\right)} - 1 \]
  11. Applied egg-rr39.6%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y \cdot x}{z}\right)} - 1} \]
  12. Step-by-step derivation
    1. expm1-def21.9%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y \cdot x}{z}\right)\right)} \]
    2. expm1-log1p27.0%

      \[\leadsto \color{blue}{\frac{y \cdot x}{z}} \]
    3. *-commutative27.0%

      \[\leadsto \frac{\color{blue}{x \cdot y}}{z} \]
    4. associate-/l*31.4%

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
  13. Simplified31.4%

    \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
  14. Step-by-step derivation
    1. associate-/r/32.8%

      \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
  15. Applied egg-rr32.8%

    \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
  16. Final simplification32.8%

    \[\leadsto \frac{x}{z} \cdot y \]

Developer target: 95.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z < 249.6182814532307:\\ \;\;\;\;\frac{y \cdot \frac{x}{z}}{z + z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{y}{z}}{1 + z} \cdot x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (< z 249.6182814532307)
   (/ (* y (/ x z)) (+ z (* z z)))
   (/ (* (/ (/ y z) (+ 1.0 z)) x) z)))
double code(double x, double y, double z) {
	double tmp;
	if (z < 249.6182814532307) {
		tmp = (y * (x / z)) / (z + (z * z));
	} else {
		tmp = (((y / z) / (1.0 + z)) * x) / z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z < 249.6182814532307d0) then
        tmp = (y * (x / z)) / (z + (z * z))
    else
        tmp = (((y / z) / (1.0d0 + z)) * x) / z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z < 249.6182814532307) {
		tmp = (y * (x / z)) / (z + (z * z));
	} else {
		tmp = (((y / z) / (1.0 + z)) * x) / z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z < 249.6182814532307:
		tmp = (y * (x / z)) / (z + (z * z))
	else:
		tmp = (((y / z) / (1.0 + z)) * x) / z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z < 249.6182814532307)
		tmp = Float64(Float64(y * Float64(x / z)) / Float64(z + Float64(z * z)));
	else
		tmp = Float64(Float64(Float64(Float64(y / z) / Float64(1.0 + z)) * x) / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z < 249.6182814532307)
		tmp = (y * (x / z)) / (z + (z * z));
	else
		tmp = (((y / z) / (1.0 + z)) * x) / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Less[z, 249.6182814532307], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / N[(z + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y / z), $MachinePrecision] / N[(1.0 + z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z < 249.6182814532307:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z + z \cdot z}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{y}{z}}{1 + z} \cdot x}{z}\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023274 
(FPCore (x y z)
  :name "Statistics.Distribution.Beta:$cvariance from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (if (< z 249.6182814532307) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1.0 z)) x) z))

  (/ (* x y) (* (* z z) (+ z 1.0))))