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

Percentage Accurate: 83.4% → 96.9%
Time: 10.5s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 83.4% 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.9% accurate, 0.4× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ \begin{array}{l} t_0 := z \cdot \frac{z}{y\_m}\\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -2.15 \cdot 10^{+54}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{t\_0}\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{-131}:\\ \;\;\;\;y\_m \cdot \frac{\frac{x\_m}{z \cdot z}}{z + 1}\\ \mathbf{elif}\;z \leq 18000000000:\\ \;\;\;\;\frac{\frac{y\_m}{\frac{z}{x\_m}}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{\left(z + 1\right) \cdot t\_0}\\ \end{array}\right) \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (let* ((t_0 (* z (/ z y_m))))
   (*
    y_s
    (*
     x_s
     (if (<= z -2.15e+54)
       (/ (/ x_m z) t_0)
       (if (<= z -6.6e-131)
         (* y_m (/ (/ x_m (* z z)) (+ z 1.0)))
         (if (<= z 18000000000.0)
           (/ (/ y_m (/ z x_m)) z)
           (/ x_m (* (+ z 1.0) t_0)))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double t_0 = z * (z / y_m);
	double tmp;
	if (z <= -2.15e+54) {
		tmp = (x_m / z) / t_0;
	} else if (z <= -6.6e-131) {
		tmp = y_m * ((x_m / (z * z)) / (z + 1.0));
	} else if (z <= 18000000000.0) {
		tmp = (y_m / (z / x_m)) / z;
	} else {
		tmp = x_m / ((z + 1.0) * t_0);
	}
	return y_s * (x_s * tmp);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = z * (z / y_m)
    if (z <= (-2.15d+54)) then
        tmp = (x_m / z) / t_0
    else if (z <= (-6.6d-131)) then
        tmp = y_m * ((x_m / (z * z)) / (z + 1.0d0))
    else if (z <= 18000000000.0d0) then
        tmp = (y_m / (z / x_m)) / z
    else
        tmp = x_m / ((z + 1.0d0) * t_0)
    end if
    code = y_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double t_0 = z * (z / y_m);
	double tmp;
	if (z <= -2.15e+54) {
		tmp = (x_m / z) / t_0;
	} else if (z <= -6.6e-131) {
		tmp = y_m * ((x_m / (z * z)) / (z + 1.0));
	} else if (z <= 18000000000.0) {
		tmp = (y_m / (z / x_m)) / z;
	} else {
		tmp = x_m / ((z + 1.0) * t_0);
	}
	return y_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	t_0 = z * (z / y_m)
	tmp = 0
	if z <= -2.15e+54:
		tmp = (x_m / z) / t_0
	elif z <= -6.6e-131:
		tmp = y_m * ((x_m / (z * z)) / (z + 1.0))
	elif z <= 18000000000.0:
		tmp = (y_m / (z / x_m)) / z
	else:
		tmp = x_m / ((z + 1.0) * t_0)
	return y_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	t_0 = Float64(z * Float64(z / y_m))
	tmp = 0.0
	if (z <= -2.15e+54)
		tmp = Float64(Float64(x_m / z) / t_0);
	elseif (z <= -6.6e-131)
		tmp = Float64(y_m * Float64(Float64(x_m / Float64(z * z)) / Float64(z + 1.0)));
	elseif (z <= 18000000000.0)
		tmp = Float64(Float64(y_m / Float64(z / x_m)) / z);
	else
		tmp = Float64(x_m / Float64(Float64(z + 1.0) * t_0));
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
	t_0 = z * (z / y_m);
	tmp = 0.0;
	if (z <= -2.15e+54)
		tmp = (x_m / z) / t_0;
	elseif (z <= -6.6e-131)
		tmp = y_m * ((x_m / (z * z)) / (z + 1.0));
	elseif (z <= 18000000000.0)
		tmp = (y_m / (z / x_m)) / z;
	else
		tmp = x_m / ((z + 1.0) * t_0);
	end
	tmp_2 = y_s * (x_s * tmp);
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := Block[{t$95$0 = N[(z * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * N[(x$95$s * If[LessEqual[z, -2.15e+54], N[(N[(x$95$m / z), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[z, -6.6e-131], N[(y$95$m * N[(N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 18000000000.0], N[(N[(y$95$m / N[(z / x$95$m), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x$95$m / N[(N[(z + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
\begin{array}{l}
t_0 := z \cdot \frac{z}{y\_m}\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+54}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{t\_0}\\

\mathbf{elif}\;z \leq -6.6 \cdot 10^{-131}:\\
\;\;\;\;y\_m \cdot \frac{\frac{x\_m}{z \cdot z}}{z + 1}\\

\mathbf{elif}\;z \leq 18000000000:\\
\;\;\;\;\frac{\frac{y\_m}{\frac{z}{x\_m}}}{z}\\

\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(z + 1\right) \cdot t\_0}\\


\end{array}\right)
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.14999999999999988e54

    1. Initial program 75.7%

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

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

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

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

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

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

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

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

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

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

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

    if -2.14999999999999988e54 < z < -6.6000000000000004e-131

    1. Initial program 97.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{\frac{x}{z \cdot z}}{z + 1}} \]
    4. Add Preprocessing

    if -6.6000000000000004e-131 < z < 1.8e10

    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. *-commutative85.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.8e10 < z

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.15 \cdot 10^{+54}:\\ \;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{-131}:\\ \;\;\;\;y \cdot \frac{\frac{x}{z \cdot z}}{z + 1}\\ \mathbf{elif}\;z \leq 18000000000:\\ \;\;\;\;\frac{\frac{y}{\frac{z}{x}}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(z + 1\right) \cdot \left(z \cdot \frac{z}{y}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 97.2% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ \begin{array}{l} t_0 := \frac{x\_m \cdot y\_m}{\left(z + 1\right) \cdot \left(z \cdot z\right)}\\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\frac{x\_m}{\left(z + 1\right) \cdot \left(z \cdot \frac{z}{y\_m}\right)}\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+151}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{y\_m}{z} \cdot \frac{\frac{x\_m}{z + 1}}{z}\\ \end{array}\right) \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (let* ((t_0 (/ (* x_m y_m) (* (+ z 1.0) (* z z)))))
   (*
    y_s
    (*
     x_s
     (if (<= t_0 0.0)
       (/ x_m (* (+ z 1.0) (* z (/ z y_m))))
       (if (<= t_0 4e+151) t_0 (* (/ y_m z) (/ (/ x_m (+ z 1.0)) z))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double t_0 = (x_m * y_m) / ((z + 1.0) * (z * z));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = x_m / ((z + 1.0) * (z * (z / y_m)));
	} else if (t_0 <= 4e+151) {
		tmp = t_0;
	} else {
		tmp = (y_m / z) * ((x_m / (z + 1.0)) / z);
	}
	return y_s * (x_s * tmp);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (x_m * y_m) / ((z + 1.0d0) * (z * z))
    if (t_0 <= 0.0d0) then
        tmp = x_m / ((z + 1.0d0) * (z * (z / y_m)))
    else if (t_0 <= 4d+151) then
        tmp = t_0
    else
        tmp = (y_m / z) * ((x_m / (z + 1.0d0)) / z)
    end if
    code = y_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double t_0 = (x_m * y_m) / ((z + 1.0) * (z * z));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = x_m / ((z + 1.0) * (z * (z / y_m)));
	} else if (t_0 <= 4e+151) {
		tmp = t_0;
	} else {
		tmp = (y_m / z) * ((x_m / (z + 1.0)) / z);
	}
	return y_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	t_0 = (x_m * y_m) / ((z + 1.0) * (z * z))
	tmp = 0
	if t_0 <= 0.0:
		tmp = x_m / ((z + 1.0) * (z * (z / y_m)))
	elif t_0 <= 4e+151:
		tmp = t_0
	else:
		tmp = (y_m / z) * ((x_m / (z + 1.0)) / z)
	return y_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	t_0 = Float64(Float64(x_m * y_m) / Float64(Float64(z + 1.0) * Float64(z * z)))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(x_m / Float64(Float64(z + 1.0) * Float64(z * Float64(z / y_m))));
	elseif (t_0 <= 4e+151)
		tmp = t_0;
	else
		tmp = Float64(Float64(y_m / z) * Float64(Float64(x_m / Float64(z + 1.0)) / z));
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
	t_0 = (x_m * y_m) / ((z + 1.0) * (z * z));
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = x_m / ((z + 1.0) * (z * (z / y_m)));
	elseif (t_0 <= 4e+151)
		tmp = t_0;
	else
		tmp = (y_m / z) * ((x_m / (z + 1.0)) / z);
	end
	tmp_2 = y_s * (x_s * tmp);
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(x$95$m * y$95$m), $MachinePrecision] / N[(N[(z + 1.0), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * N[(x$95$s * If[LessEqual[t$95$0, 0.0], N[(x$95$m / N[(N[(z + 1.0), $MachinePrecision] * N[(z * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+151], t$95$0, N[(N[(y$95$m / z), $MachinePrecision] * N[(N[(x$95$m / N[(z + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
\begin{array}{l}
t_0 := \frac{x\_m \cdot y\_m}{\left(z + 1\right) \cdot \left(z \cdot z\right)}\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{x\_m}{\left(z + 1\right) \cdot \left(z \cdot \frac{z}{y\_m}\right)}\\

\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+151}:\\
\;\;\;\;t\_0\\

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


\end{array}\right)
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64)))) < -0.0

    1. Initial program 90.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0 < (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64)))) < 4.00000000000000007e151

    1. Initial program 98.4%

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

    if 4.00000000000000007e151 < (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64))))

    1. Initial program 66.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x \cdot y}{\left(z + 1\right) \cdot \left(z \cdot z\right)} \leq 0:\\ \;\;\;\;\frac{x}{\left(z + 1\right) \cdot \left(z \cdot \frac{z}{y}\right)}\\ \mathbf{elif}\;\frac{x \cdot y}{\left(z + 1\right) \cdot \left(z \cdot z\right)} \leq 4 \cdot 10^{+151}:\\ \;\;\;\;\frac{x \cdot y}{\left(z + 1\right) \cdot \left(z \cdot z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot \frac{\frac{x}{z + 1}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 95.7% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ \begin{array}{l} t_0 := \frac{\frac{x\_m}{z}}{z \cdot \frac{z}{y\_m}}\\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -2.15 \cdot 10^{+54}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -5.4 \cdot 10^{-26}:\\ \;\;\;\;y\_m \cdot \frac{\frac{x\_m}{z \cdot z}}{z + 1}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-40}:\\ \;\;\;\;\frac{\frac{y\_m}{\frac{z}{x\_m}}}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array}\right) \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (let* ((t_0 (/ (/ x_m z) (* z (/ z y_m)))))
   (*
    y_s
    (*
     x_s
     (if (<= z -2.15e+54)
       t_0
       (if (<= z -5.4e-26)
         (* y_m (/ (/ x_m (* z z)) (+ z 1.0)))
         (if (<= z 8.5e-40) (/ (/ y_m (/ z x_m)) z) t_0)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double t_0 = (x_m / z) / (z * (z / y_m));
	double tmp;
	if (z <= -2.15e+54) {
		tmp = t_0;
	} else if (z <= -5.4e-26) {
		tmp = y_m * ((x_m / (z * z)) / (z + 1.0));
	} else if (z <= 8.5e-40) {
		tmp = (y_m / (z / x_m)) / z;
	} else {
		tmp = t_0;
	}
	return y_s * (x_s * tmp);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (x_m / z) / (z * (z / y_m))
    if (z <= (-2.15d+54)) then
        tmp = t_0
    else if (z <= (-5.4d-26)) then
        tmp = y_m * ((x_m / (z * z)) / (z + 1.0d0))
    else if (z <= 8.5d-40) then
        tmp = (y_m / (z / x_m)) / z
    else
        tmp = t_0
    end if
    code = y_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double t_0 = (x_m / z) / (z * (z / y_m));
	double tmp;
	if (z <= -2.15e+54) {
		tmp = t_0;
	} else if (z <= -5.4e-26) {
		tmp = y_m * ((x_m / (z * z)) / (z + 1.0));
	} else if (z <= 8.5e-40) {
		tmp = (y_m / (z / x_m)) / z;
	} else {
		tmp = t_0;
	}
	return y_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	t_0 = (x_m / z) / (z * (z / y_m))
	tmp = 0
	if z <= -2.15e+54:
		tmp = t_0
	elif z <= -5.4e-26:
		tmp = y_m * ((x_m / (z * z)) / (z + 1.0))
	elif z <= 8.5e-40:
		tmp = (y_m / (z / x_m)) / z
	else:
		tmp = t_0
	return y_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	t_0 = Float64(Float64(x_m / z) / Float64(z * Float64(z / y_m)))
	tmp = 0.0
	if (z <= -2.15e+54)
		tmp = t_0;
	elseif (z <= -5.4e-26)
		tmp = Float64(y_m * Float64(Float64(x_m / Float64(z * z)) / Float64(z + 1.0)));
	elseif (z <= 8.5e-40)
		tmp = Float64(Float64(y_m / Float64(z / x_m)) / z);
	else
		tmp = t_0;
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
	t_0 = (x_m / z) / (z * (z / y_m));
	tmp = 0.0;
	if (z <= -2.15e+54)
		tmp = t_0;
	elseif (z <= -5.4e-26)
		tmp = y_m * ((x_m / (z * z)) / (z + 1.0));
	elseif (z <= 8.5e-40)
		tmp = (y_m / (z / x_m)) / z;
	else
		tmp = t_0;
	end
	tmp_2 = y_s * (x_s * tmp);
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(x$95$m / z), $MachinePrecision] / N[(z * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * N[(x$95$s * If[LessEqual[z, -2.15e+54], t$95$0, If[LessEqual[z, -5.4e-26], N[(y$95$m * N[(N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e-40], N[(N[(y$95$m / N[(z / x$95$m), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], t$95$0]]]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{x\_m}{z}}{z \cdot \frac{z}{y\_m}}\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+54}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -5.4 \cdot 10^{-26}:\\
\;\;\;\;y\_m \cdot \frac{\frac{x\_m}{z \cdot z}}{z + 1}\\

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

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}\right)
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.14999999999999988e54 or 8.4999999999999998e-40 < z

    1. Initial program 78.9%

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

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

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

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

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

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

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

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

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

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

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

    if -2.14999999999999988e54 < z < -5.39999999999999963e-26

    1. Initial program 94.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{\frac{x}{z \cdot z}}{z + 1}} \]
    4. Add Preprocessing

    if -5.39999999999999963e-26 < z < 8.4999999999999998e-40

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.15 \cdot 10^{+54}:\\ \;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\ \mathbf{elif}\;z \leq -5.4 \cdot 10^{-26}:\\ \;\;\;\;y \cdot \frac{\frac{x}{z \cdot z}}{z + 1}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-40}:\\ \;\;\;\;\frac{\frac{y}{\frac{z}{x}}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 96.7% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{+55}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z \cdot \frac{z}{y\_m}}\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-131}:\\ \;\;\;\;y\_m \cdot \frac{\frac{x\_m}{z \cdot z}}{z + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y\_m}{z} \cdot \frac{\frac{x\_m}{z + 1}}{z}\\ \end{array}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (*
  y_s
  (*
   x_s
   (if (<= z -4.1e+55)
     (/ (/ x_m z) (* z (/ z y_m)))
     (if (<= z -1e-131)
       (* y_m (/ (/ x_m (* z z)) (+ z 1.0)))
       (* (/ y_m z) (/ (/ x_m (+ z 1.0)) z)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if (z <= -4.1e+55) {
		tmp = (x_m / z) / (z * (z / y_m));
	} else if (z <= -1e-131) {
		tmp = y_m * ((x_m / (z * z)) / (z + 1.0));
	} else {
		tmp = (y_m / z) * ((x_m / (z + 1.0)) / z);
	}
	return y_s * (x_s * tmp);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z <= (-4.1d+55)) then
        tmp = (x_m / z) / (z * (z / y_m))
    else if (z <= (-1d-131)) then
        tmp = y_m * ((x_m / (z * z)) / (z + 1.0d0))
    else
        tmp = (y_m / z) * ((x_m / (z + 1.0d0)) / z)
    end if
    code = y_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if (z <= -4.1e+55) {
		tmp = (x_m / z) / (z * (z / y_m));
	} else if (z <= -1e-131) {
		tmp = y_m * ((x_m / (z * z)) / (z + 1.0));
	} else {
		tmp = (y_m / z) * ((x_m / (z + 1.0)) / z);
	}
	return y_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	tmp = 0
	if z <= -4.1e+55:
		tmp = (x_m / z) / (z * (z / y_m))
	elif z <= -1e-131:
		tmp = y_m * ((x_m / (z * z)) / (z + 1.0))
	else:
		tmp = (y_m / z) * ((x_m / (z + 1.0)) / z)
	return y_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0
	if (z <= -4.1e+55)
		tmp = Float64(Float64(x_m / z) / Float64(z * Float64(z / y_m)));
	elseif (z <= -1e-131)
		tmp = Float64(y_m * Float64(Float64(x_m / Float64(z * z)) / Float64(z + 1.0)));
	else
		tmp = Float64(Float64(y_m / z) * Float64(Float64(x_m / Float64(z + 1.0)) / z));
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0;
	if (z <= -4.1e+55)
		tmp = (x_m / z) / (z * (z / y_m));
	elseif (z <= -1e-131)
		tmp = y_m * ((x_m / (z * z)) / (z + 1.0));
	else
		tmp = (y_m / z) * ((x_m / (z + 1.0)) / z);
	end
	tmp_2 = y_s * (x_s * tmp);
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[z, -4.1e+55], N[(N[(x$95$m / z), $MachinePrecision] / N[(z * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1e-131], N[(y$95$m * N[(N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m / z), $MachinePrecision] * N[(N[(x$95$m / N[(z + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+55}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z \cdot \frac{z}{y\_m}}\\

\mathbf{elif}\;z \leq -1 \cdot 10^{-131}:\\
\;\;\;\;y\_m \cdot \frac{\frac{x\_m}{z \cdot z}}{z + 1}\\

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


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

    1. Initial program 75.7%

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

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

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

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

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

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

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

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

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

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

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

    if -4.09999999999999981e55 < z < -9.9999999999999999e-132

    1. Initial program 97.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{\frac{x}{z \cdot z}}{z + 1}} \]
    4. Add Preprocessing

    if -9.9999999999999999e-132 < z

    1. Initial program 83.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{+55}:\\ \;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-131}:\\ \;\;\;\;y \cdot \frac{\frac{x}{z \cdot z}}{z + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot \frac{\frac{x}{z + 1}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 93.9% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -215000000 \lor \neg \left(z \leq 8.4 \cdot 10^{-55}\right):\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z \cdot \frac{z}{y\_m}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y\_m}{\frac{z}{x\_m}}}{z}\\ \end{array}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (*
  y_s
  (*
   x_s
   (if (or (<= z -215000000.0) (not (<= z 8.4e-55)))
     (/ (/ x_m z) (* z (/ z y_m)))
     (/ (/ y_m (/ z x_m)) z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z <= -215000000.0) || !(z <= 8.4e-55)) {
		tmp = (x_m / z) / (z * (z / y_m));
	} else {
		tmp = (y_m / (z / x_m)) / z;
	}
	return y_s * (x_s * tmp);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-215000000.0d0)) .or. (.not. (z <= 8.4d-55))) then
        tmp = (x_m / z) / (z * (z / y_m))
    else
        tmp = (y_m / (z / x_m)) / z
    end if
    code = y_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z <= -215000000.0) || !(z <= 8.4e-55)) {
		tmp = (x_m / z) / (z * (z / y_m));
	} else {
		tmp = (y_m / (z / x_m)) / z;
	}
	return y_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	tmp = 0
	if (z <= -215000000.0) or not (z <= 8.4e-55):
		tmp = (x_m / z) / (z * (z / y_m))
	else:
		tmp = (y_m / (z / x_m)) / z
	return y_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0
	if ((z <= -215000000.0) || !(z <= 8.4e-55))
		tmp = Float64(Float64(x_m / z) / Float64(z * Float64(z / y_m)));
	else
		tmp = Float64(Float64(y_m / Float64(z / x_m)) / z);
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0;
	if ((z <= -215000000.0) || ~((z <= 8.4e-55)))
		tmp = (x_m / z) / (z * (z / y_m));
	else
		tmp = (y_m / (z / x_m)) / z;
	end
	tmp_2 = y_s * (x_s * tmp);
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[Or[LessEqual[z, -215000000.0], N[Not[LessEqual[z, 8.4e-55]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / N[(z * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m / N[(z / x$95$m), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -215000000 \lor \neg \left(z \leq 8.4 \cdot 10^{-55}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z \cdot \frac{z}{y\_m}}\\

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


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.15e8 or 8.4000000000000006e-55 < z

    1. Initial program 80.5%

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

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

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

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

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

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

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

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

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

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

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

    if -2.15e8 < z < 8.4000000000000006e-55

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -215000000 \lor \neg \left(z \leq 8.4 \cdot 10^{-55}\right):\\ \;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{\frac{z}{x}}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 93.5% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -215000000 \lor \neg \left(z \leq 8.4 \cdot 10^{-55}\right):\\ \;\;\;\;\frac{\frac{x\_m}{z} \cdot \frac{y\_m}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y\_m}{\frac{z}{x\_m}}}{z}\\ \end{array}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (*
  y_s
  (*
   x_s
   (if (or (<= z -215000000.0) (not (<= z 8.4e-55)))
     (/ (* (/ x_m z) (/ y_m z)) z)
     (/ (/ y_m (/ z x_m)) z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z <= -215000000.0) || !(z <= 8.4e-55)) {
		tmp = ((x_m / z) * (y_m / z)) / z;
	} else {
		tmp = (y_m / (z / x_m)) / z;
	}
	return y_s * (x_s * tmp);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-215000000.0d0)) .or. (.not. (z <= 8.4d-55))) then
        tmp = ((x_m / z) * (y_m / z)) / z
    else
        tmp = (y_m / (z / x_m)) / z
    end if
    code = y_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z <= -215000000.0) || !(z <= 8.4e-55)) {
		tmp = ((x_m / z) * (y_m / z)) / z;
	} else {
		tmp = (y_m / (z / x_m)) / z;
	}
	return y_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	tmp = 0
	if (z <= -215000000.0) or not (z <= 8.4e-55):
		tmp = ((x_m / z) * (y_m / z)) / z
	else:
		tmp = (y_m / (z / x_m)) / z
	return y_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0
	if ((z <= -215000000.0) || !(z <= 8.4e-55))
		tmp = Float64(Float64(Float64(x_m / z) * Float64(y_m / z)) / z);
	else
		tmp = Float64(Float64(y_m / Float64(z / x_m)) / z);
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0;
	if ((z <= -215000000.0) || ~((z <= 8.4e-55)))
		tmp = ((x_m / z) * (y_m / z)) / z;
	else
		tmp = (y_m / (z / x_m)) / z;
	end
	tmp_2 = y_s * (x_s * tmp);
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[Or[LessEqual[z, -215000000.0], N[Not[LessEqual[z, 8.4e-55]], $MachinePrecision]], N[(N[(N[(x$95$m / z), $MachinePrecision] * N[(y$95$m / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y$95$m / N[(z / x$95$m), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -215000000 \lor \neg \left(z \leq 8.4 \cdot 10^{-55}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z} \cdot \frac{y\_m}{z}}{z}\\

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


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.15e8 or 8.4000000000000006e-55 < z

    1. Initial program 80.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.15e8 < z < 8.4000000000000006e-55

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -215000000 \lor \neg \left(z \leq 8.4 \cdot 10^{-55}\right):\\ \;\;\;\;\frac{\frac{x}{z} \cdot \frac{y}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{\frac{z}{x}}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 92.9% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 3.5 \cdot 10^{-35}\right):\\ \;\;\;\;\frac{x\_m}{z} \cdot \frac{y\_m}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y\_m}{\frac{z}{x\_m}}}{z}\\ \end{array}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (*
  y_s
  (*
   x_s
   (if (or (<= z -1.0) (not (<= z 3.5e-35)))
     (* (/ x_m z) (/ y_m (* z z)))
     (/ (/ y_m (/ z x_m)) z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z <= -1.0) || !(z <= 3.5e-35)) {
		tmp = (x_m / z) * (y_m / (z * z));
	} else {
		tmp = (y_m / (z / x_m)) / z;
	}
	return y_s * (x_s * tmp);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-1.0d0)) .or. (.not. (z <= 3.5d-35))) then
        tmp = (x_m / z) * (y_m / (z * z))
    else
        tmp = (y_m / (z / x_m)) / z
    end if
    code = y_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z <= -1.0) || !(z <= 3.5e-35)) {
		tmp = (x_m / z) * (y_m / (z * z));
	} else {
		tmp = (y_m / (z / x_m)) / z;
	}
	return y_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	tmp = 0
	if (z <= -1.0) or not (z <= 3.5e-35):
		tmp = (x_m / z) * (y_m / (z * z))
	else:
		tmp = (y_m / (z / x_m)) / z
	return y_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0
	if ((z <= -1.0) || !(z <= 3.5e-35))
		tmp = Float64(Float64(x_m / z) * Float64(y_m / Float64(z * z)));
	else
		tmp = Float64(Float64(y_m / Float64(z / x_m)) / z);
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0;
	if ((z <= -1.0) || ~((z <= 3.5e-35)))
		tmp = (x_m / z) * (y_m / (z * z));
	else
		tmp = (y_m / (z / x_m)) / z;
	end
	tmp_2 = y_s * (x_s * tmp);
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 3.5e-35]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] * N[(y$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m / N[(z / x$95$m), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 3.5 \cdot 10^{-35}\right):\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{y\_m}{z \cdot z}\\

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


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1 or 3.49999999999999996e-35 < z

    1. Initial program 79.7%

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

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

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

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

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

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

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

    if -1 < z < 3.49999999999999996e-35

    1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 3.5 \cdot 10^{-35}\right):\\ \;\;\;\;\frac{x}{z} \cdot \frac{y}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{\frac{z}{x}}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 93.8% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 9.8 \cdot 10^{-26}\right):\\ \;\;\;\;\frac{y\_m}{z} \cdot \frac{\frac{x\_m}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y\_m}{\frac{z}{x\_m}}}{z}\\ \end{array}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (*
  y_s
  (*
   x_s
   (if (or (<= z -1.0) (not (<= z 9.8e-26)))
     (* (/ y_m z) (/ (/ x_m z) z))
     (/ (/ y_m (/ z x_m)) z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z <= -1.0) || !(z <= 9.8e-26)) {
		tmp = (y_m / z) * ((x_m / z) / z);
	} else {
		tmp = (y_m / (z / x_m)) / z;
	}
	return y_s * (x_s * tmp);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-1.0d0)) .or. (.not. (z <= 9.8d-26))) then
        tmp = (y_m / z) * ((x_m / z) / z)
    else
        tmp = (y_m / (z / x_m)) / z
    end if
    code = y_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if ((z <= -1.0) || !(z <= 9.8e-26)) {
		tmp = (y_m / z) * ((x_m / z) / z);
	} else {
		tmp = (y_m / (z / x_m)) / z;
	}
	return y_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	tmp = 0
	if (z <= -1.0) or not (z <= 9.8e-26):
		tmp = (y_m / z) * ((x_m / z) / z)
	else:
		tmp = (y_m / (z / x_m)) / z
	return y_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0
	if ((z <= -1.0) || !(z <= 9.8e-26))
		tmp = Float64(Float64(y_m / z) * Float64(Float64(x_m / z) / z));
	else
		tmp = Float64(Float64(y_m / Float64(z / x_m)) / z);
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0;
	if ((z <= -1.0) || ~((z <= 9.8e-26)))
		tmp = (y_m / z) * ((x_m / z) / z);
	else
		tmp = (y_m / (z / x_m)) / z;
	end
	tmp_2 = y_s * (x_s * tmp);
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 9.8e-26]], $MachinePrecision]], N[(N[(y$95$m / z), $MachinePrecision] * N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m / N[(z / x$95$m), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 9.8 \cdot 10^{-26}\right):\\
\;\;\;\;\frac{y\_m}{z} \cdot \frac{\frac{x\_m}{z}}{z}\\

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


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1 or 9.7999999999999998e-26 < z

    1. Initial program 79.5%

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

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

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

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

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

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

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

    if -1 < z < 9.7999999999999998e-26

    1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 9.8 \cdot 10^{-26}\right):\\ \;\;\;\;\frac{y}{z} \cdot \frac{\frac{x}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{\frac{z}{x}}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 77.9% accurate, 0.9× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 2.6 \cdot 10^{-90}:\\ \;\;\;\;\frac{x\_m}{z} \cdot \frac{y\_m}{z}\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot \frac{y\_m}{z \cdot z}\\ \end{array}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (*
  y_s
  (*
   x_s
   (if (<= x_m 2.6e-90) (* (/ x_m z) (/ y_m z)) (* x_m (/ y_m (* z z)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if (x_m <= 2.6e-90) {
		tmp = (x_m / z) * (y_m / z);
	} else {
		tmp = x_m * (y_m / (z * z));
	}
	return y_s * (x_s * tmp);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x_m <= 2.6d-90) then
        tmp = (x_m / z) * (y_m / z)
    else
        tmp = x_m * (y_m / (z * z))
    end if
    code = y_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	double tmp;
	if (x_m <= 2.6e-90) {
		tmp = (x_m / z) * (y_m / z);
	} else {
		tmp = x_m * (y_m / (z * z));
	}
	return y_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	tmp = 0
	if x_m <= 2.6e-90:
		tmp = (x_m / z) * (y_m / z)
	else:
		tmp = x_m * (y_m / (z * z))
	return y_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0
	if (x_m <= 2.6e-90)
		tmp = Float64(Float64(x_m / z) * Float64(y_m / z));
	else
		tmp = Float64(x_m * Float64(y_m / Float64(z * z)));
	end
	return Float64(y_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
	tmp = 0.0;
	if (x_m <= 2.6e-90)
		tmp = (x_m / z) * (y_m / z);
	else
		tmp = x_m * (y_m / (z * z));
	end
	tmp_2 = y_s * (x_s * tmp);
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[x$95$m, 2.6e-90], N[(N[(x$95$m / z), $MachinePrecision] * N[(y$95$m / z), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(y$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 2.6 \cdot 10^{-90}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{y\_m}{z}\\

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


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.6e-90

    1. Initial program 84.5%

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

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

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

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

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

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

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

    if 2.6e-90 < x

    1. Initial program 82.9%

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

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

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

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

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

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

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

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

Alternative 10: 97.9% accurate, 1.0× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ y\_s \cdot \left(x\_s \cdot \frac{\frac{x\_m}{z} \cdot \frac{y\_m}{z + 1}}{z}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (* y_s (* x_s (/ (* (/ x_m z) (/ y_m (+ z 1.0))) z))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * (((x_m / z) * (y_m / (z + 1.0))) / z));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    code = y_s * (x_s * (((x_m / z) * (y_m / (z + 1.0d0))) / z))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * (((x_m / z) * (y_m / (z + 1.0))) / z));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	return y_s * (x_s * (((x_m / z) * (y_m / (z + 1.0))) / z))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	return Float64(y_s * Float64(x_s * Float64(Float64(Float64(x_m / z) * Float64(y_m / Float64(z + 1.0))) / z)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp = code(y_s, x_s, x_m, y_m, z)
	tmp = y_s * (x_s * (((x_m / z) * (y_m / (z + 1.0))) / z));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[(N[(N[(x$95$m / z), $MachinePrecision] * N[(y$95$m / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y\_s \cdot \left(x\_s \cdot \frac{\frac{x\_m}{z} \cdot \frac{y\_m}{z + 1}}{z}\right)
\end{array}
Derivation
  1. Initial program 83.9%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot \frac{y}{z + 1}}{z}} \]
  7. Add Preprocessing

Alternative 11: 81.0% accurate, 1.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ y\_s \cdot \left(x\_s \cdot \frac{y\_m}{\frac{z}{\frac{x\_m}{z}}}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (* y_s (* x_s (/ y_m (/ z (/ x_m z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * (y_m / (z / (x_m / z))));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    code = y_s * (x_s * (y_m / (z / (x_m / z))))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * (y_m / (z / (x_m / z))));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	return y_s * (x_s * (y_m / (z / (x_m / z))))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	return Float64(y_s * Float64(x_s * Float64(y_m / Float64(z / Float64(x_m / z)))))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp = code(y_s, x_s, x_m, y_m, z)
	tmp = y_s * (x_s * (y_m / (z / (x_m / z))));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[(y$95$m / N[(z / N[(x$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y\_s \cdot \left(x\_s \cdot \frac{y\_m}{\frac{z}{\frac{x\_m}{z}}}\right)
\end{array}
Derivation
  1. Initial program 83.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{y}{\color{blue}{\frac{z}{\frac{x}{z}}}} \]
  10. Add Preprocessing

Alternative 12: 81.0% accurate, 1.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ y\_s \cdot \left(x\_s \cdot \frac{y\_m}{z \cdot \frac{z}{x\_m}}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (* y_s (* x_s (/ y_m (* z (/ z x_m))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * (y_m / (z * (z / x_m))));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    code = y_s * (x_s * (y_m / (z * (z / x_m))))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * (y_m / (z * (z / x_m))));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	return y_s * (x_s * (y_m / (z * (z / x_m))))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	return Float64(y_s * Float64(x_s * Float64(y_m / Float64(z * Float64(z / x_m)))))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp = code(y_s, x_s, x_m, y_m, z)
	tmp = y_s * (x_s * (y_m / (z * (z / x_m))));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[(y$95$m / N[(z * N[(z / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y\_s \cdot \left(x\_s \cdot \frac{y\_m}{z \cdot \frac{z}{x\_m}}\right)
\end{array}
Derivation
  1. Initial program 83.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{y}{z \cdot \frac{z}{x}} \]
  9. Add Preprocessing

Alternative 13: 74.3% accurate, 1.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ [x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\ \\ y\_s \cdot \left(x\_s \cdot \left(\frac{x\_m}{z} \cdot \frac{y\_m}{z}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
 :precision binary64
 (* y_s (* x_s (* (/ x_m z) (/ y_m z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * ((x_m / z) * (y_m / z)));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    code = y_s * (x_s * ((x_m / z) * (y_m / z)))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
	return y_s * (x_s * ((x_m / z) * (y_m / z)));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
[x_m, y_m, z] = sort([x_m, y_m, z])
def code(y_s, x_s, x_m, y_m, z):
	return y_s * (x_s * ((x_m / z) * (y_m / z)))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x_m, y_m, z = sort([x_m, y_m, z])
function code(y_s, x_s, x_m, y_m, z)
	return Float64(y_s * Float64(x_s * Float64(Float64(x_m / z) * Float64(y_m / z))))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp = code(y_s, x_s, x_m, y_m, z)
	tmp = y_s * (x_s * ((x_m / z) * (y_m / z)));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[(N[(x$95$m / z), $MachinePrecision] * N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y\_s \cdot \left(x\_s \cdot \left(\frac{x\_m}{z} \cdot \frac{y\_m}{z}\right)\right)
\end{array}
Derivation
  1. Initial program 83.9%

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

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

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

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

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

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

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

    \[\leadsto \frac{x}{z} \cdot \frac{y}{z} \]
  7. Add Preprocessing

Developer target: 96.7% accurate, 0.7× 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 2024107 
(FPCore (x y z)
  :name "Statistics.Distribution.Beta:$cvariance from math-functions-0.1.5.2"
  :precision binary64

  :alt
  (if (< z 249.6182814532307) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1.0 z)) x) z))

  (/ (* x y) (* (* z z) (+ z 1.0))))