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

Percentage Accurate: 83.2% → 96.0%
Time: 8.8s
Alternatives: 15
Speedup: 0.9×

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 15 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.2% 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.0% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z] = \mathsf{sort}([x_m, y, z])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;\left(z \cdot z\right) \cdot \left(z + 1\right) \leq -1 \cdot 10^{+191}:\\ \;\;\;\;\frac{\frac{\frac{y}{z}}{z} \cdot x\_m}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{z} \cdot y}{\mathsf{fma}\left(z, z, z\right)}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z)
 :precision binary64
 (*
  x_s
  (if (<= (* (* z z) (+ z 1.0)) -1e+191)
    (/ (* (/ (/ y z) z) x_m) z)
    (/ (* (/ x_m z) y) (fma z z z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z);
double code(double x_s, double x_m, double y, double z) {
	double tmp;
	if (((z * z) * (z + 1.0)) <= -1e+191) {
		tmp = (((y / z) / z) * x_m) / z;
	} else {
		tmp = ((x_m / z) * y) / fma(z, z, z);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z = sort([x_m, y, z])
function code(x_s, x_m, y, z)
	tmp = 0.0
	if (Float64(Float64(z * z) * Float64(z + 1.0)) <= -1e+191)
		tmp = Float64(Float64(Float64(Float64(y / z) / z) * x_m) / z);
	else
		tmp = Float64(Float64(Float64(x_m / z) * y) / fma(z, z, z));
	end
	return Float64(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]
NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], -1e+191], N[(N[(N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision] * x$95$m), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(x$95$m / z), $MachinePrecision] * y), $MachinePrecision] / N[(z * z + z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z] = \mathsf{sort}([x_m, y, z])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;\left(z \cdot z\right) \cdot \left(z + 1\right) \leq -1 \cdot 10^{+191}:\\
\;\;\;\;\frac{\frac{\frac{y}{z}}{z} \cdot x\_m}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64))) < -1.00000000000000007e191

    1. Initial program 82.4%

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      2. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{z + 1}}{z \cdot z}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{z + 1}}{\color{blue}{z \cdot z}} \]
      5. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z + 1}}{z}}{z}} \]
      6. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z + 1}}{z}}{z}} \]
      7. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{x \cdot y}{z + 1}}{z}}}{z} \]
      8. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{z + 1}}{z}}{z} \]
      9. associate-*r/N/A

        \[\leadsto \frac{\frac{\color{blue}{x \cdot \frac{y}{z + 1}}}{z}}{z} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{y}{z + 1} \cdot x}}{z}}{z} \]
      11. lower-*.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{y}{z + 1} \cdot x}}{z}}{z} \]
      12. lower-/.f6498.2

        \[\leadsto \frac{\frac{\color{blue}{\frac{y}{z + 1}} \cdot x}{z}}{z} \]
      13. lift-+.f64N/A

        \[\leadsto \frac{\frac{\frac{y}{\color{blue}{z + 1}} \cdot x}{z}}{z} \]
      14. +-commutativeN/A

        \[\leadsto \frac{\frac{\frac{y}{\color{blue}{1 + z}} \cdot x}{z}}{z} \]
      15. lower-+.f6498.2

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{y}{1 + z} \cdot x}{z}}{z}} \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{y}{1 + z} \cdot x}{z}}}{z} \]
      2. lift-*.f64N/A

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

        \[\leadsto \frac{\color{blue}{\frac{y}{1 + z} \cdot \frac{x}{z}}}{z} \]
      4. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{y}{1 + z}} \cdot \frac{x}{z}}{z} \]
      5. frac-timesN/A

        \[\leadsto \frac{\color{blue}{\frac{y \cdot x}{\left(1 + z\right) \cdot z}}}{z} \]
      6. lift-+.f64N/A

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

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(z + 1\right)} \cdot z}}{z} \]
      8. distribute-lft1-inN/A

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{z \cdot z + z}}}{z} \]
      9. lift-fma.f64N/A

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\mathsf{fma}\left(z, z, z\right)}}}{z} \]
      10. div-invN/A

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

        \[\leadsto \frac{\color{blue}{y \cdot \left(x \cdot \frac{1}{\mathsf{fma}\left(z, z, z\right)}\right)}}{z} \]
      12. div-invN/A

        \[\leadsto \frac{y \cdot \color{blue}{\frac{x}{\mathsf{fma}\left(z, z, z\right)}}}{z} \]
      13. clear-numN/A

        \[\leadsto \frac{y \cdot \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
      14. lift-/.f64N/A

        \[\leadsto \frac{y \cdot \frac{1}{\color{blue}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
      15. div-invN/A

        \[\leadsto \frac{\color{blue}{\frac{y}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
      16. lift-/.f64N/A

        \[\leadsto \frac{\frac{y}{\color{blue}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
      17. associate-/r/N/A

        \[\leadsto \frac{\color{blue}{\frac{y}{\mathsf{fma}\left(z, z, z\right)} \cdot x}}{z} \]
      18. lift-fma.f64N/A

        \[\leadsto \frac{\frac{y}{\color{blue}{z \cdot z + z}} \cdot x}{z} \]
      19. *-rgt-identityN/A

        \[\leadsto \frac{\frac{y}{z \cdot z + \color{blue}{z \cdot 1}} \cdot x}{z} \]
      20. distribute-lft-inN/A

        \[\leadsto \frac{\frac{y}{\color{blue}{z \cdot \left(z + 1\right)}} \cdot x}{z} \]
      21. +-commutativeN/A

        \[\leadsto \frac{\frac{y}{z \cdot \color{blue}{\left(1 + z\right)}} \cdot x}{z} \]
      22. lift-+.f64N/A

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{y}{1 + z}}{z}} \cdot x}{z} \]
      24. lift-/.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{y}{1 + z}}}{z} \cdot x}{z} \]
      25. lower-*.f64N/A

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

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

      \[\leadsto \frac{\color{blue}{\frac{y}{{z}^{2}}} \cdot x}{z} \]
    8. Step-by-step derivation
      1. unpow2N/A

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{y}{z}}{z}} \cdot x}{z} \]
      3. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{y}{z}}{z}} \cdot x}{z} \]
      4. lower-/.f6499.3

        \[\leadsto \frac{\frac{\color{blue}{\frac{y}{z}}}{z} \cdot x}{z} \]
    9. Applied rewrites99.3%

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

    if -1.00000000000000007e191 < (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64)))

    1. Initial program 87.0%

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      4. times-fracN/A

        \[\leadsto \color{blue}{\frac{x}{z \cdot z} \cdot \frac{y}{z + 1}} \]
      5. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \cdot \frac{y}{z + 1} \]
      7. frac-timesN/A

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot y}{z \cdot \left(z + 1\right)}} \]
      8. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot y}{z \cdot \left(z + 1\right)}} \]
      9. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{x}{z} \cdot y}}{z \cdot \left(z + 1\right)} \]
      10. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{x}{z}} \cdot y}{z \cdot \left(z + 1\right)} \]
      11. *-commutativeN/A

        \[\leadsto \frac{\frac{x}{z} \cdot y}{\color{blue}{\left(z + 1\right) \cdot z}} \]
      12. lift-+.f64N/A

        \[\leadsto \frac{\frac{x}{z} \cdot y}{\color{blue}{\left(z + 1\right)} \cdot z} \]
      13. distribute-lft1-inN/A

        \[\leadsto \frac{\frac{x}{z} \cdot y}{\color{blue}{z \cdot z + z}} \]
      14. lower-fma.f6497.4

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

      \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot y}{\mathsf{fma}\left(z, z, z\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 93.4% accurate, 0.4× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z] = \mathsf{sort}([x_m, y, z])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{x\_m \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \leq 10^{-42}:\\ \;\;\;\;\frac{x\_m}{\frac{\mathsf{fma}\left(z, z, z\right)}{y} \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{\mathsf{fma}\left(z, z, z\right)}}{z} \cdot y\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z)
 :precision binary64
 (*
  x_s
  (if (<= (/ (* x_m y) (* (* z z) (+ z 1.0))) 1e-42)
    (/ x_m (* (/ (fma z z z) y) z))
    (* (/ (/ x_m (fma z z z)) z) y))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z);
double code(double x_s, double x_m, double y, double z) {
	double tmp;
	if (((x_m * y) / ((z * z) * (z + 1.0))) <= 1e-42) {
		tmp = x_m / ((fma(z, z, z) / y) * z);
	} else {
		tmp = ((x_m / fma(z, z, z)) / z) * y;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z = sort([x_m, y, z])
function code(x_s, x_m, y, z)
	tmp = 0.0
	if (Float64(Float64(x_m * y) / Float64(Float64(z * z) * Float64(z + 1.0))) <= 1e-42)
		tmp = Float64(x_m / Float64(Float64(fma(z, z, z) / y) * z));
	else
		tmp = Float64(Float64(Float64(x_m / fma(z, z, z)) / z) * y);
	end
	return Float64(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]
NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[N[(N[(x$95$m * y), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e-42], N[(x$95$m / N[(N[(N[(z * z + z), $MachinePrecision] / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x$95$m / N[(z * z + z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z] = \mathsf{sort}([x_m, y, z])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{x\_m \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \leq 10^{-42}:\\
\;\;\;\;\frac{x\_m}{\frac{\mathsf{fma}\left(z, z, z\right)}{y} \cdot z}\\

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


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

    1. Initial program 91.1%

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      2. lift-*.f64N/A

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      4. clear-numN/A

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{\left(z \cdot z\right) \cdot \left(z + 1\right)}{y}}} \]
      5. un-div-invN/A

        \[\leadsto \color{blue}{\frac{x}{\frac{\left(z \cdot z\right) \cdot \left(z + 1\right)}{y}}} \]
      6. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{x}{\frac{\left(z \cdot z\right) \cdot \left(z + 1\right)}{y}}} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{x}{\frac{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}}{y}} \]
      8. lift-*.f64N/A

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

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

        \[\leadsto \frac{x}{\color{blue}{z \cdot \frac{z \cdot \left(z + 1\right)}{y}}} \]
      11. lower-*.f64N/A

        \[\leadsto \frac{x}{\color{blue}{z \cdot \frac{z \cdot \left(z + 1\right)}{y}}} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{x}{z \cdot \color{blue}{\frac{z \cdot \left(z + 1\right)}{y}}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{x}{z \cdot \frac{\color{blue}{\left(z + 1\right) \cdot z}}{y}} \]
      14. lift-+.f64N/A

        \[\leadsto \frac{x}{z \cdot \frac{\color{blue}{\left(z + 1\right)} \cdot z}{y}} \]
      15. distribute-lft1-inN/A

        \[\leadsto \frac{x}{z \cdot \frac{\color{blue}{z \cdot z + z}}{y}} \]
      16. lower-fma.f6494.8

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

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

    if 1.00000000000000004e-42 < (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64))))

    1. Initial program 74.6%

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      2. lift-*.f64N/A

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot y} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot y} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{x}{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \cdot y \]
      8. lift-*.f64N/A

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

        \[\leadsto \frac{x}{\color{blue}{z \cdot \left(z \cdot \left(z + 1\right)\right)}} \cdot y \]
      10. *-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z \cdot \left(z + 1\right)}}{z}} \cdot y \]
      12. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{x}{z \cdot \left(z + 1\right)}}{z}} \cdot y \]
      13. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{x}{z \cdot \left(z + 1\right)}}}{z} \cdot y \]
      14. *-commutativeN/A

        \[\leadsto \frac{\frac{x}{\color{blue}{\left(z + 1\right) \cdot z}}}{z} \cdot y \]
      15. lift-+.f64N/A

        \[\leadsto \frac{\frac{x}{\color{blue}{\left(z + 1\right)} \cdot z}}{z} \cdot y \]
      16. distribute-lft1-inN/A

        \[\leadsto \frac{\frac{x}{\color{blue}{z \cdot z + z}}}{z} \cdot y \]
      17. lower-fma.f6484.5

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

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

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

Alternative 3: 87.8% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z] = \mathsf{sort}([x_m, y, z])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{x\_m \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \leq 5 \cdot 10^{+109}:\\ \;\;\;\;\frac{y}{\mathsf{fma}\left(z, z, z\right) \cdot z} \cdot x\_m\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{z}{x\_m} \cdot z}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z)
 :precision binary64
 (*
  x_s
  (if (<= (/ (* x_m y) (* (* z z) (+ z 1.0))) 5e+109)
    (* (/ y (* (fma z z z) z)) x_m)
    (/ y (* (/ z x_m) z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z);
double code(double x_s, double x_m, double y, double z) {
	double tmp;
	if (((x_m * y) / ((z * z) * (z + 1.0))) <= 5e+109) {
		tmp = (y / (fma(z, z, z) * z)) * x_m;
	} else {
		tmp = y / ((z / x_m) * z);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z = sort([x_m, y, z])
function code(x_s, x_m, y, z)
	tmp = 0.0
	if (Float64(Float64(x_m * y) / Float64(Float64(z * z) * Float64(z + 1.0))) <= 5e+109)
		tmp = Float64(Float64(y / Float64(fma(z, z, z) * z)) * x_m);
	else
		tmp = Float64(y / Float64(Float64(z / x_m) * z));
	end
	return Float64(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]
NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[N[(N[(x$95$m * y), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+109], N[(N[(y / N[(N[(z * z + z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision], N[(y / N[(N[(z / x$95$m), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z] = \mathsf{sort}([x_m, y, z])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{x\_m \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \leq 5 \cdot 10^{+109}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(z, z, z\right) \cdot z} \cdot x\_m\\

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


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

    1. Initial program 91.3%

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      2. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{z + 1}}{z \cdot z}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{z + 1}}{\color{blue}{z \cdot z}} \]
      5. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z + 1}}{z}}{z}} \]
      6. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z + 1}}{z}}{z}} \]
      7. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{x \cdot y}{z + 1}}{z}}}{z} \]
      8. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{z + 1}}{z}}{z} \]
      9. associate-*r/N/A

        \[\leadsto \frac{\frac{\color{blue}{x \cdot \frac{y}{z + 1}}}{z}}{z} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{y}{z + 1} \cdot x}}{z}}{z} \]
      11. lower-*.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{y}{z + 1} \cdot x}}{z}}{z} \]
      12. lower-/.f6497.8

        \[\leadsto \frac{\frac{\color{blue}{\frac{y}{z + 1}} \cdot x}{z}}{z} \]
      13. lift-+.f64N/A

        \[\leadsto \frac{\frac{\frac{y}{\color{blue}{z + 1}} \cdot x}{z}}{z} \]
      14. +-commutativeN/A

        \[\leadsto \frac{\frac{\frac{y}{\color{blue}{1 + z}} \cdot x}{z}}{z} \]
      15. lower-+.f6497.8

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{y}{1 + z} \cdot x}{z}}{z}} \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{y}{1 + z} \cdot x}{z}}}{z} \]
      2. lift-*.f64N/A

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

        \[\leadsto \frac{\color{blue}{\frac{y}{1 + z} \cdot \frac{x}{z}}}{z} \]
      4. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{y}{1 + z}} \cdot \frac{x}{z}}{z} \]
      5. frac-timesN/A

        \[\leadsto \frac{\color{blue}{\frac{y \cdot x}{\left(1 + z\right) \cdot z}}}{z} \]
      6. lift-+.f64N/A

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

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(z + 1\right)} \cdot z}}{z} \]
      8. distribute-lft1-inN/A

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{z \cdot z + z}}}{z} \]
      9. lift-fma.f64N/A

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\mathsf{fma}\left(z, z, z\right)}}}{z} \]
      10. div-invN/A

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

        \[\leadsto \frac{\color{blue}{y \cdot \left(x \cdot \frac{1}{\mathsf{fma}\left(z, z, z\right)}\right)}}{z} \]
      12. div-invN/A

        \[\leadsto \frac{y \cdot \color{blue}{\frac{x}{\mathsf{fma}\left(z, z, z\right)}}}{z} \]
      13. clear-numN/A

        \[\leadsto \frac{y \cdot \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
      14. lift-/.f64N/A

        \[\leadsto \frac{y \cdot \frac{1}{\color{blue}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
      15. div-invN/A

        \[\leadsto \frac{\color{blue}{\frac{y}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
      16. lift-/.f64N/A

        \[\leadsto \frac{\frac{y}{\color{blue}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
      17. associate-/r/N/A

        \[\leadsto \frac{\color{blue}{\frac{y}{\mathsf{fma}\left(z, z, z\right)} \cdot x}}{z} \]
      18. lift-fma.f64N/A

        \[\leadsto \frac{\frac{y}{\color{blue}{z \cdot z + z}} \cdot x}{z} \]
      19. *-rgt-identityN/A

        \[\leadsto \frac{\frac{y}{z \cdot z + \color{blue}{z \cdot 1}} \cdot x}{z} \]
      20. distribute-lft-inN/A

        \[\leadsto \frac{\frac{y}{\color{blue}{z \cdot \left(z + 1\right)}} \cdot x}{z} \]
      21. +-commutativeN/A

        \[\leadsto \frac{\frac{y}{z \cdot \color{blue}{\left(1 + z\right)}} \cdot x}{z} \]
      22. lift-+.f64N/A

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{y}{1 + z}}{z}} \cdot x}{z} \]
      24. lift-/.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{y}{1 + z}}}{z} \cdot x}{z} \]
      25. lower-*.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{\mathsf{fma}\left(z, z, z\right)} \cdot x}{z}} \]
      2. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{y}{\mathsf{fma}\left(z, z, z\right)} \cdot \frac{x}{z}} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{y}{\mathsf{fma}\left(z, z, z\right)}} \cdot \frac{x}{z} \]
      5. frac-timesN/A

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{z \cdot \mathsf{fma}\left(z, z, z\right)}} \]
      7. lift-fma.f64N/A

        \[\leadsto \frac{y \cdot x}{z \cdot \color{blue}{\left(z \cdot z + z\right)}} \]
      8. distribute-lft-inN/A

        \[\leadsto \frac{y \cdot x}{\color{blue}{z \cdot \left(z \cdot z\right) + z \cdot z}} \]
      9. *-lft-identityN/A

        \[\leadsto \frac{y \cdot x}{z \cdot \left(z \cdot z\right) + \color{blue}{1 \cdot \left(z \cdot z\right)}} \]
      10. distribute-rgt-inN/A

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      11. *-commutativeN/A

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot x} \]
      14. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot x} \]
      15. lower-/.f64N/A

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

        \[\leadsto \frac{y}{\color{blue}{z \cdot \left(z \cdot \left(z + 1\right)\right)}} \cdot x \]
      17. distribute-lft-inN/A

        \[\leadsto \frac{y}{z \cdot \color{blue}{\left(z \cdot z + z \cdot 1\right)}} \cdot x \]
      18. *-rgt-identityN/A

        \[\leadsto \frac{y}{z \cdot \left(z \cdot z + \color{blue}{z}\right)} \cdot x \]
      19. lift-fma.f64N/A

        \[\leadsto \frac{y}{z \cdot \color{blue}{\mathsf{fma}\left(z, z, z\right)}} \cdot x \]
      20. *-commutativeN/A

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

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

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

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

    1. Initial program 71.8%

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      4. times-fracN/A

        \[\leadsto \color{blue}{\frac{x}{z \cdot z} \cdot \frac{y}{z + 1}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{y}{z + 1} \cdot \frac{x}{z \cdot z}} \]
      6. clear-numN/A

        \[\leadsto \frac{y}{z + 1} \cdot \color{blue}{\frac{1}{\frac{z \cdot z}{x}}} \]
      7. un-div-invN/A

        \[\leadsto \color{blue}{\frac{\frac{y}{z + 1}}{\frac{z \cdot z}{x}}} \]
      8. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{y}{z + 1}}{\frac{z \cdot z}{x}}} \]
      9. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{y}{z + 1}}}{\frac{z \cdot z}{x}} \]
      10. lift-+.f64N/A

        \[\leadsto \frac{\frac{y}{\color{blue}{z + 1}}}{\frac{z \cdot z}{x}} \]
      11. +-commutativeN/A

        \[\leadsto \frac{\frac{y}{\color{blue}{1 + z}}}{\frac{z \cdot z}{x}} \]
      12. lower-+.f64N/A

        \[\leadsto \frac{\frac{y}{\color{blue}{1 + z}}}{\frac{z \cdot z}{x}} \]
      13. lift-*.f64N/A

        \[\leadsto \frac{\frac{y}{1 + z}}{\frac{\color{blue}{z \cdot z}}{x}} \]
      14. associate-/l*N/A

        \[\leadsto \frac{\frac{y}{1 + z}}{\color{blue}{z \cdot \frac{z}{x}}} \]
      15. lower-*.f64N/A

        \[\leadsto \frac{\frac{y}{1 + z}}{\color{blue}{z \cdot \frac{z}{x}}} \]
      16. lower-/.f6487.7

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

      \[\leadsto \color{blue}{\frac{\frac{y}{1 + z}}{z \cdot \frac{z}{x}}} \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{y}{1 + z}}{z \cdot \frac{z}{x}}} \]
      2. lift-/.f64N/A

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

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

        \[\leadsto \frac{y}{\color{blue}{\left(1 + z\right) \cdot \left(z \cdot \frac{z}{x}\right)}} \]
      5. lift-*.f64N/A

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

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

        \[\leadsto \frac{y}{\color{blue}{\left(\left(1 + z\right) \cdot \frac{z}{x}\right) \cdot z}} \]
      8. lift-/.f64N/A

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

        \[\leadsto \frac{y}{\color{blue}{\frac{\left(1 + z\right) \cdot z}{x}} \cdot z} \]
      10. lift-+.f64N/A

        \[\leadsto \frac{y}{\frac{\color{blue}{\left(1 + z\right)} \cdot z}{x} \cdot z} \]
      11. +-commutativeN/A

        \[\leadsto \frac{y}{\frac{\color{blue}{\left(z + 1\right)} \cdot z}{x} \cdot z} \]
      12. distribute-lft1-inN/A

        \[\leadsto \frac{y}{\frac{\color{blue}{z \cdot z + z}}{x} \cdot z} \]
      13. lift-fma.f64N/A

        \[\leadsto \frac{y}{\frac{\color{blue}{\mathsf{fma}\left(z, z, z\right)}}{x} \cdot z} \]
      14. clear-numN/A

        \[\leadsto \frac{y}{\color{blue}{\frac{1}{\frac{x}{\mathsf{fma}\left(z, z, z\right)}}} \cdot z} \]
      15. lift-/.f64N/A

        \[\leadsto \frac{y}{\frac{1}{\color{blue}{\frac{x}{\mathsf{fma}\left(z, z, z\right)}}} \cdot z} \]
      16. associate-*l/N/A

        \[\leadsto \frac{y}{\color{blue}{\frac{1 \cdot z}{\frac{x}{\mathsf{fma}\left(z, z, z\right)}}}} \]
      17. *-lft-identityN/A

        \[\leadsto \frac{y}{\frac{\color{blue}{z}}{\frac{x}{\mathsf{fma}\left(z, z, z\right)}}} \]
      18. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{\frac{x}{\mathsf{fma}\left(z, z, z\right)}}}} \]
      19. *-lft-identityN/A

        \[\leadsto \frac{y}{\frac{\color{blue}{1 \cdot z}}{\frac{x}{\mathsf{fma}\left(z, z, z\right)}}} \]
      20. associate-*l/N/A

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

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

      \[\leadsto \frac{y}{\color{blue}{\frac{z}{x}} \cdot z} \]
    8. Step-by-step derivation
      1. lower-/.f6476.4

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

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

Alternative 4: 87.6% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z] = \mathsf{sort}([x_m, y, z])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{x\_m \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \leq 5 \cdot 10^{+109}:\\ \;\;\;\;\frac{y}{\mathsf{fma}\left(z, z, z\right) \cdot z} \cdot x\_m\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z} \cdot y\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z)
 :precision binary64
 (*
  x_s
  (if (<= (/ (* x_m y) (* (* z z) (+ z 1.0))) 5e+109)
    (* (/ y (* (fma z z z) z)) x_m)
    (* (/ (/ x_m z) z) y))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z);
double code(double x_s, double x_m, double y, double z) {
	double tmp;
	if (((x_m * y) / ((z * z) * (z + 1.0))) <= 5e+109) {
		tmp = (y / (fma(z, z, z) * z)) * x_m;
	} else {
		tmp = ((x_m / z) / z) * y;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z = sort([x_m, y, z])
function code(x_s, x_m, y, z)
	tmp = 0.0
	if (Float64(Float64(x_m * y) / Float64(Float64(z * z) * Float64(z + 1.0))) <= 5e+109)
		tmp = Float64(Float64(y / Float64(fma(z, z, z) * z)) * x_m);
	else
		tmp = Float64(Float64(Float64(x_m / z) / z) * y);
	end
	return Float64(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]
NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[N[(N[(x$95$m * y), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+109], N[(N[(y / N[(N[(z * z + z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision], N[(N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z] = \mathsf{sort}([x_m, y, z])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{x\_m \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \leq 5 \cdot 10^{+109}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(z, z, z\right) \cdot z} \cdot x\_m\\

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


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

    1. Initial program 91.3%

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      2. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{z + 1}}{z \cdot z}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\frac{x \cdot y}{z + 1}}{\color{blue}{z \cdot z}} \]
      5. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z + 1}}{z}}{z}} \]
      6. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z + 1}}{z}}{z}} \]
      7. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{x \cdot y}{z + 1}}{z}}}{z} \]
      8. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{z + 1}}{z}}{z} \]
      9. associate-*r/N/A

        \[\leadsto \frac{\frac{\color{blue}{x \cdot \frac{y}{z + 1}}}{z}}{z} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{y}{z + 1} \cdot x}}{z}}{z} \]
      11. lower-*.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{y}{z + 1} \cdot x}}{z}}{z} \]
      12. lower-/.f6497.8

        \[\leadsto \frac{\frac{\color{blue}{\frac{y}{z + 1}} \cdot x}{z}}{z} \]
      13. lift-+.f64N/A

        \[\leadsto \frac{\frac{\frac{y}{\color{blue}{z + 1}} \cdot x}{z}}{z} \]
      14. +-commutativeN/A

        \[\leadsto \frac{\frac{\frac{y}{\color{blue}{1 + z}} \cdot x}{z}}{z} \]
      15. lower-+.f6497.8

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{y}{1 + z} \cdot x}{z}}{z}} \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{y}{1 + z} \cdot x}{z}}}{z} \]
      2. lift-*.f64N/A

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

        \[\leadsto \frac{\color{blue}{\frac{y}{1 + z} \cdot \frac{x}{z}}}{z} \]
      4. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{y}{1 + z}} \cdot \frac{x}{z}}{z} \]
      5. frac-timesN/A

        \[\leadsto \frac{\color{blue}{\frac{y \cdot x}{\left(1 + z\right) \cdot z}}}{z} \]
      6. lift-+.f64N/A

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

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(z + 1\right)} \cdot z}}{z} \]
      8. distribute-lft1-inN/A

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{z \cdot z + z}}}{z} \]
      9. lift-fma.f64N/A

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\mathsf{fma}\left(z, z, z\right)}}}{z} \]
      10. div-invN/A

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

        \[\leadsto \frac{\color{blue}{y \cdot \left(x \cdot \frac{1}{\mathsf{fma}\left(z, z, z\right)}\right)}}{z} \]
      12. div-invN/A

        \[\leadsto \frac{y \cdot \color{blue}{\frac{x}{\mathsf{fma}\left(z, z, z\right)}}}{z} \]
      13. clear-numN/A

        \[\leadsto \frac{y \cdot \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
      14. lift-/.f64N/A

        \[\leadsto \frac{y \cdot \frac{1}{\color{blue}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
      15. div-invN/A

        \[\leadsto \frac{\color{blue}{\frac{y}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
      16. lift-/.f64N/A

        \[\leadsto \frac{\frac{y}{\color{blue}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
      17. associate-/r/N/A

        \[\leadsto \frac{\color{blue}{\frac{y}{\mathsf{fma}\left(z, z, z\right)} \cdot x}}{z} \]
      18. lift-fma.f64N/A

        \[\leadsto \frac{\frac{y}{\color{blue}{z \cdot z + z}} \cdot x}{z} \]
      19. *-rgt-identityN/A

        \[\leadsto \frac{\frac{y}{z \cdot z + \color{blue}{z \cdot 1}} \cdot x}{z} \]
      20. distribute-lft-inN/A

        \[\leadsto \frac{\frac{y}{\color{blue}{z \cdot \left(z + 1\right)}} \cdot x}{z} \]
      21. +-commutativeN/A

        \[\leadsto \frac{\frac{y}{z \cdot \color{blue}{\left(1 + z\right)}} \cdot x}{z} \]
      22. lift-+.f64N/A

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{y}{1 + z}}{z}} \cdot x}{z} \]
      24. lift-/.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{y}{1 + z}}}{z} \cdot x}{z} \]
      25. lower-*.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{\mathsf{fma}\left(z, z, z\right)} \cdot x}{z}} \]
      2. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{y}{\mathsf{fma}\left(z, z, z\right)} \cdot \frac{x}{z}} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{y}{\mathsf{fma}\left(z, z, z\right)}} \cdot \frac{x}{z} \]
      5. frac-timesN/A

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{z \cdot \mathsf{fma}\left(z, z, z\right)}} \]
      7. lift-fma.f64N/A

        \[\leadsto \frac{y \cdot x}{z \cdot \color{blue}{\left(z \cdot z + z\right)}} \]
      8. distribute-lft-inN/A

        \[\leadsto \frac{y \cdot x}{\color{blue}{z \cdot \left(z \cdot z\right) + z \cdot z}} \]
      9. *-lft-identityN/A

        \[\leadsto \frac{y \cdot x}{z \cdot \left(z \cdot z\right) + \color{blue}{1 \cdot \left(z \cdot z\right)}} \]
      10. distribute-rgt-inN/A

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      11. *-commutativeN/A

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot x} \]
      14. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot x} \]
      15. lower-/.f64N/A

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

        \[\leadsto \frac{y}{\color{blue}{z \cdot \left(z \cdot \left(z + 1\right)\right)}} \cdot x \]
      17. distribute-lft-inN/A

        \[\leadsto \frac{y}{z \cdot \color{blue}{\left(z \cdot z + z \cdot 1\right)}} \cdot x \]
      18. *-rgt-identityN/A

        \[\leadsto \frac{y}{z \cdot \left(z \cdot z + \color{blue}{z}\right)} \cdot x \]
      19. lift-fma.f64N/A

        \[\leadsto \frac{y}{z \cdot \color{blue}{\mathsf{fma}\left(z, z, z\right)}} \cdot x \]
      20. *-commutativeN/A

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

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

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

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

    1. Initial program 71.8%

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      2. lift-*.f64N/A

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot y} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot y} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{x}{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \cdot y \]
      8. lift-*.f64N/A

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

        \[\leadsto \frac{x}{\color{blue}{z \cdot \left(z \cdot \left(z + 1\right)\right)}} \cdot y \]
      10. *-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z \cdot \left(z + 1\right)}}{z}} \cdot y \]
      12. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{x}{z \cdot \left(z + 1\right)}}{z}} \cdot y \]
      13. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{x}{z \cdot \left(z + 1\right)}}}{z} \cdot y \]
      14. *-commutativeN/A

        \[\leadsto \frac{\frac{x}{\color{blue}{\left(z + 1\right) \cdot z}}}{z} \cdot y \]
      15. lift-+.f64N/A

        \[\leadsto \frac{\frac{x}{\color{blue}{\left(z + 1\right)} \cdot z}}{z} \cdot y \]
      16. distribute-lft1-inN/A

        \[\leadsto \frac{\frac{x}{\color{blue}{z \cdot z + z}}}{z} \cdot y \]
      17. lower-fma.f6482.3

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

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

      \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \cdot y \]
    6. Step-by-step derivation
      1. lower-/.f6476.3

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \cdot y \]
    7. Applied rewrites76.3%

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

Alternative 5: 95.6% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z] = \mathsf{sort}([x_m, y, z])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;\left(z \cdot z\right) \cdot \left(z + 1\right) \leq -5 \cdot 10^{+93}:\\ \;\;\;\;\frac{\frac{y}{z}}{\frac{z}{x\_m} \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{z} \cdot y}{\mathsf{fma}\left(z, z, z\right)}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z)
 :precision binary64
 (*
  x_s
  (if (<= (* (* z z) (+ z 1.0)) -5e+93)
    (/ (/ y z) (* (/ z x_m) z))
    (/ (* (/ x_m z) y) (fma z z z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z);
double code(double x_s, double x_m, double y, double z) {
	double tmp;
	if (((z * z) * (z + 1.0)) <= -5e+93) {
		tmp = (y / z) / ((z / x_m) * z);
	} else {
		tmp = ((x_m / z) * y) / fma(z, z, z);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z = sort([x_m, y, z])
function code(x_s, x_m, y, z)
	tmp = 0.0
	if (Float64(Float64(z * z) * Float64(z + 1.0)) <= -5e+93)
		tmp = Float64(Float64(y / z) / Float64(Float64(z / x_m) * z));
	else
		tmp = Float64(Float64(Float64(x_m / z) * y) / fma(z, z, z));
	end
	return Float64(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]
NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], -5e+93], N[(N[(y / z), $MachinePrecision] / N[(N[(z / x$95$m), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x$95$m / z), $MachinePrecision] * y), $MachinePrecision] / N[(z * z + z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z] = \mathsf{sort}([x_m, y, z])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;\left(z \cdot z\right) \cdot \left(z + 1\right) \leq -5 \cdot 10^{+93}:\\
\;\;\;\;\frac{\frac{y}{z}}{\frac{z}{x\_m} \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64))) < -5.0000000000000001e93

    1. Initial program 83.3%

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      4. times-fracN/A

        \[\leadsto \color{blue}{\frac{x}{z \cdot z} \cdot \frac{y}{z + 1}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{y}{z + 1} \cdot \frac{x}{z \cdot z}} \]
      6. clear-numN/A

        \[\leadsto \frac{y}{z + 1} \cdot \color{blue}{\frac{1}{\frac{z \cdot z}{x}}} \]
      7. un-div-invN/A

        \[\leadsto \color{blue}{\frac{\frac{y}{z + 1}}{\frac{z \cdot z}{x}}} \]
      8. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{y}{z + 1}}{\frac{z \cdot z}{x}}} \]
      9. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{y}{z + 1}}}{\frac{z \cdot z}{x}} \]
      10. lift-+.f64N/A

        \[\leadsto \frac{\frac{y}{\color{blue}{z + 1}}}{\frac{z \cdot z}{x}} \]
      11. +-commutativeN/A

        \[\leadsto \frac{\frac{y}{\color{blue}{1 + z}}}{\frac{z \cdot z}{x}} \]
      12. lower-+.f64N/A

        \[\leadsto \frac{\frac{y}{\color{blue}{1 + z}}}{\frac{z \cdot z}{x}} \]
      13. lift-*.f64N/A

        \[\leadsto \frac{\frac{y}{1 + z}}{\frac{\color{blue}{z \cdot z}}{x}} \]
      14. associate-/l*N/A

        \[\leadsto \frac{\frac{y}{1 + z}}{\color{blue}{z \cdot \frac{z}{x}}} \]
      15. lower-*.f64N/A

        \[\leadsto \frac{\frac{y}{1 + z}}{\color{blue}{z \cdot \frac{z}{x}}} \]
      16. lower-/.f6499.9

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

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

      \[\leadsto \frac{\color{blue}{\frac{y}{z}}}{z \cdot \frac{z}{x}} \]
    6. Step-by-step derivation
      1. lower-/.f6499.9

        \[\leadsto \frac{\color{blue}{\frac{y}{z}}}{z \cdot \frac{z}{x}} \]
    7. Applied rewrites99.9%

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

    if -5.0000000000000001e93 < (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64)))

    1. Initial program 86.8%

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      4. times-fracN/A

        \[\leadsto \color{blue}{\frac{x}{z \cdot z} \cdot \frac{y}{z + 1}} \]
      5. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \cdot \frac{y}{z + 1} \]
      7. frac-timesN/A

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot y}{z \cdot \left(z + 1\right)}} \]
      8. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot y}{z \cdot \left(z + 1\right)}} \]
      9. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{x}{z} \cdot y}}{z \cdot \left(z + 1\right)} \]
      10. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{x}{z}} \cdot y}{z \cdot \left(z + 1\right)} \]
      11. *-commutativeN/A

        \[\leadsto \frac{\frac{x}{z} \cdot y}{\color{blue}{\left(z + 1\right) \cdot z}} \]
      12. lift-+.f64N/A

        \[\leadsto \frac{\frac{x}{z} \cdot y}{\color{blue}{\left(z + 1\right)} \cdot z} \]
      13. distribute-lft1-inN/A

        \[\leadsto \frac{\frac{x}{z} \cdot y}{\color{blue}{z \cdot z + z}} \]
      14. lower-fma.f6497.4

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

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

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

Alternative 6: 32.1% accurate, 0.6× speedup?

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

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


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

    1. Initial program 90.4%

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{\frac{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right) + x \cdot y}{{z}^{2}}} \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

        \[\leadsto \frac{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \color{blue}{1 \cdot \left(x \cdot y\right)}}{{z}^{2}} \]
      2. metadata-evalN/A

        \[\leadsto \frac{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot \left(x \cdot y\right)}{{z}^{2}} \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -1 \cdot \left(x \cdot y\right)}}{{z}^{2}} \]
      4. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -1 \cdot \left(x \cdot y\right)}{{z}^{2}}} \]
      5. distribute-lft-out--N/A

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(x \cdot \left(y \cdot z\right) - x \cdot y\right)}}{{z}^{2}} \]
      6. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\left(x \cdot \left(y \cdot z\right) - x \cdot y\right)\right)}}{{z}^{2}} \]
      7. sub-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(x \cdot \left(y \cdot z\right) + \left(\mathsf{neg}\left(x \cdot y\right)\right)\right)}\right)}{{z}^{2}} \]
      8. associate-*r*N/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\left(x \cdot y\right) \cdot z} + \left(\mathsf{neg}\left(x \cdot y\right)\right)\right)\right)}{{z}^{2}} \]
      9. mul-1-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(\left(x \cdot y\right) \cdot z + \color{blue}{-1 \cdot \left(x \cdot y\right)}\right)\right)}{{z}^{2}} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(\left(x \cdot y\right) \cdot z + \color{blue}{\left(x \cdot y\right) \cdot -1}\right)\right)}{{z}^{2}} \]
      11. distribute-lft-outN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(x \cdot y\right) \cdot \left(z + -1\right)}\right)}{{z}^{2}} \]
      12. *-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(z + -1\right) \cdot \left(x \cdot y\right)}\right)}{{z}^{2}} \]
      13. distribute-lft-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(\left(z + -1\right)\right)\right) \cdot \left(x \cdot y\right)}}{{z}^{2}} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(\left(z + -1\right)\right)\right) \cdot \left(x \cdot y\right)}}{{z}^{2}} \]
      15. +-commutativeN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(-1 + z\right)}\right)\right) \cdot \left(x \cdot y\right)}{{z}^{2}} \]
      16. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\left(\mathsf{neg}\left(-1\right)\right) + \left(\mathsf{neg}\left(z\right)\right)\right)} \cdot \left(x \cdot y\right)}{{z}^{2}} \]
      17. metadata-evalN/A

        \[\leadsto \frac{\left(\color{blue}{1} + \left(\mathsf{neg}\left(z\right)\right)\right) \cdot \left(x \cdot y\right)}{{z}^{2}} \]
      18. sub-negN/A

        \[\leadsto \frac{\color{blue}{\left(1 - z\right)} \cdot \left(x \cdot y\right)}{{z}^{2}} \]
      19. lower--.f64N/A

        \[\leadsto \frac{\color{blue}{\left(1 - z\right)} \cdot \left(x \cdot y\right)}{{z}^{2}} \]
      20. *-commutativeN/A

        \[\leadsto \frac{\left(1 - z\right) \cdot \color{blue}{\left(y \cdot x\right)}}{{z}^{2}} \]
      21. lower-*.f64N/A

        \[\leadsto \frac{\left(1 - z\right) \cdot \color{blue}{\left(y \cdot x\right)}}{{z}^{2}} \]
      22. unpow2N/A

        \[\leadsto \frac{\left(1 - z\right) \cdot \left(y \cdot x\right)}{\color{blue}{z \cdot z}} \]
      23. lower-*.f6469.8

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

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

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

        \[\leadsto \frac{-y}{z} \cdot \color{blue}{x} \]
      2. Taylor expanded in z around inf

        \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot y}{z}} \]
      3. Step-by-step derivation
        1. Applied rewrites37.0%

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

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

        1. Initial program 78.1%

          \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in z around 0

          \[\leadsto \color{blue}{\frac{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right) + x \cdot y}{{z}^{2}}} \]
        4. Step-by-step derivation
          1. *-lft-identityN/A

            \[\leadsto \frac{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \color{blue}{1 \cdot \left(x \cdot y\right)}}{{z}^{2}} \]
          2. metadata-evalN/A

            \[\leadsto \frac{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot \left(x \cdot y\right)}{{z}^{2}} \]
          3. cancel-sign-sub-invN/A

            \[\leadsto \frac{\color{blue}{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -1 \cdot \left(x \cdot y\right)}}{{z}^{2}} \]
          4. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -1 \cdot \left(x \cdot y\right)}{{z}^{2}}} \]
          5. distribute-lft-out--N/A

            \[\leadsto \frac{\color{blue}{-1 \cdot \left(x \cdot \left(y \cdot z\right) - x \cdot y\right)}}{{z}^{2}} \]
          6. mul-1-negN/A

            \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\left(x \cdot \left(y \cdot z\right) - x \cdot y\right)\right)}}{{z}^{2}} \]
          7. sub-negN/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(x \cdot \left(y \cdot z\right) + \left(\mathsf{neg}\left(x \cdot y\right)\right)\right)}\right)}{{z}^{2}} \]
          8. associate-*r*N/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\left(x \cdot y\right) \cdot z} + \left(\mathsf{neg}\left(x \cdot y\right)\right)\right)\right)}{{z}^{2}} \]
          9. mul-1-negN/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\left(x \cdot y\right) \cdot z + \color{blue}{-1 \cdot \left(x \cdot y\right)}\right)\right)}{{z}^{2}} \]
          10. *-commutativeN/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\left(x \cdot y\right) \cdot z + \color{blue}{\left(x \cdot y\right) \cdot -1}\right)\right)}{{z}^{2}} \]
          11. distribute-lft-outN/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(x \cdot y\right) \cdot \left(z + -1\right)}\right)}{{z}^{2}} \]
          12. *-commutativeN/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(z + -1\right) \cdot \left(x \cdot y\right)}\right)}{{z}^{2}} \]
          13. distribute-lft-neg-inN/A

            \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(\left(z + -1\right)\right)\right) \cdot \left(x \cdot y\right)}}{{z}^{2}} \]
          14. lower-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(\left(z + -1\right)\right)\right) \cdot \left(x \cdot y\right)}}{{z}^{2}} \]
          15. +-commutativeN/A

            \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(-1 + z\right)}\right)\right) \cdot \left(x \cdot y\right)}{{z}^{2}} \]
          16. distribute-neg-inN/A

            \[\leadsto \frac{\color{blue}{\left(\left(\mathsf{neg}\left(-1\right)\right) + \left(\mathsf{neg}\left(z\right)\right)\right)} \cdot \left(x \cdot y\right)}{{z}^{2}} \]
          17. metadata-evalN/A

            \[\leadsto \frac{\left(\color{blue}{1} + \left(\mathsf{neg}\left(z\right)\right)\right) \cdot \left(x \cdot y\right)}{{z}^{2}} \]
          18. sub-negN/A

            \[\leadsto \frac{\color{blue}{\left(1 - z\right)} \cdot \left(x \cdot y\right)}{{z}^{2}} \]
          19. lower--.f64N/A

            \[\leadsto \frac{\color{blue}{\left(1 - z\right)} \cdot \left(x \cdot y\right)}{{z}^{2}} \]
          20. *-commutativeN/A

            \[\leadsto \frac{\left(1 - z\right) \cdot \color{blue}{\left(y \cdot x\right)}}{{z}^{2}} \]
          21. lower-*.f64N/A

            \[\leadsto \frac{\left(1 - z\right) \cdot \color{blue}{\left(y \cdot x\right)}}{{z}^{2}} \]
          22. unpow2N/A

            \[\leadsto \frac{\left(1 - z\right) \cdot \left(y \cdot x\right)}{\color{blue}{z \cdot z}} \]
          23. lower-*.f6462.5

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

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

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

            \[\leadsto \frac{-y}{z} \cdot \color{blue}{x} \]
        8. Recombined 2 regimes into one program.
        9. Add Preprocessing

        Alternative 7: 92.3% accurate, 0.6× speedup?

        \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z] = \mathsf{sort}([x_m, y, z])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;\left(z \cdot z\right) \cdot \left(z + 1\right) \leq 5 \cdot 10^{+30}:\\ \;\;\;\;\frac{\frac{x\_m}{\mathsf{fma}\left(z, z, z\right)}}{z} \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{z} \cdot x\_m}{z \cdot z}\\ \end{array} \end{array} \]
        x\_m = (fabs.f64 x)
        x\_s = (copysign.f64 #s(literal 1 binary64) x)
        NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
        (FPCore (x_s x_m y z)
         :precision binary64
         (*
          x_s
          (if (<= (* (* z z) (+ z 1.0)) 5e+30)
            (* (/ (/ x_m (fma z z z)) z) y)
            (/ (* (/ y z) x_m) (* z z)))))
        x\_m = fabs(x);
        x\_s = copysign(1.0, x);
        assert(x_m < y && y < z);
        double code(double x_s, double x_m, double y, double z) {
        	double tmp;
        	if (((z * z) * (z + 1.0)) <= 5e+30) {
        		tmp = ((x_m / fma(z, z, z)) / z) * y;
        	} else {
        		tmp = ((y / z) * x_m) / (z * z);
        	}
        	return x_s * tmp;
        }
        
        x\_m = abs(x)
        x\_s = copysign(1.0, x)
        x_m, y, z = sort([x_m, y, z])
        function code(x_s, x_m, y, z)
        	tmp = 0.0
        	if (Float64(Float64(z * z) * Float64(z + 1.0)) <= 5e+30)
        		tmp = Float64(Float64(Float64(x_m / fma(z, z, z)) / z) * y);
        	else
        		tmp = Float64(Float64(Float64(y / z) * x_m) / Float64(z * z));
        	end
        	return Float64(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]
        NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
        code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], 5e+30], N[(N[(N[(x$95$m / N[(z * z + z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(y / z), $MachinePrecision] * x$95$m), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
        
        \begin{array}{l}
        x\_m = \left|x\right|
        \\
        x\_s = \mathsf{copysign}\left(1, x\right)
        \\
        [x_m, y, z] = \mathsf{sort}([x_m, y, z])\\
        \\
        x\_s \cdot \begin{array}{l}
        \mathbf{if}\;\left(z \cdot z\right) \cdot \left(z + 1\right) \leq 5 \cdot 10^{+30}:\\
        \;\;\;\;\frac{\frac{x\_m}{\mathsf{fma}\left(z, z, z\right)}}{z} \cdot y\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\frac{y}{z} \cdot x\_m}{z \cdot z}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64))) < 4.9999999999999998e30

          1. Initial program 86.0%

            \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
            2. lift-*.f64N/A

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

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

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

              \[\leadsto \color{blue}{\frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot y} \]
            6. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot y} \]
            7. lift-*.f64N/A

              \[\leadsto \frac{x}{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \cdot y \]
            8. lift-*.f64N/A

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

              \[\leadsto \frac{x}{\color{blue}{z \cdot \left(z \cdot \left(z + 1\right)\right)}} \cdot y \]
            10. *-commutativeN/A

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

              \[\leadsto \color{blue}{\frac{\frac{x}{z \cdot \left(z + 1\right)}}{z}} \cdot y \]
            12. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{\frac{x}{z \cdot \left(z + 1\right)}}{z}} \cdot y \]
            13. lower-/.f64N/A

              \[\leadsto \frac{\color{blue}{\frac{x}{z \cdot \left(z + 1\right)}}}{z} \cdot y \]
            14. *-commutativeN/A

              \[\leadsto \frac{\frac{x}{\color{blue}{\left(z + 1\right) \cdot z}}}{z} \cdot y \]
            15. lift-+.f64N/A

              \[\leadsto \frac{\frac{x}{\color{blue}{\left(z + 1\right)} \cdot z}}{z} \cdot y \]
            16. distribute-lft1-inN/A

              \[\leadsto \frac{\frac{x}{\color{blue}{z \cdot z + z}}}{z} \cdot y \]
            17. lower-fma.f6488.8

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

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

          if 4.9999999999999998e30 < (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64)))

          1. Initial program 86.1%

            \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
            2. lift-*.f64N/A

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

              \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
            4. lift-*.f64N/A

              \[\leadsto \frac{y \cdot x}{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
            5. lift-*.f64N/A

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

              \[\leadsto \frac{y \cdot x}{\color{blue}{z \cdot \left(z \cdot \left(z + 1\right)\right)}} \]
            7. times-fracN/A

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

              \[\leadsto \color{blue}{\frac{\frac{y}{z} \cdot x}{z \cdot \left(z + 1\right)}} \]
            9. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{\frac{y}{z} \cdot x}{z \cdot \left(z + 1\right)}} \]
            10. lower-*.f64N/A

              \[\leadsto \frac{\color{blue}{\frac{y}{z} \cdot x}}{z \cdot \left(z + 1\right)} \]
            11. lower-/.f64N/A

              \[\leadsto \frac{\color{blue}{\frac{y}{z}} \cdot x}{z \cdot \left(z + 1\right)} \]
            12. *-commutativeN/A

              \[\leadsto \frac{\frac{y}{z} \cdot x}{\color{blue}{\left(z + 1\right) \cdot z}} \]
            13. lift-+.f64N/A

              \[\leadsto \frac{\frac{y}{z} \cdot x}{\color{blue}{\left(z + 1\right)} \cdot z} \]
            14. distribute-lft1-inN/A

              \[\leadsto \frac{\frac{y}{z} \cdot x}{\color{blue}{z \cdot z + z}} \]
            15. lower-fma.f6497.9

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

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

            \[\leadsto \frac{\frac{y}{z} \cdot x}{\color{blue}{{z}^{2}}} \]
          6. Step-by-step derivation
            1. unpow2N/A

              \[\leadsto \frac{\frac{y}{z} \cdot x}{\color{blue}{z \cdot z}} \]
            2. lower-*.f6497.9

              \[\leadsto \frac{\frac{y}{z} \cdot x}{\color{blue}{z \cdot z}} \]
          7. Applied rewrites97.9%

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

        Alternative 8: 91.1% accurate, 0.7× speedup?

        \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z] = \mathsf{sort}([x_m, y, z])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-16}:\\ \;\;\;\;\frac{y}{\mathsf{fma}\left(z, z, z\right) \cdot z} \cdot x\_m\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-8}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z} \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{z} \cdot x\_m}{z \cdot z}\\ \end{array} \end{array} \]
        x\_m = (fabs.f64 x)
        x\_s = (copysign.f64 #s(literal 1 binary64) x)
        NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
        (FPCore (x_s x_m y z)
         :precision binary64
         (*
          x_s
          (if (<= z -5e-16)
            (* (/ y (* (fma z z z) z)) x_m)
            (if (<= z 3.2e-8) (* (/ (/ x_m z) z) y) (/ (* (/ y z) x_m) (* z z))))))
        x\_m = fabs(x);
        x\_s = copysign(1.0, x);
        assert(x_m < y && y < z);
        double code(double x_s, double x_m, double y, double z) {
        	double tmp;
        	if (z <= -5e-16) {
        		tmp = (y / (fma(z, z, z) * z)) * x_m;
        	} else if (z <= 3.2e-8) {
        		tmp = ((x_m / z) / z) * y;
        	} else {
        		tmp = ((y / z) * x_m) / (z * z);
        	}
        	return x_s * tmp;
        }
        
        x\_m = abs(x)
        x\_s = copysign(1.0, x)
        x_m, y, z = sort([x_m, y, z])
        function code(x_s, x_m, y, z)
        	tmp = 0.0
        	if (z <= -5e-16)
        		tmp = Float64(Float64(y / Float64(fma(z, z, z) * z)) * x_m);
        	elseif (z <= 3.2e-8)
        		tmp = Float64(Float64(Float64(x_m / z) / z) * y);
        	else
        		tmp = Float64(Float64(Float64(y / z) * x_m) / Float64(z * z));
        	end
        	return Float64(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]
        NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
        code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[z, -5e-16], N[(N[(y / N[(N[(z * z + z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision], If[LessEqual[z, 3.2e-8], N[(N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(y / z), $MachinePrecision] * x$95$m), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
        
        \begin{array}{l}
        x\_m = \left|x\right|
        \\
        x\_s = \mathsf{copysign}\left(1, x\right)
        \\
        [x_m, y, z] = \mathsf{sort}([x_m, y, z])\\
        \\
        x\_s \cdot \begin{array}{l}
        \mathbf{if}\;z \leq -5 \cdot 10^{-16}:\\
        \;\;\;\;\frac{y}{\mathsf{fma}\left(z, z, z\right) \cdot z} \cdot x\_m\\
        
        \mathbf{elif}\;z \leq 3.2 \cdot 10^{-8}:\\
        \;\;\;\;\frac{\frac{x\_m}{z}}{z} \cdot y\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\frac{y}{z} \cdot x\_m}{z \cdot z}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if z < -5.0000000000000004e-16

          1. Initial program 85.1%

            \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
            2. lift-*.f64N/A

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

              \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{z + 1}}{z \cdot z}} \]
            4. lift-*.f64N/A

              \[\leadsto \frac{\frac{x \cdot y}{z + 1}}{\color{blue}{z \cdot z}} \]
            5. associate-/r*N/A

              \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z + 1}}{z}}{z}} \]
            6. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z + 1}}{z}}{z}} \]
            7. lower-/.f64N/A

              \[\leadsto \frac{\color{blue}{\frac{\frac{x \cdot y}{z + 1}}{z}}}{z} \]
            8. lift-*.f64N/A

              \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{z + 1}}{z}}{z} \]
            9. associate-*r/N/A

              \[\leadsto \frac{\frac{\color{blue}{x \cdot \frac{y}{z + 1}}}{z}}{z} \]
            10. *-commutativeN/A

              \[\leadsto \frac{\frac{\color{blue}{\frac{y}{z + 1} \cdot x}}{z}}{z} \]
            11. lower-*.f64N/A

              \[\leadsto \frac{\frac{\color{blue}{\frac{y}{z + 1} \cdot x}}{z}}{z} \]
            12. lower-/.f6498.4

              \[\leadsto \frac{\frac{\color{blue}{\frac{y}{z + 1}} \cdot x}{z}}{z} \]
            13. lift-+.f64N/A

              \[\leadsto \frac{\frac{\frac{y}{\color{blue}{z + 1}} \cdot x}{z}}{z} \]
            14. +-commutativeN/A

              \[\leadsto \frac{\frac{\frac{y}{\color{blue}{1 + z}} \cdot x}{z}}{z} \]
            15. lower-+.f6498.4

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

            \[\leadsto \color{blue}{\frac{\frac{\frac{y}{1 + z} \cdot x}{z}}{z}} \]
          5. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \frac{\color{blue}{\frac{\frac{y}{1 + z} \cdot x}{z}}}{z} \]
            2. lift-*.f64N/A

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

              \[\leadsto \frac{\color{blue}{\frac{y}{1 + z} \cdot \frac{x}{z}}}{z} \]
            4. lift-/.f64N/A

              \[\leadsto \frac{\color{blue}{\frac{y}{1 + z}} \cdot \frac{x}{z}}{z} \]
            5. frac-timesN/A

              \[\leadsto \frac{\color{blue}{\frac{y \cdot x}{\left(1 + z\right) \cdot z}}}{z} \]
            6. lift-+.f64N/A

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

              \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(z + 1\right)} \cdot z}}{z} \]
            8. distribute-lft1-inN/A

              \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{z \cdot z + z}}}{z} \]
            9. lift-fma.f64N/A

              \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\mathsf{fma}\left(z, z, z\right)}}}{z} \]
            10. div-invN/A

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

              \[\leadsto \frac{\color{blue}{y \cdot \left(x \cdot \frac{1}{\mathsf{fma}\left(z, z, z\right)}\right)}}{z} \]
            12. div-invN/A

              \[\leadsto \frac{y \cdot \color{blue}{\frac{x}{\mathsf{fma}\left(z, z, z\right)}}}{z} \]
            13. clear-numN/A

              \[\leadsto \frac{y \cdot \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
            14. lift-/.f64N/A

              \[\leadsto \frac{y \cdot \frac{1}{\color{blue}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
            15. div-invN/A

              \[\leadsto \frac{\color{blue}{\frac{y}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
            16. lift-/.f64N/A

              \[\leadsto \frac{\frac{y}{\color{blue}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
            17. associate-/r/N/A

              \[\leadsto \frac{\color{blue}{\frac{y}{\mathsf{fma}\left(z, z, z\right)} \cdot x}}{z} \]
            18. lift-fma.f64N/A

              \[\leadsto \frac{\frac{y}{\color{blue}{z \cdot z + z}} \cdot x}{z} \]
            19. *-rgt-identityN/A

              \[\leadsto \frac{\frac{y}{z \cdot z + \color{blue}{z \cdot 1}} \cdot x}{z} \]
            20. distribute-lft-inN/A

              \[\leadsto \frac{\frac{y}{\color{blue}{z \cdot \left(z + 1\right)}} \cdot x}{z} \]
            21. +-commutativeN/A

              \[\leadsto \frac{\frac{y}{z \cdot \color{blue}{\left(1 + z\right)}} \cdot x}{z} \]
            22. lift-+.f64N/A

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

              \[\leadsto \frac{\color{blue}{\frac{\frac{y}{1 + z}}{z}} \cdot x}{z} \]
            24. lift-/.f64N/A

              \[\leadsto \frac{\frac{\color{blue}{\frac{y}{1 + z}}}{z} \cdot x}{z} \]
            25. lower-*.f64N/A

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

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

              \[\leadsto \color{blue}{\frac{\frac{y}{\mathsf{fma}\left(z, z, z\right)} \cdot x}{z}} \]
            2. lift-*.f64N/A

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

              \[\leadsto \color{blue}{\frac{y}{\mathsf{fma}\left(z, z, z\right)} \cdot \frac{x}{z}} \]
            4. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{y}{\mathsf{fma}\left(z, z, z\right)}} \cdot \frac{x}{z} \]
            5. frac-timesN/A

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

              \[\leadsto \frac{y \cdot x}{\color{blue}{z \cdot \mathsf{fma}\left(z, z, z\right)}} \]
            7. lift-fma.f64N/A

              \[\leadsto \frac{y \cdot x}{z \cdot \color{blue}{\left(z \cdot z + z\right)}} \]
            8. distribute-lft-inN/A

              \[\leadsto \frac{y \cdot x}{\color{blue}{z \cdot \left(z \cdot z\right) + z \cdot z}} \]
            9. *-lft-identityN/A

              \[\leadsto \frac{y \cdot x}{z \cdot \left(z \cdot z\right) + \color{blue}{1 \cdot \left(z \cdot z\right)}} \]
            10. distribute-rgt-inN/A

              \[\leadsto \frac{y \cdot x}{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
            11. *-commutativeN/A

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

              \[\leadsto \color{blue}{x \cdot \frac{y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
            13. *-commutativeN/A

              \[\leadsto \color{blue}{\frac{y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot x} \]
            14. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot x} \]
            15. lower-/.f64N/A

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

              \[\leadsto \frac{y}{\color{blue}{z \cdot \left(z \cdot \left(z + 1\right)\right)}} \cdot x \]
            17. distribute-lft-inN/A

              \[\leadsto \frac{y}{z \cdot \color{blue}{\left(z \cdot z + z \cdot 1\right)}} \cdot x \]
            18. *-rgt-identityN/A

              \[\leadsto \frac{y}{z \cdot \left(z \cdot z + \color{blue}{z}\right)} \cdot x \]
            19. lift-fma.f64N/A

              \[\leadsto \frac{y}{z \cdot \color{blue}{\mathsf{fma}\left(z, z, z\right)}} \cdot x \]
            20. *-commutativeN/A

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

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

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

          if -5.0000000000000004e-16 < z < 3.2000000000000002e-8

          1. Initial program 86.1%

            \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
            2. lift-*.f64N/A

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

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

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

              \[\leadsto \color{blue}{\frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot y} \]
            6. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot y} \]
            7. lift-*.f64N/A

              \[\leadsto \frac{x}{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \cdot y \]
            8. lift-*.f64N/A

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

              \[\leadsto \frac{x}{\color{blue}{z \cdot \left(z \cdot \left(z + 1\right)\right)}} \cdot y \]
            10. *-commutativeN/A

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

              \[\leadsto \color{blue}{\frac{\frac{x}{z \cdot \left(z + 1\right)}}{z}} \cdot y \]
            12. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{\frac{x}{z \cdot \left(z + 1\right)}}{z}} \cdot y \]
            13. lower-/.f64N/A

              \[\leadsto \frac{\color{blue}{\frac{x}{z \cdot \left(z + 1\right)}}}{z} \cdot y \]
            14. *-commutativeN/A

              \[\leadsto \frac{\frac{x}{\color{blue}{\left(z + 1\right) \cdot z}}}{z} \cdot y \]
            15. lift-+.f64N/A

              \[\leadsto \frac{\frac{x}{\color{blue}{\left(z + 1\right)} \cdot z}}{z} \cdot y \]
            16. distribute-lft1-inN/A

              \[\leadsto \frac{\frac{x}{\color{blue}{z \cdot z + z}}}{z} \cdot y \]
            17. lower-fma.f6487.4

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

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

            \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \cdot y \]
          6. Step-by-step derivation
            1. lower-/.f6487.2

              \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \cdot y \]
          7. Applied rewrites87.2%

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

          if 3.2000000000000002e-8 < z

          1. Initial program 86.9%

            \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
            2. lift-*.f64N/A

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

              \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
            4. lift-*.f64N/A

              \[\leadsto \frac{y \cdot x}{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
            5. lift-*.f64N/A

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

              \[\leadsto \frac{y \cdot x}{\color{blue}{z \cdot \left(z \cdot \left(z + 1\right)\right)}} \]
            7. times-fracN/A

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

              \[\leadsto \color{blue}{\frac{\frac{y}{z} \cdot x}{z \cdot \left(z + 1\right)}} \]
            9. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{\frac{y}{z} \cdot x}{z \cdot \left(z + 1\right)}} \]
            10. lower-*.f64N/A

              \[\leadsto \frac{\color{blue}{\frac{y}{z} \cdot x}}{z \cdot \left(z + 1\right)} \]
            11. lower-/.f64N/A

              \[\leadsto \frac{\color{blue}{\frac{y}{z}} \cdot x}{z \cdot \left(z + 1\right)} \]
            12. *-commutativeN/A

              \[\leadsto \frac{\frac{y}{z} \cdot x}{\color{blue}{\left(z + 1\right) \cdot z}} \]
            13. lift-+.f64N/A

              \[\leadsto \frac{\frac{y}{z} \cdot x}{\color{blue}{\left(z + 1\right)} \cdot z} \]
            14. distribute-lft1-inN/A

              \[\leadsto \frac{\frac{y}{z} \cdot x}{\color{blue}{z \cdot z + z}} \]
            15. lower-fma.f6498.0

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

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

            \[\leadsto \frac{\frac{y}{z} \cdot x}{\color{blue}{{z}^{2}}} \]
          6. Step-by-step derivation
            1. unpow2N/A

              \[\leadsto \frac{\frac{y}{z} \cdot x}{\color{blue}{z \cdot z}} \]
            2. lower-*.f6497.5

              \[\leadsto \frac{\frac{y}{z} \cdot x}{\color{blue}{z \cdot z}} \]
          7. Applied rewrites97.5%

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

        Alternative 9: 95.1% accurate, 0.7× speedup?

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

          \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
          2. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
          3. lift-*.f64N/A

            \[\leadsto \frac{x \cdot y}{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
          4. times-fracN/A

            \[\leadsto \color{blue}{\frac{x}{z \cdot z} \cdot \frac{y}{z + 1}} \]
          5. *-commutativeN/A

            \[\leadsto \color{blue}{\frac{y}{z + 1} \cdot \frac{x}{z \cdot z}} \]
          6. clear-numN/A

            \[\leadsto \frac{y}{z + 1} \cdot \color{blue}{\frac{1}{\frac{z \cdot z}{x}}} \]
          7. un-div-invN/A

            \[\leadsto \color{blue}{\frac{\frac{y}{z + 1}}{\frac{z \cdot z}{x}}} \]
          8. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{y}{z + 1}}{\frac{z \cdot z}{x}}} \]
          9. lower-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{y}{z + 1}}}{\frac{z \cdot z}{x}} \]
          10. lift-+.f64N/A

            \[\leadsto \frac{\frac{y}{\color{blue}{z + 1}}}{\frac{z \cdot z}{x}} \]
          11. +-commutativeN/A

            \[\leadsto \frac{\frac{y}{\color{blue}{1 + z}}}{\frac{z \cdot z}{x}} \]
          12. lower-+.f64N/A

            \[\leadsto \frac{\frac{y}{\color{blue}{1 + z}}}{\frac{z \cdot z}{x}} \]
          13. lift-*.f64N/A

            \[\leadsto \frac{\frac{y}{1 + z}}{\frac{\color{blue}{z \cdot z}}{x}} \]
          14. associate-/l*N/A

            \[\leadsto \frac{\frac{y}{1 + z}}{\color{blue}{z \cdot \frac{z}{x}}} \]
          15. lower-*.f64N/A

            \[\leadsto \frac{\frac{y}{1 + z}}{\color{blue}{z \cdot \frac{z}{x}}} \]
          16. lower-/.f6493.5

            \[\leadsto \frac{\frac{y}{1 + z}}{z \cdot \color{blue}{\frac{z}{x}}} \]
        4. Applied rewrites93.5%

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

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

        Alternative 10: 91.6% accurate, 0.7× speedup?

        \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z] = \mathsf{sort}([x_m, y, z])\\ \\ \begin{array}{l} t_0 := \frac{y}{\mathsf{fma}\left(z, z, z\right) \cdot z} \cdot x\_m\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{-34}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-14}:\\ \;\;\;\;\frac{x\_m}{z} \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \end{array} \]
        x\_m = (fabs.f64 x)
        x\_s = (copysign.f64 #s(literal 1 binary64) x)
        NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
        (FPCore (x_s x_m y z)
         :precision binary64
         (let* ((t_0 (* (/ y (* (fma z z z) z)) x_m)))
           (*
            x_s
            (if (<= z -3.4e-34) t_0 (if (<= z 1.2e-14) (* (/ x_m z) (/ y z)) t_0)))))
        x\_m = fabs(x);
        x\_s = copysign(1.0, x);
        assert(x_m < y && y < z);
        double code(double x_s, double x_m, double y, double z) {
        	double t_0 = (y / (fma(z, z, z) * z)) * x_m;
        	double tmp;
        	if (z <= -3.4e-34) {
        		tmp = t_0;
        	} else if (z <= 1.2e-14) {
        		tmp = (x_m / z) * (y / z);
        	} else {
        		tmp = t_0;
        	}
        	return x_s * tmp;
        }
        
        x\_m = abs(x)
        x\_s = copysign(1.0, x)
        x_m, y, z = sort([x_m, y, z])
        function code(x_s, x_m, y, z)
        	t_0 = Float64(Float64(y / Float64(fma(z, z, z) * z)) * x_m)
        	tmp = 0.0
        	if (z <= -3.4e-34)
        		tmp = t_0;
        	elseif (z <= 1.2e-14)
        		tmp = Float64(Float64(x_m / z) * Float64(y / z));
        	else
        		tmp = t_0;
        	end
        	return Float64(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]
        NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
        code[x$95$s_, x$95$m_, y_, z_] := Block[{t$95$0 = N[(N[(y / N[(N[(z * z + z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -3.4e-34], t$95$0, If[LessEqual[z, 1.2e-14], N[(N[(x$95$m / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], t$95$0]]), $MachinePrecision]]
        
        \begin{array}{l}
        x\_m = \left|x\right|
        \\
        x\_s = \mathsf{copysign}\left(1, x\right)
        \\
        [x_m, y, z] = \mathsf{sort}([x_m, y, z])\\
        \\
        \begin{array}{l}
        t_0 := \frac{y}{\mathsf{fma}\left(z, z, z\right) \cdot z} \cdot x\_m\\
        x\_s \cdot \begin{array}{l}
        \mathbf{if}\;z \leq -3.4 \cdot 10^{-34}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;z \leq 1.2 \cdot 10^{-14}:\\
        \;\;\;\;\frac{x\_m}{z} \cdot \frac{y}{z}\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if z < -3.4000000000000001e-34 or 1.2e-14 < z

          1. Initial program 86.4%

            \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
            2. lift-*.f64N/A

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

              \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{z + 1}}{z \cdot z}} \]
            4. lift-*.f64N/A

              \[\leadsto \frac{\frac{x \cdot y}{z + 1}}{\color{blue}{z \cdot z}} \]
            5. associate-/r*N/A

              \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z + 1}}{z}}{z}} \]
            6. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{z + 1}}{z}}{z}} \]
            7. lower-/.f64N/A

              \[\leadsto \frac{\color{blue}{\frac{\frac{x \cdot y}{z + 1}}{z}}}{z} \]
            8. lift-*.f64N/A

              \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{z + 1}}{z}}{z} \]
            9. associate-*r/N/A

              \[\leadsto \frac{\frac{\color{blue}{x \cdot \frac{y}{z + 1}}}{z}}{z} \]
            10. *-commutativeN/A

              \[\leadsto \frac{\frac{\color{blue}{\frac{y}{z + 1} \cdot x}}{z}}{z} \]
            11. lower-*.f64N/A

              \[\leadsto \frac{\frac{\color{blue}{\frac{y}{z + 1} \cdot x}}{z}}{z} \]
            12. lower-/.f6499.1

              \[\leadsto \frac{\frac{\color{blue}{\frac{y}{z + 1}} \cdot x}{z}}{z} \]
            13. lift-+.f64N/A

              \[\leadsto \frac{\frac{\frac{y}{\color{blue}{z + 1}} \cdot x}{z}}{z} \]
            14. +-commutativeN/A

              \[\leadsto \frac{\frac{\frac{y}{\color{blue}{1 + z}} \cdot x}{z}}{z} \]
            15. lower-+.f6499.1

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

            \[\leadsto \color{blue}{\frac{\frac{\frac{y}{1 + z} \cdot x}{z}}{z}} \]
          5. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \frac{\color{blue}{\frac{\frac{y}{1 + z} \cdot x}{z}}}{z} \]
            2. lift-*.f64N/A

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

              \[\leadsto \frac{\color{blue}{\frac{y}{1 + z} \cdot \frac{x}{z}}}{z} \]
            4. lift-/.f64N/A

              \[\leadsto \frac{\color{blue}{\frac{y}{1 + z}} \cdot \frac{x}{z}}{z} \]
            5. frac-timesN/A

              \[\leadsto \frac{\color{blue}{\frac{y \cdot x}{\left(1 + z\right) \cdot z}}}{z} \]
            6. lift-+.f64N/A

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

              \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(z + 1\right)} \cdot z}}{z} \]
            8. distribute-lft1-inN/A

              \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{z \cdot z + z}}}{z} \]
            9. lift-fma.f64N/A

              \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\mathsf{fma}\left(z, z, z\right)}}}{z} \]
            10. div-invN/A

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

              \[\leadsto \frac{\color{blue}{y \cdot \left(x \cdot \frac{1}{\mathsf{fma}\left(z, z, z\right)}\right)}}{z} \]
            12. div-invN/A

              \[\leadsto \frac{y \cdot \color{blue}{\frac{x}{\mathsf{fma}\left(z, z, z\right)}}}{z} \]
            13. clear-numN/A

              \[\leadsto \frac{y \cdot \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
            14. lift-/.f64N/A

              \[\leadsto \frac{y \cdot \frac{1}{\color{blue}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
            15. div-invN/A

              \[\leadsto \frac{\color{blue}{\frac{y}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
            16. lift-/.f64N/A

              \[\leadsto \frac{\frac{y}{\color{blue}{\frac{\mathsf{fma}\left(z, z, z\right)}{x}}}}{z} \]
            17. associate-/r/N/A

              \[\leadsto \frac{\color{blue}{\frac{y}{\mathsf{fma}\left(z, z, z\right)} \cdot x}}{z} \]
            18. lift-fma.f64N/A

              \[\leadsto \frac{\frac{y}{\color{blue}{z \cdot z + z}} \cdot x}{z} \]
            19. *-rgt-identityN/A

              \[\leadsto \frac{\frac{y}{z \cdot z + \color{blue}{z \cdot 1}} \cdot x}{z} \]
            20. distribute-lft-inN/A

              \[\leadsto \frac{\frac{y}{\color{blue}{z \cdot \left(z + 1\right)}} \cdot x}{z} \]
            21. +-commutativeN/A

              \[\leadsto \frac{\frac{y}{z \cdot \color{blue}{\left(1 + z\right)}} \cdot x}{z} \]
            22. lift-+.f64N/A

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

              \[\leadsto \frac{\color{blue}{\frac{\frac{y}{1 + z}}{z}} \cdot x}{z} \]
            24. lift-/.f64N/A

              \[\leadsto \frac{\frac{\color{blue}{\frac{y}{1 + z}}}{z} \cdot x}{z} \]
            25. lower-*.f64N/A

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

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

              \[\leadsto \color{blue}{\frac{\frac{y}{\mathsf{fma}\left(z, z, z\right)} \cdot x}{z}} \]
            2. lift-*.f64N/A

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

              \[\leadsto \color{blue}{\frac{y}{\mathsf{fma}\left(z, z, z\right)} \cdot \frac{x}{z}} \]
            4. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{y}{\mathsf{fma}\left(z, z, z\right)}} \cdot \frac{x}{z} \]
            5. frac-timesN/A

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

              \[\leadsto \frac{y \cdot x}{\color{blue}{z \cdot \mathsf{fma}\left(z, z, z\right)}} \]
            7. lift-fma.f64N/A

              \[\leadsto \frac{y \cdot x}{z \cdot \color{blue}{\left(z \cdot z + z\right)}} \]
            8. distribute-lft-inN/A

              \[\leadsto \frac{y \cdot x}{\color{blue}{z \cdot \left(z \cdot z\right) + z \cdot z}} \]
            9. *-lft-identityN/A

              \[\leadsto \frac{y \cdot x}{z \cdot \left(z \cdot z\right) + \color{blue}{1 \cdot \left(z \cdot z\right)}} \]
            10. distribute-rgt-inN/A

              \[\leadsto \frac{y \cdot x}{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
            11. *-commutativeN/A

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

              \[\leadsto \color{blue}{x \cdot \frac{y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
            13. *-commutativeN/A

              \[\leadsto \color{blue}{\frac{y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot x} \]
            14. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot x} \]
            15. lower-/.f64N/A

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

              \[\leadsto \frac{y}{\color{blue}{z \cdot \left(z \cdot \left(z + 1\right)\right)}} \cdot x \]
            17. distribute-lft-inN/A

              \[\leadsto \frac{y}{z \cdot \color{blue}{\left(z \cdot z + z \cdot 1\right)}} \cdot x \]
            18. *-rgt-identityN/A

              \[\leadsto \frac{y}{z \cdot \left(z \cdot z + \color{blue}{z}\right)} \cdot x \]
            19. lift-fma.f64N/A

              \[\leadsto \frac{y}{z \cdot \color{blue}{\mathsf{fma}\left(z, z, z\right)}} \cdot x \]
            20. *-commutativeN/A

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

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

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

          if -3.4000000000000001e-34 < z < 1.2e-14

          1. Initial program 85.6%

            \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in z around 0

            \[\leadsto \color{blue}{\frac{x \cdot y}{{z}^{2}}} \]
          4. Step-by-step derivation
            1. unpow2N/A

              \[\leadsto \frac{x \cdot y}{\color{blue}{z \cdot z}} \]
            2. times-fracN/A

              \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{y}{z}} \]
            3. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{y}{z}} \]
            4. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{x}{z}} \cdot \frac{y}{z} \]
            5. lower-/.f6498.4

              \[\leadsto \frac{x}{z} \cdot \color{blue}{\frac{y}{z}} \]
          5. Applied rewrites98.4%

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

        Alternative 11: 82.6% accurate, 0.8× speedup?

        \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z] = \mathsf{sort}([x_m, y, z])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \cdot y \leq 2 \cdot 10^{-144}:\\ \;\;\;\;\frac{x\_m}{z} \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{\mathsf{fma}\left(z, z, z\right) \cdot z} \cdot y\\ \end{array} \end{array} \]
        x\_m = (fabs.f64 x)
        x\_s = (copysign.f64 #s(literal 1 binary64) x)
        NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
        (FPCore (x_s x_m y z)
         :precision binary64
         (*
          x_s
          (if (<= (* x_m y) 2e-144)
            (* (/ x_m z) (/ y z))
            (* (/ x_m (* (fma z z z) z)) y))))
        x\_m = fabs(x);
        x\_s = copysign(1.0, x);
        assert(x_m < y && y < z);
        double code(double x_s, double x_m, double y, double z) {
        	double tmp;
        	if ((x_m * y) <= 2e-144) {
        		tmp = (x_m / z) * (y / z);
        	} else {
        		tmp = (x_m / (fma(z, z, z) * z)) * y;
        	}
        	return x_s * tmp;
        }
        
        x\_m = abs(x)
        x\_s = copysign(1.0, x)
        x_m, y, z = sort([x_m, y, z])
        function code(x_s, x_m, y, z)
        	tmp = 0.0
        	if (Float64(x_m * y) <= 2e-144)
        		tmp = Float64(Float64(x_m / z) * Float64(y / z));
        	else
        		tmp = Float64(Float64(x_m / Float64(fma(z, z, z) * z)) * y);
        	end
        	return Float64(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]
        NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
        code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[N[(x$95$m * y), $MachinePrecision], 2e-144], N[(N[(x$95$m / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(N[(z * z + z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]), $MachinePrecision]
        
        \begin{array}{l}
        x\_m = \left|x\right|
        \\
        x\_s = \mathsf{copysign}\left(1, x\right)
        \\
        [x_m, y, z] = \mathsf{sort}([x_m, y, z])\\
        \\
        x\_s \cdot \begin{array}{l}
        \mathbf{if}\;x\_m \cdot y \leq 2 \cdot 10^{-144}:\\
        \;\;\;\;\frac{x\_m}{z} \cdot \frac{y}{z}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{x\_m}{\mathsf{fma}\left(z, z, z\right) \cdot z} \cdot y\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 x y) < 1.9999999999999999e-144

          1. Initial program 83.7%

            \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in z around 0

            \[\leadsto \color{blue}{\frac{x \cdot y}{{z}^{2}}} \]
          4. Step-by-step derivation
            1. unpow2N/A

              \[\leadsto \frac{x \cdot y}{\color{blue}{z \cdot z}} \]
            2. times-fracN/A

              \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{y}{z}} \]
            3. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{y}{z}} \]
            4. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{x}{z}} \cdot \frac{y}{z} \]
            5. lower-/.f6479.9

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

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

          if 1.9999999999999999e-144 < (*.f64 x y)

          1. Initial program 91.1%

            \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
            2. lift-*.f64N/A

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

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

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

              \[\leadsto \color{blue}{\frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot y} \]
            6. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot y} \]
            7. lift-*.f64N/A

              \[\leadsto \frac{x}{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \cdot y \]
            8. lift-*.f64N/A

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

              \[\leadsto \frac{x}{\color{blue}{z \cdot \left(z \cdot \left(z + 1\right)\right)}} \cdot y \]
            10. *-commutativeN/A

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

              \[\leadsto \color{blue}{\frac{\frac{x}{z \cdot \left(z + 1\right)}}{z}} \cdot y \]
            12. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{\frac{x}{z \cdot \left(z + 1\right)}}{z}} \cdot y \]
            13. lower-/.f64N/A

              \[\leadsto \frac{\color{blue}{\frac{x}{z \cdot \left(z + 1\right)}}}{z} \cdot y \]
            14. *-commutativeN/A

              \[\leadsto \frac{\frac{x}{\color{blue}{\left(z + 1\right) \cdot z}}}{z} \cdot y \]
            15. lift-+.f64N/A

              \[\leadsto \frac{\frac{x}{\color{blue}{\left(z + 1\right)} \cdot z}}{z} \cdot y \]
            16. distribute-lft1-inN/A

              \[\leadsto \frac{\frac{x}{\color{blue}{z \cdot z + z}}}{z} \cdot y \]
            17. lower-fma.f6492.6

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

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

              \[\leadsto \color{blue}{\frac{\frac{x}{\mathsf{fma}\left(z, z, z\right)}}{z}} \cdot y \]
            2. lift-/.f64N/A

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

              \[\leadsto \frac{\color{blue}{\frac{\mathsf{neg}\left(x\right)}{\mathsf{neg}\left(\mathsf{fma}\left(z, z, z\right)\right)}}}{z} \cdot y \]
            4. associate-/l/N/A

              \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(x\right)}{z \cdot \left(\mathsf{neg}\left(\mathsf{fma}\left(z, z, z\right)\right)\right)}} \cdot y \]
            5. lift-fma.f64N/A

              \[\leadsto \frac{\mathsf{neg}\left(x\right)}{z \cdot \left(\mathsf{neg}\left(\color{blue}{\left(z \cdot z + z\right)}\right)\right)} \cdot y \]
            6. *-lft-identityN/A

              \[\leadsto \frac{\mathsf{neg}\left(x\right)}{z \cdot \left(\mathsf{neg}\left(\left(z \cdot z + \color{blue}{1 \cdot z}\right)\right)\right)} \cdot y \]
            7. distribute-rgt-inN/A

              \[\leadsto \frac{\mathsf{neg}\left(x\right)}{z \cdot \left(\mathsf{neg}\left(\color{blue}{z \cdot \left(z + 1\right)}\right)\right)} \cdot y \]
            8. distribute-rgt-neg-inN/A

              \[\leadsto \frac{\mathsf{neg}\left(x\right)}{\color{blue}{\mathsf{neg}\left(z \cdot \left(z \cdot \left(z + 1\right)\right)\right)}} \cdot y \]
            9. associate-*l*N/A

              \[\leadsto \frac{\mathsf{neg}\left(x\right)}{\mathsf{neg}\left(\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\right)} \cdot y \]
            10. frac-2negN/A

              \[\leadsto \color{blue}{\frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \cdot y \]
            11. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \cdot y \]
            12. lift-*.f64N/A

              \[\leadsto \frac{x}{\color{blue}{\left(z \cdot z\right)} \cdot \left(z + 1\right)} \cdot y \]
            13. distribute-lft-inN/A

              \[\leadsto \frac{x}{\color{blue}{\left(z \cdot z\right) \cdot z + \left(z \cdot z\right) \cdot 1}} \cdot y \]
            14. *-rgt-identityN/A

              \[\leadsto \frac{x}{\left(z \cdot z\right) \cdot z + \color{blue}{z \cdot z}} \cdot y \]
            15. lift-*.f64N/A

              \[\leadsto \frac{x}{\left(z \cdot z\right) \cdot z + \color{blue}{z \cdot z}} \cdot y \]
            16. distribute-rgt-inN/A

              \[\leadsto \frac{x}{\color{blue}{z \cdot \left(z \cdot z + z\right)}} \cdot y \]
            17. lift-*.f64N/A

              \[\leadsto \frac{x}{z \cdot \left(\color{blue}{z \cdot z} + z\right)} \cdot y \]
            18. lift-fma.f64N/A

              \[\leadsto \frac{x}{z \cdot \color{blue}{\mathsf{fma}\left(z, z, z\right)}} \cdot y \]
            19. *-commutativeN/A

              \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(z, z, z\right) \cdot z}} \cdot y \]
            20. lower-*.f6487.7

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

            \[\leadsto \color{blue}{\frac{x}{\mathsf{fma}\left(z, z, z\right) \cdot z}} \cdot y \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 12: 77.6% accurate, 0.8× speedup?

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

          1. Initial program 83.7%

            \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in z around 0

            \[\leadsto \color{blue}{\frac{x \cdot y}{{z}^{2}}} \]
          4. Step-by-step derivation
            1. unpow2N/A

              \[\leadsto \frac{x \cdot y}{\color{blue}{z \cdot z}} \]
            2. times-fracN/A

              \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{y}{z}} \]
            3. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{y}{z}} \]
            4. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{x}{z}} \cdot \frac{y}{z} \]
            5. lower-/.f6479.9

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

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

          if 1.9999999999999999e-144 < (*.f64 x y)

          1. Initial program 91.1%

            \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
            2. lift-*.f64N/A

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

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

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

              \[\leadsto \color{blue}{\frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot y} \]
            6. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot y} \]
            7. lift-*.f64N/A

              \[\leadsto \frac{x}{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \cdot y \]
            8. lift-*.f64N/A

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

              \[\leadsto \frac{x}{\color{blue}{z \cdot \left(z \cdot \left(z + 1\right)\right)}} \cdot y \]
            10. *-commutativeN/A

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

              \[\leadsto \color{blue}{\frac{\frac{x}{z \cdot \left(z + 1\right)}}{z}} \cdot y \]
            12. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{\frac{x}{z \cdot \left(z + 1\right)}}{z}} \cdot y \]
            13. lower-/.f64N/A

              \[\leadsto \frac{\color{blue}{\frac{x}{z \cdot \left(z + 1\right)}}}{z} \cdot y \]
            14. *-commutativeN/A

              \[\leadsto \frac{\frac{x}{\color{blue}{\left(z + 1\right) \cdot z}}}{z} \cdot y \]
            15. lift-+.f64N/A

              \[\leadsto \frac{\frac{x}{\color{blue}{\left(z + 1\right)} \cdot z}}{z} \cdot y \]
            16. distribute-lft1-inN/A

              \[\leadsto \frac{\frac{x}{\color{blue}{z \cdot z + z}}}{z} \cdot y \]
            17. lower-fma.f6492.6

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

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

            \[\leadsto \color{blue}{\frac{x}{{z}^{2}}} \cdot y \]
          6. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{x}{{z}^{2}}} \cdot y \]
            2. unpow2N/A

              \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \cdot y \]
            3. lower-*.f6474.6

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

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

        Alternative 13: 94.7% accurate, 0.9× speedup?

        \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z] = \mathsf{sort}([x_m, y, z])\\ \\ x\_s \cdot \frac{\frac{x\_m}{z} \cdot y}{\mathsf{fma}\left(z, z, z\right)} \end{array} \]
        x\_m = (fabs.f64 x)
        x\_s = (copysign.f64 #s(literal 1 binary64) x)
        NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
        (FPCore (x_s x_m y z)
         :precision binary64
         (* x_s (/ (* (/ x_m z) y) (fma z z z))))
        x\_m = fabs(x);
        x\_s = copysign(1.0, x);
        assert(x_m < y && y < z);
        double code(double x_s, double x_m, double y, double z) {
        	return x_s * (((x_m / z) * y) / fma(z, z, z));
        }
        
        x\_m = abs(x)
        x\_s = copysign(1.0, x)
        x_m, y, z = sort([x_m, y, z])
        function code(x_s, x_m, y, z)
        	return Float64(x_s * Float64(Float64(Float64(x_m / z) * y) / fma(z, z, 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]
        NOTE: x_m, y, and z should be sorted in increasing order before calling this function.
        code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * N[(N[(N[(x$95$m / z), $MachinePrecision] * y), $MachinePrecision] / N[(z * z + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        x\_m = \left|x\right|
        \\
        x\_s = \mathsf{copysign}\left(1, x\right)
        \\
        [x_m, y, z] = \mathsf{sort}([x_m, y, z])\\
        \\
        x\_s \cdot \frac{\frac{x\_m}{z} \cdot y}{\mathsf{fma}\left(z, z, z\right)}
        \end{array}
        
        Derivation
        1. Initial program 86.0%

          \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
          2. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
          3. lift-*.f64N/A

            \[\leadsto \frac{x \cdot y}{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
          4. times-fracN/A

            \[\leadsto \color{blue}{\frac{x}{z \cdot z} \cdot \frac{y}{z + 1}} \]
          5. lift-*.f64N/A

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

            \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \cdot \frac{y}{z + 1} \]
          7. frac-timesN/A

            \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot y}{z \cdot \left(z + 1\right)}} \]
          8. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot y}{z \cdot \left(z + 1\right)}} \]
          9. lower-*.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{x}{z} \cdot y}}{z \cdot \left(z + 1\right)} \]
          10. lower-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{x}{z}} \cdot y}{z \cdot \left(z + 1\right)} \]
          11. *-commutativeN/A

            \[\leadsto \frac{\frac{x}{z} \cdot y}{\color{blue}{\left(z + 1\right) \cdot z}} \]
          12. lift-+.f64N/A

            \[\leadsto \frac{\frac{x}{z} \cdot y}{\color{blue}{\left(z + 1\right)} \cdot z} \]
          13. distribute-lft1-inN/A

            \[\leadsto \frac{\frac{x}{z} \cdot y}{\color{blue}{z \cdot z + z}} \]
          14. lower-fma.f6496.0

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

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

        Alternative 14: 73.6% accurate, 1.4× speedup?

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

          \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
          2. lift-*.f64N/A

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

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

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

            \[\leadsto \color{blue}{\frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot y} \]
          6. lower-*.f64N/A

            \[\leadsto \color{blue}{\frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \cdot y} \]
          7. lift-*.f64N/A

            \[\leadsto \frac{x}{\color{blue}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \cdot y \]
          8. lift-*.f64N/A

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

            \[\leadsto \frac{x}{\color{blue}{z \cdot \left(z \cdot \left(z + 1\right)\right)}} \cdot y \]
          10. *-commutativeN/A

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

            \[\leadsto \color{blue}{\frac{\frac{x}{z \cdot \left(z + 1\right)}}{z}} \cdot y \]
          12. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{x}{z \cdot \left(z + 1\right)}}{z}} \cdot y \]
          13. lower-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{x}{z \cdot \left(z + 1\right)}}}{z} \cdot y \]
          14. *-commutativeN/A

            \[\leadsto \frac{\frac{x}{\color{blue}{\left(z + 1\right) \cdot z}}}{z} \cdot y \]
          15. lift-+.f64N/A

            \[\leadsto \frac{\frac{x}{\color{blue}{\left(z + 1\right)} \cdot z}}{z} \cdot y \]
          16. distribute-lft1-inN/A

            \[\leadsto \frac{\frac{x}{\color{blue}{z \cdot z + z}}}{z} \cdot y \]
          17. lower-fma.f6489.8

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

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

          \[\leadsto \color{blue}{\frac{x}{{z}^{2}}} \cdot y \]
        6. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{x}{{z}^{2}}} \cdot y \]
          2. unpow2N/A

            \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \cdot y \]
          3. lower-*.f6473.1

            \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \cdot y \]
        7. Applied rewrites73.1%

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

        Alternative 15: 30.6% accurate, 1.6× speedup?

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

          \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in z around 0

          \[\leadsto \color{blue}{\frac{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right) + x \cdot y}{{z}^{2}}} \]
        4. Step-by-step derivation
          1. *-lft-identityN/A

            \[\leadsto \frac{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \color{blue}{1 \cdot \left(x \cdot y\right)}}{{z}^{2}} \]
          2. metadata-evalN/A

            \[\leadsto \frac{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot \left(x \cdot y\right)}{{z}^{2}} \]
          3. cancel-sign-sub-invN/A

            \[\leadsto \frac{\color{blue}{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -1 \cdot \left(x \cdot y\right)}}{{z}^{2}} \]
          4. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -1 \cdot \left(x \cdot y\right)}{{z}^{2}}} \]
          5. distribute-lft-out--N/A

            \[\leadsto \frac{\color{blue}{-1 \cdot \left(x \cdot \left(y \cdot z\right) - x \cdot y\right)}}{{z}^{2}} \]
          6. mul-1-negN/A

            \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\left(x \cdot \left(y \cdot z\right) - x \cdot y\right)\right)}}{{z}^{2}} \]
          7. sub-negN/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(x \cdot \left(y \cdot z\right) + \left(\mathsf{neg}\left(x \cdot y\right)\right)\right)}\right)}{{z}^{2}} \]
          8. associate-*r*N/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\left(x \cdot y\right) \cdot z} + \left(\mathsf{neg}\left(x \cdot y\right)\right)\right)\right)}{{z}^{2}} \]
          9. mul-1-negN/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\left(x \cdot y\right) \cdot z + \color{blue}{-1 \cdot \left(x \cdot y\right)}\right)\right)}{{z}^{2}} \]
          10. *-commutativeN/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\left(x \cdot y\right) \cdot z + \color{blue}{\left(x \cdot y\right) \cdot -1}\right)\right)}{{z}^{2}} \]
          11. distribute-lft-outN/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(x \cdot y\right) \cdot \left(z + -1\right)}\right)}{{z}^{2}} \]
          12. *-commutativeN/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(z + -1\right) \cdot \left(x \cdot y\right)}\right)}{{z}^{2}} \]
          13. distribute-lft-neg-inN/A

            \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(\left(z + -1\right)\right)\right) \cdot \left(x \cdot y\right)}}{{z}^{2}} \]
          14. lower-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(\left(z + -1\right)\right)\right) \cdot \left(x \cdot y\right)}}{{z}^{2}} \]
          15. +-commutativeN/A

            \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(-1 + z\right)}\right)\right) \cdot \left(x \cdot y\right)}{{z}^{2}} \]
          16. distribute-neg-inN/A

            \[\leadsto \frac{\color{blue}{\left(\left(\mathsf{neg}\left(-1\right)\right) + \left(\mathsf{neg}\left(z\right)\right)\right)} \cdot \left(x \cdot y\right)}{{z}^{2}} \]
          17. metadata-evalN/A

            \[\leadsto \frac{\left(\color{blue}{1} + \left(\mathsf{neg}\left(z\right)\right)\right) \cdot \left(x \cdot y\right)}{{z}^{2}} \]
          18. sub-negN/A

            \[\leadsto \frac{\color{blue}{\left(1 - z\right)} \cdot \left(x \cdot y\right)}{{z}^{2}} \]
          19. lower--.f64N/A

            \[\leadsto \frac{\color{blue}{\left(1 - z\right)} \cdot \left(x \cdot y\right)}{{z}^{2}} \]
          20. *-commutativeN/A

            \[\leadsto \frac{\left(1 - z\right) \cdot \color{blue}{\left(y \cdot x\right)}}{{z}^{2}} \]
          21. lower-*.f64N/A

            \[\leadsto \frac{\left(1 - z\right) \cdot \color{blue}{\left(y \cdot x\right)}}{{z}^{2}} \]
          22. unpow2N/A

            \[\leadsto \frac{\left(1 - z\right) \cdot \left(y \cdot x\right)}{\color{blue}{z \cdot z}} \]
          23. lower-*.f6467.2

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

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

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

            \[\leadsto \frac{-y}{z} \cdot \color{blue}{x} \]
          2. Taylor expanded in z around inf

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

              \[\leadsto \frac{-x}{z} \cdot \color{blue}{y} \]
            2. Add Preprocessing

            Developer Target 1: 96.1% accurate, 0.6× 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 2024255 
            (FPCore (x y z)
              :name "Statistics.Distribution.Beta:$cvariance from math-functions-0.1.5.2"
              :precision binary64
            
              :alt
              (! :herbie-platform default (if (< z 2496182814532307/10000000000000) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1 z)) x) z)))
            
              (/ (* x y) (* (* z z) (+ z 1.0))))