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

Percentage Accurate: 82.1% → 96.9%
Time: 12.3s
Alternatives: 16
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 82.1% accurate, 1.0× speedup?

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

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

Alternative 1: 96.9% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 95.5% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{-19} \lor \neg \left(z \leq 1.65 \cdot 10^{-245}\right):\\ \;\;\;\;\frac{\frac{y}{z}}{z} \cdot \frac{x}{1 + z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z} \cdot y}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -4e-19) (not (<= z 1.65e-245)))
   (* (/ (/ y z) z) (/ x (+ 1.0 z)))
   (/ (* (/ x z) y) z)))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -4e-19) || !(z <= 1.65e-245)) {
		tmp = ((y / z) / z) * (x / (1.0 + 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 ((z <= (-4d-19)) .or. (.not. (z <= 1.65d-245))) then
        tmp = ((y / z) / z) * (x / (1.0d0 + 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 ((z <= -4e-19) || !(z <= 1.65e-245)) {
		tmp = ((y / z) / z) * (x / (1.0 + z));
	} else {
		tmp = ((x / z) * y) / z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -4e-19) or not (z <= 1.65e-245):
		tmp = ((y / z) / z) * (x / (1.0 + z))
	else:
		tmp = ((x / z) * y) / z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -4e-19) || !(z <= 1.65e-245))
		tmp = Float64(Float64(Float64(y / z) / z) * Float64(x / Float64(1.0 + z)));
	else
		tmp = Float64(Float64(Float64(x / z) * y) / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -4e-19) || ~((z <= 1.65e-245)))
		tmp = ((y / z) / z) * (x / (1.0 + z));
	else
		tmp = ((x / z) * y) / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -4e-19], N[Not[LessEqual[z, 1.65e-245]], $MachinePrecision]], N[(N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision] * N[(x / N[(1.0 + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-19} \lor \neg \left(z \leq 1.65 \cdot 10^{-245}\right):\\
\;\;\;\;\frac{\frac{y}{z}}{z} \cdot \frac{x}{1 + z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.9999999999999999e-19 or 1.65e-245 < z

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.9999999999999999e-19 < z < 1.65e-245

    1. Initial program 79.7%

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

        \[\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 79.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 94.6% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq 8.5 \cdot 10^{-37}:\\
\;\;\;\;\frac{x}{z} \cdot \left(\frac{y}{z} - y\right)\\

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


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

    1. Initial program 84.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{z \cdot \color{blue}{\frac{z \cdot z}{y}}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity87.3%

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

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

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

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

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

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

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

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

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

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

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

    if -38000 < z < 8.5000000000000007e-37

    1. Initial program 78.3%

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

        \[\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 95.3%

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

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

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

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

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

    if 8.5000000000000007e-37 < z

    1. Initial program 85.1%

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

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

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

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

Alternative 4: 92.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -38000 \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 -38000.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 <= -38000.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 <= (-38000.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 <= -38000.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 <= -38000.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 <= -38000.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 <= -38000.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, -38000.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 -38000 \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 < -38000 or 0.75 < z

    1. Initial program 83.7%

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

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

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

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

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

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

      \[\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 -38000 < z < 0.75

    1. Initial program 79.7%

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

        \[\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 95.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -38000 \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 5: 92.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -38000 \lor \neg \left(z \leq 0.78\right):\\ \;\;\;\;\frac{y}{z} \cdot \frac{x}{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 -38000.0) (not (<= z 0.78)))
   (* (/ y z) (/ x (* z z)))
   (* (/ x z) (- (/ y z) y))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -38000.0) || !(z <= 0.78)) {
		tmp = (y / z) * (x / (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 <= (-38000.0d0)) .or. (.not. (z <= 0.78d0))) then
        tmp = (y / z) * (x / (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 <= -38000.0) || !(z <= 0.78)) {
		tmp = (y / z) * (x / (z * z));
	} else {
		tmp = (x / z) * ((y / z) - y);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -38000.0) or not (z <= 0.78):
		tmp = (y / z) * (x / (z * z))
	else:
		tmp = (x / z) * ((y / z) - y)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -38000.0) || !(z <= 0.78))
		tmp = Float64(Float64(y / z) * Float64(x / 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 <= -38000.0) || ~((z <= 0.78)))
		tmp = (y / z) * (x / (z * z));
	else
		tmp = (x / z) * ((y / z) - y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -38000.0], N[Not[LessEqual[z, 0.78]], $MachinePrecision]], N[(N[(y / z), $MachinePrecision] * N[(x / 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 -38000 \lor \neg \left(z \leq 0.78\right):\\
\;\;\;\;\frac{y}{z} \cdot \frac{x}{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 < -38000 or 0.78000000000000003 < z

    1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -38000 < z < 0.78000000000000003

    1. Initial program 79.7%

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

        \[\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 95.0%

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

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

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

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

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

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

Alternative 6: 95.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -38000 \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 -38000.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 <= -38000.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 <= (-38000.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 <= -38000.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 <= -38000.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 <= -38000.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 <= -38000.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, -38000.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 -38000 \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 < -38000 or 0.75 < z

    1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -38000 < z < 0.75

    1. Initial program 79.7%

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

        \[\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 95.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -38000 \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 7: 95.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -38000 \lor \neg \left(z \leq 0.75\right):\\ \;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\ \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 -38000.0) (not (<= z 0.75)))
   (/ (/ y z) (* z (/ z x)))
   (* (/ x z) (- (/ y z) y))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -38000.0) || !(z <= 0.75)) {
		tmp = (y / z) / (z * (z / x));
	} 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 <= (-38000.0d0)) .or. (.not. (z <= 0.75d0))) then
        tmp = (y / z) / (z * (z / x))
    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 <= -38000.0) || !(z <= 0.75)) {
		tmp = (y / z) / (z * (z / x));
	} else {
		tmp = (x / z) * ((y / z) - y);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -38000.0) or not (z <= 0.75):
		tmp = (y / z) / (z * (z / x))
	else:
		tmp = (x / z) * ((y / z) - y)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -38000.0) || !(z <= 0.75))
		tmp = Float64(Float64(y / z) / Float64(z * Float64(z / x)));
	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 <= -38000.0) || ~((z <= 0.75)))
		tmp = (y / z) / (z * (z / x));
	else
		tmp = (x / z) * ((y / z) - y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -38000.0], N[Not[LessEqual[z, 0.75]], $MachinePrecision]], N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $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 -38000 \lor \neg \left(z \leq 0.75\right):\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\

\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 < -38000 or 0.75 < z

    1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{z \cdot \color{blue}{\frac{z \cdot z}{y}}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity88.8%

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

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

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

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

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

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

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

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

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

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

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

    if -38000 < z < 0.75

    1. Initial program 79.7%

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

        \[\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 95.0%

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

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

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

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

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

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

Alternative 8: 97.3% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{y \cdot \frac{x}{z}}{\color{blue}{z \cdot z + z}} \]
    4. distribute-lft1-in92.7%

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

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

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

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

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

Alternative 9: 96.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{y \cdot \frac{x}{z}}{\color{blue}{z \cdot z + z}} \]
    4. distribute-lft1-in92.7%

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

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

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

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

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

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

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

Alternative 10: 75.8% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 81.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000018e-11 < y

    1. Initial program 83.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 75.9% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{+33}:\\ \;\;\;\;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 -2e+33) (* x (/ y (* z z))) (* (/ x z) (/ y z))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -2e+33) {
		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 <= (-2d+33)) 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 <= -2e+33) {
		tmp = x * (y / (z * z));
	} else {
		tmp = (x / z) * (y / z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -2e+33:
		tmp = x * (y / (z * z))
	else:
		tmp = (x / z) * (y / z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -2e+33)
		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 <= -2e+33)
		tmp = x * (y / (z * z));
	else
		tmp = (x / z) * (y / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -2e+33], 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 -2 \cdot 10^{+33}:\\
\;\;\;\;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.9999999999999999e33

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e33 < x

    1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 75.3% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 85.4%

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

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

        \[\leadsto \frac{\color{blue}{\frac{x}{\frac{1}{y}}}}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
      3. associate-/l/85.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*87.7%

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

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

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

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

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

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

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

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

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

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

    if -4.5000000000000001e-76 < x

    1. Initial program 79.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 38.8% accurate, 1.4× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.99999999999979e-311 < z

    1. Initial program 81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 31.1% accurate, 1.6× speedup?

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

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

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


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

    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-frac95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{z}{\sqrt{\color{blue}{y \cdot y}} \cdot x}} \]
      7. sqrt-unprod12.8%

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

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

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

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

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

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

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

    if 5.0000000000000002e166 < y

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 71.4% accurate, 1.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 30.4% 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 81.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 95.4% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023195 
(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))))