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

Percentage Accurate: 82.9% → 97.2%
Time: 10.4s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 82.9% 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: 97.2% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 93.2% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 0.76000000000000001

    1. Initial program 82.9%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 0.76\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 3: 95.3% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 0.76000000000000001

    1. Initial program 82.9%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 0.76\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 4: 95.4% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 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-frac93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 0.76000000000000001

    1. Initial program 82.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.76000000000000001 < z

    1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 95.3% accurate, 0.8× speedup?

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

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

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

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


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

    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-frac93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 0.76000000000000001

    1. Initial program 82.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.76000000000000001 < z

    1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 95.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-151}:\\
\;\;\;\;\frac{y}{z + 1} \cdot \frac{\frac{x}{z}}{z}\\

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

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


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

    1. Initial program 86.5%

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

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

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

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

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

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

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

    if -2.90000000000000013e-151 < z < 1

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1 < z

    1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 76.8% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -9.99999999999999977e37

    1. Initial program 84.9%

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

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

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

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

    if -9.99999999999999977e37 < (*.f64 x y)

    1. Initial program 84.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 76.8% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -9.99999999999999977e37

    1. Initial program 84.9%

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

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

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

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

    if -9.99999999999999977e37 < (*.f64 x y)

    1. Initial program 84.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 76.3% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

    if 1.65000000000000008e-43 < y

    1. Initial program 83.5%

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

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

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

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

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

Alternative 10: 76.1% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 89.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{y}{z}}}} \]
    7. Step-by-step derivation
      1. div-inv78.4%

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

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

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

    if -1.5000000000000001e-36 < x

    1. Initial program 83.4%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 -1.5 \cdot 10^{-36}:\\ \;\;\;\;x \cdot \frac{\frac{y}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\ \end{array} \]

Alternative 11: 76.2% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 90.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999999945e-21 < x

    1. Initial program 83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 76.5% accurate, 1.2× speedup?

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

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2000000000000001e-26 < y

    1. Initial program 82.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 73.5% accurate, 1.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 95.6% 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 2023221 
(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))))