Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, D

Percentage Accurate: 99.5% → 99.8%
Time: 15.0s
Alternatives: 17
Speedup: 1.2×

Specification

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

\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 99.5% accurate, 1.0× speedup?

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

\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}

Alternative 1: 99.8% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right) \end{array} \]
(FPCore (x y z) :precision binary64 (fma (- y x) (+ 4.0 (* z -6.0)) x))
double code(double x, double y, double z) {
	return fma((y - x), (4.0 + (z * -6.0)), x);
}
function code(x, y, z)
	return fma(Float64(y - x), Float64(4.0 + Float64(z * -6.0)), x)
end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right)
\end{array}
Derivation
  1. Initial program 99.6%

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

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

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

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

      \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
    5. distribute-rgt-in99.8%

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

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{0.6666666666666666} \cdot 6 + \left(-z\right) \cdot 6, x\right) \]
    7. metadata-eval99.8%

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
    8. distribute-lft-neg-out99.8%

      \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
    9. distribute-rgt-neg-in99.8%

      \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{z \cdot \left(-6\right)}, x\right) \]
    10. metadata-eval99.8%

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right)} \]
  4. Add Preprocessing
  5. Final simplification99.8%

    \[\leadsto \mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right) \]
  6. Add Preprocessing

Alternative 2: 50.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ t_1 := 6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -4.5 \cdot 10^{+68}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+28}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-15}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-228}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-273}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-81}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{-20}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.52:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+125}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))) (t_1 (* 6.0 (* x z))))
   (if (<= z -4.5e+68)
     t_0
     (if (<= z -1.5e+28)
       t_1
       (if (<= z -7e-15)
         (* y 4.0)
         (if (<= z -1e-228)
           (* x -3.0)
           (if (<= z 5.6e-273)
             (* y 4.0)
             (if (<= z 1.4e-81)
               (* x -3.0)
               (if (<= z 1.5e-20)
                 (* y 4.0)
                 (if (<= z 0.52)
                   (* x -3.0)
                   (if (<= z 9e+125) t_0 t_1)))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -4.5e+68) {
		tmp = t_0;
	} else if (z <= -1.5e+28) {
		tmp = t_1;
	} else if (z <= -7e-15) {
		tmp = y * 4.0;
	} else if (z <= -1e-228) {
		tmp = x * -3.0;
	} else if (z <= 5.6e-273) {
		tmp = y * 4.0;
	} else if (z <= 1.4e-81) {
		tmp = x * -3.0;
	} else if (z <= 1.5e-20) {
		tmp = y * 4.0;
	} else if (z <= 0.52) {
		tmp = x * -3.0;
	} else if (z <= 9e+125) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	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) :: t_1
    real(8) :: tmp
    t_0 = (-6.0d0) * (y * z)
    t_1 = 6.0d0 * (x * z)
    if (z <= (-4.5d+68)) then
        tmp = t_0
    else if (z <= (-1.5d+28)) then
        tmp = t_1
    else if (z <= (-7d-15)) then
        tmp = y * 4.0d0
    else if (z <= (-1d-228)) then
        tmp = x * (-3.0d0)
    else if (z <= 5.6d-273) then
        tmp = y * 4.0d0
    else if (z <= 1.4d-81) then
        tmp = x * (-3.0d0)
    else if (z <= 1.5d-20) then
        tmp = y * 4.0d0
    else if (z <= 0.52d0) then
        tmp = x * (-3.0d0)
    else if (z <= 9d+125) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -4.5e+68) {
		tmp = t_0;
	} else if (z <= -1.5e+28) {
		tmp = t_1;
	} else if (z <= -7e-15) {
		tmp = y * 4.0;
	} else if (z <= -1e-228) {
		tmp = x * -3.0;
	} else if (z <= 5.6e-273) {
		tmp = y * 4.0;
	} else if (z <= 1.4e-81) {
		tmp = x * -3.0;
	} else if (z <= 1.5e-20) {
		tmp = y * 4.0;
	} else if (z <= 0.52) {
		tmp = x * -3.0;
	} else if (z <= 9e+125) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	t_1 = 6.0 * (x * z)
	tmp = 0
	if z <= -4.5e+68:
		tmp = t_0
	elif z <= -1.5e+28:
		tmp = t_1
	elif z <= -7e-15:
		tmp = y * 4.0
	elif z <= -1e-228:
		tmp = x * -3.0
	elif z <= 5.6e-273:
		tmp = y * 4.0
	elif z <= 1.4e-81:
		tmp = x * -3.0
	elif z <= 1.5e-20:
		tmp = y * 4.0
	elif z <= 0.52:
		tmp = x * -3.0
	elif z <= 9e+125:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	t_1 = Float64(6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -4.5e+68)
		tmp = t_0;
	elseif (z <= -1.5e+28)
		tmp = t_1;
	elseif (z <= -7e-15)
		tmp = Float64(y * 4.0);
	elseif (z <= -1e-228)
		tmp = Float64(x * -3.0);
	elseif (z <= 5.6e-273)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.4e-81)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.5e-20)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.52)
		tmp = Float64(x * -3.0);
	elseif (z <= 9e+125)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	t_1 = 6.0 * (x * z);
	tmp = 0.0;
	if (z <= -4.5e+68)
		tmp = t_0;
	elseif (z <= -1.5e+28)
		tmp = t_1;
	elseif (z <= -7e-15)
		tmp = y * 4.0;
	elseif (z <= -1e-228)
		tmp = x * -3.0;
	elseif (z <= 5.6e-273)
		tmp = y * 4.0;
	elseif (z <= 1.4e-81)
		tmp = x * -3.0;
	elseif (z <= 1.5e-20)
		tmp = y * 4.0;
	elseif (z <= 0.52)
		tmp = x * -3.0;
	elseif (z <= 9e+125)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e+68], t$95$0, If[LessEqual[z, -1.5e+28], t$95$1, If[LessEqual[z, -7e-15], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1e-228], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 5.6e-273], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.4e-81], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.5e-20], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.52], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 9e+125], t$95$0, t$95$1]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
t_1 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+68}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -1.5 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -7 \cdot 10^{-15}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq -1 \cdot 10^{-228}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 5.6 \cdot 10^{-273}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 1.4 \cdot 10^{-81}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 1.5 \cdot 10^{-20}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 0.52:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 9 \cdot 10^{+125}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.5000000000000003e68 or 0.52000000000000002 < z < 9.0000000000000001e125

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.7%

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

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

      \[\leadsto \color{blue}{-6 \cdot \left(y \cdot z\right)} \]
    8. Step-by-step derivation
      1. *-commutative63.6%

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

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

    if -4.5000000000000003e68 < z < -1.5e28 or 9.0000000000000001e125 < z

    1. Initial program 100.0%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 66.4%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg66.4%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      2. distribute-rgt-in66.4%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      3. metadata-eval66.4%

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

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
      5. neg-mul-166.4%

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

        \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{-1 \cdot \left(z \cdot -6\right)}\right)\right) \]
      7. *-commutative66.4%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-1 \cdot 4 + -1 \cdot \left(-6 \cdot z\right)\right)}\right) \]
      10. metadata-eval66.4%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      11. metadata-eval66.4%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      12. associate-+r+66.4%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + -1 \cdot \left(-6 \cdot z\right)\right)} \]
      13. metadata-eval66.4%

        \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + -1 \cdot \left(-6 \cdot z\right)\right) \]
      14. metadata-eval66.4%

        \[\leadsto x \cdot \left(\color{blue}{-3} + -1 \cdot \left(-6 \cdot z\right)\right) \]
      15. associate-*r*66.4%

        \[\leadsto x \cdot \left(-3 + \color{blue}{\left(-1 \cdot -6\right) \cdot z}\right) \]
      16. metadata-eval66.4%

        \[\leadsto x \cdot \left(-3 + \color{blue}{6} \cdot z\right) \]
      17. *-commutative66.4%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot 6}\right) \]
    7. Simplified66.4%

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
    8. Step-by-step derivation
      1. flip-+64.3%

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

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

        \[\leadsto \frac{x \cdot \left(\color{blue}{9} - \left(z \cdot 6\right) \cdot \left(z \cdot 6\right)\right)}{-3 - z \cdot 6} \]
      4. swap-sqr55.6%

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

        \[\leadsto \frac{x \cdot \left(9 - \color{blue}{{z}^{2}} \cdot \left(6 \cdot 6\right)\right)}{-3 - z \cdot 6} \]
      6. metadata-eval55.6%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot \color{blue}{36}\right)}{-3 - z \cdot 6} \]
      7. *-commutative55.6%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{-3 - \color{blue}{6 \cdot z}} \]
      8. cancel-sign-sub-inv55.6%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{\color{blue}{-3 + \left(-6\right) \cdot z}} \]
      9. metadata-eval55.6%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{-3 + \color{blue}{-6} \cdot z} \]
    9. Applied egg-rr55.6%

      \[\leadsto \color{blue}{\frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{-3 + -6 \cdot z}} \]
    10. Step-by-step derivation
      1. associate-/l*64.3%

        \[\leadsto \color{blue}{\frac{x}{\frac{-3 + -6 \cdot z}{9 - {z}^{2} \cdot 36}}} \]
      2. +-commutative64.3%

        \[\leadsto \frac{x}{\frac{\color{blue}{-6 \cdot z + -3}}{9 - {z}^{2} \cdot 36}} \]
      3. *-commutative64.3%

        \[\leadsto \frac{x}{\frac{\color{blue}{z \cdot -6} + -3}{9 - {z}^{2} \cdot 36}} \]
    11. Simplified64.3%

      \[\leadsto \color{blue}{\frac{x}{\frac{z \cdot -6 + -3}{9 - {z}^{2} \cdot 36}}} \]
    12. Taylor expanded in z around inf 66.4%

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

    if -1.5e28 < z < -7.0000000000000001e-15 or -1.00000000000000003e-228 < z < 5.59999999999999971e-273 or 1.3999999999999999e-81 < z < 1.50000000000000014e-20

    1. Initial program 99.4%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add099.4%

        \[\leadsto x + \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) + 0\right)} \]
      2. associate-*l*99.8%

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

      \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right) + 0\right)} \]
    7. Taylor expanded in x around 0 62.6%

      \[\leadsto \color{blue}{6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)} \]
    8. Taylor expanded in z around 0 57.2%

      \[\leadsto \color{blue}{4 \cdot y} \]
    9. Step-by-step derivation
      1. *-commutative57.2%

        \[\leadsto \color{blue}{y \cdot 4} \]
    10. Simplified57.2%

      \[\leadsto \color{blue}{y \cdot 4} \]

    if -7.0000000000000001e-15 < z < -1.00000000000000003e-228 or 5.59999999999999971e-273 < z < 1.3999999999999999e-81 or 1.50000000000000014e-20 < z < 0.52000000000000002

    1. Initial program 99.4%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 63.4%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg63.4%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      2. distribute-rgt-in63.5%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      3. metadata-eval63.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      4. metadata-eval63.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
      5. neg-mul-163.5%

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

        \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{-1 \cdot \left(z \cdot -6\right)}\right)\right) \]
      7. *-commutative63.5%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-1 \cdot 4 + -1 \cdot \left(-6 \cdot z\right)\right)}\right) \]
      10. metadata-eval63.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      11. metadata-eval63.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      12. associate-+r+63.5%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + -1 \cdot \left(-6 \cdot z\right)\right)} \]
      13. metadata-eval63.5%

        \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + -1 \cdot \left(-6 \cdot z\right)\right) \]
      14. metadata-eval63.5%

        \[\leadsto x \cdot \left(\color{blue}{-3} + -1 \cdot \left(-6 \cdot z\right)\right) \]
      15. associate-*r*63.5%

        \[\leadsto x \cdot \left(-3 + \color{blue}{\left(-1 \cdot -6\right) \cdot z}\right) \]
      16. metadata-eval63.5%

        \[\leadsto x \cdot \left(-3 + \color{blue}{6} \cdot z\right) \]
      17. *-commutative63.5%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot 6}\right) \]
    7. Simplified63.5%

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
    8. Taylor expanded in z around 0 62.7%

      \[\leadsto \color{blue}{-3 \cdot x} \]
    9. Step-by-step derivation
      1. *-commutative62.7%

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified62.7%

      \[\leadsto \color{blue}{x \cdot -3} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification62.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+68}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+28}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-15}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-228}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-273}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-81}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{-20}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.52:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+125}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 50.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -2.9 \cdot 10^{+72}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+28}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -6.4 \cdot 10^{-16}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-229}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{-273}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{-82}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-21}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.55:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+126}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))))
   (if (<= z -2.9e+72)
     t_0
     (if (<= z -1.5e+28)
       (* 6.0 (* x z))
       (if (<= z -6.4e-16)
         (* y 4.0)
         (if (<= z -1.4e-229)
           (* x -3.0)
           (if (<= z 5.2e-273)
             (* y 4.0)
             (if (<= z 7.8e-82)
               (* x -3.0)
               (if (<= z 5e-21)
                 (* y 4.0)
                 (if (<= z 0.55)
                   (* x -3.0)
                   (if (<= z 6.2e+126) t_0 (* x (* z 6.0)))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double tmp;
	if (z <= -2.9e+72) {
		tmp = t_0;
	} else if (z <= -1.5e+28) {
		tmp = 6.0 * (x * z);
	} else if (z <= -6.4e-16) {
		tmp = y * 4.0;
	} else if (z <= -1.4e-229) {
		tmp = x * -3.0;
	} else if (z <= 5.2e-273) {
		tmp = y * 4.0;
	} else if (z <= 7.8e-82) {
		tmp = x * -3.0;
	} else if (z <= 5e-21) {
		tmp = y * 4.0;
	} else if (z <= 0.55) {
		tmp = x * -3.0;
	} else if (z <= 6.2e+126) {
		tmp = t_0;
	} else {
		tmp = x * (z * 6.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 = (-6.0d0) * (y * z)
    if (z <= (-2.9d+72)) then
        tmp = t_0
    else if (z <= (-1.5d+28)) then
        tmp = 6.0d0 * (x * z)
    else if (z <= (-6.4d-16)) then
        tmp = y * 4.0d0
    else if (z <= (-1.4d-229)) then
        tmp = x * (-3.0d0)
    else if (z <= 5.2d-273) then
        tmp = y * 4.0d0
    else if (z <= 7.8d-82) then
        tmp = x * (-3.0d0)
    else if (z <= 5d-21) then
        tmp = y * 4.0d0
    else if (z <= 0.55d0) then
        tmp = x * (-3.0d0)
    else if (z <= 6.2d+126) then
        tmp = t_0
    else
        tmp = x * (z * 6.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double tmp;
	if (z <= -2.9e+72) {
		tmp = t_0;
	} else if (z <= -1.5e+28) {
		tmp = 6.0 * (x * z);
	} else if (z <= -6.4e-16) {
		tmp = y * 4.0;
	} else if (z <= -1.4e-229) {
		tmp = x * -3.0;
	} else if (z <= 5.2e-273) {
		tmp = y * 4.0;
	} else if (z <= 7.8e-82) {
		tmp = x * -3.0;
	} else if (z <= 5e-21) {
		tmp = y * 4.0;
	} else if (z <= 0.55) {
		tmp = x * -3.0;
	} else if (z <= 6.2e+126) {
		tmp = t_0;
	} else {
		tmp = x * (z * 6.0);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	tmp = 0
	if z <= -2.9e+72:
		tmp = t_0
	elif z <= -1.5e+28:
		tmp = 6.0 * (x * z)
	elif z <= -6.4e-16:
		tmp = y * 4.0
	elif z <= -1.4e-229:
		tmp = x * -3.0
	elif z <= 5.2e-273:
		tmp = y * 4.0
	elif z <= 7.8e-82:
		tmp = x * -3.0
	elif z <= 5e-21:
		tmp = y * 4.0
	elif z <= 0.55:
		tmp = x * -3.0
	elif z <= 6.2e+126:
		tmp = t_0
	else:
		tmp = x * (z * 6.0)
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -2.9e+72)
		tmp = t_0;
	elseif (z <= -1.5e+28)
		tmp = Float64(6.0 * Float64(x * z));
	elseif (z <= -6.4e-16)
		tmp = Float64(y * 4.0);
	elseif (z <= -1.4e-229)
		tmp = Float64(x * -3.0);
	elseif (z <= 5.2e-273)
		tmp = Float64(y * 4.0);
	elseif (z <= 7.8e-82)
		tmp = Float64(x * -3.0);
	elseif (z <= 5e-21)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.55)
		tmp = Float64(x * -3.0);
	elseif (z <= 6.2e+126)
		tmp = t_0;
	else
		tmp = Float64(x * Float64(z * 6.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	tmp = 0.0;
	if (z <= -2.9e+72)
		tmp = t_0;
	elseif (z <= -1.5e+28)
		tmp = 6.0 * (x * z);
	elseif (z <= -6.4e-16)
		tmp = y * 4.0;
	elseif (z <= -1.4e-229)
		tmp = x * -3.0;
	elseif (z <= 5.2e-273)
		tmp = y * 4.0;
	elseif (z <= 7.8e-82)
		tmp = x * -3.0;
	elseif (z <= 5e-21)
		tmp = y * 4.0;
	elseif (z <= 0.55)
		tmp = x * -3.0;
	elseif (z <= 6.2e+126)
		tmp = t_0;
	else
		tmp = x * (z * 6.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e+72], t$95$0, If[LessEqual[z, -1.5e+28], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.4e-16], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.4e-229], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 5.2e-273], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7.8e-82], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 5e-21], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.55], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.2e+126], t$95$0, N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+72}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -1.5 \cdot 10^{+28}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\

\mathbf{elif}\;z \leq -6.4 \cdot 10^{-16}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq -1.4 \cdot 10^{-229}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 5.2 \cdot 10^{-273}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 7.8 \cdot 10^{-82}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 5 \cdot 10^{-21}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 0.55:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 6.2 \cdot 10^{+126}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.90000000000000017e72 or 0.55000000000000004 < z < 6.2e126

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.7%

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

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

      \[\leadsto \color{blue}{-6 \cdot \left(y \cdot z\right)} \]
    8. Step-by-step derivation
      1. *-commutative63.6%

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

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

    if -2.90000000000000017e72 < z < -1.5e28

    1. Initial program 100.0%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 73.2%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg73.2%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      2. distribute-rgt-in73.2%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      3. metadata-eval73.2%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      4. metadata-eval73.2%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
      5. neg-mul-173.2%

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

        \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{-1 \cdot \left(z \cdot -6\right)}\right)\right) \]
      7. *-commutative73.2%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-1 \cdot 4 + -1 \cdot \left(-6 \cdot z\right)\right)}\right) \]
      10. metadata-eval73.2%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      11. metadata-eval73.2%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      12. associate-+r+73.2%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + -1 \cdot \left(-6 \cdot z\right)\right)} \]
      13. metadata-eval73.2%

        \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + -1 \cdot \left(-6 \cdot z\right)\right) \]
      14. metadata-eval73.2%

        \[\leadsto x \cdot \left(\color{blue}{-3} + -1 \cdot \left(-6 \cdot z\right)\right) \]
      15. associate-*r*73.2%

        \[\leadsto x \cdot \left(-3 + \color{blue}{\left(-1 \cdot -6\right) \cdot z}\right) \]
      16. metadata-eval73.2%

        \[\leadsto x \cdot \left(-3 + \color{blue}{6} \cdot z\right) \]
      17. *-commutative73.2%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot 6}\right) \]
    7. Simplified73.2%

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
    8. Step-by-step derivation
      1. flip-+73.2%

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

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

        \[\leadsto \frac{x \cdot \left(\color{blue}{9} - \left(z \cdot 6\right) \cdot \left(z \cdot 6\right)\right)}{-3 - z \cdot 6} \]
      4. swap-sqr56.9%

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

        \[\leadsto \frac{x \cdot \left(9 - \color{blue}{{z}^{2}} \cdot \left(6 \cdot 6\right)\right)}{-3 - z \cdot 6} \]
      6. metadata-eval56.9%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot \color{blue}{36}\right)}{-3 - z \cdot 6} \]
      7. *-commutative56.9%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{-3 - \color{blue}{6 \cdot z}} \]
      8. cancel-sign-sub-inv56.9%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{\color{blue}{-3 + \left(-6\right) \cdot z}} \]
      9. metadata-eval56.9%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{-3 + \color{blue}{-6} \cdot z} \]
    9. Applied egg-rr56.9%

      \[\leadsto \color{blue}{\frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{-3 + -6 \cdot z}} \]
    10. Step-by-step derivation
      1. associate-/l*73.2%

        \[\leadsto \color{blue}{\frac{x}{\frac{-3 + -6 \cdot z}{9 - {z}^{2} \cdot 36}}} \]
      2. +-commutative73.2%

        \[\leadsto \frac{x}{\frac{\color{blue}{-6 \cdot z + -3}}{9 - {z}^{2} \cdot 36}} \]
      3. *-commutative73.2%

        \[\leadsto \frac{x}{\frac{\color{blue}{z \cdot -6} + -3}{9 - {z}^{2} \cdot 36}} \]
    11. Simplified73.2%

      \[\leadsto \color{blue}{\frac{x}{\frac{z \cdot -6 + -3}{9 - {z}^{2} \cdot 36}}} \]
    12. Taylor expanded in z around inf 73.4%

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

    if -1.5e28 < z < -6.40000000000000046e-16 or -1.39999999999999995e-229 < z < 5.19999999999999967e-273 or 7.79999999999999947e-82 < z < 4.99999999999999973e-21

    1. Initial program 99.4%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add099.4%

        \[\leadsto x + \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) + 0\right)} \]
      2. associate-*l*99.8%

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

      \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right) + 0\right)} \]
    7. Taylor expanded in x around 0 62.6%

      \[\leadsto \color{blue}{6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)} \]
    8. Taylor expanded in z around 0 57.2%

      \[\leadsto \color{blue}{4 \cdot y} \]
    9. Step-by-step derivation
      1. *-commutative57.2%

        \[\leadsto \color{blue}{y \cdot 4} \]
    10. Simplified57.2%

      \[\leadsto \color{blue}{y \cdot 4} \]

    if -6.40000000000000046e-16 < z < -1.39999999999999995e-229 or 5.19999999999999967e-273 < z < 7.79999999999999947e-82 or 4.99999999999999973e-21 < z < 0.55000000000000004

    1. Initial program 99.4%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 63.4%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg63.4%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      2. distribute-rgt-in63.5%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      3. metadata-eval63.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      4. metadata-eval63.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
      5. neg-mul-163.5%

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

        \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{-1 \cdot \left(z \cdot -6\right)}\right)\right) \]
      7. *-commutative63.5%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-1 \cdot 4 + -1 \cdot \left(-6 \cdot z\right)\right)}\right) \]
      10. metadata-eval63.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      11. metadata-eval63.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      12. associate-+r+63.5%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + -1 \cdot \left(-6 \cdot z\right)\right)} \]
      13. metadata-eval63.5%

        \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + -1 \cdot \left(-6 \cdot z\right)\right) \]
      14. metadata-eval63.5%

        \[\leadsto x \cdot \left(\color{blue}{-3} + -1 \cdot \left(-6 \cdot z\right)\right) \]
      15. associate-*r*63.5%

        \[\leadsto x \cdot \left(-3 + \color{blue}{\left(-1 \cdot -6\right) \cdot z}\right) \]
      16. metadata-eval63.5%

        \[\leadsto x \cdot \left(-3 + \color{blue}{6} \cdot z\right) \]
      17. *-commutative63.5%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot 6}\right) \]
    7. Simplified63.5%

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
    8. Taylor expanded in z around 0 62.7%

      \[\leadsto \color{blue}{-3 \cdot x} \]
    9. Step-by-step derivation
      1. *-commutative62.7%

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified62.7%

      \[\leadsto \color{blue}{x \cdot -3} \]

    if 6.2e126 < z

    1. Initial program 99.9%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 63.9%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg63.9%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      2. distribute-rgt-in63.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      3. metadata-eval63.9%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      4. metadata-eval63.9%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
      5. neg-mul-163.9%

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

        \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{-1 \cdot \left(z \cdot -6\right)}\right)\right) \]
      7. *-commutative63.9%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-1 \cdot 4 + -1 \cdot \left(-6 \cdot z\right)\right)}\right) \]
      10. metadata-eval63.9%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      11. metadata-eval63.9%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      12. associate-+r+63.9%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + -1 \cdot \left(-6 \cdot z\right)\right)} \]
      13. metadata-eval63.9%

        \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + -1 \cdot \left(-6 \cdot z\right)\right) \]
      14. metadata-eval63.9%

        \[\leadsto x \cdot \left(\color{blue}{-3} + -1 \cdot \left(-6 \cdot z\right)\right) \]
      15. associate-*r*63.9%

        \[\leadsto x \cdot \left(-3 + \color{blue}{\left(-1 \cdot -6\right) \cdot z}\right) \]
      16. metadata-eval63.9%

        \[\leadsto x \cdot \left(-3 + \color{blue}{6} \cdot z\right) \]
      17. *-commutative63.9%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot 6}\right) \]
    7. Simplified63.9%

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
    8. Taylor expanded in z around inf 63.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{+72}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+28}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -6.4 \cdot 10^{-16}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-229}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{-273}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{-82}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-21}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.55:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+126}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 50.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(z \cdot -6\right)\\ \mathbf{if}\;z \leq -2.8 \cdot 10^{+74}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+28}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-15}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{-229}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-271}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-81}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-18}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.56:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{+126}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (* z -6.0))))
   (if (<= z -2.8e+74)
     t_0
     (if (<= z -1.5e+28)
       (* 6.0 (* x z))
       (if (<= z -2.9e-15)
         (* y 4.0)
         (if (<= z -6.5e-229)
           (* x -3.0)
           (if (<= z 1.6e-271)
             (* y 4.0)
             (if (<= z 3.4e-81)
               (* x -3.0)
               (if (<= z 6.2e-18)
                 (* y 4.0)
                 (if (<= z 0.56)
                   (* x -3.0)
                   (if (<= z 1.95e+126) t_0 (* x (* z 6.0)))))))))))))
double code(double x, double y, double z) {
	double t_0 = y * (z * -6.0);
	double tmp;
	if (z <= -2.8e+74) {
		tmp = t_0;
	} else if (z <= -1.5e+28) {
		tmp = 6.0 * (x * z);
	} else if (z <= -2.9e-15) {
		tmp = y * 4.0;
	} else if (z <= -6.5e-229) {
		tmp = x * -3.0;
	} else if (z <= 1.6e-271) {
		tmp = y * 4.0;
	} else if (z <= 3.4e-81) {
		tmp = x * -3.0;
	} else if (z <= 6.2e-18) {
		tmp = y * 4.0;
	} else if (z <= 0.56) {
		tmp = x * -3.0;
	} else if (z <= 1.95e+126) {
		tmp = t_0;
	} else {
		tmp = x * (z * 6.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 = y * (z * (-6.0d0))
    if (z <= (-2.8d+74)) then
        tmp = t_0
    else if (z <= (-1.5d+28)) then
        tmp = 6.0d0 * (x * z)
    else if (z <= (-2.9d-15)) then
        tmp = y * 4.0d0
    else if (z <= (-6.5d-229)) then
        tmp = x * (-3.0d0)
    else if (z <= 1.6d-271) then
        tmp = y * 4.0d0
    else if (z <= 3.4d-81) then
        tmp = x * (-3.0d0)
    else if (z <= 6.2d-18) then
        tmp = y * 4.0d0
    else if (z <= 0.56d0) then
        tmp = x * (-3.0d0)
    else if (z <= 1.95d+126) then
        tmp = t_0
    else
        tmp = x * (z * 6.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = y * (z * -6.0);
	double tmp;
	if (z <= -2.8e+74) {
		tmp = t_0;
	} else if (z <= -1.5e+28) {
		tmp = 6.0 * (x * z);
	} else if (z <= -2.9e-15) {
		tmp = y * 4.0;
	} else if (z <= -6.5e-229) {
		tmp = x * -3.0;
	} else if (z <= 1.6e-271) {
		tmp = y * 4.0;
	} else if (z <= 3.4e-81) {
		tmp = x * -3.0;
	} else if (z <= 6.2e-18) {
		tmp = y * 4.0;
	} else if (z <= 0.56) {
		tmp = x * -3.0;
	} else if (z <= 1.95e+126) {
		tmp = t_0;
	} else {
		tmp = x * (z * 6.0);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * (z * -6.0)
	tmp = 0
	if z <= -2.8e+74:
		tmp = t_0
	elif z <= -1.5e+28:
		tmp = 6.0 * (x * z)
	elif z <= -2.9e-15:
		tmp = y * 4.0
	elif z <= -6.5e-229:
		tmp = x * -3.0
	elif z <= 1.6e-271:
		tmp = y * 4.0
	elif z <= 3.4e-81:
		tmp = x * -3.0
	elif z <= 6.2e-18:
		tmp = y * 4.0
	elif z <= 0.56:
		tmp = x * -3.0
	elif z <= 1.95e+126:
		tmp = t_0
	else:
		tmp = x * (z * 6.0)
	return tmp
function code(x, y, z)
	t_0 = Float64(y * Float64(z * -6.0))
	tmp = 0.0
	if (z <= -2.8e+74)
		tmp = t_0;
	elseif (z <= -1.5e+28)
		tmp = Float64(6.0 * Float64(x * z));
	elseif (z <= -2.9e-15)
		tmp = Float64(y * 4.0);
	elseif (z <= -6.5e-229)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.6e-271)
		tmp = Float64(y * 4.0);
	elseif (z <= 3.4e-81)
		tmp = Float64(x * -3.0);
	elseif (z <= 6.2e-18)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.56)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.95e+126)
		tmp = t_0;
	else
		tmp = Float64(x * Float64(z * 6.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * (z * -6.0);
	tmp = 0.0;
	if (z <= -2.8e+74)
		tmp = t_0;
	elseif (z <= -1.5e+28)
		tmp = 6.0 * (x * z);
	elseif (z <= -2.9e-15)
		tmp = y * 4.0;
	elseif (z <= -6.5e-229)
		tmp = x * -3.0;
	elseif (z <= 1.6e-271)
		tmp = y * 4.0;
	elseif (z <= 3.4e-81)
		tmp = x * -3.0;
	elseif (z <= 6.2e-18)
		tmp = y * 4.0;
	elseif (z <= 0.56)
		tmp = x * -3.0;
	elseif (z <= 1.95e+126)
		tmp = t_0;
	else
		tmp = x * (z * 6.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.8e+74], t$95$0, If[LessEqual[z, -1.5e+28], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.9e-15], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -6.5e-229], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.6e-271], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.4e-81], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.2e-18], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.56], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.95e+126], t$95$0, N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y \cdot \left(z \cdot -6\right)\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{+74}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -1.5 \cdot 10^{+28}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\

\mathbf{elif}\;z \leq -2.9 \cdot 10^{-15}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq -6.5 \cdot 10^{-229}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 1.6 \cdot 10^{-271}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 3.4 \cdot 10^{-81}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 6.2 \cdot 10^{-18}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 0.56:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 1.95 \cdot 10^{+126}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.80000000000000002e74 or 0.56000000000000005 < z < 1.94999999999999997e126

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.7%

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

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

      \[\leadsto \color{blue}{-6 \cdot \left(y \cdot z\right)} \]
    8. Step-by-step derivation
      1. *-commutative63.6%

        \[\leadsto -6 \cdot \color{blue}{\left(z \cdot y\right)} \]
      2. associate-*l*63.7%

        \[\leadsto \color{blue}{\left(-6 \cdot z\right) \cdot y} \]
      3. *-commutative63.7%

        \[\leadsto \color{blue}{y \cdot \left(-6 \cdot z\right)} \]
      4. *-commutative63.7%

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

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

    if -2.80000000000000002e74 < z < -1.5e28

    1. Initial program 100.0%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 73.2%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg73.2%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      2. distribute-rgt-in73.2%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      3. metadata-eval73.2%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      4. metadata-eval73.2%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
      5. neg-mul-173.2%

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

        \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{-1 \cdot \left(z \cdot -6\right)}\right)\right) \]
      7. *-commutative73.2%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-1 \cdot 4 + -1 \cdot \left(-6 \cdot z\right)\right)}\right) \]
      10. metadata-eval73.2%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      11. metadata-eval73.2%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      12. associate-+r+73.2%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + -1 \cdot \left(-6 \cdot z\right)\right)} \]
      13. metadata-eval73.2%

        \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + -1 \cdot \left(-6 \cdot z\right)\right) \]
      14. metadata-eval73.2%

        \[\leadsto x \cdot \left(\color{blue}{-3} + -1 \cdot \left(-6 \cdot z\right)\right) \]
      15. associate-*r*73.2%

        \[\leadsto x \cdot \left(-3 + \color{blue}{\left(-1 \cdot -6\right) \cdot z}\right) \]
      16. metadata-eval73.2%

        \[\leadsto x \cdot \left(-3 + \color{blue}{6} \cdot z\right) \]
      17. *-commutative73.2%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot 6}\right) \]
    7. Simplified73.2%

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
    8. Step-by-step derivation
      1. flip-+73.2%

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

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

        \[\leadsto \frac{x \cdot \left(\color{blue}{9} - \left(z \cdot 6\right) \cdot \left(z \cdot 6\right)\right)}{-3 - z \cdot 6} \]
      4. swap-sqr56.9%

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

        \[\leadsto \frac{x \cdot \left(9 - \color{blue}{{z}^{2}} \cdot \left(6 \cdot 6\right)\right)}{-3 - z \cdot 6} \]
      6. metadata-eval56.9%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot \color{blue}{36}\right)}{-3 - z \cdot 6} \]
      7. *-commutative56.9%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{-3 - \color{blue}{6 \cdot z}} \]
      8. cancel-sign-sub-inv56.9%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{\color{blue}{-3 + \left(-6\right) \cdot z}} \]
      9. metadata-eval56.9%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{-3 + \color{blue}{-6} \cdot z} \]
    9. Applied egg-rr56.9%

      \[\leadsto \color{blue}{\frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{-3 + -6 \cdot z}} \]
    10. Step-by-step derivation
      1. associate-/l*73.2%

        \[\leadsto \color{blue}{\frac{x}{\frac{-3 + -6 \cdot z}{9 - {z}^{2} \cdot 36}}} \]
      2. +-commutative73.2%

        \[\leadsto \frac{x}{\frac{\color{blue}{-6 \cdot z + -3}}{9 - {z}^{2} \cdot 36}} \]
      3. *-commutative73.2%

        \[\leadsto \frac{x}{\frac{\color{blue}{z \cdot -6} + -3}{9 - {z}^{2} \cdot 36}} \]
    11. Simplified73.2%

      \[\leadsto \color{blue}{\frac{x}{\frac{z \cdot -6 + -3}{9 - {z}^{2} \cdot 36}}} \]
    12. Taylor expanded in z around inf 73.4%

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

    if -1.5e28 < z < -2.90000000000000019e-15 or -6.5e-229 < z < 1.59999999999999989e-271 or 3.3999999999999999e-81 < z < 6.20000000000000014e-18

    1. Initial program 99.4%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add099.4%

        \[\leadsto x + \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) + 0\right)} \]
      2. associate-*l*99.8%

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

      \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right) + 0\right)} \]
    7. Taylor expanded in x around 0 62.6%

      \[\leadsto \color{blue}{6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)} \]
    8. Taylor expanded in z around 0 57.2%

      \[\leadsto \color{blue}{4 \cdot y} \]
    9. Step-by-step derivation
      1. *-commutative57.2%

        \[\leadsto \color{blue}{y \cdot 4} \]
    10. Simplified57.2%

      \[\leadsto \color{blue}{y \cdot 4} \]

    if -2.90000000000000019e-15 < z < -6.5e-229 or 1.59999999999999989e-271 < z < 3.3999999999999999e-81 or 6.20000000000000014e-18 < z < 0.56000000000000005

    1. Initial program 99.4%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 63.4%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg63.4%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      2. distribute-rgt-in63.5%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      3. metadata-eval63.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      4. metadata-eval63.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
      5. neg-mul-163.5%

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

        \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{-1 \cdot \left(z \cdot -6\right)}\right)\right) \]
      7. *-commutative63.5%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-1 \cdot 4 + -1 \cdot \left(-6 \cdot z\right)\right)}\right) \]
      10. metadata-eval63.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      11. metadata-eval63.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      12. associate-+r+63.5%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + -1 \cdot \left(-6 \cdot z\right)\right)} \]
      13. metadata-eval63.5%

        \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + -1 \cdot \left(-6 \cdot z\right)\right) \]
      14. metadata-eval63.5%

        \[\leadsto x \cdot \left(\color{blue}{-3} + -1 \cdot \left(-6 \cdot z\right)\right) \]
      15. associate-*r*63.5%

        \[\leadsto x \cdot \left(-3 + \color{blue}{\left(-1 \cdot -6\right) \cdot z}\right) \]
      16. metadata-eval63.5%

        \[\leadsto x \cdot \left(-3 + \color{blue}{6} \cdot z\right) \]
      17. *-commutative63.5%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot 6}\right) \]
    7. Simplified63.5%

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
    8. Taylor expanded in z around 0 62.7%

      \[\leadsto \color{blue}{-3 \cdot x} \]
    9. Step-by-step derivation
      1. *-commutative62.7%

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified62.7%

      \[\leadsto \color{blue}{x \cdot -3} \]

    if 1.94999999999999997e126 < z

    1. Initial program 99.9%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 63.9%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg63.9%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      2. distribute-rgt-in63.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      3. metadata-eval63.9%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      4. metadata-eval63.9%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
      5. neg-mul-163.9%

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

        \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{-1 \cdot \left(z \cdot -6\right)}\right)\right) \]
      7. *-commutative63.9%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-1 \cdot 4 + -1 \cdot \left(-6 \cdot z\right)\right)}\right) \]
      10. metadata-eval63.9%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      11. metadata-eval63.9%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      12. associate-+r+63.9%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + -1 \cdot \left(-6 \cdot z\right)\right)} \]
      13. metadata-eval63.9%

        \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + -1 \cdot \left(-6 \cdot z\right)\right) \]
      14. metadata-eval63.9%

        \[\leadsto x \cdot \left(\color{blue}{-3} + -1 \cdot \left(-6 \cdot z\right)\right) \]
      15. associate-*r*63.9%

        \[\leadsto x \cdot \left(-3 + \color{blue}{\left(-1 \cdot -6\right) \cdot z}\right) \]
      16. metadata-eval63.9%

        \[\leadsto x \cdot \left(-3 + \color{blue}{6} \cdot z\right) \]
      17. *-commutative63.9%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot 6}\right) \]
    7. Simplified63.9%

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
    8. Taylor expanded in z around inf 63.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.8 \cdot 10^{+74}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+28}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-15}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{-229}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-271}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-81}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-18}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.56:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{+126}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 50.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(z \cdot -6\right)\\ t_1 := z \cdot \left(x \cdot 6\right)\\ \mathbf{if}\;z \leq -2.1 \cdot 10^{+74}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+28}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{-15}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{-229}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-272}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-81}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-17}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.55:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+125}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (* z -6.0))) (t_1 (* z (* x 6.0))))
   (if (<= z -2.1e+74)
     t_0
     (if (<= z -1.5e+28)
       t_1
       (if (<= z -6.8e-15)
         (* y 4.0)
         (if (<= z -6.2e-229)
           (* x -3.0)
           (if (<= z 2.5e-272)
             (* y 4.0)
             (if (<= z 2.6e-81)
               (* x -3.0)
               (if (<= z 4.4e-17)
                 (* y 4.0)
                 (if (<= z 0.55)
                   (* x -3.0)
                   (if (<= z 1.8e+125) t_0 t_1)))))))))))
double code(double x, double y, double z) {
	double t_0 = y * (z * -6.0);
	double t_1 = z * (x * 6.0);
	double tmp;
	if (z <= -2.1e+74) {
		tmp = t_0;
	} else if (z <= -1.5e+28) {
		tmp = t_1;
	} else if (z <= -6.8e-15) {
		tmp = y * 4.0;
	} else if (z <= -6.2e-229) {
		tmp = x * -3.0;
	} else if (z <= 2.5e-272) {
		tmp = y * 4.0;
	} else if (z <= 2.6e-81) {
		tmp = x * -3.0;
	} else if (z <= 4.4e-17) {
		tmp = y * 4.0;
	} else if (z <= 0.55) {
		tmp = x * -3.0;
	} else if (z <= 1.8e+125) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	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) :: t_1
    real(8) :: tmp
    t_0 = y * (z * (-6.0d0))
    t_1 = z * (x * 6.0d0)
    if (z <= (-2.1d+74)) then
        tmp = t_0
    else if (z <= (-1.5d+28)) then
        tmp = t_1
    else if (z <= (-6.8d-15)) then
        tmp = y * 4.0d0
    else if (z <= (-6.2d-229)) then
        tmp = x * (-3.0d0)
    else if (z <= 2.5d-272) then
        tmp = y * 4.0d0
    else if (z <= 2.6d-81) then
        tmp = x * (-3.0d0)
    else if (z <= 4.4d-17) then
        tmp = y * 4.0d0
    else if (z <= 0.55d0) then
        tmp = x * (-3.0d0)
    else if (z <= 1.8d+125) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = y * (z * -6.0);
	double t_1 = z * (x * 6.0);
	double tmp;
	if (z <= -2.1e+74) {
		tmp = t_0;
	} else if (z <= -1.5e+28) {
		tmp = t_1;
	} else if (z <= -6.8e-15) {
		tmp = y * 4.0;
	} else if (z <= -6.2e-229) {
		tmp = x * -3.0;
	} else if (z <= 2.5e-272) {
		tmp = y * 4.0;
	} else if (z <= 2.6e-81) {
		tmp = x * -3.0;
	} else if (z <= 4.4e-17) {
		tmp = y * 4.0;
	} else if (z <= 0.55) {
		tmp = x * -3.0;
	} else if (z <= 1.8e+125) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * (z * -6.0)
	t_1 = z * (x * 6.0)
	tmp = 0
	if z <= -2.1e+74:
		tmp = t_0
	elif z <= -1.5e+28:
		tmp = t_1
	elif z <= -6.8e-15:
		tmp = y * 4.0
	elif z <= -6.2e-229:
		tmp = x * -3.0
	elif z <= 2.5e-272:
		tmp = y * 4.0
	elif z <= 2.6e-81:
		tmp = x * -3.0
	elif z <= 4.4e-17:
		tmp = y * 4.0
	elif z <= 0.55:
		tmp = x * -3.0
	elif z <= 1.8e+125:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(y * Float64(z * -6.0))
	t_1 = Float64(z * Float64(x * 6.0))
	tmp = 0.0
	if (z <= -2.1e+74)
		tmp = t_0;
	elseif (z <= -1.5e+28)
		tmp = t_1;
	elseif (z <= -6.8e-15)
		tmp = Float64(y * 4.0);
	elseif (z <= -6.2e-229)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.5e-272)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.6e-81)
		tmp = Float64(x * -3.0);
	elseif (z <= 4.4e-17)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.55)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.8e+125)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * (z * -6.0);
	t_1 = z * (x * 6.0);
	tmp = 0.0;
	if (z <= -2.1e+74)
		tmp = t_0;
	elseif (z <= -1.5e+28)
		tmp = t_1;
	elseif (z <= -6.8e-15)
		tmp = y * 4.0;
	elseif (z <= -6.2e-229)
		tmp = x * -3.0;
	elseif (z <= 2.5e-272)
		tmp = y * 4.0;
	elseif (z <= 2.6e-81)
		tmp = x * -3.0;
	elseif (z <= 4.4e-17)
		tmp = y * 4.0;
	elseif (z <= 0.55)
		tmp = x * -3.0;
	elseif (z <= 1.8e+125)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+74], t$95$0, If[LessEqual[z, -1.5e+28], t$95$1, If[LessEqual[z, -6.8e-15], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -6.2e-229], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.5e-272], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.6e-81], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.4e-17], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.55], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.8e+125], t$95$0, t$95$1]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y \cdot \left(z \cdot -6\right)\\
t_1 := z \cdot \left(x \cdot 6\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+74}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -1.5 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -6.8 \cdot 10^{-15}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq -6.2 \cdot 10^{-229}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 2.5 \cdot 10^{-272}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 2.6 \cdot 10^{-81}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 4.4 \cdot 10^{-17}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 0.55:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 1.8 \cdot 10^{+125}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.0999999999999999e74 or 0.55000000000000004 < z < 1.8000000000000002e125

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.7%

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

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

      \[\leadsto \color{blue}{-6 \cdot \left(y \cdot z\right)} \]
    8. Step-by-step derivation
      1. *-commutative63.6%

        \[\leadsto -6 \cdot \color{blue}{\left(z \cdot y\right)} \]
      2. associate-*l*63.7%

        \[\leadsto \color{blue}{\left(-6 \cdot z\right) \cdot y} \]
      3. *-commutative63.7%

        \[\leadsto \color{blue}{y \cdot \left(-6 \cdot z\right)} \]
      4. *-commutative63.7%

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

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

    if -2.0999999999999999e74 < z < -1.5e28 or 1.8000000000000002e125 < z

    1. Initial program 100.0%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 66.4%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg66.4%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      2. distribute-rgt-in66.4%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      3. metadata-eval66.4%

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

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
      5. neg-mul-166.4%

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

        \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{-1 \cdot \left(z \cdot -6\right)}\right)\right) \]
      7. *-commutative66.4%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-1 \cdot 4 + -1 \cdot \left(-6 \cdot z\right)\right)}\right) \]
      10. metadata-eval66.4%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      11. metadata-eval66.4%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      12. associate-+r+66.4%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + -1 \cdot \left(-6 \cdot z\right)\right)} \]
      13. metadata-eval66.4%

        \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + -1 \cdot \left(-6 \cdot z\right)\right) \]
      14. metadata-eval66.4%

        \[\leadsto x \cdot \left(\color{blue}{-3} + -1 \cdot \left(-6 \cdot z\right)\right) \]
      15. associate-*r*66.4%

        \[\leadsto x \cdot \left(-3 + \color{blue}{\left(-1 \cdot -6\right) \cdot z}\right) \]
      16. metadata-eval66.4%

        \[\leadsto x \cdot \left(-3 + \color{blue}{6} \cdot z\right) \]
      17. *-commutative66.4%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot 6}\right) \]
    7. Simplified66.4%

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
    8. Step-by-step derivation
      1. flip-+64.3%

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

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

        \[\leadsto \frac{x \cdot \left(\color{blue}{9} - \left(z \cdot 6\right) \cdot \left(z \cdot 6\right)\right)}{-3 - z \cdot 6} \]
      4. swap-sqr55.6%

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

        \[\leadsto \frac{x \cdot \left(9 - \color{blue}{{z}^{2}} \cdot \left(6 \cdot 6\right)\right)}{-3 - z \cdot 6} \]
      6. metadata-eval55.6%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot \color{blue}{36}\right)}{-3 - z \cdot 6} \]
      7. *-commutative55.6%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{-3 - \color{blue}{6 \cdot z}} \]
      8. cancel-sign-sub-inv55.6%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{\color{blue}{-3 + \left(-6\right) \cdot z}} \]
      9. metadata-eval55.6%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{-3 + \color{blue}{-6} \cdot z} \]
    9. Applied egg-rr55.6%

      \[\leadsto \color{blue}{\frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{-3 + -6 \cdot z}} \]
    10. Step-by-step derivation
      1. associate-/l*64.3%

        \[\leadsto \color{blue}{\frac{x}{\frac{-3 + -6 \cdot z}{9 - {z}^{2} \cdot 36}}} \]
      2. +-commutative64.3%

        \[\leadsto \frac{x}{\frac{\color{blue}{-6 \cdot z + -3}}{9 - {z}^{2} \cdot 36}} \]
      3. *-commutative64.3%

        \[\leadsto \frac{x}{\frac{\color{blue}{z \cdot -6} + -3}{9 - {z}^{2} \cdot 36}} \]
    11. Simplified64.3%

      \[\leadsto \color{blue}{\frac{x}{\frac{z \cdot -6 + -3}{9 - {z}^{2} \cdot 36}}} \]
    12. Taylor expanded in z around inf 66.4%

      \[\leadsto \color{blue}{6 \cdot \left(x \cdot z\right)} \]
    13. Step-by-step derivation
      1. associate-*r*66.6%

        \[\leadsto \color{blue}{\left(6 \cdot x\right) \cdot z} \]
    14. Simplified66.6%

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

    if -1.5e28 < z < -6.8000000000000001e-15 or -6.2000000000000002e-229 < z < 2.49999999999999991e-272 or 2.5999999999999999e-81 < z < 4.4e-17

    1. Initial program 99.4%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add099.4%

        \[\leadsto x + \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) + 0\right)} \]
      2. associate-*l*99.8%

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

      \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right) + 0\right)} \]
    7. Taylor expanded in x around 0 62.6%

      \[\leadsto \color{blue}{6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)} \]
    8. Taylor expanded in z around 0 57.2%

      \[\leadsto \color{blue}{4 \cdot y} \]
    9. Step-by-step derivation
      1. *-commutative57.2%

        \[\leadsto \color{blue}{y \cdot 4} \]
    10. Simplified57.2%

      \[\leadsto \color{blue}{y \cdot 4} \]

    if -6.8000000000000001e-15 < z < -6.2000000000000002e-229 or 2.49999999999999991e-272 < z < 2.5999999999999999e-81 or 4.4e-17 < z < 0.55000000000000004

    1. Initial program 99.4%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 63.4%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg63.4%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      2. distribute-rgt-in63.5%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      3. metadata-eval63.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      4. metadata-eval63.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
      5. neg-mul-163.5%

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

        \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{-1 \cdot \left(z \cdot -6\right)}\right)\right) \]
      7. *-commutative63.5%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-1 \cdot 4 + -1 \cdot \left(-6 \cdot z\right)\right)}\right) \]
      10. metadata-eval63.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      11. metadata-eval63.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      12. associate-+r+63.5%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + -1 \cdot \left(-6 \cdot z\right)\right)} \]
      13. metadata-eval63.5%

        \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + -1 \cdot \left(-6 \cdot z\right)\right) \]
      14. metadata-eval63.5%

        \[\leadsto x \cdot \left(\color{blue}{-3} + -1 \cdot \left(-6 \cdot z\right)\right) \]
      15. associate-*r*63.5%

        \[\leadsto x \cdot \left(-3 + \color{blue}{\left(-1 \cdot -6\right) \cdot z}\right) \]
      16. metadata-eval63.5%

        \[\leadsto x \cdot \left(-3 + \color{blue}{6} \cdot z\right) \]
      17. *-commutative63.5%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot 6}\right) \]
    7. Simplified63.5%

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
    8. Taylor expanded in z around 0 62.7%

      \[\leadsto \color{blue}{-3 \cdot x} \]
    9. Step-by-step derivation
      1. *-commutative62.7%

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified62.7%

      \[\leadsto \color{blue}{x \cdot -3} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification62.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{+74}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+28}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{-15}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{-229}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-272}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-81}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-17}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.55:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+125}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 74.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{if}\;z \leq -3.5:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-17}:\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{-229}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-273}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-82}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{-18}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* (- y x) z))))
   (if (<= z -3.5)
     t_0
     (if (<= z -8e-17)
       (* 6.0 (* y (- 0.6666666666666666 z)))
       (if (<= z -6.8e-229)
         (* x -3.0)
         (if (<= z 2.3e-273)
           (* y 4.0)
           (if (<= z 7e-82)
             (* x -3.0)
             (if (<= z 1.65e-18)
               (* y 4.0)
               (if (<= z 0.5) (* x -3.0) t_0)))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -3.5) {
		tmp = t_0;
	} else if (z <= -8e-17) {
		tmp = 6.0 * (y * (0.6666666666666666 - z));
	} else if (z <= -6.8e-229) {
		tmp = x * -3.0;
	} else if (z <= 2.3e-273) {
		tmp = y * 4.0;
	} else if (z <= 7e-82) {
		tmp = x * -3.0;
	} else if (z <= 1.65e-18) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else {
		tmp = 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 = (-6.0d0) * ((y - x) * z)
    if (z <= (-3.5d0)) then
        tmp = t_0
    else if (z <= (-8d-17)) then
        tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
    else if (z <= (-6.8d-229)) then
        tmp = x * (-3.0d0)
    else if (z <= 2.3d-273) then
        tmp = y * 4.0d0
    else if (z <= 7d-82) then
        tmp = x * (-3.0d0)
    else if (z <= 1.65d-18) then
        tmp = y * 4.0d0
    else if (z <= 0.5d0) then
        tmp = x * (-3.0d0)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -3.5) {
		tmp = t_0;
	} else if (z <= -8e-17) {
		tmp = 6.0 * (y * (0.6666666666666666 - z));
	} else if (z <= -6.8e-229) {
		tmp = x * -3.0;
	} else if (z <= 2.3e-273) {
		tmp = y * 4.0;
	} else if (z <= 7e-82) {
		tmp = x * -3.0;
	} else if (z <= 1.65e-18) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * ((y - x) * z)
	tmp = 0
	if z <= -3.5:
		tmp = t_0
	elif z <= -8e-17:
		tmp = 6.0 * (y * (0.6666666666666666 - z))
	elif z <= -6.8e-229:
		tmp = x * -3.0
	elif z <= 2.3e-273:
		tmp = y * 4.0
	elif z <= 7e-82:
		tmp = x * -3.0
	elif z <= 1.65e-18:
		tmp = y * 4.0
	elif z <= 0.5:
		tmp = x * -3.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(Float64(y - x) * z))
	tmp = 0.0
	if (z <= -3.5)
		tmp = t_0;
	elseif (z <= -8e-17)
		tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z)));
	elseif (z <= -6.8e-229)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.3e-273)
		tmp = Float64(y * 4.0);
	elseif (z <= 7e-82)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.65e-18)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.5)
		tmp = Float64(x * -3.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * ((y - x) * z);
	tmp = 0.0;
	if (z <= -3.5)
		tmp = t_0;
	elseif (z <= -8e-17)
		tmp = 6.0 * (y * (0.6666666666666666 - z));
	elseif (z <= -6.8e-229)
		tmp = x * -3.0;
	elseif (z <= 2.3e-273)
		tmp = y * 4.0;
	elseif (z <= 7e-82)
		tmp = x * -3.0;
	elseif (z <= 1.65e-18)
		tmp = y * 4.0;
	elseif (z <= 0.5)
		tmp = x * -3.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5], t$95$0, If[LessEqual[z, -8e-17], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.8e-229], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.3e-273], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7e-82], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.65e-18], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -3.5:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -8 \cdot 10^{-17}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\

\mathbf{elif}\;z \leq -6.8 \cdot 10^{-229}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 2.3 \cdot 10^{-273}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 7 \cdot 10^{-82}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 1.65 \cdot 10^{-18}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


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

    1. Initial program 99.8%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.7%

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

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

    if -3.5 < z < -8.00000000000000057e-17

    1. Initial program 98.8%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified98.8%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add098.8%

        \[\leadsto x + \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) + 0\right)} \]
      2. associate-*l*99.0%

        \[\leadsto x + \left(\color{blue}{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)} + 0\right) \]
    6. Applied egg-rr99.0%

      \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right) + 0\right)} \]
    7. Taylor expanded in x around 0 85.5%

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

    if -8.00000000000000057e-17 < z < -6.7999999999999998e-229 or 2.29999999999999981e-273 < z < 6.9999999999999997e-82 or 1.6500000000000001e-18 < z < 0.5

    1. Initial program 99.4%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 64.1%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg64.1%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      2. distribute-rgt-in64.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      3. metadata-eval64.1%

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

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
      5. neg-mul-164.1%

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

        \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{-1 \cdot \left(z \cdot -6\right)}\right)\right) \]
      7. *-commutative64.1%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-1 \cdot 4 + -1 \cdot \left(-6 \cdot z\right)\right)}\right) \]
      10. metadata-eval64.1%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      11. metadata-eval64.1%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      12. associate-+r+64.1%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + -1 \cdot \left(-6 \cdot z\right)\right)} \]
      13. metadata-eval64.1%

        \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + -1 \cdot \left(-6 \cdot z\right)\right) \]
      14. metadata-eval64.1%

        \[\leadsto x \cdot \left(\color{blue}{-3} + -1 \cdot \left(-6 \cdot z\right)\right) \]
      15. associate-*r*64.1%

        \[\leadsto x \cdot \left(-3 + \color{blue}{\left(-1 \cdot -6\right) \cdot z}\right) \]
      16. metadata-eval64.1%

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

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

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
    8. Taylor expanded in z around 0 63.4%

      \[\leadsto \color{blue}{-3 \cdot x} \]
    9. Step-by-step derivation
      1. *-commutative63.4%

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified63.4%

      \[\leadsto \color{blue}{x \cdot -3} \]

    if -6.7999999999999998e-229 < z < 2.29999999999999981e-273 or 6.9999999999999997e-82 < z < 1.6500000000000001e-18

    1. Initial program 99.5%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add099.5%

        \[\leadsto x + \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) + 0\right)} \]
      2. associate-*l*100.0%

        \[\leadsto x + \left(\color{blue}{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)} + 0\right) \]
    6. Applied egg-rr100.0%

      \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right) + 0\right)} \]
    7. Taylor expanded in x around 0 59.6%

      \[\leadsto \color{blue}{6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)} \]
    8. Taylor expanded in z around 0 59.8%

      \[\leadsto \color{blue}{4 \cdot y} \]
    9. Step-by-step derivation
      1. *-commutative59.8%

        \[\leadsto \color{blue}{y \cdot 4} \]
    10. Simplified59.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.5:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-17}:\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{-229}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-273}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-82}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{-18}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 74.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{if}\;z \leq -4.8 \cdot 10^{-9}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-229}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.42 \cdot 10^{-272}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-81}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-15}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* (- y x) z))))
   (if (<= z -4.8e-9)
     t_0
     (if (<= z -8e-229)
       (* x -3.0)
       (if (<= z 1.42e-272)
         (* y 4.0)
         (if (<= z 1.6e-81)
           (* x -3.0)
           (if (<= z 7e-15) (* y 4.0) (if (<= z 0.5) (* x -3.0) t_0))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -4.8e-9) {
		tmp = t_0;
	} else if (z <= -8e-229) {
		tmp = x * -3.0;
	} else if (z <= 1.42e-272) {
		tmp = y * 4.0;
	} else if (z <= 1.6e-81) {
		tmp = x * -3.0;
	} else if (z <= 7e-15) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else {
		tmp = 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 = (-6.0d0) * ((y - x) * z)
    if (z <= (-4.8d-9)) then
        tmp = t_0
    else if (z <= (-8d-229)) then
        tmp = x * (-3.0d0)
    else if (z <= 1.42d-272) then
        tmp = y * 4.0d0
    else if (z <= 1.6d-81) then
        tmp = x * (-3.0d0)
    else if (z <= 7d-15) then
        tmp = y * 4.0d0
    else if (z <= 0.5d0) then
        tmp = x * (-3.0d0)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -4.8e-9) {
		tmp = t_0;
	} else if (z <= -8e-229) {
		tmp = x * -3.0;
	} else if (z <= 1.42e-272) {
		tmp = y * 4.0;
	} else if (z <= 1.6e-81) {
		tmp = x * -3.0;
	} else if (z <= 7e-15) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * ((y - x) * z)
	tmp = 0
	if z <= -4.8e-9:
		tmp = t_0
	elif z <= -8e-229:
		tmp = x * -3.0
	elif z <= 1.42e-272:
		tmp = y * 4.0
	elif z <= 1.6e-81:
		tmp = x * -3.0
	elif z <= 7e-15:
		tmp = y * 4.0
	elif z <= 0.5:
		tmp = x * -3.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(Float64(y - x) * z))
	tmp = 0.0
	if (z <= -4.8e-9)
		tmp = t_0;
	elseif (z <= -8e-229)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.42e-272)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.6e-81)
		tmp = Float64(x * -3.0);
	elseif (z <= 7e-15)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.5)
		tmp = Float64(x * -3.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * ((y - x) * z);
	tmp = 0.0;
	if (z <= -4.8e-9)
		tmp = t_0;
	elseif (z <= -8e-229)
		tmp = x * -3.0;
	elseif (z <= 1.42e-272)
		tmp = y * 4.0;
	elseif (z <= 1.6e-81)
		tmp = x * -3.0;
	elseif (z <= 7e-15)
		tmp = y * 4.0;
	elseif (z <= 0.5)
		tmp = x * -3.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e-9], t$95$0, If[LessEqual[z, -8e-229], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.42e-272], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.6e-81], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 7e-15], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{-9}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -8 \cdot 10^{-229}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 1.42 \cdot 10^{-272}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 1.6 \cdot 10^{-81}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 7 \cdot 10^{-15}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.8e-9 or 0.5 < z

    1. Initial program 99.8%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.7%

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

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

    if -4.8e-9 < z < -8.00000000000000055e-229 or 1.41999999999999997e-272 < z < 1.6e-81 or 7.0000000000000001e-15 < z < 0.5

    1. Initial program 99.4%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 61.3%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg61.3%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      2. distribute-rgt-in61.3%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      3. metadata-eval61.3%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      4. metadata-eval61.3%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
      5. neg-mul-161.3%

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

        \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{-1 \cdot \left(z \cdot -6\right)}\right)\right) \]
      7. *-commutative61.3%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-1 \cdot 4 + -1 \cdot \left(-6 \cdot z\right)\right)}\right) \]
      10. metadata-eval61.3%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      11. metadata-eval61.3%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      12. associate-+r+61.3%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + -1 \cdot \left(-6 \cdot z\right)\right)} \]
      13. metadata-eval61.3%

        \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + -1 \cdot \left(-6 \cdot z\right)\right) \]
      14. metadata-eval61.3%

        \[\leadsto x \cdot \left(\color{blue}{-3} + -1 \cdot \left(-6 \cdot z\right)\right) \]
      15. associate-*r*61.3%

        \[\leadsto x \cdot \left(-3 + \color{blue}{\left(-1 \cdot -6\right) \cdot z}\right) \]
      16. metadata-eval61.3%

        \[\leadsto x \cdot \left(-3 + \color{blue}{6} \cdot z\right) \]
      17. *-commutative61.3%

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

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
    8. Taylor expanded in z around 0 60.2%

      \[\leadsto \color{blue}{-3 \cdot x} \]
    9. Step-by-step derivation
      1. *-commutative60.2%

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified60.2%

      \[\leadsto \color{blue}{x \cdot -3} \]

    if -8.00000000000000055e-229 < z < 1.41999999999999997e-272 or 1.6e-81 < z < 7.0000000000000001e-15

    1. Initial program 99.5%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add099.5%

        \[\leadsto x + \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) + 0\right)} \]
      2. associate-*l*100.0%

        \[\leadsto x + \left(\color{blue}{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)} + 0\right) \]
    6. Applied egg-rr100.0%

      \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right) + 0\right)} \]
    7. Taylor expanded in x around 0 59.6%

      \[\leadsto \color{blue}{6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)} \]
    8. Taylor expanded in z around 0 59.8%

      \[\leadsto \color{blue}{4 \cdot y} \]
    9. Step-by-step derivation
      1. *-commutative59.8%

        \[\leadsto \color{blue}{y \cdot 4} \]
    10. Simplified59.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{-9}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-229}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.42 \cdot 10^{-272}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-81}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-15}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 50.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -26:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{-229}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-271}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-81}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-19}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.55:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))))
   (if (<= z -26.0)
     t_0
     (if (<= z -6.8e-229)
       (* x -3.0)
       (if (<= z 2.6e-271)
         (* y 4.0)
         (if (<= z 2.7e-81)
           (* x -3.0)
           (if (<= z 7.6e-19) (* y 4.0) (if (<= z 0.55) (* x -3.0) t_0))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double tmp;
	if (z <= -26.0) {
		tmp = t_0;
	} else if (z <= -6.8e-229) {
		tmp = x * -3.0;
	} else if (z <= 2.6e-271) {
		tmp = y * 4.0;
	} else if (z <= 2.7e-81) {
		tmp = x * -3.0;
	} else if (z <= 7.6e-19) {
		tmp = y * 4.0;
	} else if (z <= 0.55) {
		tmp = x * -3.0;
	} else {
		tmp = 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 = (-6.0d0) * (y * z)
    if (z <= (-26.0d0)) then
        tmp = t_0
    else if (z <= (-6.8d-229)) then
        tmp = x * (-3.0d0)
    else if (z <= 2.6d-271) then
        tmp = y * 4.0d0
    else if (z <= 2.7d-81) then
        tmp = x * (-3.0d0)
    else if (z <= 7.6d-19) then
        tmp = y * 4.0d0
    else if (z <= 0.55d0) then
        tmp = x * (-3.0d0)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double tmp;
	if (z <= -26.0) {
		tmp = t_0;
	} else if (z <= -6.8e-229) {
		tmp = x * -3.0;
	} else if (z <= 2.6e-271) {
		tmp = y * 4.0;
	} else if (z <= 2.7e-81) {
		tmp = x * -3.0;
	} else if (z <= 7.6e-19) {
		tmp = y * 4.0;
	} else if (z <= 0.55) {
		tmp = x * -3.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	tmp = 0
	if z <= -26.0:
		tmp = t_0
	elif z <= -6.8e-229:
		tmp = x * -3.0
	elif z <= 2.6e-271:
		tmp = y * 4.0
	elif z <= 2.7e-81:
		tmp = x * -3.0
	elif z <= 7.6e-19:
		tmp = y * 4.0
	elif z <= 0.55:
		tmp = x * -3.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -26.0)
		tmp = t_0;
	elseif (z <= -6.8e-229)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.6e-271)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.7e-81)
		tmp = Float64(x * -3.0);
	elseif (z <= 7.6e-19)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.55)
		tmp = Float64(x * -3.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	tmp = 0.0;
	if (z <= -26.0)
		tmp = t_0;
	elseif (z <= -6.8e-229)
		tmp = x * -3.0;
	elseif (z <= 2.6e-271)
		tmp = y * 4.0;
	elseif (z <= 2.7e-81)
		tmp = x * -3.0;
	elseif (z <= 7.6e-19)
		tmp = y * 4.0;
	elseif (z <= 0.55)
		tmp = x * -3.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -26.0], t$95$0, If[LessEqual[z, -6.8e-229], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.6e-271], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.7e-81], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 7.6e-19], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.55], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -26:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -6.8 \cdot 10^{-229}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 2.6 \cdot 10^{-271}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 2.7 \cdot 10^{-81}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 7.6 \cdot 10^{-19}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 0.55:\\
\;\;\;\;x \cdot -3\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


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

    1. Initial program 99.8%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.7%

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

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

      \[\leadsto \color{blue}{-6 \cdot \left(y \cdot z\right)} \]
    8. Step-by-step derivation
      1. *-commutative56.7%

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

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

    if -26 < z < -6.7999999999999998e-229 or 2.6e-271 < z < 2.6999999999999999e-81 or 7.6e-19 < z < 0.55000000000000004

    1. Initial program 99.4%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 61.1%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg61.1%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      2. distribute-rgt-in61.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      3. metadata-eval61.1%

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

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
      5. neg-mul-161.1%

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

        \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{-1 \cdot \left(z \cdot -6\right)}\right)\right) \]
      7. *-commutative61.1%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-1 \cdot 4 + -1 \cdot \left(-6 \cdot z\right)\right)}\right) \]
      10. metadata-eval61.1%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      11. metadata-eval61.1%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      12. associate-+r+61.1%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + -1 \cdot \left(-6 \cdot z\right)\right)} \]
      13. metadata-eval61.1%

        \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + -1 \cdot \left(-6 \cdot z\right)\right) \]
      14. metadata-eval61.1%

        \[\leadsto x \cdot \left(\color{blue}{-3} + -1 \cdot \left(-6 \cdot z\right)\right) \]
      15. associate-*r*61.1%

        \[\leadsto x \cdot \left(-3 + \color{blue}{\left(-1 \cdot -6\right) \cdot z}\right) \]
      16. metadata-eval61.1%

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

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot 6}\right) \]
    7. Simplified61.1%

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
    8. Taylor expanded in z around 0 59.1%

      \[\leadsto \color{blue}{-3 \cdot x} \]
    9. Step-by-step derivation
      1. *-commutative59.1%

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified59.1%

      \[\leadsto \color{blue}{x \cdot -3} \]

    if -6.7999999999999998e-229 < z < 2.6e-271 or 2.6999999999999999e-81 < z < 7.6e-19

    1. Initial program 99.5%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add099.5%

        \[\leadsto x + \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) + 0\right)} \]
      2. associate-*l*100.0%

        \[\leadsto x + \left(\color{blue}{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)} + 0\right) \]
    6. Applied egg-rr100.0%

      \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right) + 0\right)} \]
    7. Taylor expanded in x around 0 59.6%

      \[\leadsto \color{blue}{6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)} \]
    8. Taylor expanded in z around 0 59.8%

      \[\leadsto \color{blue}{4 \cdot y} \]
    9. Step-by-step derivation
      1. *-commutative59.8%

        \[\leadsto \color{blue}{y \cdot 4} \]
    10. Simplified59.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -26:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{-229}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-271}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-81}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-19}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.55:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 73.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{-39} \lor \neg \left(x \leq 3.3 \cdot 10^{+24}\right) \land \left(x \leq 1.7 \cdot 10^{+45} \lor \neg \left(x \leq 1.15 \cdot 10^{+103}\right)\right):\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -2.2e-39)
         (and (not (<= x 3.3e+24)) (or (<= x 1.7e+45) (not (<= x 1.15e+103)))))
   (* x (+ -3.0 (* z 6.0)))
   (* 6.0 (* y (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -2.2e-39) || (!(x <= 3.3e+24) && ((x <= 1.7e+45) || !(x <= 1.15e+103)))) {
		tmp = x * (-3.0 + (z * 6.0));
	} else {
		tmp = 6.0 * (y * (0.6666666666666666 - 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 <= (-2.2d-39)) .or. (.not. (x <= 3.3d+24)) .and. (x <= 1.7d+45) .or. (.not. (x <= 1.15d+103))) then
        tmp = x * ((-3.0d0) + (z * 6.0d0))
    else
        tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((x <= -2.2e-39) || (!(x <= 3.3e+24) && ((x <= 1.7e+45) || !(x <= 1.15e+103)))) {
		tmp = x * (-3.0 + (z * 6.0));
	} else {
		tmp = 6.0 * (y * (0.6666666666666666 - z));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -2.2e-39) or (not (x <= 3.3e+24) and ((x <= 1.7e+45) or not (x <= 1.15e+103))):
		tmp = x * (-3.0 + (z * 6.0))
	else:
		tmp = 6.0 * (y * (0.6666666666666666 - z))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -2.2e-39) || (!(x <= 3.3e+24) && ((x <= 1.7e+45) || !(x <= 1.15e+103))))
		tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0)));
	else
		tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((x <= -2.2e-39) || (~((x <= 3.3e+24)) && ((x <= 1.7e+45) || ~((x <= 1.15e+103)))))
		tmp = x * (-3.0 + (z * 6.0));
	else
		tmp = 6.0 * (y * (0.6666666666666666 - z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.2e-39], And[N[Not[LessEqual[x, 3.3e+24]], $MachinePrecision], Or[LessEqual[x, 1.7e+45], N[Not[LessEqual[x, 1.15e+103]], $MachinePrecision]]]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-39} \lor \neg \left(x \leq 3.3 \cdot 10^{+24}\right) \land \left(x \leq 1.7 \cdot 10^{+45} \lor \neg \left(x \leq 1.15 \cdot 10^{+103}\right)\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\

\mathbf{else}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.20000000000000001e-39 or 3.2999999999999999e24 < x < 1.7e45 or 1.15000000000000004e103 < x

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 86.4%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg86.4%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      2. distribute-rgt-in86.4%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      3. metadata-eval86.4%

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

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
      5. neg-mul-186.4%

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

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

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-1 \cdot 4 + -1 \cdot \left(-6 \cdot z\right)\right)}\right) \]
      10. metadata-eval86.4%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      11. metadata-eval86.4%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      12. associate-+r+86.4%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + -1 \cdot \left(-6 \cdot z\right)\right)} \]
      13. metadata-eval86.4%

        \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + -1 \cdot \left(-6 \cdot z\right)\right) \]
      14. metadata-eval86.4%

        \[\leadsto x \cdot \left(\color{blue}{-3} + -1 \cdot \left(-6 \cdot z\right)\right) \]
      15. associate-*r*86.4%

        \[\leadsto x \cdot \left(-3 + \color{blue}{\left(-1 \cdot -6\right) \cdot z}\right) \]
      16. metadata-eval86.4%

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

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot 6}\right) \]
    7. Simplified86.4%

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]

    if -2.20000000000000001e-39 < x < 3.2999999999999999e24 or 1.7e45 < x < 1.15000000000000004e103

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add099.6%

        \[\leadsto x + \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) + 0\right)} \]
      2. associate-*l*99.8%

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

      \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right) + 0\right)} \]
    7. Taylor expanded in x around 0 79.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{-39} \lor \neg \left(x \leq 3.3 \cdot 10^{+24}\right) \land \left(x \leq 1.7 \cdot 10^{+45} \lor \neg \left(x \leq 1.15 \cdot 10^{+103}\right)\right):\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 73.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{-45} \lor \neg \left(x \leq 10^{+24} \lor \neg \left(x \leq 1.6 \cdot 10^{+45}\right) \land x \leq 3.8 \cdot 10^{+103}\right):\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -4.2e-45)
         (not (or (<= x 1e+24) (and (not (<= x 1.6e+45)) (<= x 3.8e+103)))))
   (* x (+ -3.0 (* z 6.0)))
   (* y (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -4.2e-45) || !((x <= 1e+24) || (!(x <= 1.6e+45) && (x <= 3.8e+103)))) {
		tmp = x * (-3.0 + (z * 6.0));
	} else {
		tmp = y * (4.0 + (z * -6.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) :: tmp
    if ((x <= (-4.2d-45)) .or. (.not. (x <= 1d+24) .or. (.not. (x <= 1.6d+45)) .and. (x <= 3.8d+103))) then
        tmp = x * ((-3.0d0) + (z * 6.0d0))
    else
        tmp = y * (4.0d0 + (z * (-6.0d0)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((x <= -4.2e-45) || !((x <= 1e+24) || (!(x <= 1.6e+45) && (x <= 3.8e+103)))) {
		tmp = x * (-3.0 + (z * 6.0));
	} else {
		tmp = y * (4.0 + (z * -6.0));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -4.2e-45) or not ((x <= 1e+24) or (not (x <= 1.6e+45) and (x <= 3.8e+103))):
		tmp = x * (-3.0 + (z * 6.0))
	else:
		tmp = y * (4.0 + (z * -6.0))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -4.2e-45) || !((x <= 1e+24) || (!(x <= 1.6e+45) && (x <= 3.8e+103))))
		tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0)));
	else
		tmp = Float64(y * Float64(4.0 + Float64(z * -6.0)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((x <= -4.2e-45) || ~(((x <= 1e+24) || (~((x <= 1.6e+45)) && (x <= 3.8e+103)))))
		tmp = x * (-3.0 + (z * 6.0));
	else
		tmp = y * (4.0 + (z * -6.0));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[x, -4.2e-45], N[Not[Or[LessEqual[x, 1e+24], And[N[Not[LessEqual[x, 1.6e+45]], $MachinePrecision], LessEqual[x, 3.8e+103]]]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{-45} \lor \neg \left(x \leq 10^{+24} \lor \neg \left(x \leq 1.6 \cdot 10^{+45}\right) \land x \leq 3.8 \cdot 10^{+103}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\

\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.1999999999999999e-45 or 9.9999999999999998e23 < x < 1.6000000000000001e45 or 3.7999999999999997e103 < x

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 86.4%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg86.4%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      2. distribute-rgt-in86.4%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      3. metadata-eval86.4%

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

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
      5. neg-mul-186.4%

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

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

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-1 \cdot 4 + -1 \cdot \left(-6 \cdot z\right)\right)}\right) \]
      10. metadata-eval86.4%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      11. metadata-eval86.4%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      12. associate-+r+86.4%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + -1 \cdot \left(-6 \cdot z\right)\right)} \]
      13. metadata-eval86.4%

        \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + -1 \cdot \left(-6 \cdot z\right)\right) \]
      14. metadata-eval86.4%

        \[\leadsto x \cdot \left(\color{blue}{-3} + -1 \cdot \left(-6 \cdot z\right)\right) \]
      15. associate-*r*86.4%

        \[\leadsto x \cdot \left(-3 + \color{blue}{\left(-1 \cdot -6\right) \cdot z}\right) \]
      16. metadata-eval86.4%

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

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot 6}\right) \]
    7. Simplified86.4%

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]

    if -4.1999999999999999e-45 < x < 9.9999999999999998e23 or 1.6000000000000001e45 < x < 3.7999999999999997e103

    1. Initial program 99.6%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
      5. distribute-rgt-in99.8%

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{0.6666666666666666} \cdot 6 + \left(-z\right) \cdot 6, x\right) \]
      7. metadata-eval99.8%

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
      8. distribute-lft-neg-out99.8%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
      9. distribute-rgt-neg-in99.8%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{z \cdot \left(-6\right)}, x\right) \]
      10. metadata-eval99.8%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 79.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{-45} \lor \neg \left(x \leq 10^{+24} \lor \neg \left(x \leq 1.6 \cdot 10^{+45}\right) \land x \leq 3.8 \cdot 10^{+103}\right):\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 97.8% accurate, 0.8× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\


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

    1. Initial program 99.8%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.8%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) + x} \]
      2. add-sqr-sqrt52.8%

        \[\leadsto \color{blue}{\sqrt{\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \cdot \sqrt{\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} + x \]
      3. fma-define52.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}, \sqrt{\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}, x\right)} \]
      4. associate-*l*52.9%

        \[\leadsto \mathsf{fma}\left(\sqrt{\color{blue}{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)}}, \sqrt{\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}, x\right) \]
      5. associate-*l*52.8%

        \[\leadsto \mathsf{fma}\left(\sqrt{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)}, \sqrt{\color{blue}{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)}}, x\right) \]
    6. Applied egg-rr52.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)}, \sqrt{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)}, x\right)} \]
    7. Step-by-step derivation
      1. fma-undefine52.8%

        \[\leadsto \color{blue}{\sqrt{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)} \cdot \sqrt{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)} + x} \]
      2. add-sqr-sqrt99.7%

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

      \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right) + x} \]
    9. Taylor expanded in z around inf 97.8%

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

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

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

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

    if -0.57999999999999996 < z < 0.599999999999999978

    1. Initial program 99.4%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 98.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.58 \lor \neg \left(z \leq 0.6\right):\\ \;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - x\right) \cdot 4\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 99.7% accurate, 0.9× speedup?

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

\\
x + \left(-6 \cdot \left(\left(y - x\right) \cdot z\right) + \left(y - x\right) \cdot 4\right)
\end{array}
Derivation
  1. Initial program 99.6%

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

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

    \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in z around 0 99.8%

    \[\leadsto x + \color{blue}{\left(-6 \cdot \left(z \cdot \left(y - x\right)\right) + 4 \cdot \left(y - x\right)\right)} \]
  6. Final simplification99.8%

    \[\leadsto x + \left(-6 \cdot \left(\left(y - x\right) \cdot z\right) + \left(y - x\right) \cdot 4\right) \]
  7. Add Preprocessing

Alternative 13: 38.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{+28} \lor \neg \left(x \leq 1.5 \cdot 10^{+28}\right):\\
\;\;\;\;x \cdot -3\\

\mathbf{else}:\\
\;\;\;\;y \cdot 4\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.0000000000000002e28 or 1.5e28 < x

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 80.2%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg80.2%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      2. distribute-rgt-in80.2%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      3. metadata-eval80.2%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      4. metadata-eval80.2%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
      5. neg-mul-180.2%

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

        \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{-1 \cdot \left(z \cdot -6\right)}\right)\right) \]
      7. *-commutative80.2%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-1 \cdot 4 + -1 \cdot \left(-6 \cdot z\right)\right)}\right) \]
      10. metadata-eval80.2%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      11. metadata-eval80.2%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      12. associate-+r+80.2%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + -1 \cdot \left(-6 \cdot z\right)\right)} \]
      13. metadata-eval80.2%

        \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + -1 \cdot \left(-6 \cdot z\right)\right) \]
      14. metadata-eval80.2%

        \[\leadsto x \cdot \left(\color{blue}{-3} + -1 \cdot \left(-6 \cdot z\right)\right) \]
      15. associate-*r*80.2%

        \[\leadsto x \cdot \left(-3 + \color{blue}{\left(-1 \cdot -6\right) \cdot z}\right) \]
      16. metadata-eval80.2%

        \[\leadsto x \cdot \left(-3 + \color{blue}{6} \cdot z\right) \]
      17. *-commutative80.2%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot 6}\right) \]
    7. Simplified80.2%

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
    8. Taylor expanded in z around 0 48.1%

      \[\leadsto \color{blue}{-3 \cdot x} \]
    9. Step-by-step derivation
      1. *-commutative48.1%

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified48.1%

      \[\leadsto \color{blue}{x \cdot -3} \]

    if -6.0000000000000002e28 < x < 1.5e28

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add099.6%

        \[\leadsto x + \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) + 0\right)} \]
      2. associate-*l*99.8%

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

      \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right) + 0\right)} \]
    7. Taylor expanded in x around 0 76.6%

      \[\leadsto \color{blue}{6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)} \]
    8. Taylor expanded in z around 0 40.7%

      \[\leadsto \color{blue}{4 \cdot y} \]
    9. Step-by-step derivation
      1. *-commutative40.7%

        \[\leadsto \color{blue}{y \cdot 4} \]
    10. Simplified40.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6 \cdot 10^{+28} \lor \neg \left(x \leq 1.5 \cdot 10^{+28}\right):\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;y \cdot 4\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 38.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{+28}:\\
\;\;\;\;\frac{x}{-0.3333333333333333}\\

\mathbf{elif}\;x \leq 1.1 \cdot 10^{+24}:\\
\;\;\;\;y \cdot 4\\

\mathbf{else}:\\
\;\;\;\;x \cdot -3\\


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

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 82.5%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg82.5%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      2. distribute-rgt-in82.5%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      3. metadata-eval82.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      4. metadata-eval82.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
      5. neg-mul-182.5%

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

        \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{-1 \cdot \left(z \cdot -6\right)}\right)\right) \]
      7. *-commutative82.5%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-1 \cdot 4 + -1 \cdot \left(-6 \cdot z\right)\right)}\right) \]
      10. metadata-eval82.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      11. metadata-eval82.5%

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

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + -1 \cdot \left(-6 \cdot z\right)\right)} \]
      13. metadata-eval82.5%

        \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + -1 \cdot \left(-6 \cdot z\right)\right) \]
      14. metadata-eval82.5%

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

        \[\leadsto x \cdot \left(-3 + \color{blue}{\left(-1 \cdot -6\right) \cdot z}\right) \]
      16. metadata-eval82.5%

        \[\leadsto x \cdot \left(-3 + \color{blue}{6} \cdot z\right) \]
      17. *-commutative82.5%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot 6}\right) \]
    7. Simplified82.5%

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
    8. Step-by-step derivation
      1. flip-+78.1%

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

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

        \[\leadsto \frac{x \cdot \left(\color{blue}{9} - \left(z \cdot 6\right) \cdot \left(z \cdot 6\right)\right)}{-3 - z \cdot 6} \]
      4. swap-sqr73.6%

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

        \[\leadsto \frac{x \cdot \left(9 - \color{blue}{{z}^{2}} \cdot \left(6 \cdot 6\right)\right)}{-3 - z \cdot 6} \]
      6. metadata-eval73.6%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot \color{blue}{36}\right)}{-3 - z \cdot 6} \]
      7. *-commutative73.6%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{-3 - \color{blue}{6 \cdot z}} \]
      8. cancel-sign-sub-inv73.6%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{\color{blue}{-3 + \left(-6\right) \cdot z}} \]
      9. metadata-eval73.6%

        \[\leadsto \frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{-3 + \color{blue}{-6} \cdot z} \]
    9. Applied egg-rr73.6%

      \[\leadsto \color{blue}{\frac{x \cdot \left(9 - {z}^{2} \cdot 36\right)}{-3 + -6 \cdot z}} \]
    10. Step-by-step derivation
      1. associate-/l*78.1%

        \[\leadsto \color{blue}{\frac{x}{\frac{-3 + -6 \cdot z}{9 - {z}^{2} \cdot 36}}} \]
      2. +-commutative78.1%

        \[\leadsto \frac{x}{\frac{\color{blue}{-6 \cdot z + -3}}{9 - {z}^{2} \cdot 36}} \]
      3. *-commutative78.1%

        \[\leadsto \frac{x}{\frac{\color{blue}{z \cdot -6} + -3}{9 - {z}^{2} \cdot 36}} \]
    11. Simplified78.1%

      \[\leadsto \color{blue}{\frac{x}{\frac{z \cdot -6 + -3}{9 - {z}^{2} \cdot 36}}} \]
    12. Taylor expanded in z around 0 45.4%

      \[\leadsto \frac{x}{\color{blue}{-0.3333333333333333}} \]

    if -3.0000000000000001e28 < x < 1.10000000000000001e24

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add099.6%

        \[\leadsto x + \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) + 0\right)} \]
      2. associate-*l*99.8%

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

      \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right) + 0\right)} \]
    7. Taylor expanded in x around 0 76.6%

      \[\leadsto \color{blue}{6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)} \]
    8. Taylor expanded in z around 0 40.7%

      \[\leadsto \color{blue}{4 \cdot y} \]
    9. Step-by-step derivation
      1. *-commutative40.7%

        \[\leadsto \color{blue}{y \cdot 4} \]
    10. Simplified40.7%

      \[\leadsto \color{blue}{y \cdot 4} \]

    if 1.10000000000000001e24 < x

    1. Initial program 99.5%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 77.9%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg77.9%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      2. distribute-rgt-in77.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      3. metadata-eval77.9%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      4. metadata-eval77.9%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
      5. neg-mul-177.9%

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

        \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{-1 \cdot \left(z \cdot -6\right)}\right)\right) \]
      7. *-commutative77.9%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-1 \cdot 4 + -1 \cdot \left(-6 \cdot z\right)\right)}\right) \]
      10. metadata-eval77.9%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      11. metadata-eval77.9%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
      12. associate-+r+77.9%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + -1 \cdot \left(-6 \cdot z\right)\right)} \]
      13. metadata-eval77.9%

        \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + -1 \cdot \left(-6 \cdot z\right)\right) \]
      14. metadata-eval77.9%

        \[\leadsto x \cdot \left(\color{blue}{-3} + -1 \cdot \left(-6 \cdot z\right)\right) \]
      15. associate-*r*77.9%

        \[\leadsto x \cdot \left(-3 + \color{blue}{\left(-1 \cdot -6\right) \cdot z}\right) \]
      16. metadata-eval77.9%

        \[\leadsto x \cdot \left(-3 + \color{blue}{6} \cdot z\right) \]
      17. *-commutative77.9%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot 6}\right) \]
    7. Simplified77.9%

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
    8. Taylor expanded in z around 0 51.0%

      \[\leadsto \color{blue}{-3 \cdot x} \]
    9. Step-by-step derivation
      1. *-commutative51.0%

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified51.0%

      \[\leadsto \color{blue}{x \cdot -3} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification44.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3 \cdot 10^{+28}:\\ \;\;\;\;\frac{x}{-0.3333333333333333}\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{+24}:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;x \cdot -3\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 99.5% accurate, 1.2× speedup?

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

\\
x + \left(6 \cdot \left(x - y\right)\right) \cdot \left(z - 0.6666666666666666\right)
\end{array}
Derivation
  1. Initial program 99.6%

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

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

    \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
  4. Add Preprocessing
  5. Final simplification99.6%

    \[\leadsto x + \left(6 \cdot \left(x - y\right)\right) \cdot \left(z - 0.6666666666666666\right) \]
  6. Add Preprocessing

Alternative 16: 99.8% accurate, 1.2× speedup?

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

\\
x + \left(x - y\right) \cdot \left(6 \cdot \left(z - 0.6666666666666666\right)\right)
\end{array}
Derivation
  1. Initial program 99.6%

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

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

    \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutative99.6%

      \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) + x} \]
    2. add-sqr-sqrt46.5%

      \[\leadsto \color{blue}{\sqrt{\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \cdot \sqrt{\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} + x \]
    3. fma-define46.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}, \sqrt{\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}, x\right)} \]
    4. associate-*l*46.6%

      \[\leadsto \mathsf{fma}\left(\sqrt{\color{blue}{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)}}, \sqrt{\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}, x\right) \]
    5. associate-*l*46.6%

      \[\leadsto \mathsf{fma}\left(\sqrt{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)}, \sqrt{\color{blue}{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)}}, x\right) \]
  6. Applied egg-rr46.6%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)}, \sqrt{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)}, x\right)} \]
  7. Step-by-step derivation
    1. fma-undefine46.5%

      \[\leadsto \color{blue}{\sqrt{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)} \cdot \sqrt{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)} + x} \]
    2. add-sqr-sqrt99.8%

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

    \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right) + x} \]
  9. Final simplification99.8%

    \[\leadsto x + \left(x - y\right) \cdot \left(6 \cdot \left(z - 0.6666666666666666\right)\right) \]
  10. Add Preprocessing

Alternative 17: 26.3% accurate, 4.3× speedup?

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

\\
x \cdot -3
\end{array}
Derivation
  1. Initial program 99.6%

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

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

    \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf 52.1%

    \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
  6. Step-by-step derivation
    1. sub-neg52.1%

      \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
    2. distribute-rgt-in52.1%

      \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
    3. metadata-eval52.1%

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

      \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
    5. neg-mul-152.1%

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

      \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{-1 \cdot \left(z \cdot -6\right)}\right)\right) \]
    7. *-commutative52.1%

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

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

      \[\leadsto x \cdot \left(1 + \color{blue}{\left(-1 \cdot 4 + -1 \cdot \left(-6 \cdot z\right)\right)}\right) \]
    10. metadata-eval52.1%

      \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
    11. metadata-eval52.1%

      \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + -1 \cdot \left(-6 \cdot z\right)\right)\right) \]
    12. associate-+r+52.1%

      \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + -1 \cdot \left(-6 \cdot z\right)\right)} \]
    13. metadata-eval52.1%

      \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + -1 \cdot \left(-6 \cdot z\right)\right) \]
    14. metadata-eval52.1%

      \[\leadsto x \cdot \left(\color{blue}{-3} + -1 \cdot \left(-6 \cdot z\right)\right) \]
    15. associate-*r*52.1%

      \[\leadsto x \cdot \left(-3 + \color{blue}{\left(-1 \cdot -6\right) \cdot z}\right) \]
    16. metadata-eval52.1%

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

      \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot 6}\right) \]
  7. Simplified52.1%

    \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
  8. Taylor expanded in z around 0 31.3%

    \[\leadsto \color{blue}{-3 \cdot x} \]
  9. Step-by-step derivation
    1. *-commutative31.3%

      \[\leadsto \color{blue}{x \cdot -3} \]
  10. Simplified31.3%

    \[\leadsto \color{blue}{x \cdot -3} \]
  11. Final simplification31.3%

    \[\leadsto x \cdot -3 \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2024034 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, D"
  :precision binary64
  (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))