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

Percentage Accurate: 83.3% → 97.4%
Time: 10.6s
Alternatives: 16
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 16 alternatives:

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

Initial Program: 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: 97.4% accurate, 0.5× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z 1))) < 2.00000000000000013e265

    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. associate-*l*89.3%

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

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

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

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

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

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

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

    if 2.00000000000000013e265 < (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z 1)))

    1. Initial program 53.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 95.2% accurate, 0.4× speedup?

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

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


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

    1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e31 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 1e-3

    1. Initial program 83.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.4% accurate, 0.5× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z 1))) < 2.00000000000000013e265

    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. associate-*l*89.3%

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

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

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

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

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

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

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

    if 2.00000000000000013e265 < (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z 1)))

    1. Initial program 53.7%

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

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

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

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

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

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

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

Alternative 4: 80.0% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -4e-30

    1. Initial program 78.3%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      3. sqr-neg78.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*79.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*78.9%

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

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

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

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

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

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

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

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

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

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

    if -4e-30 < (*.f64 x y) < 9.99999999999999924e-25

    1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999924e-25 < (*.f64 x y)

    1. Initial program 80.2%

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

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

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

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

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

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

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

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

Alternative 5: 93.5% accurate, 0.8× speedup?

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

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


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

    1. Initial program 77.7%

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

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

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

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

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

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

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

    if -1 < z < 1

    1. Initial program 83.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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{x \cdot \frac{y}{z}}{z}\\ \end{array} \]

Alternative 6: 93.8% accurate, 0.8× speedup?

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

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


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

    1. Initial program 77.7%

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

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

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

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

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

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

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

    if -1 < z < 0.71999999999999997

    1. Initial program 83.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 97.2% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{\frac{y}{z} \cdot \frac{x}{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 (/ (* (/ y z) (/ x z)) (+ z 1.0)))
assert(x < y);
double code(double x, double y, double z) {
	return ((y / z) * (x / 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 = ((y / z) * (x / z)) / (z + 1.0d0)
end function
assert x < y;
public static double code(double x, double y, double z) {
	return ((y / z) * (x / z)) / (z + 1.0);
}
[x, y] = sort([x, y])
def code(x, y, z):
	return ((y / z) * (x / z)) / (z + 1.0)
x, y = sort([x, y])
function code(x, y, z)
	return Float64(Float64(Float64(y / z) * Float64(x / z)) / Float64(z + 1.0))
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
	tmp = ((y / z) * (x / 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[(y / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y}{z} \cdot \frac{x}{z}}{z + 1}
\end{array}
Derivation
  1. Initial program 80.4%

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

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

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

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

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

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

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

Alternative 8: 76.5% accurate, 1.2× speedup?

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

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


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

    1. Initial program 74.7%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      3. sqr-neg72.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*72.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*72.4%

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999997e-37 < x

    1. Initial program 82.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{x}{z \cdot z}} \]
    7. Taylor expanded in x around 0 73.4%

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

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

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

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

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

Alternative 9: 78.2% accurate, 1.2× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.6500000000000001e-71

    1. Initial program 77.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.6500000000000001e-71 < y

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 80.1% accurate, 1.2× speedup?

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

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


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

    1. Initial program 74.7%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      3. sqr-neg72.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*72.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*72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9000000000000002e-37 < x

    1. Initial program 82.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{x}{z \cdot z}} \]
    7. Taylor expanded in x around 0 73.4%

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

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

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

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

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

Alternative 11: 80.5% accurate, 1.2× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.9 \cdot 10^{-37}:\\ \;\;\;\;\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 -1.9e-37) (/ x (* z (/ z y))) (/ y (* z (/ z x)))))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if (x <= -1.9e-37) {
		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 <= (-1.9d-37)) 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 <= -1.9e-37) {
		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 <= -1.9e-37:
		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 <= -1.9e-37)
		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 <= -1.9e-37)
		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, -1.9e-37], 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 -1.9 \cdot 10^{-37}:\\
\;\;\;\;\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 < -1.9000000000000002e-37

    1. Initial program 74.7%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      3. sqr-neg72.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*72.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*72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9000000000000002e-37 < x

    1. Initial program 82.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 40.1% accurate, 1.4× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{-311}:\\ \;\;\;\;x \cdot \frac{-y}{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 -4e-311) (* x (/ (- y) z)) (/ x (/ z y))))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if (z <= -4e-311) {
		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 (z <= (-4d-311)) 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 (z <= -4e-311) {
		tmp = x * (-y / z);
	} else {
		tmp = x / (z / y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z):
	tmp = 0
	if z <= -4e-311:
		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 (z <= -4e-311)
		tmp = Float64(x * Float64(Float64(-y) / 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 <= -4e-311)
		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[z, -4e-311], N[(x * N[((-y) / 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 -4 \cdot 10^{-311}:\\
\;\;\;\;x \cdot \frac{-y}{z}\\

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


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

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.99999999999979e-311 < z

    1. Initial program 78.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(-\frac{y}{z}\right)} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt18.6%

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

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

        \[\leadsto x \cdot \sqrt{\color{blue}{\frac{y}{z} \cdot \frac{y}{z}}} \]
      4. sqrt-unprod20.8%

        \[\leadsto x \cdot \color{blue}{\left(\sqrt{\frac{y}{z}} \cdot \sqrt{\frac{y}{z}}\right)} \]
      5. add-sqr-sqrt35.6%

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    11. Applied egg-rr36.4%

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

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

Alternative 13: 33.0% accurate, 1.6× speedup?

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

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


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

    1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(-\frac{y}{z}\right)} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt19.4%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(\sqrt{\frac{y}{z}} \cdot \sqrt{\frac{y}{z}}\right)} \]
      5. add-sqr-sqrt24.6%

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

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

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

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    12. Step-by-step derivation
      1. clear-num26.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{z}{y}}{x}}} \]
      2. associate-/r/25.6%

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

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

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

    if -1.05e-159 < x

    1. Initial program 80.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(-\frac{y}{z}\right)} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt24.4%

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

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

        \[\leadsto x \cdot \sqrt{\color{blue}{\frac{y}{z} \cdot \frac{y}{z}}} \]
      4. sqrt-unprod19.2%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    11. Applied egg-rr29.5%

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
    13. Applied egg-rr32.2%

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

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

Alternative 14: 33.4% accurate, 1.6× speedup?

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

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


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

    1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(-\frac{y}{z}\right)} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt19.4%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(\sqrt{\frac{y}{z}} \cdot \sqrt{\frac{y}{z}}\right)} \]
      5. add-sqr-sqrt24.6%

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

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

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

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

    if -4.99999999999999994e-160 < x

    1. Initial program 80.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(-\frac{y}{z}\right)} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt24.4%

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

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

        \[\leadsto x \cdot \sqrt{\color{blue}{\frac{y}{z} \cdot \frac{y}{z}}} \]
      4. sqrt-unprod19.2%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    11. Applied egg-rr29.5%

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
    13. Applied egg-rr32.2%

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

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

Alternative 15: 73.1% 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 80.4%

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

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

      \[\leadsto \color{blue}{y \cdot \frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
    3. sqr-neg80.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*80.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*80.6%

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

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

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

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

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

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

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

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

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

    \[\leadsto y \cdot \color{blue}{\frac{x}{z \cdot z}} \]
  7. Final simplification69.8%

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

Alternative 16: 31.7% accurate, 2.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot y}{z}} \]
  8. Step-by-step derivation
    1. mul-1-neg23.8%

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

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

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

    \[\leadsto \color{blue}{x \cdot \left(-\frac{y}{z}\right)} \]
  10. Step-by-step derivation
    1. add-sqr-sqrt22.7%

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

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

      \[\leadsto x \cdot \sqrt{\color{blue}{\frac{y}{z} \cdot \frac{y}{z}}} \]
    4. sqrt-unprod19.2%

      \[\leadsto x \cdot \color{blue}{\left(\sqrt{\frac{y}{z}} \cdot \sqrt{\frac{y}{z}}\right)} \]
    5. add-sqr-sqrt27.7%

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

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

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
  11. Applied egg-rr28.1%

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

      \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
  13. Applied egg-rr27.4%

    \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
  14. Final simplification27.4%

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

Developer target: 95.4% 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 2023272 
(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))))