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

Percentage Accurate: 99.5% → 99.8%
Time: 13.1s
Alternatives: 16
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 16 alternatives:

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

Initial Program: 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.5%

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

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

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

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

      \[\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.7% accurate, 0.2× 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 -5.2 \cdot 10^{+267}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{+225}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{+181}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -5.6 \cdot 10^{+107}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -0.68:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-148}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-214}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-298}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{-215}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-57}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{-24}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.66:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+29} \lor \neg \left(z \leq 1.56 \cdot 10^{+90}\right):\\ \;\;\;\;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 -5.2e+267)
     t_0
     (if (<= z -1.02e+225)
       t_1
       (if (<= z -2.7e+181)
         t_0
         (if (<= z -5.6e+107)
           t_1
           (if (<= z -0.68)
             t_0
             (if (<= z -1.95e-148)
               (* y 4.0)
               (if (<= z -2.8e-214)
                 (* x -3.0)
                 (if (<= z -3.8e-298)
                   (* y 4.0)
                   (if (<= z 4.3e-215)
                     (* x -3.0)
                     (if (<= z 1.05e-57)
                       (* y 4.0)
                       (if (<= z 3.5e-24)
                         (* x -3.0)
                         (if (<= z 0.66)
                           (* y 4.0)
                           (if (or (<= z 4.6e+29) (not (<= z 1.56e+90)))
                             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 <= -5.2e+267) {
		tmp = t_0;
	} else if (z <= -1.02e+225) {
		tmp = t_1;
	} else if (z <= -2.7e+181) {
		tmp = t_0;
	} else if (z <= -5.6e+107) {
		tmp = t_1;
	} else if (z <= -0.68) {
		tmp = t_0;
	} else if (z <= -1.95e-148) {
		tmp = y * 4.0;
	} else if (z <= -2.8e-214) {
		tmp = x * -3.0;
	} else if (z <= -3.8e-298) {
		tmp = y * 4.0;
	} else if (z <= 4.3e-215) {
		tmp = x * -3.0;
	} else if (z <= 1.05e-57) {
		tmp = y * 4.0;
	} else if (z <= 3.5e-24) {
		tmp = x * -3.0;
	} else if (z <= 0.66) {
		tmp = y * 4.0;
	} else if ((z <= 4.6e+29) || !(z <= 1.56e+90)) {
		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 <= (-5.2d+267)) then
        tmp = t_0
    else if (z <= (-1.02d+225)) then
        tmp = t_1
    else if (z <= (-2.7d+181)) then
        tmp = t_0
    else if (z <= (-5.6d+107)) then
        tmp = t_1
    else if (z <= (-0.68d0)) then
        tmp = t_0
    else if (z <= (-1.95d-148)) then
        tmp = y * 4.0d0
    else if (z <= (-2.8d-214)) then
        tmp = x * (-3.0d0)
    else if (z <= (-3.8d-298)) then
        tmp = y * 4.0d0
    else if (z <= 4.3d-215) then
        tmp = x * (-3.0d0)
    else if (z <= 1.05d-57) then
        tmp = y * 4.0d0
    else if (z <= 3.5d-24) then
        tmp = x * (-3.0d0)
    else if (z <= 0.66d0) then
        tmp = y * 4.0d0
    else if ((z <= 4.6d+29) .or. (.not. (z <= 1.56d+90))) 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 <= -5.2e+267) {
		tmp = t_0;
	} else if (z <= -1.02e+225) {
		tmp = t_1;
	} else if (z <= -2.7e+181) {
		tmp = t_0;
	} else if (z <= -5.6e+107) {
		tmp = t_1;
	} else if (z <= -0.68) {
		tmp = t_0;
	} else if (z <= -1.95e-148) {
		tmp = y * 4.0;
	} else if (z <= -2.8e-214) {
		tmp = x * -3.0;
	} else if (z <= -3.8e-298) {
		tmp = y * 4.0;
	} else if (z <= 4.3e-215) {
		tmp = x * -3.0;
	} else if (z <= 1.05e-57) {
		tmp = y * 4.0;
	} else if (z <= 3.5e-24) {
		tmp = x * -3.0;
	} else if (z <= 0.66) {
		tmp = y * 4.0;
	} else if ((z <= 4.6e+29) || !(z <= 1.56e+90)) {
		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 <= -5.2e+267:
		tmp = t_0
	elif z <= -1.02e+225:
		tmp = t_1
	elif z <= -2.7e+181:
		tmp = t_0
	elif z <= -5.6e+107:
		tmp = t_1
	elif z <= -0.68:
		tmp = t_0
	elif z <= -1.95e-148:
		tmp = y * 4.0
	elif z <= -2.8e-214:
		tmp = x * -3.0
	elif z <= -3.8e-298:
		tmp = y * 4.0
	elif z <= 4.3e-215:
		tmp = x * -3.0
	elif z <= 1.05e-57:
		tmp = y * 4.0
	elif z <= 3.5e-24:
		tmp = x * -3.0
	elif z <= 0.66:
		tmp = y * 4.0
	elif (z <= 4.6e+29) or not (z <= 1.56e+90):
		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 <= -5.2e+267)
		tmp = t_0;
	elseif (z <= -1.02e+225)
		tmp = t_1;
	elseif (z <= -2.7e+181)
		tmp = t_0;
	elseif (z <= -5.6e+107)
		tmp = t_1;
	elseif (z <= -0.68)
		tmp = t_0;
	elseif (z <= -1.95e-148)
		tmp = Float64(y * 4.0);
	elseif (z <= -2.8e-214)
		tmp = Float64(x * -3.0);
	elseif (z <= -3.8e-298)
		tmp = Float64(y * 4.0);
	elseif (z <= 4.3e-215)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.05e-57)
		tmp = Float64(y * 4.0);
	elseif (z <= 3.5e-24)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.66)
		tmp = Float64(y * 4.0);
	elseif ((z <= 4.6e+29) || !(z <= 1.56e+90))
		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 <= -5.2e+267)
		tmp = t_0;
	elseif (z <= -1.02e+225)
		tmp = t_1;
	elseif (z <= -2.7e+181)
		tmp = t_0;
	elseif (z <= -5.6e+107)
		tmp = t_1;
	elseif (z <= -0.68)
		tmp = t_0;
	elseif (z <= -1.95e-148)
		tmp = y * 4.0;
	elseif (z <= -2.8e-214)
		tmp = x * -3.0;
	elseif (z <= -3.8e-298)
		tmp = y * 4.0;
	elseif (z <= 4.3e-215)
		tmp = x * -3.0;
	elseif (z <= 1.05e-57)
		tmp = y * 4.0;
	elseif (z <= 3.5e-24)
		tmp = x * -3.0;
	elseif (z <= 0.66)
		tmp = y * 4.0;
	elseif ((z <= 4.6e+29) || ~((z <= 1.56e+90)))
		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, -5.2e+267], t$95$0, If[LessEqual[z, -1.02e+225], t$95$1, If[LessEqual[z, -2.7e+181], t$95$0, If[LessEqual[z, -5.6e+107], t$95$1, If[LessEqual[z, -0.68], t$95$0, If[LessEqual[z, -1.95e-148], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -2.8e-214], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -3.8e-298], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 4.3e-215], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.05e-57], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.5e-24], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.66], N[(y * 4.0), $MachinePrecision], If[Or[LessEqual[z, 4.6e+29], N[Not[LessEqual[z, 1.56e+90]], $MachinePrecision]], 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 -5.2 \cdot 10^{+267}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -1.02 \cdot 10^{+225}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -2.7 \cdot 10^{+181}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -5.6 \cdot 10^{+107}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -0.68:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -1.95 \cdot 10^{-148}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq -2.8 \cdot 10^{-214}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq -3.8 \cdot 10^{-298}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 4.3 \cdot 10^{-215}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 1.05 \cdot 10^{-57}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 3.5 \cdot 10^{-24}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 4.6 \cdot 10^{+29} \lor \neg \left(z \leq 1.56 \cdot 10^{+90}\right):\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.20000000000000005e267 or -1.0200000000000001e225 < z < -2.70000000000000007e181 or -5.59999999999999969e107 < z < -0.680000000000000049 or 0.660000000000000031 < z < 4.6000000000000002e29 or 1.56000000000000004e90 < z

    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. +-commutative99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.20000000000000005e267 < z < -1.0200000000000001e225 or -2.70000000000000007e181 < z < -5.59999999999999969e107 or 4.6000000000000002e29 < z < 1.56000000000000004e90

    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 75.3%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in75.3%

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

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

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

      \[\leadsto \color{blue}{6 \cdot \left(x \cdot z\right)} \]
    9. Step-by-step derivation
      1. *-commutative75.3%

        \[\leadsto 6 \cdot \color{blue}{\left(z \cdot x\right)} \]
    10. Simplified75.3%

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

    if -0.680000000000000049 < z < -1.94999999999999997e-148 or -2.8000000000000002e-214 < z < -3.8e-298 or 4.30000000000000024e-215 < z < 1.05e-57 or 3.4999999999999996e-24 < z < 0.660000000000000031

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    8. Simplified62.0%

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

    if -1.94999999999999997e-148 < z < -2.8000000000000002e-214 or -3.8e-298 < z < 4.30000000000000024e-215 or 1.05e-57 < z < 3.4999999999999996e-24

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in69.0%

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified69.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{+267}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{+225}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{+181}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -5.6 \cdot 10^{+107}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -0.68:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-148}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-214}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-298}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{-215}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-57}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{-24}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.66:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+29} \lor \neg \left(z \leq 1.56 \cdot 10^{+90}\right):\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 50.7% accurate, 0.2× 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 -9.6 \cdot 10^{+272}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{+225}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -1.35 \cdot 10^{+179}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{+107}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -0.68:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-148}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-212}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-298}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-215}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-57}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-25}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.66:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{+29} \lor \neg \left(z \leq 1.6 \cdot 10^{+90}\right):\\ \;\;\;\;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 -9.6e+272)
     t_0
     (if (<= z -3.7e+225)
       (* x (* z 6.0))
       (if (<= z -1.35e+179)
         t_0
         (if (<= z -6.5e+107)
           t_1
           (if (<= z -0.68)
             t_0
             (if (<= z -1.45e-148)
               (* y 4.0)
               (if (<= z -2.6e-212)
                 (* x -3.0)
                 (if (<= z -5.2e-298)
                   (* y 4.0)
                   (if (<= z 3.6e-215)
                     (* x -3.0)
                     (if (<= z 2.2e-57)
                       (* y 4.0)
                       (if (<= z 3.1e-25)
                         (* x -3.0)
                         (if (<= z 0.66)
                           (* y 4.0)
                           (if (or (<= z 6.5e+29) (not (<= z 1.6e+90)))
                             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 <= -9.6e+272) {
		tmp = t_0;
	} else if (z <= -3.7e+225) {
		tmp = x * (z * 6.0);
	} else if (z <= -1.35e+179) {
		tmp = t_0;
	} else if (z <= -6.5e+107) {
		tmp = t_1;
	} else if (z <= -0.68) {
		tmp = t_0;
	} else if (z <= -1.45e-148) {
		tmp = y * 4.0;
	} else if (z <= -2.6e-212) {
		tmp = x * -3.0;
	} else if (z <= -5.2e-298) {
		tmp = y * 4.0;
	} else if (z <= 3.6e-215) {
		tmp = x * -3.0;
	} else if (z <= 2.2e-57) {
		tmp = y * 4.0;
	} else if (z <= 3.1e-25) {
		tmp = x * -3.0;
	} else if (z <= 0.66) {
		tmp = y * 4.0;
	} else if ((z <= 6.5e+29) || !(z <= 1.6e+90)) {
		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 <= (-9.6d+272)) then
        tmp = t_0
    else if (z <= (-3.7d+225)) then
        tmp = x * (z * 6.0d0)
    else if (z <= (-1.35d+179)) then
        tmp = t_0
    else if (z <= (-6.5d+107)) then
        tmp = t_1
    else if (z <= (-0.68d0)) then
        tmp = t_0
    else if (z <= (-1.45d-148)) then
        tmp = y * 4.0d0
    else if (z <= (-2.6d-212)) then
        tmp = x * (-3.0d0)
    else if (z <= (-5.2d-298)) then
        tmp = y * 4.0d0
    else if (z <= 3.6d-215) then
        tmp = x * (-3.0d0)
    else if (z <= 2.2d-57) then
        tmp = y * 4.0d0
    else if (z <= 3.1d-25) then
        tmp = x * (-3.0d0)
    else if (z <= 0.66d0) then
        tmp = y * 4.0d0
    else if ((z <= 6.5d+29) .or. (.not. (z <= 1.6d+90))) 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 <= -9.6e+272) {
		tmp = t_0;
	} else if (z <= -3.7e+225) {
		tmp = x * (z * 6.0);
	} else if (z <= -1.35e+179) {
		tmp = t_0;
	} else if (z <= -6.5e+107) {
		tmp = t_1;
	} else if (z <= -0.68) {
		tmp = t_0;
	} else if (z <= -1.45e-148) {
		tmp = y * 4.0;
	} else if (z <= -2.6e-212) {
		tmp = x * -3.0;
	} else if (z <= -5.2e-298) {
		tmp = y * 4.0;
	} else if (z <= 3.6e-215) {
		tmp = x * -3.0;
	} else if (z <= 2.2e-57) {
		tmp = y * 4.0;
	} else if (z <= 3.1e-25) {
		tmp = x * -3.0;
	} else if (z <= 0.66) {
		tmp = y * 4.0;
	} else if ((z <= 6.5e+29) || !(z <= 1.6e+90)) {
		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 <= -9.6e+272:
		tmp = t_0
	elif z <= -3.7e+225:
		tmp = x * (z * 6.0)
	elif z <= -1.35e+179:
		tmp = t_0
	elif z <= -6.5e+107:
		tmp = t_1
	elif z <= -0.68:
		tmp = t_0
	elif z <= -1.45e-148:
		tmp = y * 4.0
	elif z <= -2.6e-212:
		tmp = x * -3.0
	elif z <= -5.2e-298:
		tmp = y * 4.0
	elif z <= 3.6e-215:
		tmp = x * -3.0
	elif z <= 2.2e-57:
		tmp = y * 4.0
	elif z <= 3.1e-25:
		tmp = x * -3.0
	elif z <= 0.66:
		tmp = y * 4.0
	elif (z <= 6.5e+29) or not (z <= 1.6e+90):
		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 <= -9.6e+272)
		tmp = t_0;
	elseif (z <= -3.7e+225)
		tmp = Float64(x * Float64(z * 6.0));
	elseif (z <= -1.35e+179)
		tmp = t_0;
	elseif (z <= -6.5e+107)
		tmp = t_1;
	elseif (z <= -0.68)
		tmp = t_0;
	elseif (z <= -1.45e-148)
		tmp = Float64(y * 4.0);
	elseif (z <= -2.6e-212)
		tmp = Float64(x * -3.0);
	elseif (z <= -5.2e-298)
		tmp = Float64(y * 4.0);
	elseif (z <= 3.6e-215)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.2e-57)
		tmp = Float64(y * 4.0);
	elseif (z <= 3.1e-25)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.66)
		tmp = Float64(y * 4.0);
	elseif ((z <= 6.5e+29) || !(z <= 1.6e+90))
		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 <= -9.6e+272)
		tmp = t_0;
	elseif (z <= -3.7e+225)
		tmp = x * (z * 6.0);
	elseif (z <= -1.35e+179)
		tmp = t_0;
	elseif (z <= -6.5e+107)
		tmp = t_1;
	elseif (z <= -0.68)
		tmp = t_0;
	elseif (z <= -1.45e-148)
		tmp = y * 4.0;
	elseif (z <= -2.6e-212)
		tmp = x * -3.0;
	elseif (z <= -5.2e-298)
		tmp = y * 4.0;
	elseif (z <= 3.6e-215)
		tmp = x * -3.0;
	elseif (z <= 2.2e-57)
		tmp = y * 4.0;
	elseif (z <= 3.1e-25)
		tmp = x * -3.0;
	elseif (z <= 0.66)
		tmp = y * 4.0;
	elseif ((z <= 6.5e+29) || ~((z <= 1.6e+90)))
		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, -9.6e+272], t$95$0, If[LessEqual[z, -3.7e+225], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.35e+179], t$95$0, If[LessEqual[z, -6.5e+107], t$95$1, If[LessEqual[z, -0.68], t$95$0, If[LessEqual[z, -1.45e-148], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -2.6e-212], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -5.2e-298], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.6e-215], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.2e-57], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.1e-25], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.66], N[(y * 4.0), $MachinePrecision], If[Or[LessEqual[z, 6.5e+29], N[Not[LessEqual[z, 1.6e+90]], $MachinePrecision]], 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 -9.6 \cdot 10^{+272}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;z \leq -1.35 \cdot 10^{+179}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -6.5 \cdot 10^{+107}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -0.68:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -1.45 \cdot 10^{-148}:\\
\;\;\;\;y \cdot 4\\

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

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

\mathbf{elif}\;z \leq 3.6 \cdot 10^{-215}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 2.2 \cdot 10^{-57}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 3.1 \cdot 10^{-25}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 6.5 \cdot 10^{+29} \lor \neg \left(z \leq 1.6 \cdot 10^{+90}\right):\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -9.6000000000000001e272 or -3.69999999999999995e225 < z < -1.34999999999999991e179 or -6.5000000000000006e107 < z < -0.680000000000000049 or 0.660000000000000031 < z < 6.49999999999999971e29 or 1.59999999999999999e90 < z

    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. +-commutative99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.6000000000000001e272 < z < -3.69999999999999995e225

    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 86.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.34999999999999991e179 < z < -6.5000000000000006e107 or 6.49999999999999971e29 < z < 1.59999999999999999e90

    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 x around inf 72.6%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in72.6%

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

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

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

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

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

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

    if -0.680000000000000049 < z < -1.4499999999999999e-148 or -2.6e-212 < z < -5.1999999999999998e-298 or 3.5999999999999999e-215 < z < 2.19999999999999999e-57 or 3.09999999999999995e-25 < z < 0.660000000000000031

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    8. Simplified62.0%

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

    if -1.4499999999999999e-148 < z < -2.6e-212 or -5.1999999999999998e-298 < z < 3.5999999999999999e-215 or 2.19999999999999999e-57 < z < 3.09999999999999995e-25

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in69.0%

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified69.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.6 \cdot 10^{+272}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{+225}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -1.35 \cdot 10^{+179}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{+107}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -0.68:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-148}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-212}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-298}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-215}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-57}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-25}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.66:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{+29} \lor \neg \left(z \leq 1.6 \cdot 10^{+90}\right):\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 50.7% accurate, 0.2× 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 -7.8 \cdot 10^{+278}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{+225}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{+183}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -5.6 \cdot 10^{+107}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -0.68:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-147}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -8.8 \cdot 10^{-212}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -4.6 \cdot 10^{-299}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-214}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-53}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{-25}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.66:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{+30} \lor \neg \left(z \leq 7.5 \cdot 10^{+89}\right):\\ \;\;\;\;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 -7.8e+278)
     t_0
     (if (<= z -1.02e+225)
       (* x (* z 6.0))
       (if (<= z -1.1e+183)
         (* y (* z -6.0))
         (if (<= z -5.6e+107)
           t_1
           (if (<= z -0.68)
             t_0
             (if (<= z -3.5e-147)
               (* y 4.0)
               (if (<= z -8.8e-212)
                 (* x -3.0)
                 (if (<= z -4.6e-299)
                   (* y 4.0)
                   (if (<= z 2.1e-214)
                     (* x -3.0)
                     (if (<= z 1.05e-53)
                       (* y 4.0)
                       (if (<= z 2.05e-25)
                         (* x -3.0)
                         (if (<= z 0.66)
                           (* y 4.0)
                           (if (or (<= z 2.15e+30) (not (<= z 7.5e+89)))
                             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 <= -7.8e+278) {
		tmp = t_0;
	} else if (z <= -1.02e+225) {
		tmp = x * (z * 6.0);
	} else if (z <= -1.1e+183) {
		tmp = y * (z * -6.0);
	} else if (z <= -5.6e+107) {
		tmp = t_1;
	} else if (z <= -0.68) {
		tmp = t_0;
	} else if (z <= -3.5e-147) {
		tmp = y * 4.0;
	} else if (z <= -8.8e-212) {
		tmp = x * -3.0;
	} else if (z <= -4.6e-299) {
		tmp = y * 4.0;
	} else if (z <= 2.1e-214) {
		tmp = x * -3.0;
	} else if (z <= 1.05e-53) {
		tmp = y * 4.0;
	} else if (z <= 2.05e-25) {
		tmp = x * -3.0;
	} else if (z <= 0.66) {
		tmp = y * 4.0;
	} else if ((z <= 2.15e+30) || !(z <= 7.5e+89)) {
		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 <= (-7.8d+278)) then
        tmp = t_0
    else if (z <= (-1.02d+225)) then
        tmp = x * (z * 6.0d0)
    else if (z <= (-1.1d+183)) then
        tmp = y * (z * (-6.0d0))
    else if (z <= (-5.6d+107)) then
        tmp = t_1
    else if (z <= (-0.68d0)) then
        tmp = t_0
    else if (z <= (-3.5d-147)) then
        tmp = y * 4.0d0
    else if (z <= (-8.8d-212)) then
        tmp = x * (-3.0d0)
    else if (z <= (-4.6d-299)) then
        tmp = y * 4.0d0
    else if (z <= 2.1d-214) then
        tmp = x * (-3.0d0)
    else if (z <= 1.05d-53) then
        tmp = y * 4.0d0
    else if (z <= 2.05d-25) then
        tmp = x * (-3.0d0)
    else if (z <= 0.66d0) then
        tmp = y * 4.0d0
    else if ((z <= 2.15d+30) .or. (.not. (z <= 7.5d+89))) 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 <= -7.8e+278) {
		tmp = t_0;
	} else if (z <= -1.02e+225) {
		tmp = x * (z * 6.0);
	} else if (z <= -1.1e+183) {
		tmp = y * (z * -6.0);
	} else if (z <= -5.6e+107) {
		tmp = t_1;
	} else if (z <= -0.68) {
		tmp = t_0;
	} else if (z <= -3.5e-147) {
		tmp = y * 4.0;
	} else if (z <= -8.8e-212) {
		tmp = x * -3.0;
	} else if (z <= -4.6e-299) {
		tmp = y * 4.0;
	} else if (z <= 2.1e-214) {
		tmp = x * -3.0;
	} else if (z <= 1.05e-53) {
		tmp = y * 4.0;
	} else if (z <= 2.05e-25) {
		tmp = x * -3.0;
	} else if (z <= 0.66) {
		tmp = y * 4.0;
	} else if ((z <= 2.15e+30) || !(z <= 7.5e+89)) {
		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 <= -7.8e+278:
		tmp = t_0
	elif z <= -1.02e+225:
		tmp = x * (z * 6.0)
	elif z <= -1.1e+183:
		tmp = y * (z * -6.0)
	elif z <= -5.6e+107:
		tmp = t_1
	elif z <= -0.68:
		tmp = t_0
	elif z <= -3.5e-147:
		tmp = y * 4.0
	elif z <= -8.8e-212:
		tmp = x * -3.0
	elif z <= -4.6e-299:
		tmp = y * 4.0
	elif z <= 2.1e-214:
		tmp = x * -3.0
	elif z <= 1.05e-53:
		tmp = y * 4.0
	elif z <= 2.05e-25:
		tmp = x * -3.0
	elif z <= 0.66:
		tmp = y * 4.0
	elif (z <= 2.15e+30) or not (z <= 7.5e+89):
		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 <= -7.8e+278)
		tmp = t_0;
	elseif (z <= -1.02e+225)
		tmp = Float64(x * Float64(z * 6.0));
	elseif (z <= -1.1e+183)
		tmp = Float64(y * Float64(z * -6.0));
	elseif (z <= -5.6e+107)
		tmp = t_1;
	elseif (z <= -0.68)
		tmp = t_0;
	elseif (z <= -3.5e-147)
		tmp = Float64(y * 4.0);
	elseif (z <= -8.8e-212)
		tmp = Float64(x * -3.0);
	elseif (z <= -4.6e-299)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.1e-214)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.05e-53)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.05e-25)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.66)
		tmp = Float64(y * 4.0);
	elseif ((z <= 2.15e+30) || !(z <= 7.5e+89))
		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 <= -7.8e+278)
		tmp = t_0;
	elseif (z <= -1.02e+225)
		tmp = x * (z * 6.0);
	elseif (z <= -1.1e+183)
		tmp = y * (z * -6.0);
	elseif (z <= -5.6e+107)
		tmp = t_1;
	elseif (z <= -0.68)
		tmp = t_0;
	elseif (z <= -3.5e-147)
		tmp = y * 4.0;
	elseif (z <= -8.8e-212)
		tmp = x * -3.0;
	elseif (z <= -4.6e-299)
		tmp = y * 4.0;
	elseif (z <= 2.1e-214)
		tmp = x * -3.0;
	elseif (z <= 1.05e-53)
		tmp = y * 4.0;
	elseif (z <= 2.05e-25)
		tmp = x * -3.0;
	elseif (z <= 0.66)
		tmp = y * 4.0;
	elseif ((z <= 2.15e+30) || ~((z <= 7.5e+89)))
		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, -7.8e+278], t$95$0, If[LessEqual[z, -1.02e+225], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.1e+183], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.6e+107], t$95$1, If[LessEqual[z, -0.68], t$95$0, If[LessEqual[z, -3.5e-147], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -8.8e-212], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -4.6e-299], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.1e-214], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.05e-53], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.05e-25], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.66], N[(y * 4.0), $MachinePrecision], If[Or[LessEqual[z, 2.15e+30], N[Not[LessEqual[z, 7.5e+89]], $MachinePrecision]], 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 -7.8 \cdot 10^{+278}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;z \leq -1.1 \cdot 10^{+183}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\

\mathbf{elif}\;z \leq -5.6 \cdot 10^{+107}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -0.68:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -3.5 \cdot 10^{-147}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq -8.8 \cdot 10^{-212}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq -4.6 \cdot 10^{-299}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 2.1 \cdot 10^{-214}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 1.05 \cdot 10^{-53}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 2.05 \cdot 10^{-25}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 2.15 \cdot 10^{+30} \lor \neg \left(z \leq 7.5 \cdot 10^{+89}\right):\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -7.8000000000000004e278 or -5.59999999999999969e107 < z < -0.680000000000000049 or 0.660000000000000031 < z < 2.15e30 or 7.49999999999999947e89 < z

    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. +-commutative99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.8000000000000004e278 < z < -1.0200000000000001e225

    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 86.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.0200000000000001e225 < z < -1.09999999999999995e183

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.09999999999999995e183 < z < -5.59999999999999969e107 or 2.15e30 < z < 7.49999999999999947e89

    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 x around inf 72.6%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in72.6%

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

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

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

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

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

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

    if -0.680000000000000049 < z < -3.50000000000000004e-147 or -8.80000000000000012e-212 < z < -4.6000000000000001e-299 or 2.09999999999999992e-214 < z < 1.04999999999999989e-53 or 2.04999999999999994e-25 < z < 0.660000000000000031

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    8. Simplified62.0%

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

    if -3.50000000000000004e-147 < z < -8.80000000000000012e-212 or -4.6000000000000001e-299 < z < 2.09999999999999992e-214 or 1.04999999999999989e-53 < z < 2.04999999999999994e-25

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in69.0%

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified69.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.8 \cdot 10^{+278}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{+225}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{+183}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -5.6 \cdot 10^{+107}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -0.68:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-147}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -8.8 \cdot 10^{-212}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -4.6 \cdot 10^{-299}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-214}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-53}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{-25}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.66:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{+30} \lor \neg \left(z \leq 7.5 \cdot 10^{+89}\right):\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 50.6% accurate, 0.2× 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 -1.2 \cdot 10^{+264}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.28 \cdot 10^{+225}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{+180}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{+107}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -0.68:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-147}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-212}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-299}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-211}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{-57}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-24}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.66:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+29}:\\ \;\;\;\;z \cdot \left(y \cdot -6\right)\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+89}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \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 -1.2e+264)
     t_0
     (if (<= z -1.28e+225)
       (* x (* z 6.0))
       (if (<= z -3.6e+180)
         (* y (* z -6.0))
         (if (<= z -8.5e+107)
           t_1
           (if (<= z -0.68)
             t_0
             (if (<= z -1.45e-147)
               (* y 4.0)
               (if (<= z -2.9e-212)
                 (* x -3.0)
                 (if (<= z -4.5e-299)
                   (* y 4.0)
                   (if (<= z 1.7e-211)
                     (* x -3.0)
                     (if (<= z 2.35e-57)
                       (* y 4.0)
                       (if (<= z 1.1e-24)
                         (* x -3.0)
                         (if (<= z 0.66)
                           (* y 4.0)
                           (if (<= z 3.8e+29)
                             (* z (* y -6.0))
                             (if (<= z 8.5e+89) t_1 t_0))))))))))))))))
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 <= -1.2e+264) {
		tmp = t_0;
	} else if (z <= -1.28e+225) {
		tmp = x * (z * 6.0);
	} else if (z <= -3.6e+180) {
		tmp = y * (z * -6.0);
	} else if (z <= -8.5e+107) {
		tmp = t_1;
	} else if (z <= -0.68) {
		tmp = t_0;
	} else if (z <= -1.45e-147) {
		tmp = y * 4.0;
	} else if (z <= -2.9e-212) {
		tmp = x * -3.0;
	} else if (z <= -4.5e-299) {
		tmp = y * 4.0;
	} else if (z <= 1.7e-211) {
		tmp = x * -3.0;
	} else if (z <= 2.35e-57) {
		tmp = y * 4.0;
	} else if (z <= 1.1e-24) {
		tmp = x * -3.0;
	} else if (z <= 0.66) {
		tmp = y * 4.0;
	} else if (z <= 3.8e+29) {
		tmp = z * (y * -6.0);
	} else if (z <= 8.5e+89) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_0 = (-6.0d0) * (y * z)
    t_1 = 6.0d0 * (x * z)
    if (z <= (-1.2d+264)) then
        tmp = t_0
    else if (z <= (-1.28d+225)) then
        tmp = x * (z * 6.0d0)
    else if (z <= (-3.6d+180)) then
        tmp = y * (z * (-6.0d0))
    else if (z <= (-8.5d+107)) then
        tmp = t_1
    else if (z <= (-0.68d0)) then
        tmp = t_0
    else if (z <= (-1.45d-147)) then
        tmp = y * 4.0d0
    else if (z <= (-2.9d-212)) then
        tmp = x * (-3.0d0)
    else if (z <= (-4.5d-299)) then
        tmp = y * 4.0d0
    else if (z <= 1.7d-211) then
        tmp = x * (-3.0d0)
    else if (z <= 2.35d-57) then
        tmp = y * 4.0d0
    else if (z <= 1.1d-24) then
        tmp = x * (-3.0d0)
    else if (z <= 0.66d0) then
        tmp = y * 4.0d0
    else if (z <= 3.8d+29) then
        tmp = z * (y * (-6.0d0))
    else if (z <= 8.5d+89) then
        tmp = t_1
    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 t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -1.2e+264) {
		tmp = t_0;
	} else if (z <= -1.28e+225) {
		tmp = x * (z * 6.0);
	} else if (z <= -3.6e+180) {
		tmp = y * (z * -6.0);
	} else if (z <= -8.5e+107) {
		tmp = t_1;
	} else if (z <= -0.68) {
		tmp = t_0;
	} else if (z <= -1.45e-147) {
		tmp = y * 4.0;
	} else if (z <= -2.9e-212) {
		tmp = x * -3.0;
	} else if (z <= -4.5e-299) {
		tmp = y * 4.0;
	} else if (z <= 1.7e-211) {
		tmp = x * -3.0;
	} else if (z <= 2.35e-57) {
		tmp = y * 4.0;
	} else if (z <= 1.1e-24) {
		tmp = x * -3.0;
	} else if (z <= 0.66) {
		tmp = y * 4.0;
	} else if (z <= 3.8e+29) {
		tmp = z * (y * -6.0);
	} else if (z <= 8.5e+89) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	t_1 = 6.0 * (x * z)
	tmp = 0
	if z <= -1.2e+264:
		tmp = t_0
	elif z <= -1.28e+225:
		tmp = x * (z * 6.0)
	elif z <= -3.6e+180:
		tmp = y * (z * -6.0)
	elif z <= -8.5e+107:
		tmp = t_1
	elif z <= -0.68:
		tmp = t_0
	elif z <= -1.45e-147:
		tmp = y * 4.0
	elif z <= -2.9e-212:
		tmp = x * -3.0
	elif z <= -4.5e-299:
		tmp = y * 4.0
	elif z <= 1.7e-211:
		tmp = x * -3.0
	elif z <= 2.35e-57:
		tmp = y * 4.0
	elif z <= 1.1e-24:
		tmp = x * -3.0
	elif z <= 0.66:
		tmp = y * 4.0
	elif z <= 3.8e+29:
		tmp = z * (y * -6.0)
	elif z <= 8.5e+89:
		tmp = t_1
	else:
		tmp = t_0
	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 <= -1.2e+264)
		tmp = t_0;
	elseif (z <= -1.28e+225)
		tmp = Float64(x * Float64(z * 6.0));
	elseif (z <= -3.6e+180)
		tmp = Float64(y * Float64(z * -6.0));
	elseif (z <= -8.5e+107)
		tmp = t_1;
	elseif (z <= -0.68)
		tmp = t_0;
	elseif (z <= -1.45e-147)
		tmp = Float64(y * 4.0);
	elseif (z <= -2.9e-212)
		tmp = Float64(x * -3.0);
	elseif (z <= -4.5e-299)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.7e-211)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.35e-57)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.1e-24)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.66)
		tmp = Float64(y * 4.0);
	elseif (z <= 3.8e+29)
		tmp = Float64(z * Float64(y * -6.0));
	elseif (z <= 8.5e+89)
		tmp = t_1;
	else
		tmp = t_0;
	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 <= -1.2e+264)
		tmp = t_0;
	elseif (z <= -1.28e+225)
		tmp = x * (z * 6.0);
	elseif (z <= -3.6e+180)
		tmp = y * (z * -6.0);
	elseif (z <= -8.5e+107)
		tmp = t_1;
	elseif (z <= -0.68)
		tmp = t_0;
	elseif (z <= -1.45e-147)
		tmp = y * 4.0;
	elseif (z <= -2.9e-212)
		tmp = x * -3.0;
	elseif (z <= -4.5e-299)
		tmp = y * 4.0;
	elseif (z <= 1.7e-211)
		tmp = x * -3.0;
	elseif (z <= 2.35e-57)
		tmp = y * 4.0;
	elseif (z <= 1.1e-24)
		tmp = x * -3.0;
	elseif (z <= 0.66)
		tmp = y * 4.0;
	elseif (z <= 3.8e+29)
		tmp = z * (y * -6.0);
	elseif (z <= 8.5e+89)
		tmp = t_1;
	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]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.2e+264], t$95$0, If[LessEqual[z, -1.28e+225], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.6e+180], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.5e+107], t$95$1, If[LessEqual[z, -0.68], t$95$0, If[LessEqual[z, -1.45e-147], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -2.9e-212], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -4.5e-299], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.7e-211], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.35e-57], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.1e-24], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.66], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.8e+29], N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+89], t$95$1, t$95$0]]]]]]]]]]]]]]]]
\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 -1.2 \cdot 10^{+264}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;z \leq -3.6 \cdot 10^{+180}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\

\mathbf{elif}\;z \leq -8.5 \cdot 10^{+107}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -0.68:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -1.45 \cdot 10^{-147}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq -2.9 \cdot 10^{-212}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq -4.5 \cdot 10^{-299}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 1.7 \cdot 10^{-211}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 2.35 \cdot 10^{-57}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 1.1 \cdot 10^{-24}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 3.8 \cdot 10^{+29}:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\

\mathbf{elif}\;z \leq 8.5 \cdot 10^{+89}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if z < -1.19999999999999996e264 or -8.4999999999999999e107 < z < -0.680000000000000049 or 8.50000000000000045e89 < z

    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. +-commutative99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.19999999999999996e264 < z < -1.28000000000000006e225

    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 86.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.28000000000000006e225 < z < -3.6000000000000002e180

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.6000000000000002e180 < z < -8.4999999999999999e107 or 3.79999999999999971e29 < z < 8.50000000000000045e89

    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 x around inf 72.6%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in72.6%

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

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

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

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

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

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

    if -0.680000000000000049 < z < -1.4500000000000001e-147 or -2.8999999999999999e-212 < z < -4.50000000000000003e-299 or 1.7e-211 < z < 2.3499999999999999e-57 or 1.10000000000000001e-24 < z < 0.660000000000000031

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    8. Simplified62.0%

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

    if -1.4500000000000001e-147 < z < -2.8999999999999999e-212 or -4.50000000000000003e-299 < z < 1.7e-211 or 2.3499999999999999e-57 < z < 1.10000000000000001e-24

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in69.0%

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified69.0%

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

    if 0.660000000000000031 < z < 3.79999999999999971e29

    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 0 99.7%

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

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

        \[\leadsto \color{blue}{\left(6 \cdot y\right) \cdot \left(0.6666666666666666 - z\right)} \]
      2. *-commutative84.1%

        \[\leadsto \color{blue}{\left(y \cdot 6\right)} \cdot \left(0.6666666666666666 - z\right) \]
    8. Simplified84.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+264}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.28 \cdot 10^{+225}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{+180}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{+107}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -0.68:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-147}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-212}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-299}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-211}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{-57}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-24}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.66:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+29}:\\ \;\;\;\;z \cdot \left(y \cdot -6\right)\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+89}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\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 -0.0215:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{-148}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-212}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -7.6 \cdot 10^{-298}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-211}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{-57}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-24}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.6:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* (- y x) z))))
   (if (<= z -0.0215)
     t_0
     (if (<= z -1.55e-148)
       (* y 4.0)
       (if (<= z -1.45e-212)
         (* x -3.0)
         (if (<= z -7.6e-298)
           (* y 4.0)
           (if (<= z 2.3e-211)
             (* x -3.0)
             (if (<= z 8.2e-57)
               (* y 4.0)
               (if (<= z 1.7e-24)
                 (* x -3.0)
                 (if (<= z 0.6) (* y 4.0) t_0))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -0.0215) {
		tmp = t_0;
	} else if (z <= -1.55e-148) {
		tmp = y * 4.0;
	} else if (z <= -1.45e-212) {
		tmp = x * -3.0;
	} else if (z <= -7.6e-298) {
		tmp = y * 4.0;
	} else if (z <= 2.3e-211) {
		tmp = x * -3.0;
	} else if (z <= 8.2e-57) {
		tmp = y * 4.0;
	} else if (z <= 1.7e-24) {
		tmp = x * -3.0;
	} else if (z <= 0.6) {
		tmp = y * 4.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 <= (-0.0215d0)) then
        tmp = t_0
    else if (z <= (-1.55d-148)) then
        tmp = y * 4.0d0
    else if (z <= (-1.45d-212)) then
        tmp = x * (-3.0d0)
    else if (z <= (-7.6d-298)) then
        tmp = y * 4.0d0
    else if (z <= 2.3d-211) then
        tmp = x * (-3.0d0)
    else if (z <= 8.2d-57) then
        tmp = y * 4.0d0
    else if (z <= 1.7d-24) then
        tmp = x * (-3.0d0)
    else if (z <= 0.6d0) then
        tmp = y * 4.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 <= -0.0215) {
		tmp = t_0;
	} else if (z <= -1.55e-148) {
		tmp = y * 4.0;
	} else if (z <= -1.45e-212) {
		tmp = x * -3.0;
	} else if (z <= -7.6e-298) {
		tmp = y * 4.0;
	} else if (z <= 2.3e-211) {
		tmp = x * -3.0;
	} else if (z <= 8.2e-57) {
		tmp = y * 4.0;
	} else if (z <= 1.7e-24) {
		tmp = x * -3.0;
	} else if (z <= 0.6) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * ((y - x) * z)
	tmp = 0
	if z <= -0.0215:
		tmp = t_0
	elif z <= -1.55e-148:
		tmp = y * 4.0
	elif z <= -1.45e-212:
		tmp = x * -3.0
	elif z <= -7.6e-298:
		tmp = y * 4.0
	elif z <= 2.3e-211:
		tmp = x * -3.0
	elif z <= 8.2e-57:
		tmp = y * 4.0
	elif z <= 1.7e-24:
		tmp = x * -3.0
	elif z <= 0.6:
		tmp = y * 4.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 <= -0.0215)
		tmp = t_0;
	elseif (z <= -1.55e-148)
		tmp = Float64(y * 4.0);
	elseif (z <= -1.45e-212)
		tmp = Float64(x * -3.0);
	elseif (z <= -7.6e-298)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.3e-211)
		tmp = Float64(x * -3.0);
	elseif (z <= 8.2e-57)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.7e-24)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.6)
		tmp = Float64(y * 4.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 <= -0.0215)
		tmp = t_0;
	elseif (z <= -1.55e-148)
		tmp = y * 4.0;
	elseif (z <= -1.45e-212)
		tmp = x * -3.0;
	elseif (z <= -7.6e-298)
		tmp = y * 4.0;
	elseif (z <= 2.3e-211)
		tmp = x * -3.0;
	elseif (z <= 8.2e-57)
		tmp = y * 4.0;
	elseif (z <= 1.7e-24)
		tmp = x * -3.0;
	elseif (z <= 0.6)
		tmp = y * 4.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, -0.0215], t$95$0, If[LessEqual[z, -1.55e-148], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.45e-212], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -7.6e-298], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.3e-211], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 8.2e-57], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.7e-24], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.6], N[(y * 4.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 -0.0215:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -1.55 \cdot 10^{-148}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq -1.45 \cdot 10^{-212}:\\
\;\;\;\;x \cdot -3\\

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

\mathbf{elif}\;z \leq 2.3 \cdot 10^{-211}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 8.2 \cdot 10^{-57}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 1.7 \cdot 10^{-24}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;y \cdot 4\\

\mathbf{else}:\\
\;\;\;\;t_0\\


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

    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 inf 98.3%

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

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

    if -0.021499999999999998 < z < -1.5500000000000001e-148 or -1.45e-212 < z < -7.6000000000000001e-298 or 2.29999999999999988e-211 < z < 8.2000000000000003e-57 or 1.69999999999999996e-24 < z < 0.599999999999999978

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    8. Simplified62.0%

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

    if -1.5500000000000001e-148 < z < -1.45e-212 or -7.6000000000000001e-298 < z < 2.29999999999999988e-211 or 8.2000000000000003e-57 < z < 1.69999999999999996e-24

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in69.0%

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified69.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.0215:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{-148}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-212}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -7.6 \cdot 10^{-298}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-211}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{-57}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-24}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.6:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 50.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -0.68:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-147}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-213}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-299}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-213}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-58}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{-26}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.66:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))))
   (if (<= z -0.68)
     t_0
     (if (<= z -3.6e-147)
       (* y 4.0)
       (if (<= z -3.8e-213)
         (* x -3.0)
         (if (<= z -7e-299)
           (* y 4.0)
           (if (<= z 9e-213)
             (* x -3.0)
             (if (<= z 2.3e-58)
               (* y 4.0)
               (if (<= z 9.2e-26)
                 (* x -3.0)
                 (if (<= z 0.66) (* y 4.0) t_0))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double tmp;
	if (z <= -0.68) {
		tmp = t_0;
	} else if (z <= -3.6e-147) {
		tmp = y * 4.0;
	} else if (z <= -3.8e-213) {
		tmp = x * -3.0;
	} else if (z <= -7e-299) {
		tmp = y * 4.0;
	} else if (z <= 9e-213) {
		tmp = x * -3.0;
	} else if (z <= 2.3e-58) {
		tmp = y * 4.0;
	} else if (z <= 9.2e-26) {
		tmp = x * -3.0;
	} else if (z <= 0.66) {
		tmp = y * 4.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 <= (-0.68d0)) then
        tmp = t_0
    else if (z <= (-3.6d-147)) then
        tmp = y * 4.0d0
    else if (z <= (-3.8d-213)) then
        tmp = x * (-3.0d0)
    else if (z <= (-7d-299)) then
        tmp = y * 4.0d0
    else if (z <= 9d-213) then
        tmp = x * (-3.0d0)
    else if (z <= 2.3d-58) then
        tmp = y * 4.0d0
    else if (z <= 9.2d-26) then
        tmp = x * (-3.0d0)
    else if (z <= 0.66d0) then
        tmp = y * 4.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 <= -0.68) {
		tmp = t_0;
	} else if (z <= -3.6e-147) {
		tmp = y * 4.0;
	} else if (z <= -3.8e-213) {
		tmp = x * -3.0;
	} else if (z <= -7e-299) {
		tmp = y * 4.0;
	} else if (z <= 9e-213) {
		tmp = x * -3.0;
	} else if (z <= 2.3e-58) {
		tmp = y * 4.0;
	} else if (z <= 9.2e-26) {
		tmp = x * -3.0;
	} else if (z <= 0.66) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	tmp = 0
	if z <= -0.68:
		tmp = t_0
	elif z <= -3.6e-147:
		tmp = y * 4.0
	elif z <= -3.8e-213:
		tmp = x * -3.0
	elif z <= -7e-299:
		tmp = y * 4.0
	elif z <= 9e-213:
		tmp = x * -3.0
	elif z <= 2.3e-58:
		tmp = y * 4.0
	elif z <= 9.2e-26:
		tmp = x * -3.0
	elif z <= 0.66:
		tmp = y * 4.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 <= -0.68)
		tmp = t_0;
	elseif (z <= -3.6e-147)
		tmp = Float64(y * 4.0);
	elseif (z <= -3.8e-213)
		tmp = Float64(x * -3.0);
	elseif (z <= -7e-299)
		tmp = Float64(y * 4.0);
	elseif (z <= 9e-213)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.3e-58)
		tmp = Float64(y * 4.0);
	elseif (z <= 9.2e-26)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.66)
		tmp = Float64(y * 4.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 <= -0.68)
		tmp = t_0;
	elseif (z <= -3.6e-147)
		tmp = y * 4.0;
	elseif (z <= -3.8e-213)
		tmp = x * -3.0;
	elseif (z <= -7e-299)
		tmp = y * 4.0;
	elseif (z <= 9e-213)
		tmp = x * -3.0;
	elseif (z <= 2.3e-58)
		tmp = y * 4.0;
	elseif (z <= 9.2e-26)
		tmp = x * -3.0;
	elseif (z <= 0.66)
		tmp = y * 4.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, -0.68], t$95$0, If[LessEqual[z, -3.6e-147], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -3.8e-213], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -7e-299], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 9e-213], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.3e-58], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 9.2e-26], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.66], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -3.6 \cdot 10^{-147}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq -3.8 \cdot 10^{-213}:\\
\;\;\;\;x \cdot -3\\

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

\mathbf{elif}\;z \leq 9 \cdot 10^{-213}:\\
\;\;\;\;x \cdot -3\\

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

\mathbf{elif}\;z \leq 9.2 \cdot 10^{-26}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\

\mathbf{else}:\\
\;\;\;\;t_0\\


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

    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. +-commutative99.7%

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

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

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

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

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

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

    if -0.680000000000000049 < z < -3.60000000000000012e-147 or -3.8e-213 < z < -6.99999999999999981e-299 or 9.0000000000000002e-213 < z < 2.2999999999999999e-58 or 9.20000000000000035e-26 < z < 0.660000000000000031

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    8. Simplified62.0%

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

    if -3.60000000000000012e-147 < z < -3.8e-213 or -6.99999999999999981e-299 < z < 9.0000000000000002e-213 or 2.2999999999999999e-58 < z < 9.20000000000000035e-26

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in69.0%

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified69.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.68:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-147}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-213}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-299}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-213}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-58}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{-26}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.66:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 74.7% 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 -0.014:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-147}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-212}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{-298}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-216}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-57}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 135000:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* (- y x) z))))
   (if (<= z -0.014)
     t_0
     (if (<= z -1.15e-147)
       (* y 4.0)
       (if (<= z -3.6e-212)
         (* x -3.0)
         (if (<= z -8.5e-298)
           (* y 4.0)
           (if (<= z 2.3e-216)
             (* x -3.0)
             (if (<= z 6.2e-57)
               (* y 4.0)
               (if (<= z 135000.0) (* x (+ -3.0 (* z 6.0))) t_0)))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -0.014) {
		tmp = t_0;
	} else if (z <= -1.15e-147) {
		tmp = y * 4.0;
	} else if (z <= -3.6e-212) {
		tmp = x * -3.0;
	} else if (z <= -8.5e-298) {
		tmp = y * 4.0;
	} else if (z <= 2.3e-216) {
		tmp = x * -3.0;
	} else if (z <= 6.2e-57) {
		tmp = y * 4.0;
	} else if (z <= 135000.0) {
		tmp = x * (-3.0 + (z * 6.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 <= (-0.014d0)) then
        tmp = t_0
    else if (z <= (-1.15d-147)) then
        tmp = y * 4.0d0
    else if (z <= (-3.6d-212)) then
        tmp = x * (-3.0d0)
    else if (z <= (-8.5d-298)) then
        tmp = y * 4.0d0
    else if (z <= 2.3d-216) then
        tmp = x * (-3.0d0)
    else if (z <= 6.2d-57) then
        tmp = y * 4.0d0
    else if (z <= 135000.0d0) then
        tmp = x * ((-3.0d0) + (z * 6.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 <= -0.014) {
		tmp = t_0;
	} else if (z <= -1.15e-147) {
		tmp = y * 4.0;
	} else if (z <= -3.6e-212) {
		tmp = x * -3.0;
	} else if (z <= -8.5e-298) {
		tmp = y * 4.0;
	} else if (z <= 2.3e-216) {
		tmp = x * -3.0;
	} else if (z <= 6.2e-57) {
		tmp = y * 4.0;
	} else if (z <= 135000.0) {
		tmp = x * (-3.0 + (z * 6.0));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * ((y - x) * z)
	tmp = 0
	if z <= -0.014:
		tmp = t_0
	elif z <= -1.15e-147:
		tmp = y * 4.0
	elif z <= -3.6e-212:
		tmp = x * -3.0
	elif z <= -8.5e-298:
		tmp = y * 4.0
	elif z <= 2.3e-216:
		tmp = x * -3.0
	elif z <= 6.2e-57:
		tmp = y * 4.0
	elif z <= 135000.0:
		tmp = x * (-3.0 + (z * 6.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 <= -0.014)
		tmp = t_0;
	elseif (z <= -1.15e-147)
		tmp = Float64(y * 4.0);
	elseif (z <= -3.6e-212)
		tmp = Float64(x * -3.0);
	elseif (z <= -8.5e-298)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.3e-216)
		tmp = Float64(x * -3.0);
	elseif (z <= 6.2e-57)
		tmp = Float64(y * 4.0);
	elseif (z <= 135000.0)
		tmp = Float64(x * Float64(-3.0 + Float64(z * 6.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 <= -0.014)
		tmp = t_0;
	elseif (z <= -1.15e-147)
		tmp = y * 4.0;
	elseif (z <= -3.6e-212)
		tmp = x * -3.0;
	elseif (z <= -8.5e-298)
		tmp = y * 4.0;
	elseif (z <= 2.3e-216)
		tmp = x * -3.0;
	elseif (z <= 6.2e-57)
		tmp = y * 4.0;
	elseif (z <= 135000.0)
		tmp = x * (-3.0 + (z * 6.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, -0.014], t$95$0, If[LessEqual[z, -1.15e-147], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -3.6e-212], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -8.5e-298], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.3e-216], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.2e-57], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 135000.0], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $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 -0.014:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -1.15 \cdot 10^{-147}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq -3.6 \cdot 10^{-212}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq -8.5 \cdot 10^{-298}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 2.3 \cdot 10^{-216}:\\
\;\;\;\;x \cdot -3\\

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

\mathbf{elif}\;z \leq 135000:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\

\mathbf{else}:\\
\;\;\;\;t_0\\


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

    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 inf 98.7%

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

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

    if -0.0140000000000000003 < z < -1.14999999999999995e-147 or -3.6000000000000001e-212 < z < -8.49999999999999957e-298 or 2.29999999999999997e-216 < z < 6.19999999999999952e-57

    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. +-commutative99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    8. Simplified62.6%

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

    if -1.14999999999999995e-147 < z < -3.6000000000000001e-212 or -8.49999999999999957e-298 < z < 2.29999999999999997e-216

    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 66.0%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in66.0%

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified66.0%

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

    if 6.19999999999999952e-57 < z < 135000

    1. Initial program 98.6%

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

        \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\color{blue}{0.6666666666666666} - z\right) \]
    3. Simplified98.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 75.3%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in75.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.014:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-147}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-212}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{-298}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-216}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-57}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 135000:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 99.4% accurate, 0.6× speedup?

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

\\
\left(x + \left(\left(y - x\right) \cdot 8 - -6 \cdot \left(z \cdot \left(x - y\right)\right)\right)\right) + 4 \cdot \left(x - y\right)
\end{array}
Derivation
  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. +-commutative99.5%

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

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

      \[\leadsto \frac{\color{blue}{{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}^{2}} - x \cdot x}{\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) - x} \]
    4. associate-*l*38.2%

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

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

      \[\leadsto \frac{{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}^{2} - {x}^{2}}{\color{blue}{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)} - x} \]
  6. Applied egg-rr38.3%

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

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

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

Alternative 10: 76.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5.2 \cdot 10^{-15} \lor \neg \left(x \leq 4.4 \cdot 10^{+23}\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 -5.2e-15) (not (<= x 4.4e+23)))
   (* x (+ -3.0 (* z 6.0)))
   (* y (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -5.2e-15) || !(x <= 4.4e+23)) {
		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 <= (-5.2d-15)) .or. (.not. (x <= 4.4d+23))) 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 <= -5.2e-15) || !(x <= 4.4e+23)) {
		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 <= -5.2e-15) or not (x <= 4.4e+23):
		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 <= -5.2e-15) || !(x <= 4.4e+23))
		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 <= -5.2e-15) || ~((x <= 4.4e+23)))
		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, -5.2e-15], N[Not[LessEqual[x, 4.4e+23]], $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 -5.2 \cdot 10^{-15} \lor \neg \left(x \leq 4.4 \cdot 10^{+23}\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 < -5.20000000000000009e-15 or 4.40000000000000017e23 < 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 78.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.20000000000000009e-15 < x < 4.40000000000000017e23

    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. +-commutative99.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.2 \cdot 10^{-15} \lor \neg \left(x \leq 4.4 \cdot 10^{+23}\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.55:\\ \;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq 0.65:\\ \;\;\;\;x + \left(y - x\right) \cdot 4\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -0.55)
   (* (- y x) (* z -6.0))
   (if (<= z 0.65) (+ x (* (- y x) 4.0)) (* z (* (- y x) -6.0)))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -0.55) {
		tmp = (y - x) * (z * -6.0);
	} else if (z <= 0.65) {
		tmp = x + ((y - x) * 4.0);
	} else {
		tmp = z * ((y - x) * -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 (z <= (-0.55d0)) then
        tmp = (y - x) * (z * (-6.0d0))
    else if (z <= 0.65d0) then
        tmp = x + ((y - x) * 4.0d0)
    else
        tmp = z * ((y - x) * (-6.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -0.55) {
		tmp = (y - x) * (z * -6.0);
	} else if (z <= 0.65) {
		tmp = x + ((y - x) * 4.0);
	} else {
		tmp = z * ((y - x) * -6.0);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -0.55:
		tmp = (y - x) * (z * -6.0)
	elif z <= 0.65:
		tmp = x + ((y - x) * 4.0)
	else:
		tmp = z * ((y - x) * -6.0)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -0.55)
		tmp = Float64(Float64(y - x) * Float64(z * -6.0));
	elseif (z <= 0.65)
		tmp = Float64(x + Float64(Float64(y - x) * 4.0));
	else
		tmp = Float64(z * Float64(Float64(y - x) * -6.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -0.55)
		tmp = (y - x) * (z * -6.0);
	elseif (z <= 0.65)
		tmp = x + ((y - x) * 4.0);
	else
		tmp = z * ((y - x) * -6.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -0.55], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.65], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\

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


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

    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 inf 98.1%

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

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

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

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

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

    if -0.55000000000000004 < z < 0.650000000000000022

    1. Initial program 99.3%

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

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

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

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

    if 0.650000000000000022 < 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 inf 98.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(z \cdot -6\right)} \cdot \left(y - x\right) \]
      3. associate-*r*98.6%

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

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

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

Alternative 12: 97.8% accurate, 0.8× speedup?

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

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

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

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


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

    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 inf 98.1%

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

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

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

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

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

    if -0.55000000000000004 < z < 0.5

    1. Initial program 99.3%

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

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

      \[\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 0 99.5%

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

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

    if 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 inf 98.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(z \cdot -6\right)} \cdot \left(y - x\right) \]
      3. associate-*r*98.6%

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

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

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

Alternative 13: 37.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{-90} \lor \neg \left(x \leq 1.18 \cdot 10^{+48}\right):\\
\;\;\;\;x \cdot -3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.0999999999999999e-90 or 1.18000000000000007e48 < 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 76.0%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in76.0%

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified36.6%

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

    if -2.0999999999999999e-90 < x < 1.18000000000000007e48

    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. +-commutative99.5%

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

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot \left(\frac{2}{3} - z\right)\right)} + x \]
      3. fma-def99.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 85.3%

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    8. Simplified44.3%

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

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

Alternative 14: 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.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. Final simplification99.5%

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

Alternative 15: 26.0% 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.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 48.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot -3} \]
  10. Simplified24.5%

    \[\leadsto \color{blue}{x \cdot -3} \]
  11. Final simplification24.5%

    \[\leadsto x \cdot -3 \]
  12. Add Preprocessing

Alternative 16: 2.6% accurate, 13.0× speedup?

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

\\
x
\end{array}
Derivation
  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 z around inf 51.9%

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

    \[\leadsto \color{blue}{x} \]
  7. Final simplification2.5%

    \[\leadsto x \]
  8. Add Preprocessing

Reproduce

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