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

Percentage Accurate: 83.5% → 96.9%
Time: 9.9s
Alternatives: 14
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 14 alternatives:

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.8% accurate, 0.8× speedup?

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

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

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


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

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

        \[\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. associate-/r*97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 0.75

    1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 95.1% accurate, 0.8× speedup?

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

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

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


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

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

        \[\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. associate-/r*97.4%

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 0.76000000000000001

    1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 80.0% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{z \cdot \left(-z\right)}} \]
      3. *-rgt-identity64.8%

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

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

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

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

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

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

    if -1 < z < 0.619999999999999996

    1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.619999999999999996 < z

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

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

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

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

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

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

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

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

Alternative 5: 94.0% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 0.75

    1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.75 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-\frac{y}{z} \cdot x}{-z \cdot z}} \]
      3. distribute-lft-neg-out96.6%

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

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

        \[\leadsto \frac{\color{blue}{x \cdot \frac{-y}{z}}}{-z \cdot z} \]
      6. add-sqr-sqrt57.7%

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

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

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

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

        \[\leadsto \frac{x \cdot \frac{\color{blue}{y}}{z}}{-z \cdot z} \]
      11. distribute-rgt-neg-out65.7%

        \[\leadsto \frac{x \cdot \frac{y}{z}}{\color{blue}{z \cdot \left(-z\right)}} \]
      12. add-sqr-sqrt0.0%

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

        \[\leadsto \frac{x \cdot \frac{y}{z}}{\color{blue}{\sqrt{\left(z \cdot \left(-z\right)\right) \cdot \left(z \cdot \left(-z\right)\right)}}} \]
      14. swap-sqr81.4%

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

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

        \[\leadsto \frac{x \cdot \frac{y}{z}}{\color{blue}{\sqrt{z \cdot z} \cdot \sqrt{z \cdot z}}} \]
      17. add-sqr-sqrt96.6%

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

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

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

Alternative 6: 76.7% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 87.7%

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

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

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

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

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

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

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

    if -3.15e19 < x < -5.00000000000000013e-301

    1. Initial program 81.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000013e-301 < x

    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. *-commutative81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 76.8% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq -7 \cdot 10^{-301}:\\
\;\;\;\;\frac{\frac{y}{z}}{\frac{z}{x}}\\

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


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

    1. Initial program 87.9%

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

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

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

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

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

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

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

    if -2.2e9 < x < -6.99999999999999984e-301

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.99999999999999984e-301 < x

    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. *-commutative81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 78.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;z \leq 2.55 \cdot 10^{-144}:\\
\;\;\;\;\frac{\frac{y}{z}}{\frac{z}{x}}\\

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


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

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{z \cdot \left(-z\right)}} \]
      3. *-rgt-identity64.8%

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

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

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

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

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

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

    if -1 < z < 2.55e-144

    1. Initial program 78.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.55e-144 < z

    1. Initial program 84.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 96.3% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 41.6% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 82.7%

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*82.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. associate-/r*97.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{z} \cdot \frac{y}{z} + \frac{\color{blue}{-x \cdot y}}{z} \]
      7. distribute-rgt-neg-out43.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{-y}{z}} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt14.4%

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

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

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

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

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

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

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

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

    if -1 < z < -1.999999999999994e-310

    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-frac98.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{z} \cdot \frac{y}{z} + \frac{\color{blue}{-x \cdot y}}{z} \]
      7. distribute-rgt-neg-out97.7%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \left(-\frac{y}{z}\right)} \]
      5. distribute-neg-frac36.3%

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

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

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

Alternative 11: 76.2% accurate, 1.2× speedup?

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

    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-frac97.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.2e87 < y

    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. *-commutative80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 72.6% 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 82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 31.8% 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 82.8%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{z} \cdot \frac{y}{z} + \frac{\color{blue}{-x \cdot y}}{z} \]
    7. distribute-rgt-neg-out57.6%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x \cdot \frac{-y}{z}} \]
  10. Step-by-step derivation
    1. expm1-log1p-u27.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 31.9% accurate, 2.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{z} \cdot \frac{y}{z} + \frac{\color{blue}{-x \cdot y}}{z} \]
    7. distribute-rgt-neg-out57.6%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x \cdot \frac{-y}{z}} \]
  10. Step-by-step derivation
    1. add-sqr-sqrt14.8%

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

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

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

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

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

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

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

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

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

Developer target: 95.1% 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 2023268 
(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))))