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

Percentage Accurate: 83.0% → 95.8%
Time: 12.0s
Alternatives: 17
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 17 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.0% accurate, 1.0× speedup?

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

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

Alternative 1: 95.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(z + 1\right) \cdot \left(z \cdot z\right)\\ \mathbf{if}\;t_0 \leq -1 \cdot 10^{+20}:\\ \;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{-153}:\\ \;\;\;\;\frac{\frac{x}{z}}{\frac{z}{y}}\\ \mathbf{elif}\;t_0 \leq 2 \cdot 10^{+140}:\\ \;\;\;\;\frac{x \cdot y}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z \cdot \left(\frac{z}{x} \cdot \frac{z}{y}\right)}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* (+ z 1.0) (* z z))))
   (if (<= t_0 -1e+20)
     (/ (/ y z) (* z (/ z x)))
     (if (<= t_0 5e-153)
       (/ (/ x z) (/ z y))
       (if (<= t_0 2e+140)
         (/ (* x y) t_0)
         (/ 1.0 (* z (* (/ z x) (/ z y)))))))))
double code(double x, double y, double z) {
	double t_0 = (z + 1.0) * (z * z);
	double tmp;
	if (t_0 <= -1e+20) {
		tmp = (y / z) / (z * (z / x));
	} else if (t_0 <= 5e-153) {
		tmp = (x / z) / (z / y);
	} else if (t_0 <= 2e+140) {
		tmp = (x * y) / t_0;
	} else {
		tmp = 1.0 / (z * ((z / x) * (z / y)));
	}
	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) :: t_0
    real(8) :: tmp
    t_0 = (z + 1.0d0) * (z * z)
    if (t_0 <= (-1d+20)) then
        tmp = (y / z) / (z * (z / x))
    else if (t_0 <= 5d-153) then
        tmp = (x / z) / (z / y)
    else if (t_0 <= 2d+140) then
        tmp = (x * y) / t_0
    else
        tmp = 1.0d0 / (z * ((z / x) * (z / y)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = (z + 1.0) * (z * z);
	double tmp;
	if (t_0 <= -1e+20) {
		tmp = (y / z) / (z * (z / x));
	} else if (t_0 <= 5e-153) {
		tmp = (x / z) / (z / y);
	} else if (t_0 <= 2e+140) {
		tmp = (x * y) / t_0;
	} else {
		tmp = 1.0 / (z * ((z / x) * (z / y)));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = (z + 1.0) * (z * z)
	tmp = 0
	if t_0 <= -1e+20:
		tmp = (y / z) / (z * (z / x))
	elif t_0 <= 5e-153:
		tmp = (x / z) / (z / y)
	elif t_0 <= 2e+140:
		tmp = (x * y) / t_0
	else:
		tmp = 1.0 / (z * ((z / x) * (z / y)))
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(z + 1.0) * Float64(z * z))
	tmp = 0.0
	if (t_0 <= -1e+20)
		tmp = Float64(Float64(y / z) / Float64(z * Float64(z / x)));
	elseif (t_0 <= 5e-153)
		tmp = Float64(Float64(x / z) / Float64(z / y));
	elseif (t_0 <= 2e+140)
		tmp = Float64(Float64(x * y) / t_0);
	else
		tmp = Float64(1.0 / Float64(z * Float64(Float64(z / x) * Float64(z / y))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = (z + 1.0) * (z * z);
	tmp = 0.0;
	if (t_0 <= -1e+20)
		tmp = (y / z) / (z * (z / x));
	elseif (t_0 <= 5e-153)
		tmp = (x / z) / (z / y);
	elseif (t_0 <= 2e+140)
		tmp = (x * y) / t_0;
	else
		tmp = 1.0 / (z * ((z / x) * (z / y)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z + 1.0), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+20], N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-153], N[(N[(x / z), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+140], N[(N[(x * y), $MachinePrecision] / t$95$0), $MachinePrecision], N[(1.0 / N[(z * N[(N[(z / x), $MachinePrecision] * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(z + 1\right) \cdot \left(z \cdot z\right)\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{+20}:\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (*.f64 z z) (+.f64 z 1)) < -1e20

    1. Initial program 81.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e20 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 5.00000000000000033e-153

    1. Initial program 82.0%

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000033e-153 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 2.00000000000000012e140

    1. Initial program 99.6%

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

    if 2.00000000000000012e140 < (*.f64 (*.f64 z z) (+.f64 z 1))

    1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{\frac{z \cdot z}{y}}} \]
      2. add-cube-cbrt88.8%

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

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

        \[\leadsto \color{blue}{\frac{\sqrt[3]{\frac{x}{z}} \cdot \sqrt[3]{\frac{x}{z}}}{1} \cdot \frac{\sqrt[3]{\frac{x}{z}}}{\frac{z \cdot z}{y}}} \]
      5. pow288.9%

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

        \[\leadsto \frac{{\left(\sqrt[3]{\frac{x}{z}}\right)}^{2}}{1} \cdot \frac{\sqrt[3]{\frac{x}{z}}}{\color{blue}{\left(z \cdot z\right) \cdot \frac{1}{y}}} \]
      7. associate-*l*95.3%

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

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

      \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{\frac{x}{z}}\right)}^{2}}{1} \cdot \frac{\sqrt[3]{\frac{x}{z}}}{z \cdot \frac{z}{y}}} \]
    9. Step-by-step derivation
      1. times-frac95.2%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{\frac{x}{z}}\right)}^{2} \cdot \sqrt[3]{\frac{x}{z}}}{1 \cdot \left(z \cdot \frac{z}{y}\right)}} \]
      2. *-lft-identity95.2%

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

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{\frac{x}{z}} \cdot \sqrt[3]{\frac{x}{z}}\right)} \cdot \sqrt[3]{\frac{x}{z}}}{z \cdot \frac{z}{y}} \]
      4. rem-3cbrt-lft95.5%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{x}{z}}{\frac{z}{y}}}}{z} \]
      4. clear-num99.8%

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

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

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

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

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

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

Alternative 2: 94.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\

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

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


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

    1. Initial program 81.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 0.75

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.75 < z

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt[3]{\frac{x}{z}} \cdot \sqrt[3]{\frac{x}{z}}}{1} \cdot \frac{\sqrt[3]{\frac{x}{z}}}{\frac{z \cdot z}{y}}} \]
      5. pow287.9%

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

        \[\leadsto \frac{{\left(\sqrt[3]{\frac{x}{z}}\right)}^{2}}{1} \cdot \frac{\sqrt[3]{\frac{x}{z}}}{\color{blue}{\left(z \cdot z\right) \cdot \frac{1}{y}}} \]
      7. associate-*l*93.1%

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

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

      \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{\frac{x}{z}}\right)}^{2}}{1} \cdot \frac{\sqrt[3]{\frac{x}{z}}}{z \cdot \frac{z}{y}}} \]
    9. Step-by-step derivation
      1. times-frac93.0%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{\frac{x}{z}}\right)}^{2} \cdot \sqrt[3]{\frac{x}{z}}}{1 \cdot \left(z \cdot \frac{z}{y}\right)}} \]
      2. *-lft-identity93.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{x}{z}}{\frac{z}{y}}}}{z} \]
      4. clear-num96.8%

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

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

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

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

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

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

Alternative 3: 93.0% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 84.8%

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 0.75

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 95.1% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 84.8%

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 0.75

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 94.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{y}{z} \cdot \frac{\frac{x}{z}}{z}\\

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

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


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

    1. Initial program 81.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 0.76000000000000001

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.76000000000000001 < z

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 94.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\

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

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


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

    1. Initial program 81.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 0.75

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.75 < z

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 96.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\frac{x}{z} \cdot \frac{y}{z}}{z + 1} \end{array} \]
(FPCore (x y z) :precision binary64 (/ (* (/ x z) (/ y z)) (+ z 1.0)))
double code(double x, double y, double z) {
	return ((x / z) * (y / 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 / z) * (y / z)) / (z + 1.0d0)
end function
public static double code(double x, double y, double z) {
	return ((x / z) * (y / z)) / (z + 1.0);
}
def code(x, y, z):
	return ((x / z) * (y / z)) / (z + 1.0)
function code(x, y, z)
	return Float64(Float64(Float64(x / z) * Float64(y / z)) / Float64(z + 1.0))
end
function tmp = code(x, y, z)
	tmp = ((x / z) * (y / z)) / (z + 1.0);
end
code[x_, y_, z_] := N[(N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{x}{z} \cdot \frac{y}{z}}{z + 1}
\end{array}
Derivation
  1. Initial program 85.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 75.4% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{-157}:\\ \;\;\;\;x \cdot \frac{\frac{y}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -4.2e-157) (* x (/ (/ y z) z)) (* (/ x z) (/ y z))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -4.2e-157) {
		tmp = x * ((y / z) / z);
	} else {
		tmp = (x / z) * (y / 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 (x <= (-4.2d-157)) then
        tmp = x * ((y / z) / z)
    else
        tmp = (x / z) * (y / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -4.2e-157) {
		tmp = x * ((y / z) / z);
	} else {
		tmp = (x / z) * (y / z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -4.2e-157:
		tmp = x * ((y / z) / z)
	else:
		tmp = (x / z) * (y / z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -4.2e-157)
		tmp = Float64(x * Float64(Float64(y / z) / z));
	else
		tmp = Float64(Float64(x / z) * Float64(y / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -4.2e-157)
		tmp = x * ((y / z) / z);
	else
		tmp = (x / z) * (y / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -4.2e-157], N[(x * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{-157}:\\
\;\;\;\;x \cdot \frac{\frac{y}{z}}{z}\\

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


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

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.2e-157 < x

    1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

Alternative 9: 76.1% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 2 \cdot 10^{+43}:\\ \;\;\;\;x \cdot \frac{\frac{y}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z \cdot z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y 2e+43) (* x (/ (/ y z) z)) (* y (/ x (* z z)))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= 2e+43) {
		tmp = x * ((y / z) / z);
	} else {
		tmp = y * (x / (z * 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 (y <= 2d+43) then
        tmp = x * ((y / z) / z)
    else
        tmp = y * (x / (z * z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= 2e+43) {
		tmp = x * ((y / z) / z);
	} else {
		tmp = y * (x / (z * z));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= 2e+43:
		tmp = x * ((y / z) / z)
	else:
		tmp = y * (x / (z * z))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= 2e+43)
		tmp = Float64(x * Float64(Float64(y / z) / z));
	else
		tmp = Float64(y * Float64(x / Float64(z * z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= 2e+43)
		tmp = x * ((y / z) / z);
	else
		tmp = y * (x / (z * z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, 2e+43], N[(x * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2 \cdot 10^{+43}:\\
\;\;\;\;x \cdot \frac{\frac{y}{z}}{z}\\

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


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

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000003e43 < y

    1. Initial program 82.4%

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

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

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

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

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

Alternative 10: 75.7% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.02 \cdot 10^{-103}:\\ \;\;\;\;x \cdot \frac{y}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -1.02e-103) (* x (/ y (* z z))) (* (/ x z) (/ y z))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -1.02e-103) {
		tmp = x * (y / (z * z));
	} else {
		tmp = (x / z) * (y / 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 (x <= (-1.02d-103)) then
        tmp = x * (y / (z * z))
    else
        tmp = (x / z) * (y / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -1.02e-103) {
		tmp = x * (y / (z * z));
	} else {
		tmp = (x / z) * (y / z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -1.02e-103:
		tmp = x * (y / (z * z))
	else:
		tmp = (x / z) * (y / z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -1.02e-103)
		tmp = Float64(x * Float64(y / Float64(z * z)));
	else
		tmp = Float64(Float64(x / z) * Float64(y / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -1.02e-103)
		tmp = x * (y / (z * z));
	else
		tmp = (x / z) * (y / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -1.02e-103], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.02 \cdot 10^{-103}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\

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


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

    1. Initial program 84.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.01999999999999998e-103 < x

    1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

Alternative 11: 76.7% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -7 \cdot 10^{-28}:\\ \;\;\;\;x \cdot \frac{y}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z \cdot \frac{z}{x}}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -7e-28) (* x (/ y (* z z))) (/ y (* z (/ z x)))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -7e-28) {
		tmp = x * (y / (z * z));
	} else {
		tmp = y / (z * (z / x));
	}
	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 (x <= (-7d-28)) then
        tmp = x * (y / (z * z))
    else
        tmp = y / (z * (z / x))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -7e-28) {
		tmp = x * (y / (z * z));
	} else {
		tmp = y / (z * (z / x));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -7e-28:
		tmp = x * (y / (z * z))
	else:
		tmp = y / (z * (z / x))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -7e-28)
		tmp = Float64(x * Float64(y / Float64(z * z)));
	else
		tmp = Float64(y / Float64(z * Float64(z / x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -7e-28)
		tmp = x * (y / (z * z));
	else
		tmp = y / (z * (z / x));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -7e-28], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{-28}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\

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


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

    1. Initial program 82.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.9999999999999999e-28 < x

    1. Initial program 87.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 39.4% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{-310}:\\ \;\;\;\;x \cdot \left(-\frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -2e-310) (* x (- (/ y z))) (/ y (/ z x))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -2e-310) {
		tmp = x * -(y / z);
	} else {
		tmp = y / (z / x);
	}
	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 <= (-2d-310)) then
        tmp = x * -(y / z)
    else
        tmp = y / (z / x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -2e-310) {
		tmp = x * -(y / z);
	} else {
		tmp = y / (z / x);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -2e-310:
		tmp = x * -(y / z)
	else:
		tmp = y / (z / x)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -2e-310)
		tmp = Float64(x * Float64(-Float64(y / z)));
	else
		tmp = Float64(y / Float64(z / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -2e-310)
		tmp = x * -(y / z);
	else
		tmp = y / (z / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -2e-310], N[(x * (-N[(y / z), $MachinePrecision])), $MachinePrecision], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-310}:\\
\;\;\;\;x \cdot \left(-\frac{y}{z}\right)\\

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


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

    1. Initial program 84.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < z

    1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 39.2% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{-310}:\\ \;\;\;\;-\frac{x}{z} \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -2e-310) (- (* (/ x z) y)) (/ y (/ z x))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -2e-310) {
		tmp = -((x / z) * y);
	} else {
		tmp = y / (z / x);
	}
	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 <= (-2d-310)) then
        tmp = -((x / z) * y)
    else
        tmp = y / (z / x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -2e-310) {
		tmp = -((x / z) * y);
	} else {
		tmp = y / (z / x);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -2e-310:
		tmp = -((x / z) * y)
	else:
		tmp = y / (z / x)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -2e-310)
		tmp = Float64(-Float64(Float64(x / z) * y));
	else
		tmp = Float64(y / Float64(z / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -2e-310)
		tmp = -((x / z) * y);
	else
		tmp = y / (z / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -2e-310], (-N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]), N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 84.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < z

    1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 73.6% accurate, 1.6× speedup?

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

\\
x \cdot \frac{\frac{y}{z}}{z}
\end{array}
Derivation
  1. Initial program 85.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 30.1% accurate, 2.2× speedup?

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

\\
\frac{x}{z} \cdot y
\end{array}
Derivation
  1. Initial program 85.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto e^{\mathsf{log1p}\left(x \cdot \color{blue}{\frac{1}{\frac{z}{y}}}\right)} - 1 \]
    9. un-div-inv37.6%

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

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

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

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

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

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

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

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

Alternative 16: 30.7% accurate, 2.2× speedup?

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

\\
x \cdot \frac{y}{z}
\end{array}
Derivation
  1. Initial program 85.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-y}{z} \cdot x} \]
    3. add-sqr-sqrt14.2%

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

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

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

      \[\leadsto \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{z} \cdot x \]
    7. add-sqr-sqrt32.5%

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

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

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

Alternative 17: 31.0% accurate, 2.2× speedup?

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

\\
\frac{x}{\frac{z}{y}}
\end{array}
Derivation
  1. Initial program 85.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 95.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z < 249.6182814532307:\\ \;\;\;\;\frac{y \cdot \frac{x}{z}}{z + z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{y}{z}}{1 + z} \cdot x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (< z 249.6182814532307)
   (/ (* y (/ x z)) (+ z (* z z)))
   (/ (* (/ (/ y z) (+ 1.0 z)) x) z)))
double code(double x, double y, double z) {
	double tmp;
	if (z < 249.6182814532307) {
		tmp = (y * (x / z)) / (z + (z * z));
	} else {
		tmp = (((y / z) / (1.0 + z)) * x) / z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z < 249.6182814532307d0) then
        tmp = (y * (x / z)) / (z + (z * z))
    else
        tmp = (((y / z) / (1.0d0 + z)) * x) / z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z < 249.6182814532307) {
		tmp = (y * (x / z)) / (z + (z * z));
	} else {
		tmp = (((y / z) / (1.0 + z)) * x) / z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z < 249.6182814532307:
		tmp = (y * (x / z)) / (z + (z * z))
	else:
		tmp = (((y / z) / (1.0 + z)) * x) / z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z < 249.6182814532307)
		tmp = Float64(Float64(y * Float64(x / z)) / Float64(z + Float64(z * z)));
	else
		tmp = Float64(Float64(Float64(Float64(y / z) / Float64(1.0 + z)) * x) / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z < 249.6182814532307)
		tmp = (y * (x / z)) / (z + (z * z));
	else
		tmp = (((y / z) / (1.0 + z)) * x) / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Less[z, 249.6182814532307], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / N[(z + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y / z), $MachinePrecision] / N[(1.0 + z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z < 249.6182814532307:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z + z \cdot z}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023240 
(FPCore (x y z)
  :name "Statistics.Distribution.Beta:$cvariance from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (if (< z 249.6182814532307) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1.0 z)) x) z))

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