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

Percentage Accurate: 83.3% → 96.6%
Time: 10.1s
Alternatives: 15
Speedup: 0.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 83.3% 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.6% accurate, 0.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 z z) (+.f64 z 1)) < 2.00000000000000017e-211 or 2.00000000000000006e257 < (*.f64 (*.f64 z z) (+.f64 z 1))

    1. Initial program 77.0%

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

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

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

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

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

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

    if 2.00000000000000017e-211 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 2.00000000000000006e257

    1. Initial program 99.4%

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

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

Alternative 2: 95.7% accurate, 0.3× speedup?

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

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

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

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

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


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

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e15 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 5.0000000000000003e-185

    1. Initial program 75.4%

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000003e-185 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 2.00000000000000006e257

    1. Initial program 99.3%

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

    if 2.00000000000000006e257 < (*.f64 (*.f64 z z) (+.f64 z 1))

    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. sqr-neg81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\frac{z}{y} \cdot \left(z \cdot \frac{z}{x}\right)\right)}^{-1}} \]
    9. Step-by-step derivation
      1. unpow-195.9%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{x}{z} \cdot 1}{z}}}{\frac{z}{y}} \]
      10. *-rgt-identity95.9%

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

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

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

Alternative 3: 94.6% accurate, 0.4× speedup?

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

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

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

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


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

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e15 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 5.0000000000000003e-185

    1. Initial program 75.4%

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000003e-185 < (*.f64 (*.f64 z z) (+.f64 z 1))

    1. Initial program 90.0%

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

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

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

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

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

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

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

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

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

Alternative 4: 94.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-92} \lor \neg \left(z \leq 5.8 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{y}{z \cdot \left(z \cdot \frac{z + 1}{x}\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.6e-92 or 5.80000000000000037e-15 < z

    1. Initial program 84.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{-z \cdot z}} \cdot \frac{x}{z + 1} \]
      2. div-inv87.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.6e-92 < z < 5.80000000000000037e-15

    1. Initial program 77.9%

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

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

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

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

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

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

      \[\leadsto \frac{y}{z \cdot z} \cdot \color{blue}{x} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt31.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\frac{\frac{y}{z}}{\frac{1}{x}}}{z}} \]
      14. distribute-neg-frac1.4%

        \[\leadsto \color{blue}{\frac{-\frac{\frac{y}{z}}{\frac{1}{x}}}{z}} \]
      15. div-inv1.4%

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

        \[\leadsto \frac{-\frac{y}{z} \cdot \color{blue}{\frac{x}{1}}}{z} \]
      17. /-rgt-identity1.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 93.1% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 82.6%

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

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

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

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

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

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

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

    if -1 < z < 1

    1. Initial program 80.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 92.2% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 1

    1. Initial program 80.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 92.4% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 1

    1. Initial program 80.8%

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

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

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

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

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

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

      \[\leadsto \frac{y}{z \cdot z} \cdot \color{blue}{x} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt32.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\frac{\frac{y}{z}}{\frac{1}{x}}}{z}} \]
      14. distribute-neg-frac1.4%

        \[\leadsto \color{blue}{\frac{-\frac{\frac{y}{z}}{\frac{1}{x}}}{z}} \]
      15. div-inv1.4%

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

        \[\leadsto \frac{-\frac{y}{z} \cdot \color{blue}{\frac{x}{1}}}{z} \]
      17. /-rgt-identity1.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 95.1% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 1

    1. Initial program 80.8%

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

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

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

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

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

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

      \[\leadsto \frac{y}{z \cdot z} \cdot \color{blue}{x} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt32.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\frac{\frac{y}{z}}{\frac{1}{x}}}{z}} \]
      14. distribute-neg-frac1.4%

        \[\leadsto \color{blue}{\frac{-\frac{\frac{y}{z}}{\frac{1}{x}}}{z}} \]
      15. div-inv1.4%

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

        \[\leadsto \frac{-\frac{y}{z} \cdot \color{blue}{\frac{x}{1}}}{z} \]
      17. /-rgt-identity1.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 92.7% accurate, 0.8× speedup?

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

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

\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 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 1

    1. Initial program 80.8%

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

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

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

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

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

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

      \[\leadsto \frac{y}{z \cdot z} \cdot \color{blue}{x} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt32.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\frac{\frac{y}{z}}{\frac{1}{x}}}{z}} \]
      14. distribute-neg-frac1.4%

        \[\leadsto \color{blue}{\frac{-\frac{\frac{y}{z}}{\frac{1}{x}}}{z}} \]
      15. div-inv1.4%

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

        \[\leadsto \frac{-\frac{y}{z} \cdot \color{blue}{\frac{x}{1}}}{z} \]
      17. /-rgt-identity1.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1 < z

    1. Initial program 85.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 93.9% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 1

    1. Initial program 80.8%

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

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

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

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

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

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

      \[\leadsto \frac{y}{z \cdot z} \cdot \color{blue}{x} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt32.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\frac{\frac{y}{z}}{\frac{1}{x}}}{z}} \]
      14. distribute-neg-frac1.4%

        \[\leadsto \color{blue}{\frac{-\frac{\frac{y}{z}}{\frac{1}{x}}}{z}} \]
      15. div-inv1.4%

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

        \[\leadsto \frac{-\frac{y}{z} \cdot \color{blue}{\frac{x}{1}}}{z} \]
      17. /-rgt-identity1.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1 < z

    1. Initial program 85.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 73.3% accurate, 1.2× speedup?

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

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

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


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

    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. sqr-neg81.1%

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

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

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

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

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

    if -9.99999999999999939e-12 < x

    1. Initial program 81.9%

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

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

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

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

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

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

Alternative 12: 75.9% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 83.1%

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

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

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

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

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

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

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

    if -3.4999999999999999e-78 < x

    1. Initial program 81.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 76.1% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 80.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.20000000000000014e-126 < y

    1. Initial program 85.3%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{x}{\left(z \cdot z\right) \cdot \left(z + 1\right)}} \]
      3. sqr-neg87.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*86.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*87.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 76.3% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 80.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.1e-133 < y

    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. *-commutative85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 71.9% accurate, 1.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 95.7% 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 2023290 
(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))))