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

Percentage Accurate: 82.7% → 96.3%
Time: 11.7s
Alternatives: 18
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 18 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: 82.7% 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: 96.3% accurate, 0.7× speedup?

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

\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 < -8.00000000000000024e-117 or 1.99999999999999988e-11 < z

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.00000000000000024e-117 < z < 1.99999999999999988e-11

    1. Initial program 81.3%

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y + \frac{y}{z}\right)} \]
    5. Step-by-step derivation
      1. neg-mul-194.7%

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

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

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

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

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

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

Alternative 2: 94.4% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.65 \cdot 10^{-119} \lor \neg \left(z \leq 9.5 \cdot 10^{-12}\right):\\ \;\;\;\;\frac{y}{z + 1} \cdot \frac{x}{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.65e-119) (not (<= z 9.5e-12)))
   (* (/ y (+ z 1.0)) (/ x (* z z)))
   (/ (* x (- (/ y z) y)) z)))
assert(x < y);
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -1.65e-119) || !(z <= 9.5e-12)) {
		tmp = (y / (z + 1.0)) * (x / (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.65d-119)) .or. (.not. (z <= 9.5d-12))) then
        tmp = (y / (z + 1.0d0)) * (x / (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.65e-119) || !(z <= 9.5e-12)) {
		tmp = (y / (z + 1.0)) * (x / (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.65e-119) or not (z <= 9.5e-12):
		tmp = (y / (z + 1.0)) * (x / (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.65e-119) || !(z <= 9.5e-12))
		tmp = Float64(Float64(y / Float64(z + 1.0)) * Float64(x / 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.65e-119) || ~((z <= 9.5e-12)))
		tmp = (y / (z + 1.0)) * (x / (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.65e-119], N[Not[LessEqual[z, 9.5e-12]], $MachinePrecision]], N[(N[(y / N[(z + 1.0), $MachinePrecision]), $MachinePrecision] * N[(x / 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.65 \cdot 10^{-119} \lor \neg \left(z \leq 9.5 \cdot 10^{-12}\right):\\
\;\;\;\;\frac{y}{z + 1} \cdot \frac{x}{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.65000000000000004e-119 or 9.4999999999999995e-12 < z

    1. Initial program 86.8%

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

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

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

    if -1.65000000000000004e-119 < z < 9.4999999999999995e-12

    1. Initial program 81.2%

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y + \frac{y}{z}\right)} \]
    5. Step-by-step derivation
      1. neg-mul-194.6%

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

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

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

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

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

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

Alternative 3: 93.0% accurate, 0.8× speedup?

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

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


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

    1. Initial program 87.2%

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 0.75

    1. Initial program 81.6%

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y + \frac{y}{z}\right)} \]
    5. Step-by-step derivation
      1. neg-mul-194.5%

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

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

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

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

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

Alternative 4: 93.1% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{\color{blue}{\frac{z}{y}} \cdot \left(z \cdot z\right)} \]
    7. Step-by-step derivation
      1. *-un-lft-identity96.4%

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

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

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

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

    if -1 < z < 0.75

    1. Initial program 81.6%

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y + \frac{y}{z}\right)} \]
    5. Step-by-step derivation
      1. neg-mul-194.5%

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

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

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

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

    if 0.75 < z

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 93.4% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{\color{blue}{\frac{z}{y}} \cdot \left(z \cdot z\right)} \]
    7. Step-by-step derivation
      1. *-un-lft-identity96.4%

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

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

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

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

    if -1 < z < 0.78000000000000003

    1. Initial program 81.6%

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y + \frac{y}{z}\right)} \]
    5. Step-by-step derivation
      1. neg-mul-194.5%

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

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

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

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

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

    if 0.78000000000000003 < z

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 96.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 94.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{z}}{z + z \cdot z}} \]
  10. Final simplification94.8%

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

Alternative 8: 96.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 77.6% accurate, 1.2× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.10000000000000011e76

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.10000000000000011e76 < x

    1. Initial program 84.6%

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

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

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

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

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

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

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

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

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

Alternative 10: 77.4% accurate, 1.2× speedup?

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

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


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

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

    if 1.60000000000000011e-16 < y

    1. Initial program 85.9%

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

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

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

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

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

Alternative 11: 78.6% accurate, 1.2× speedup?

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

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


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

    1. Initial program 85.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e76 < y

    1. Initial program 81.1%

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

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

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

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

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

Alternative 12: 79.2% accurate, 1.2× speedup?

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

    1. Initial program 82.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.30000000000000012e-79 < x

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \cdot \frac{y}{z} \]
      10. frac-times78.2%

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

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

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

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

Alternative 13: 40.4% accurate, 1.4× speedup?

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

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


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

    1. Initial program 85.3%

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y + \frac{y}{z}\right)} \]
    5. Step-by-step derivation
      1. neg-mul-167.6%

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

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

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

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

      \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y\right)} \]
    8. Step-by-step derivation
      1. neg-mul-144.4%

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

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

    if -9.999999999999969e-311 < z

    1. Initial program 83.6%

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y + \frac{y}{z}\right)} \]
    5. Step-by-step derivation
      1. neg-mul-163.7%

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

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

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

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

      \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y\right)} \]
    8. Step-by-step derivation
      1. neg-mul-119.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 40.5% accurate, 1.4× speedup?

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

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


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

    1. Initial program 85.3%

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y + \frac{y}{z}\right)} \]
    5. Step-by-step derivation
      1. neg-mul-167.6%

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

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

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

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

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

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

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

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

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

    if -9.999999999999969e-311 < z

    1. Initial program 83.6%

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y + \frac{y}{z}\right)} \]
    5. Step-by-step derivation
      1. neg-mul-163.7%

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

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

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

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

      \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y\right)} \]
    8. Step-by-step derivation
      1. neg-mul-119.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 34.1% accurate, 1.6× speedup?

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

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


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

    1. Initial program 84.8%

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y + \frac{y}{z}\right)} \]
    5. Step-by-step derivation
      1. neg-mul-148.0%

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

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

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

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

      \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y\right)} \]
    8. Step-by-step derivation
      1. neg-mul-132.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{z}{y}}} \]
      11. un-div-inv25.4%

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

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

    if -1e51 < x

    1. Initial program 84.3%

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y + \frac{y}{z}\right)} \]
    5. Step-by-step derivation
      1. neg-mul-170.0%

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

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

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

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

      \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y\right)} \]
    8. Step-by-step derivation
      1. neg-mul-131.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{\frac{z}{x}}} \]
      4. add-sqr-sqrt17.9%

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

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{\frac{z}{x}} \]
      8. add-sqr-sqrt33.0%

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

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

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

Alternative 16: 72.4% accurate, 1.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 31.7% accurate, 2.2× speedup?

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

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

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

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

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

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

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

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

    \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y + \frac{y}{z}\right)} \]
  5. Step-by-step derivation
    1. neg-mul-165.6%

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

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

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

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

    \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y\right)} \]
  8. Step-by-step derivation
    1. neg-mul-131.5%

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

    \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-y\right)} \]
  10. Step-by-step derivation
    1. expm1-log1p-u25.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 31.9% accurate, 2.2× speedup?

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

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

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

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

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

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

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

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

    \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y + \frac{y}{z}\right)} \]
  5. Step-by-step derivation
    1. neg-mul-165.6%

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

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

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

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

    \[\leadsto \frac{x}{z} \cdot \color{blue}{\left(-1 \cdot y\right)} \]
  8. Step-by-step derivation
    1. neg-mul-131.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{y}{z}} \]
    10. clear-num31.0%

      \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{z}{y}}} \]
    11. un-div-inv31.0%

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

    \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
  12. Final simplification31.0%

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

Developer target: 95.5% 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 2023230 
(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))))