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

Percentage Accurate: 99.5% → 99.8%
Time: 14.3s
Alternatives: 18
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 18 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.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. Final simplification99.8%

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

Alternative 2: 50.5% 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 -2.8 \cdot 10^{+256}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{+214}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{+47}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -920:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-102}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-129}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-148}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.18 \cdot 10^{-263}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-305}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-305}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{-253}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-190}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.185:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{+146} \lor \neg \left(z \leq 8 \cdot 10^{+221}\right):\\ \;\;\;\;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 -2.8e+256)
     t_0
     (if (<= z -1.95e+214)
       t_1
       (if (<= z -3.2e+47)
         t_0
         (if (<= z -920.0)
           t_1
           (if (<= z -2.9e-102)
             (* x -3.0)
             (if (<= z -1.05e-129)
               (* y 4.0)
               (if (<= z -5.5e-148)
                 (* x -3.0)
                 (if (<= z -1.18e-263)
                   (* y 4.0)
                   (if (<= z -4.8e-305)
                     (* x -3.0)
                     (if (<= z 2.15e-305)
                       (* y 4.0)
                       (if (<= z 3.9e-253)
                         (* x -3.0)
                         (if (<= z 4.8e-190)
                           (* y 4.0)
                           (if (<= z 0.185)
                             (* x -3.0)
                             (if (or (<= z 1.65e+146) (not (<= z 8e+221)))
                               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 <= -2.8e+256) {
		tmp = t_0;
	} else if (z <= -1.95e+214) {
		tmp = t_1;
	} else if (z <= -3.2e+47) {
		tmp = t_0;
	} else if (z <= -920.0) {
		tmp = t_1;
	} else if (z <= -2.9e-102) {
		tmp = x * -3.0;
	} else if (z <= -1.05e-129) {
		tmp = y * 4.0;
	} else if (z <= -5.5e-148) {
		tmp = x * -3.0;
	} else if (z <= -1.18e-263) {
		tmp = y * 4.0;
	} else if (z <= -4.8e-305) {
		tmp = x * -3.0;
	} else if (z <= 2.15e-305) {
		tmp = y * 4.0;
	} else if (z <= 3.9e-253) {
		tmp = x * -3.0;
	} else if (z <= 4.8e-190) {
		tmp = y * 4.0;
	} else if (z <= 0.185) {
		tmp = x * -3.0;
	} else if ((z <= 1.65e+146) || !(z <= 8e+221)) {
		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 <= (-2.8d+256)) then
        tmp = t_0
    else if (z <= (-1.95d+214)) then
        tmp = t_1
    else if (z <= (-3.2d+47)) then
        tmp = t_0
    else if (z <= (-920.0d0)) then
        tmp = t_1
    else if (z <= (-2.9d-102)) then
        tmp = x * (-3.0d0)
    else if (z <= (-1.05d-129)) then
        tmp = y * 4.0d0
    else if (z <= (-5.5d-148)) then
        tmp = x * (-3.0d0)
    else if (z <= (-1.18d-263)) then
        tmp = y * 4.0d0
    else if (z <= (-4.8d-305)) then
        tmp = x * (-3.0d0)
    else if (z <= 2.15d-305) then
        tmp = y * 4.0d0
    else if (z <= 3.9d-253) then
        tmp = x * (-3.0d0)
    else if (z <= 4.8d-190) then
        tmp = y * 4.0d0
    else if (z <= 0.185d0) then
        tmp = x * (-3.0d0)
    else if ((z <= 1.65d+146) .or. (.not. (z <= 8d+221))) 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 <= -2.8e+256) {
		tmp = t_0;
	} else if (z <= -1.95e+214) {
		tmp = t_1;
	} else if (z <= -3.2e+47) {
		tmp = t_0;
	} else if (z <= -920.0) {
		tmp = t_1;
	} else if (z <= -2.9e-102) {
		tmp = x * -3.0;
	} else if (z <= -1.05e-129) {
		tmp = y * 4.0;
	} else if (z <= -5.5e-148) {
		tmp = x * -3.0;
	} else if (z <= -1.18e-263) {
		tmp = y * 4.0;
	} else if (z <= -4.8e-305) {
		tmp = x * -3.0;
	} else if (z <= 2.15e-305) {
		tmp = y * 4.0;
	} else if (z <= 3.9e-253) {
		tmp = x * -3.0;
	} else if (z <= 4.8e-190) {
		tmp = y * 4.0;
	} else if (z <= 0.185) {
		tmp = x * -3.0;
	} else if ((z <= 1.65e+146) || !(z <= 8e+221)) {
		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 <= -2.8e+256:
		tmp = t_0
	elif z <= -1.95e+214:
		tmp = t_1
	elif z <= -3.2e+47:
		tmp = t_0
	elif z <= -920.0:
		tmp = t_1
	elif z <= -2.9e-102:
		tmp = x * -3.0
	elif z <= -1.05e-129:
		tmp = y * 4.0
	elif z <= -5.5e-148:
		tmp = x * -3.0
	elif z <= -1.18e-263:
		tmp = y * 4.0
	elif z <= -4.8e-305:
		tmp = x * -3.0
	elif z <= 2.15e-305:
		tmp = y * 4.0
	elif z <= 3.9e-253:
		tmp = x * -3.0
	elif z <= 4.8e-190:
		tmp = y * 4.0
	elif z <= 0.185:
		tmp = x * -3.0
	elif (z <= 1.65e+146) or not (z <= 8e+221):
		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 <= -2.8e+256)
		tmp = t_0;
	elseif (z <= -1.95e+214)
		tmp = t_1;
	elseif (z <= -3.2e+47)
		tmp = t_0;
	elseif (z <= -920.0)
		tmp = t_1;
	elseif (z <= -2.9e-102)
		tmp = Float64(x * -3.0);
	elseif (z <= -1.05e-129)
		tmp = Float64(y * 4.0);
	elseif (z <= -5.5e-148)
		tmp = Float64(x * -3.0);
	elseif (z <= -1.18e-263)
		tmp = Float64(y * 4.0);
	elseif (z <= -4.8e-305)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.15e-305)
		tmp = Float64(y * 4.0);
	elseif (z <= 3.9e-253)
		tmp = Float64(x * -3.0);
	elseif (z <= 4.8e-190)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.185)
		tmp = Float64(x * -3.0);
	elseif ((z <= 1.65e+146) || !(z <= 8e+221))
		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 <= -2.8e+256)
		tmp = t_0;
	elseif (z <= -1.95e+214)
		tmp = t_1;
	elseif (z <= -3.2e+47)
		tmp = t_0;
	elseif (z <= -920.0)
		tmp = t_1;
	elseif (z <= -2.9e-102)
		tmp = x * -3.0;
	elseif (z <= -1.05e-129)
		tmp = y * 4.0;
	elseif (z <= -5.5e-148)
		tmp = x * -3.0;
	elseif (z <= -1.18e-263)
		tmp = y * 4.0;
	elseif (z <= -4.8e-305)
		tmp = x * -3.0;
	elseif (z <= 2.15e-305)
		tmp = y * 4.0;
	elseif (z <= 3.9e-253)
		tmp = x * -3.0;
	elseif (z <= 4.8e-190)
		tmp = y * 4.0;
	elseif (z <= 0.185)
		tmp = x * -3.0;
	elseif ((z <= 1.65e+146) || ~((z <= 8e+221)))
		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, -2.8e+256], t$95$0, If[LessEqual[z, -1.95e+214], t$95$1, If[LessEqual[z, -3.2e+47], t$95$0, If[LessEqual[z, -920.0], t$95$1, If[LessEqual[z, -2.9e-102], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.05e-129], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -5.5e-148], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.18e-263], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -4.8e-305], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.15e-305], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.9e-253], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.8e-190], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.185], N[(x * -3.0), $MachinePrecision], If[Or[LessEqual[z, 1.65e+146], N[Not[LessEqual[z, 8e+221]], $MachinePrecision]], 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 -2.8 \cdot 10^{+256}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;z \leq -3.2 \cdot 10^{+47}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -920:\\
\;\;\;\;t\_1\\

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

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

\mathbf{elif}\;z \leq -5.5 \cdot 10^{-148}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq -1.18 \cdot 10^{-263}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq -4.8 \cdot 10^{-305}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 2.15 \cdot 10^{-305}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 3.9 \cdot 10^{-253}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 4.8 \cdot 10^{-190}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 1.65 \cdot 10^{+146} \lor \neg \left(z \leq 8 \cdot 10^{+221}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.79999999999999988e256 or -1.95000000000000007e214 < z < -3.2e47 or 1.65000000000000008e146 < z < 8.0000000000000004e221

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

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

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

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

    if -2.79999999999999988e256 < z < -1.95000000000000007e214 or -3.2e47 < z < -920 or 0.185 < z < 1.65000000000000008e146 or 8.0000000000000004e221 < z

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -920 < z < -2.89999999999999986e-102 or -1.05e-129 < z < -5.5000000000000003e-148 or -1.17999999999999998e-263 < z < -4.80000000000000039e-305 or 2.1500000000000001e-305 < z < 3.8999999999999999e-253 or 4.8000000000000001e-190 < z < 0.185

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified68.9%

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

    if -2.89999999999999986e-102 < z < -1.05e-129 or -5.5000000000000003e-148 < z < -1.17999999999999998e-263 or -4.80000000000000039e-305 < z < 2.1500000000000001e-305 or 3.8999999999999999e-253 < z < 4.8000000000000001e-190

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.8 \cdot 10^{+256}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{+214}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{+47}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -920:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-102}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-129}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-148}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.18 \cdot 10^{-263}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-305}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-305}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{-253}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-190}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.185:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{+146} \lor \neg \left(z \leq 8 \cdot 10^{+221}\right):\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 50.5% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ t_1 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -2.2 \cdot 10^{+256}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{+212}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+47}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -920:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-102}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -3.9 \cdot 10^{-130}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{-147}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{-263}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.66 \cdot 10^{-304}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-306}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-253}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-191}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.185:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+146} \lor \neg \left(z \leq 1.55 \cdot 10^{+219}\right):\\ \;\;\;\;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 (* x (* z 6.0))))
   (if (<= z -2.2e+256)
     t_0
     (if (<= z -9.5e+212)
       t_1
       (if (<= z -1.5e+47)
         t_0
         (if (<= z -920.0)
           t_1
           (if (<= z -4.2e-102)
             (* x -3.0)
             (if (<= z -3.9e-130)
               (* y 4.0)
               (if (<= z -8.5e-147)
                 (* x -3.0)
                 (if (<= z -7.8e-263)
                   (* y 4.0)
                   (if (<= z -1.66e-304)
                     (* x -3.0)
                     (if (<= z 7.2e-306)
                       (* y 4.0)
                       (if (<= z 4e-253)
                         (* x -3.0)
                         (if (<= z 1.9e-191)
                           (* y 4.0)
                           (if (<= z 0.185)
                             (* x -3.0)
                             (if (or (<= z 1.7e+146) (not (<= z 1.55e+219)))
                               t_1
                               t_0))))))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -2.2e+256) {
		tmp = t_0;
	} else if (z <= -9.5e+212) {
		tmp = t_1;
	} else if (z <= -1.5e+47) {
		tmp = t_0;
	} else if (z <= -920.0) {
		tmp = t_1;
	} else if (z <= -4.2e-102) {
		tmp = x * -3.0;
	} else if (z <= -3.9e-130) {
		tmp = y * 4.0;
	} else if (z <= -8.5e-147) {
		tmp = x * -3.0;
	} else if (z <= -7.8e-263) {
		tmp = y * 4.0;
	} else if (z <= -1.66e-304) {
		tmp = x * -3.0;
	} else if (z <= 7.2e-306) {
		tmp = y * 4.0;
	} else if (z <= 4e-253) {
		tmp = x * -3.0;
	} else if (z <= 1.9e-191) {
		tmp = y * 4.0;
	} else if (z <= 0.185) {
		tmp = x * -3.0;
	} else if ((z <= 1.7e+146) || !(z <= 1.55e+219)) {
		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 = x * (z * 6.0d0)
    if (z <= (-2.2d+256)) then
        tmp = t_0
    else if (z <= (-9.5d+212)) then
        tmp = t_1
    else if (z <= (-1.5d+47)) then
        tmp = t_0
    else if (z <= (-920.0d0)) then
        tmp = t_1
    else if (z <= (-4.2d-102)) then
        tmp = x * (-3.0d0)
    else if (z <= (-3.9d-130)) then
        tmp = y * 4.0d0
    else if (z <= (-8.5d-147)) then
        tmp = x * (-3.0d0)
    else if (z <= (-7.8d-263)) then
        tmp = y * 4.0d0
    else if (z <= (-1.66d-304)) then
        tmp = x * (-3.0d0)
    else if (z <= 7.2d-306) then
        tmp = y * 4.0d0
    else if (z <= 4d-253) then
        tmp = x * (-3.0d0)
    else if (z <= 1.9d-191) then
        tmp = y * 4.0d0
    else if (z <= 0.185d0) then
        tmp = x * (-3.0d0)
    else if ((z <= 1.7d+146) .or. (.not. (z <= 1.55d+219))) 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 = x * (z * 6.0);
	double tmp;
	if (z <= -2.2e+256) {
		tmp = t_0;
	} else if (z <= -9.5e+212) {
		tmp = t_1;
	} else if (z <= -1.5e+47) {
		tmp = t_0;
	} else if (z <= -920.0) {
		tmp = t_1;
	} else if (z <= -4.2e-102) {
		tmp = x * -3.0;
	} else if (z <= -3.9e-130) {
		tmp = y * 4.0;
	} else if (z <= -8.5e-147) {
		tmp = x * -3.0;
	} else if (z <= -7.8e-263) {
		tmp = y * 4.0;
	} else if (z <= -1.66e-304) {
		tmp = x * -3.0;
	} else if (z <= 7.2e-306) {
		tmp = y * 4.0;
	} else if (z <= 4e-253) {
		tmp = x * -3.0;
	} else if (z <= 1.9e-191) {
		tmp = y * 4.0;
	} else if (z <= 0.185) {
		tmp = x * -3.0;
	} else if ((z <= 1.7e+146) || !(z <= 1.55e+219)) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	t_1 = x * (z * 6.0)
	tmp = 0
	if z <= -2.2e+256:
		tmp = t_0
	elif z <= -9.5e+212:
		tmp = t_1
	elif z <= -1.5e+47:
		tmp = t_0
	elif z <= -920.0:
		tmp = t_1
	elif z <= -4.2e-102:
		tmp = x * -3.0
	elif z <= -3.9e-130:
		tmp = y * 4.0
	elif z <= -8.5e-147:
		tmp = x * -3.0
	elif z <= -7.8e-263:
		tmp = y * 4.0
	elif z <= -1.66e-304:
		tmp = x * -3.0
	elif z <= 7.2e-306:
		tmp = y * 4.0
	elif z <= 4e-253:
		tmp = x * -3.0
	elif z <= 1.9e-191:
		tmp = y * 4.0
	elif z <= 0.185:
		tmp = x * -3.0
	elif (z <= 1.7e+146) or not (z <= 1.55e+219):
		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(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -2.2e+256)
		tmp = t_0;
	elseif (z <= -9.5e+212)
		tmp = t_1;
	elseif (z <= -1.5e+47)
		tmp = t_0;
	elseif (z <= -920.0)
		tmp = t_1;
	elseif (z <= -4.2e-102)
		tmp = Float64(x * -3.0);
	elseif (z <= -3.9e-130)
		tmp = Float64(y * 4.0);
	elseif (z <= -8.5e-147)
		tmp = Float64(x * -3.0);
	elseif (z <= -7.8e-263)
		tmp = Float64(y * 4.0);
	elseif (z <= -1.66e-304)
		tmp = Float64(x * -3.0);
	elseif (z <= 7.2e-306)
		tmp = Float64(y * 4.0);
	elseif (z <= 4e-253)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.9e-191)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.185)
		tmp = Float64(x * -3.0);
	elseif ((z <= 1.7e+146) || !(z <= 1.55e+219))
		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 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -2.2e+256)
		tmp = t_0;
	elseif (z <= -9.5e+212)
		tmp = t_1;
	elseif (z <= -1.5e+47)
		tmp = t_0;
	elseif (z <= -920.0)
		tmp = t_1;
	elseif (z <= -4.2e-102)
		tmp = x * -3.0;
	elseif (z <= -3.9e-130)
		tmp = y * 4.0;
	elseif (z <= -8.5e-147)
		tmp = x * -3.0;
	elseif (z <= -7.8e-263)
		tmp = y * 4.0;
	elseif (z <= -1.66e-304)
		tmp = x * -3.0;
	elseif (z <= 7.2e-306)
		tmp = y * 4.0;
	elseif (z <= 4e-253)
		tmp = x * -3.0;
	elseif (z <= 1.9e-191)
		tmp = y * 4.0;
	elseif (z <= 0.185)
		tmp = x * -3.0;
	elseif ((z <= 1.7e+146) || ~((z <= 1.55e+219)))
		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[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+256], t$95$0, If[LessEqual[z, -9.5e+212], t$95$1, If[LessEqual[z, -1.5e+47], t$95$0, If[LessEqual[z, -920.0], t$95$1, If[LessEqual[z, -4.2e-102], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -3.9e-130], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -8.5e-147], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -7.8e-263], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.66e-304], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 7.2e-306], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 4e-253], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.9e-191], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.185], N[(x * -3.0), $MachinePrecision], If[Or[LessEqual[z, 1.7e+146], N[Not[LessEqual[z, 1.55e+219]], $MachinePrecision]], t$95$1, t$95$0]]]]]]]]]]]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq -920:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -4.2 \cdot 10^{-102}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq -3.9 \cdot 10^{-130}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq -8.5 \cdot 10^{-147}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq -7.8 \cdot 10^{-263}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq -1.66 \cdot 10^{-304}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 7.2 \cdot 10^{-306}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 4 \cdot 10^{-253}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 1.9 \cdot 10^{-191}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 1.7 \cdot 10^{+146} \lor \neg \left(z \leq 1.55 \cdot 10^{+219}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.1999999999999999e256 or -9.4999999999999993e212 < z < -1.5000000000000001e47 or 1.69999999999999995e146 < z < 1.54999999999999984e219

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

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

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

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

    if -2.1999999999999999e256 < z < -9.4999999999999993e212 or -1.5000000000000001e47 < z < -920 or 0.185 < z < 1.69999999999999995e146 or 1.54999999999999984e219 < z

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -920 < z < -4.2e-102 or -3.9000000000000001e-130 < z < -8.5000000000000002e-147 or -7.79999999999999939e-263 < z < -1.66e-304 or 7.19999999999999982e-306 < z < 4.0000000000000003e-253 or 1.8999999999999999e-191 < z < 0.185

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified68.9%

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

    if -4.2e-102 < z < -3.9000000000000001e-130 or -8.5000000000000002e-147 < z < -7.79999999999999939e-263 or -1.66e-304 < z < 7.19999999999999982e-306 or 4.0000000000000003e-253 < z < 1.8999999999999999e-191

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{+256}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{+212}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+47}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -920:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-102}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -3.9 \cdot 10^{-130}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{-147}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{-263}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.66 \cdot 10^{-304}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-306}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-253}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-191}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.185:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+146} \lor \neg \left(z \leq 1.55 \cdot 10^{+219}\right):\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 50.5% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ t_1 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -2.7 \cdot 10^{+256}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{+214}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+47}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -920:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-102}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-131}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -4.4 \cdot 10^{-148}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -4.4 \cdot 10^{-266}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.12 \cdot 10^{-305}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-304}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.55 \cdot 10^{-253}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-191}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.185:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+146} \lor \neg \left(z \leq 2.7 \cdot 10^{+221}\right):\\ \;\;\;\;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 (* x (* z 6.0))))
   (if (<= z -2.7e+256)
     t_0
     (if (<= z -2.3e+214)
       t_1
       (if (<= z -1.5e+47)
         (* y (* z -6.0))
         (if (<= z -920.0)
           t_1
           (if (<= z -5.2e-102)
             (* x -3.0)
             (if (<= z -1.8e-131)
               (* y 4.0)
               (if (<= z -4.4e-148)
                 (* x -3.0)
                 (if (<= z -4.4e-266)
                   (* y 4.0)
                   (if (<= z -1.12e-305)
                     (* x -3.0)
                     (if (<= z 1.55e-304)
                       (* y 4.0)
                       (if (<= z 2.55e-253)
                         (* x -3.0)
                         (if (<= z 2.7e-191)
                           (* y 4.0)
                           (if (<= z 0.185)
                             (* x -3.0)
                             (if (or (<= z 2.2e+146) (not (<= z 2.7e+221)))
                               t_1
                               t_0))))))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -2.7e+256) {
		tmp = t_0;
	} else if (z <= -2.3e+214) {
		tmp = t_1;
	} else if (z <= -1.5e+47) {
		tmp = y * (z * -6.0);
	} else if (z <= -920.0) {
		tmp = t_1;
	} else if (z <= -5.2e-102) {
		tmp = x * -3.0;
	} else if (z <= -1.8e-131) {
		tmp = y * 4.0;
	} else if (z <= -4.4e-148) {
		tmp = x * -3.0;
	} else if (z <= -4.4e-266) {
		tmp = y * 4.0;
	} else if (z <= -1.12e-305) {
		tmp = x * -3.0;
	} else if (z <= 1.55e-304) {
		tmp = y * 4.0;
	} else if (z <= 2.55e-253) {
		tmp = x * -3.0;
	} else if (z <= 2.7e-191) {
		tmp = y * 4.0;
	} else if (z <= 0.185) {
		tmp = x * -3.0;
	} else if ((z <= 2.2e+146) || !(z <= 2.7e+221)) {
		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 = x * (z * 6.0d0)
    if (z <= (-2.7d+256)) then
        tmp = t_0
    else if (z <= (-2.3d+214)) then
        tmp = t_1
    else if (z <= (-1.5d+47)) then
        tmp = y * (z * (-6.0d0))
    else if (z <= (-920.0d0)) then
        tmp = t_1
    else if (z <= (-5.2d-102)) then
        tmp = x * (-3.0d0)
    else if (z <= (-1.8d-131)) then
        tmp = y * 4.0d0
    else if (z <= (-4.4d-148)) then
        tmp = x * (-3.0d0)
    else if (z <= (-4.4d-266)) then
        tmp = y * 4.0d0
    else if (z <= (-1.12d-305)) then
        tmp = x * (-3.0d0)
    else if (z <= 1.55d-304) then
        tmp = y * 4.0d0
    else if (z <= 2.55d-253) then
        tmp = x * (-3.0d0)
    else if (z <= 2.7d-191) then
        tmp = y * 4.0d0
    else if (z <= 0.185d0) then
        tmp = x * (-3.0d0)
    else if ((z <= 2.2d+146) .or. (.not. (z <= 2.7d+221))) 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 = x * (z * 6.0);
	double tmp;
	if (z <= -2.7e+256) {
		tmp = t_0;
	} else if (z <= -2.3e+214) {
		tmp = t_1;
	} else if (z <= -1.5e+47) {
		tmp = y * (z * -6.0);
	} else if (z <= -920.0) {
		tmp = t_1;
	} else if (z <= -5.2e-102) {
		tmp = x * -3.0;
	} else if (z <= -1.8e-131) {
		tmp = y * 4.0;
	} else if (z <= -4.4e-148) {
		tmp = x * -3.0;
	} else if (z <= -4.4e-266) {
		tmp = y * 4.0;
	} else if (z <= -1.12e-305) {
		tmp = x * -3.0;
	} else if (z <= 1.55e-304) {
		tmp = y * 4.0;
	} else if (z <= 2.55e-253) {
		tmp = x * -3.0;
	} else if (z <= 2.7e-191) {
		tmp = y * 4.0;
	} else if (z <= 0.185) {
		tmp = x * -3.0;
	} else if ((z <= 2.2e+146) || !(z <= 2.7e+221)) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	t_1 = x * (z * 6.0)
	tmp = 0
	if z <= -2.7e+256:
		tmp = t_0
	elif z <= -2.3e+214:
		tmp = t_1
	elif z <= -1.5e+47:
		tmp = y * (z * -6.0)
	elif z <= -920.0:
		tmp = t_1
	elif z <= -5.2e-102:
		tmp = x * -3.0
	elif z <= -1.8e-131:
		tmp = y * 4.0
	elif z <= -4.4e-148:
		tmp = x * -3.0
	elif z <= -4.4e-266:
		tmp = y * 4.0
	elif z <= -1.12e-305:
		tmp = x * -3.0
	elif z <= 1.55e-304:
		tmp = y * 4.0
	elif z <= 2.55e-253:
		tmp = x * -3.0
	elif z <= 2.7e-191:
		tmp = y * 4.0
	elif z <= 0.185:
		tmp = x * -3.0
	elif (z <= 2.2e+146) or not (z <= 2.7e+221):
		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(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -2.7e+256)
		tmp = t_0;
	elseif (z <= -2.3e+214)
		tmp = t_1;
	elseif (z <= -1.5e+47)
		tmp = Float64(y * Float64(z * -6.0));
	elseif (z <= -920.0)
		tmp = t_1;
	elseif (z <= -5.2e-102)
		tmp = Float64(x * -3.0);
	elseif (z <= -1.8e-131)
		tmp = Float64(y * 4.0);
	elseif (z <= -4.4e-148)
		tmp = Float64(x * -3.0);
	elseif (z <= -4.4e-266)
		tmp = Float64(y * 4.0);
	elseif (z <= -1.12e-305)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.55e-304)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.55e-253)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.7e-191)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.185)
		tmp = Float64(x * -3.0);
	elseif ((z <= 2.2e+146) || !(z <= 2.7e+221))
		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 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -2.7e+256)
		tmp = t_0;
	elseif (z <= -2.3e+214)
		tmp = t_1;
	elseif (z <= -1.5e+47)
		tmp = y * (z * -6.0);
	elseif (z <= -920.0)
		tmp = t_1;
	elseif (z <= -5.2e-102)
		tmp = x * -3.0;
	elseif (z <= -1.8e-131)
		tmp = y * 4.0;
	elseif (z <= -4.4e-148)
		tmp = x * -3.0;
	elseif (z <= -4.4e-266)
		tmp = y * 4.0;
	elseif (z <= -1.12e-305)
		tmp = x * -3.0;
	elseif (z <= 1.55e-304)
		tmp = y * 4.0;
	elseif (z <= 2.55e-253)
		tmp = x * -3.0;
	elseif (z <= 2.7e-191)
		tmp = y * 4.0;
	elseif (z <= 0.185)
		tmp = x * -3.0;
	elseif ((z <= 2.2e+146) || ~((z <= 2.7e+221)))
		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[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.7e+256], t$95$0, If[LessEqual[z, -2.3e+214], t$95$1, If[LessEqual[z, -1.5e+47], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -920.0], t$95$1, If[LessEqual[z, -5.2e-102], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.8e-131], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -4.4e-148], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -4.4e-266], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.12e-305], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.55e-304], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.55e-253], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.7e-191], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.185], N[(x * -3.0), $MachinePrecision], If[Or[LessEqual[z, 2.2e+146], N[Not[LessEqual[z, 2.7e+221]], $MachinePrecision]], t$95$1, t$95$0]]]]]]]]]]]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq -920:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -5.2 \cdot 10^{-102}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq -1.8 \cdot 10^{-131}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq -4.4 \cdot 10^{-148}:\\
\;\;\;\;x \cdot -3\\

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

\mathbf{elif}\;z \leq -1.12 \cdot 10^{-305}:\\
\;\;\;\;x \cdot -3\\

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

\mathbf{elif}\;z \leq 2.55 \cdot 10^{-253}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 2.7 \cdot 10^{-191}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 2.2 \cdot 10^{+146} \lor \neg \left(z \leq 2.7 \cdot 10^{+221}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.69999999999999995e256 or 2.1999999999999998e146 < z < 2.7e221

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

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

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

    if -2.69999999999999995e256 < z < -2.2999999999999999e214 or -1.5000000000000001e47 < z < -920 or 0.185 < z < 2.1999999999999998e146 or 2.7e221 < z

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.2999999999999999e214 < z < -1.5000000000000001e47

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -920 < z < -5.19999999999999973e-102 or -1.8e-131 < z < -4.40000000000000034e-148 or -4.3999999999999999e-266 < z < -1.1200000000000001e-305 or 1.54999999999999992e-304 < z < 2.55000000000000004e-253 or 2.69999999999999999e-191 < z < 0.185

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified68.9%

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

    if -5.19999999999999973e-102 < z < -1.8e-131 or -4.40000000000000034e-148 < z < -4.3999999999999999e-266 or -1.1200000000000001e-305 < z < 1.54999999999999992e-304 or 2.55000000000000004e-253 < z < 2.69999999999999999e-191

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+256}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{+214}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+47}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -920:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-102}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-131}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -4.4 \cdot 10^{-148}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -4.4 \cdot 10^{-266}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.12 \cdot 10^{-305}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-304}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.55 \cdot 10^{-253}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-191}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.185:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+146} \lor \neg \left(z \leq 2.7 \cdot 10^{+221}\right):\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 50.5% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -2.95 \cdot 10^{+256}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -4.6 \cdot 10^{+214}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{+46}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -920:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.42 \cdot 10^{-102}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.52 \cdot 10^{-127}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-148}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.52 \cdot 10^{-263}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-305}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-306}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.65 \cdot 10^{-253}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-190}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.185:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+146} \lor \neg \left(z \leq 9.6 \cdot 10^{+218}\right):\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y \cdot -6\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (* z 6.0))))
   (if (<= z -2.95e+256)
     (* -6.0 (* y z))
     (if (<= z -4.6e+214)
       t_0
       (if (<= z -7.8e+46)
         (* y (* z -6.0))
         (if (<= z -920.0)
           t_0
           (if (<= z -1.42e-102)
             (* x -3.0)
             (if (<= z -1.52e-127)
               (* y 4.0)
               (if (<= z -9e-148)
                 (* x -3.0)
                 (if (<= z -1.52e-263)
                   (* y 4.0)
                   (if (<= z -4e-305)
                     (* x -3.0)
                     (if (<= z 4.2e-306)
                       (* y 4.0)
                       (if (<= z 2.65e-253)
                         (* x -3.0)
                         (if (<= z 7.5e-190)
                           (* y 4.0)
                           (if (<= z 0.185)
                             (* x -3.0)
                             (if (or (<= z 1.4e+146) (not (<= z 9.6e+218)))
                               t_0
                               (* z (* y -6.0))))))))))))))))))
double code(double x, double y, double z) {
	double t_0 = x * (z * 6.0);
	double tmp;
	if (z <= -2.95e+256) {
		tmp = -6.0 * (y * z);
	} else if (z <= -4.6e+214) {
		tmp = t_0;
	} else if (z <= -7.8e+46) {
		tmp = y * (z * -6.0);
	} else if (z <= -920.0) {
		tmp = t_0;
	} else if (z <= -1.42e-102) {
		tmp = x * -3.0;
	} else if (z <= -1.52e-127) {
		tmp = y * 4.0;
	} else if (z <= -9e-148) {
		tmp = x * -3.0;
	} else if (z <= -1.52e-263) {
		tmp = y * 4.0;
	} else if (z <= -4e-305) {
		tmp = x * -3.0;
	} else if (z <= 4.2e-306) {
		tmp = y * 4.0;
	} else if (z <= 2.65e-253) {
		tmp = x * -3.0;
	} else if (z <= 7.5e-190) {
		tmp = y * 4.0;
	} else if (z <= 0.185) {
		tmp = x * -3.0;
	} else if ((z <= 1.4e+146) || !(z <= 9.6e+218)) {
		tmp = t_0;
	} else {
		tmp = z * (y * -6.0);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x * (z * 6.0d0)
    if (z <= (-2.95d+256)) then
        tmp = (-6.0d0) * (y * z)
    else if (z <= (-4.6d+214)) then
        tmp = t_0
    else if (z <= (-7.8d+46)) then
        tmp = y * (z * (-6.0d0))
    else if (z <= (-920.0d0)) then
        tmp = t_0
    else if (z <= (-1.42d-102)) then
        tmp = x * (-3.0d0)
    else if (z <= (-1.52d-127)) then
        tmp = y * 4.0d0
    else if (z <= (-9d-148)) then
        tmp = x * (-3.0d0)
    else if (z <= (-1.52d-263)) then
        tmp = y * 4.0d0
    else if (z <= (-4d-305)) then
        tmp = x * (-3.0d0)
    else if (z <= 4.2d-306) then
        tmp = y * 4.0d0
    else if (z <= 2.65d-253) then
        tmp = x * (-3.0d0)
    else if (z <= 7.5d-190) then
        tmp = y * 4.0d0
    else if (z <= 0.185d0) then
        tmp = x * (-3.0d0)
    else if ((z <= 1.4d+146) .or. (.not. (z <= 9.6d+218))) then
        tmp = t_0
    else
        tmp = z * (y * (-6.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x * (z * 6.0);
	double tmp;
	if (z <= -2.95e+256) {
		tmp = -6.0 * (y * z);
	} else if (z <= -4.6e+214) {
		tmp = t_0;
	} else if (z <= -7.8e+46) {
		tmp = y * (z * -6.0);
	} else if (z <= -920.0) {
		tmp = t_0;
	} else if (z <= -1.42e-102) {
		tmp = x * -3.0;
	} else if (z <= -1.52e-127) {
		tmp = y * 4.0;
	} else if (z <= -9e-148) {
		tmp = x * -3.0;
	} else if (z <= -1.52e-263) {
		tmp = y * 4.0;
	} else if (z <= -4e-305) {
		tmp = x * -3.0;
	} else if (z <= 4.2e-306) {
		tmp = y * 4.0;
	} else if (z <= 2.65e-253) {
		tmp = x * -3.0;
	} else if (z <= 7.5e-190) {
		tmp = y * 4.0;
	} else if (z <= 0.185) {
		tmp = x * -3.0;
	} else if ((z <= 1.4e+146) || !(z <= 9.6e+218)) {
		tmp = t_0;
	} else {
		tmp = z * (y * -6.0);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (z * 6.0)
	tmp = 0
	if z <= -2.95e+256:
		tmp = -6.0 * (y * z)
	elif z <= -4.6e+214:
		tmp = t_0
	elif z <= -7.8e+46:
		tmp = y * (z * -6.0)
	elif z <= -920.0:
		tmp = t_0
	elif z <= -1.42e-102:
		tmp = x * -3.0
	elif z <= -1.52e-127:
		tmp = y * 4.0
	elif z <= -9e-148:
		tmp = x * -3.0
	elif z <= -1.52e-263:
		tmp = y * 4.0
	elif z <= -4e-305:
		tmp = x * -3.0
	elif z <= 4.2e-306:
		tmp = y * 4.0
	elif z <= 2.65e-253:
		tmp = x * -3.0
	elif z <= 7.5e-190:
		tmp = y * 4.0
	elif z <= 0.185:
		tmp = x * -3.0
	elif (z <= 1.4e+146) or not (z <= 9.6e+218):
		tmp = t_0
	else:
		tmp = z * (y * -6.0)
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -2.95e+256)
		tmp = Float64(-6.0 * Float64(y * z));
	elseif (z <= -4.6e+214)
		tmp = t_0;
	elseif (z <= -7.8e+46)
		tmp = Float64(y * Float64(z * -6.0));
	elseif (z <= -920.0)
		tmp = t_0;
	elseif (z <= -1.42e-102)
		tmp = Float64(x * -3.0);
	elseif (z <= -1.52e-127)
		tmp = Float64(y * 4.0);
	elseif (z <= -9e-148)
		tmp = Float64(x * -3.0);
	elseif (z <= -1.52e-263)
		tmp = Float64(y * 4.0);
	elseif (z <= -4e-305)
		tmp = Float64(x * -3.0);
	elseif (z <= 4.2e-306)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.65e-253)
		tmp = Float64(x * -3.0);
	elseif (z <= 7.5e-190)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.185)
		tmp = Float64(x * -3.0);
	elseif ((z <= 1.4e+146) || !(z <= 9.6e+218))
		tmp = t_0;
	else
		tmp = Float64(z * Float64(y * -6.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -2.95e+256)
		tmp = -6.0 * (y * z);
	elseif (z <= -4.6e+214)
		tmp = t_0;
	elseif (z <= -7.8e+46)
		tmp = y * (z * -6.0);
	elseif (z <= -920.0)
		tmp = t_0;
	elseif (z <= -1.42e-102)
		tmp = x * -3.0;
	elseif (z <= -1.52e-127)
		tmp = y * 4.0;
	elseif (z <= -9e-148)
		tmp = x * -3.0;
	elseif (z <= -1.52e-263)
		tmp = y * 4.0;
	elseif (z <= -4e-305)
		tmp = x * -3.0;
	elseif (z <= 4.2e-306)
		tmp = y * 4.0;
	elseif (z <= 2.65e-253)
		tmp = x * -3.0;
	elseif (z <= 7.5e-190)
		tmp = y * 4.0;
	elseif (z <= 0.185)
		tmp = x * -3.0;
	elseif ((z <= 1.4e+146) || ~((z <= 9.6e+218)))
		tmp = t_0;
	else
		tmp = z * (y * -6.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.95e+256], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.6e+214], t$95$0, If[LessEqual[z, -7.8e+46], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -920.0], t$95$0, If[LessEqual[z, -1.42e-102], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.52e-127], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -9e-148], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.52e-263], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -4e-305], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.2e-306], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.65e-253], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 7.5e-190], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.185], N[(x * -3.0), $MachinePrecision], If[Or[LessEqual[z, 1.4e+146], N[Not[LessEqual[z, 9.6e+218]], $MachinePrecision]], t$95$0, N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -2.95 \cdot 10^{+256}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\

\mathbf{elif}\;z \leq -4.6 \cdot 10^{+214}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;z \leq -920:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -1.42 \cdot 10^{-102}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq -1.52 \cdot 10^{-127}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq -1.52 \cdot 10^{-263}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq -4 \cdot 10^{-305}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 4.2 \cdot 10^{-306}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 2.65 \cdot 10^{-253}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 7.5 \cdot 10^{-190}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 1.4 \cdot 10^{+146} \lor \neg \left(z \leq 9.6 \cdot 10^{+218}\right):\\
\;\;\;\;t\_0\\

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


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

    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. +-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.95000000000000012e256 < z < -4.5999999999999998e214 or -7.7999999999999999e46 < z < -920 or 0.185 < z < 1.4e146 or 9.59999999999999923e218 < z

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.5999999999999998e214 < z < -7.7999999999999999e46

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -920 < z < -1.42000000000000009e-102 or -1.5200000000000001e-127 < z < -9.00000000000000029e-148 or -1.52000000000000005e-263 < z < -3.99999999999999999e-305 or 4.2000000000000002e-306 < z < 2.6500000000000001e-253 or 7.5e-190 < z < 0.185

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified68.9%

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

    if -1.42000000000000009e-102 < z < -1.5200000000000001e-127 or -9.00000000000000029e-148 < z < -1.52000000000000005e-263 or -3.99999999999999999e-305 < z < 4.2000000000000002e-306 or 2.6500000000000001e-253 < z < 7.5e-190

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4e146 < z < 9.59999999999999923e218

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.95 \cdot 10^{+256}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -4.6 \cdot 10^{+214}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{+46}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -920:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -1.42 \cdot 10^{-102}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.52 \cdot 10^{-127}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-148}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.52 \cdot 10^{-263}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-305}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-306}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.65 \cdot 10^{-253}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-190}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.185:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+146} \lor \neg \left(z \leq 9.6 \cdot 10^{+218}\right):\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y \cdot -6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 50.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -0.08:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-102}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -4.4 \cdot 10^{-128}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-148}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{-263}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{-305}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-306}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-253}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-191}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.52:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))))
   (if (<= z -0.08)
     t_0
     (if (<= z -6e-102)
       (* x -3.0)
       (if (<= z -4.4e-128)
         (* y 4.0)
         (if (<= z -1.2e-148)
           (* x -3.0)
           (if (<= z -1.7e-263)
             (* y 4.0)
             (if (<= z -3.1e-305)
               (* x -3.0)
               (if (<= z 4e-306)
                 (* y 4.0)
                 (if (<= z 8.8e-253)
                   (* x -3.0)
                   (if (<= z 1.6e-191)
                     (* y 4.0)
                     (if (<= z 0.52) (* x -3.0) t_0))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double tmp;
	if (z <= -0.08) {
		tmp = t_0;
	} else if (z <= -6e-102) {
		tmp = x * -3.0;
	} else if (z <= -4.4e-128) {
		tmp = y * 4.0;
	} else if (z <= -1.2e-148) {
		tmp = x * -3.0;
	} else if (z <= -1.7e-263) {
		tmp = y * 4.0;
	} else if (z <= -3.1e-305) {
		tmp = x * -3.0;
	} else if (z <= 4e-306) {
		tmp = y * 4.0;
	} else if (z <= 8.8e-253) {
		tmp = x * -3.0;
	} else if (z <= 1.6e-191) {
		tmp = y * 4.0;
	} else if (z <= 0.52) {
		tmp = x * -3.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-6.0d0) * (y * z)
    if (z <= (-0.08d0)) then
        tmp = t_0
    else if (z <= (-6d-102)) then
        tmp = x * (-3.0d0)
    else if (z <= (-4.4d-128)) then
        tmp = y * 4.0d0
    else if (z <= (-1.2d-148)) then
        tmp = x * (-3.0d0)
    else if (z <= (-1.7d-263)) then
        tmp = y * 4.0d0
    else if (z <= (-3.1d-305)) then
        tmp = x * (-3.0d0)
    else if (z <= 4d-306) then
        tmp = y * 4.0d0
    else if (z <= 8.8d-253) then
        tmp = x * (-3.0d0)
    else if (z <= 1.6d-191) then
        tmp = y * 4.0d0
    else if (z <= 0.52d0) then
        tmp = x * (-3.0d0)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double tmp;
	if (z <= -0.08) {
		tmp = t_0;
	} else if (z <= -6e-102) {
		tmp = x * -3.0;
	} else if (z <= -4.4e-128) {
		tmp = y * 4.0;
	} else if (z <= -1.2e-148) {
		tmp = x * -3.0;
	} else if (z <= -1.7e-263) {
		tmp = y * 4.0;
	} else if (z <= -3.1e-305) {
		tmp = x * -3.0;
	} else if (z <= 4e-306) {
		tmp = y * 4.0;
	} else if (z <= 8.8e-253) {
		tmp = x * -3.0;
	} else if (z <= 1.6e-191) {
		tmp = y * 4.0;
	} else if (z <= 0.52) {
		tmp = x * -3.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	tmp = 0
	if z <= -0.08:
		tmp = t_0
	elif z <= -6e-102:
		tmp = x * -3.0
	elif z <= -4.4e-128:
		tmp = y * 4.0
	elif z <= -1.2e-148:
		tmp = x * -3.0
	elif z <= -1.7e-263:
		tmp = y * 4.0
	elif z <= -3.1e-305:
		tmp = x * -3.0
	elif z <= 4e-306:
		tmp = y * 4.0
	elif z <= 8.8e-253:
		tmp = x * -3.0
	elif z <= 1.6e-191:
		tmp = y * 4.0
	elif z <= 0.52:
		tmp = x * -3.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -0.08)
		tmp = t_0;
	elseif (z <= -6e-102)
		tmp = Float64(x * -3.0);
	elseif (z <= -4.4e-128)
		tmp = Float64(y * 4.0);
	elseif (z <= -1.2e-148)
		tmp = Float64(x * -3.0);
	elseif (z <= -1.7e-263)
		tmp = Float64(y * 4.0);
	elseif (z <= -3.1e-305)
		tmp = Float64(x * -3.0);
	elseif (z <= 4e-306)
		tmp = Float64(y * 4.0);
	elseif (z <= 8.8e-253)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.6e-191)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.52)
		tmp = Float64(x * -3.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	tmp = 0.0;
	if (z <= -0.08)
		tmp = t_0;
	elseif (z <= -6e-102)
		tmp = x * -3.0;
	elseif (z <= -4.4e-128)
		tmp = y * 4.0;
	elseif (z <= -1.2e-148)
		tmp = x * -3.0;
	elseif (z <= -1.7e-263)
		tmp = y * 4.0;
	elseif (z <= -3.1e-305)
		tmp = x * -3.0;
	elseif (z <= 4e-306)
		tmp = y * 4.0;
	elseif (z <= 8.8e-253)
		tmp = x * -3.0;
	elseif (z <= 1.6e-191)
		tmp = y * 4.0;
	elseif (z <= 0.52)
		tmp = x * -3.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.08], t$95$0, If[LessEqual[z, -6e-102], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -4.4e-128], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.2e-148], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.7e-263], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -3.1e-305], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4e-306], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 8.8e-253], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.6e-191], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.52], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -6 \cdot 10^{-102}:\\
\;\;\;\;x \cdot -3\\

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

\mathbf{elif}\;z \leq -1.2 \cdot 10^{-148}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq -1.7 \cdot 10^{-263}:\\
\;\;\;\;y \cdot 4\\

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -0.0800000000000000017 or 0.52000000000000002 < 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 49.6%

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

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

    if -0.0800000000000000017 < z < -6e-102 or -4.40000000000000019e-128 < z < -1.2000000000000001e-148 or -1.70000000000000002e-263 < z < -3.0999999999999998e-305 or 4.00000000000000011e-306 < z < 8.79999999999999983e-253 or 1.6000000000000002e-191 < z < 0.52000000000000002

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6e-102 < z < -4.40000000000000019e-128 or -1.2000000000000001e-148 < z < -1.70000000000000002e-263 or -3.0999999999999998e-305 < z < 4.00000000000000011e-306 or 8.79999999999999983e-253 < z < 1.6000000000000002e-191

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.08:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-102}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -4.4 \cdot 10^{-128}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-148}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{-263}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{-305}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-306}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-253}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-191}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.52:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 75.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ t_1 := x \cdot \left(-3 + z \cdot 6\right)\\ t_2 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -4.2 \cdot 10^{+256}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{+215}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -2 \cdot 10^{+46}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-10}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 0.19:\\ \;\;\;\;x + \left(y - x\right) \cdot 4\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+146}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+223}:\\ \;\;\;\;x + t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z)))
        (t_1 (* x (+ -3.0 (* z 6.0))))
        (t_2 (* x (* z 6.0))))
   (if (<= z -4.2e+256)
     t_0
     (if (<= z -2.9e+215)
       t_2
       (if (<= z -2e+46)
         (* y (* z -6.0))
         (if (<= z -1.3e-10)
           t_1
           (if (<= z 0.19)
             (+ x (* (- y x) 4.0))
             (if (<= z 3.4e+146) t_1 (if (<= z 3.2e+223) (+ x t_0) t_2)))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = x * (-3.0 + (z * 6.0));
	double t_2 = x * (z * 6.0);
	double tmp;
	if (z <= -4.2e+256) {
		tmp = t_0;
	} else if (z <= -2.9e+215) {
		tmp = t_2;
	} else if (z <= -2e+46) {
		tmp = y * (z * -6.0);
	} else if (z <= -1.3e-10) {
		tmp = t_1;
	} else if (z <= 0.19) {
		tmp = x + ((y - x) * 4.0);
	} else if (z <= 3.4e+146) {
		tmp = t_1;
	} else if (z <= 3.2e+223) {
		tmp = x + t_0;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_0 = (-6.0d0) * (y * z)
    t_1 = x * ((-3.0d0) + (z * 6.0d0))
    t_2 = x * (z * 6.0d0)
    if (z <= (-4.2d+256)) then
        tmp = t_0
    else if (z <= (-2.9d+215)) then
        tmp = t_2
    else if (z <= (-2d+46)) then
        tmp = y * (z * (-6.0d0))
    else if (z <= (-1.3d-10)) then
        tmp = t_1
    else if (z <= 0.19d0) then
        tmp = x + ((y - x) * 4.0d0)
    else if (z <= 3.4d+146) then
        tmp = t_1
    else if (z <= 3.2d+223) then
        tmp = x + t_0
    else
        tmp = t_2
    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 = x * (-3.0 + (z * 6.0));
	double t_2 = x * (z * 6.0);
	double tmp;
	if (z <= -4.2e+256) {
		tmp = t_0;
	} else if (z <= -2.9e+215) {
		tmp = t_2;
	} else if (z <= -2e+46) {
		tmp = y * (z * -6.0);
	} else if (z <= -1.3e-10) {
		tmp = t_1;
	} else if (z <= 0.19) {
		tmp = x + ((y - x) * 4.0);
	} else if (z <= 3.4e+146) {
		tmp = t_1;
	} else if (z <= 3.2e+223) {
		tmp = x + t_0;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	t_1 = x * (-3.0 + (z * 6.0))
	t_2 = x * (z * 6.0)
	tmp = 0
	if z <= -4.2e+256:
		tmp = t_0
	elif z <= -2.9e+215:
		tmp = t_2
	elif z <= -2e+46:
		tmp = y * (z * -6.0)
	elif z <= -1.3e-10:
		tmp = t_1
	elif z <= 0.19:
		tmp = x + ((y - x) * 4.0)
	elif z <= 3.4e+146:
		tmp = t_1
	elif z <= 3.2e+223:
		tmp = x + t_0
	else:
		tmp = t_2
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	t_1 = Float64(x * Float64(-3.0 + Float64(z * 6.0)))
	t_2 = Float64(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -4.2e+256)
		tmp = t_0;
	elseif (z <= -2.9e+215)
		tmp = t_2;
	elseif (z <= -2e+46)
		tmp = Float64(y * Float64(z * -6.0));
	elseif (z <= -1.3e-10)
		tmp = t_1;
	elseif (z <= 0.19)
		tmp = Float64(x + Float64(Float64(y - x) * 4.0));
	elseif (z <= 3.4e+146)
		tmp = t_1;
	elseif (z <= 3.2e+223)
		tmp = Float64(x + t_0);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	t_1 = x * (-3.0 + (z * 6.0));
	t_2 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -4.2e+256)
		tmp = t_0;
	elseif (z <= -2.9e+215)
		tmp = t_2;
	elseif (z <= -2e+46)
		tmp = y * (z * -6.0);
	elseif (z <= -1.3e-10)
		tmp = t_1;
	elseif (z <= 0.19)
		tmp = x + ((y - x) * 4.0);
	elseif (z <= 3.4e+146)
		tmp = t_1;
	elseif (z <= 3.2e+223)
		tmp = x + t_0;
	else
		tmp = t_2;
	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[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e+256], t$95$0, If[LessEqual[z, -2.9e+215], t$95$2, If[LessEqual[z, -2e+46], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.3e-10], t$95$1, If[LessEqual[z, 0.19], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e+146], t$95$1, If[LessEqual[z, 3.2e+223], N[(x + t$95$0), $MachinePrecision], t$95$2]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.9 \cdot 10^{+215}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq -1.3 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 3.4 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.2 \cdot 10^{+223}:\\
\;\;\;\;x + t\_0\\

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


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

    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. +-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.2e256 < z < -2.8999999999999999e215 or 3.2000000000000001e223 < 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 x around inf 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8999999999999999e215 < z < -2e46

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e46 < z < -1.29999999999999991e-10 or 0.19 < z < 3.39999999999999991e146

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.29999999999999991e-10 < z < 0.19

    1. Initial program 99.4%

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

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

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

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

    if 3.39999999999999991e146 < z < 3.2000000000000001e223

    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 y around inf 70.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+256}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{+215}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -2 \cdot 10^{+46}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-10}:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{elif}\;z \leq 0.19:\\ \;\;\;\;x + \left(y - x\right) \cdot 4\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+146}:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+223}:\\ \;\;\;\;x + -6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 75.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ t_1 := x \cdot \left(-3 + z \cdot 6\right)\\ t_2 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -4.6 \cdot 10^{+256}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.22 \cdot 10^{+213}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{+47}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{-9}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 0.19:\\ \;\;\;\;x \cdot -3 + y \cdot 4\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+146}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+221}:\\ \;\;\;\;x + t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z)))
        (t_1 (* x (+ -3.0 (* z 6.0))))
        (t_2 (* x (* z 6.0))))
   (if (<= z -4.6e+256)
     t_0
     (if (<= z -1.22e+213)
       t_2
       (if (<= z -2.7e+47)
         (* y (* z -6.0))
         (if (<= z -1.7e-9)
           t_1
           (if (<= z 0.19)
             (+ (* x -3.0) (* y 4.0))
             (if (<= z 4.6e+146) t_1 (if (<= z 3.2e+221) (+ x t_0) t_2)))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = x * (-3.0 + (z * 6.0));
	double t_2 = x * (z * 6.0);
	double tmp;
	if (z <= -4.6e+256) {
		tmp = t_0;
	} else if (z <= -1.22e+213) {
		tmp = t_2;
	} else if (z <= -2.7e+47) {
		tmp = y * (z * -6.0);
	} else if (z <= -1.7e-9) {
		tmp = t_1;
	} else if (z <= 0.19) {
		tmp = (x * -3.0) + (y * 4.0);
	} else if (z <= 4.6e+146) {
		tmp = t_1;
	} else if (z <= 3.2e+221) {
		tmp = x + t_0;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_0 = (-6.0d0) * (y * z)
    t_1 = x * ((-3.0d0) + (z * 6.0d0))
    t_2 = x * (z * 6.0d0)
    if (z <= (-4.6d+256)) then
        tmp = t_0
    else if (z <= (-1.22d+213)) then
        tmp = t_2
    else if (z <= (-2.7d+47)) then
        tmp = y * (z * (-6.0d0))
    else if (z <= (-1.7d-9)) then
        tmp = t_1
    else if (z <= 0.19d0) then
        tmp = (x * (-3.0d0)) + (y * 4.0d0)
    else if (z <= 4.6d+146) then
        tmp = t_1
    else if (z <= 3.2d+221) then
        tmp = x + t_0
    else
        tmp = t_2
    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 = x * (-3.0 + (z * 6.0));
	double t_2 = x * (z * 6.0);
	double tmp;
	if (z <= -4.6e+256) {
		tmp = t_0;
	} else if (z <= -1.22e+213) {
		tmp = t_2;
	} else if (z <= -2.7e+47) {
		tmp = y * (z * -6.0);
	} else if (z <= -1.7e-9) {
		tmp = t_1;
	} else if (z <= 0.19) {
		tmp = (x * -3.0) + (y * 4.0);
	} else if (z <= 4.6e+146) {
		tmp = t_1;
	} else if (z <= 3.2e+221) {
		tmp = x + t_0;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	t_1 = x * (-3.0 + (z * 6.0))
	t_2 = x * (z * 6.0)
	tmp = 0
	if z <= -4.6e+256:
		tmp = t_0
	elif z <= -1.22e+213:
		tmp = t_2
	elif z <= -2.7e+47:
		tmp = y * (z * -6.0)
	elif z <= -1.7e-9:
		tmp = t_1
	elif z <= 0.19:
		tmp = (x * -3.0) + (y * 4.0)
	elif z <= 4.6e+146:
		tmp = t_1
	elif z <= 3.2e+221:
		tmp = x + t_0
	else:
		tmp = t_2
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	t_1 = Float64(x * Float64(-3.0 + Float64(z * 6.0)))
	t_2 = Float64(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -4.6e+256)
		tmp = t_0;
	elseif (z <= -1.22e+213)
		tmp = t_2;
	elseif (z <= -2.7e+47)
		tmp = Float64(y * Float64(z * -6.0));
	elseif (z <= -1.7e-9)
		tmp = t_1;
	elseif (z <= 0.19)
		tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0));
	elseif (z <= 4.6e+146)
		tmp = t_1;
	elseif (z <= 3.2e+221)
		tmp = Float64(x + t_0);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	t_1 = x * (-3.0 + (z * 6.0));
	t_2 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -4.6e+256)
		tmp = t_0;
	elseif (z <= -1.22e+213)
		tmp = t_2;
	elseif (z <= -2.7e+47)
		tmp = y * (z * -6.0);
	elseif (z <= -1.7e-9)
		tmp = t_1;
	elseif (z <= 0.19)
		tmp = (x * -3.0) + (y * 4.0);
	elseif (z <= 4.6e+146)
		tmp = t_1;
	elseif (z <= 3.2e+221)
		tmp = x + t_0;
	else
		tmp = t_2;
	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[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.6e+256], t$95$0, If[LessEqual[z, -1.22e+213], t$95$2, If[LessEqual[z, -2.7e+47], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.7e-9], t$95$1, If[LessEqual[z, 0.19], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.6e+146], t$95$1, If[LessEqual[z, 3.2e+221], N[(x + t$95$0), $MachinePrecision], t$95$2]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.22 \cdot 10^{+213}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq -1.7 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 4.6 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.2 \cdot 10^{+221}:\\
\;\;\;\;x + t\_0\\

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


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

    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. +-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.5999999999999997e256 < z < -1.2199999999999999e213 or 3.2e221 < 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 x around inf 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2199999999999999e213 < z < -2.69999999999999996e47

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.69999999999999996e47 < z < -1.6999999999999999e-9 or 0.19 < z < 4.60000000000000001e146

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6999999999999999e-9 < z < 0.19

    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 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 z around 0 98.5%

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

    if 4.60000000000000001e146 < z < 3.2e221

    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 y around inf 70.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.6 \cdot 10^{+256}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.22 \cdot 10^{+213}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{+47}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{-9}:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{elif}\;z \leq 0.19:\\ \;\;\;\;x \cdot -3 + y \cdot 4\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+146}:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+221}:\\ \;\;\;\;x + -6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 75.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(-3 + z \cdot 6\right)\\ t_1 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -3.3 \cdot 10^{+256}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+214}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{+47}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-10}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 0.19:\\ \;\;\;\;x \cdot -3 + y \cdot 4\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+146}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+221}:\\ \;\;\;\;x - z \cdot \left(y \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (+ -3.0 (* z 6.0)))) (t_1 (* x (* z 6.0))))
   (if (<= z -3.3e+256)
     (* -6.0 (* y z))
     (if (<= z -1.5e+214)
       t_1
       (if (<= z -1.7e+47)
         (* y (* z -6.0))
         (if (<= z -1.4e-10)
           t_0
           (if (<= z 0.19)
             (+ (* x -3.0) (* y 4.0))
             (if (<= z 3e+146)
               t_0
               (if (<= z 2.4e+221) (- x (* z (* y 6.0))) t_1)))))))))
double code(double x, double y, double z) {
	double t_0 = x * (-3.0 + (z * 6.0));
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -3.3e+256) {
		tmp = -6.0 * (y * z);
	} else if (z <= -1.5e+214) {
		tmp = t_1;
	} else if (z <= -1.7e+47) {
		tmp = y * (z * -6.0);
	} else if (z <= -1.4e-10) {
		tmp = t_0;
	} else if (z <= 0.19) {
		tmp = (x * -3.0) + (y * 4.0);
	} else if (z <= 3e+146) {
		tmp = t_0;
	} else if (z <= 2.4e+221) {
		tmp = x - (z * (y * 6.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 = x * ((-3.0d0) + (z * 6.0d0))
    t_1 = x * (z * 6.0d0)
    if (z <= (-3.3d+256)) then
        tmp = (-6.0d0) * (y * z)
    else if (z <= (-1.5d+214)) then
        tmp = t_1
    else if (z <= (-1.7d+47)) then
        tmp = y * (z * (-6.0d0))
    else if (z <= (-1.4d-10)) then
        tmp = t_0
    else if (z <= 0.19d0) then
        tmp = (x * (-3.0d0)) + (y * 4.0d0)
    else if (z <= 3d+146) then
        tmp = t_0
    else if (z <= 2.4d+221) then
        tmp = x - (z * (y * 6.0d0))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x * (-3.0 + (z * 6.0));
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -3.3e+256) {
		tmp = -6.0 * (y * z);
	} else if (z <= -1.5e+214) {
		tmp = t_1;
	} else if (z <= -1.7e+47) {
		tmp = y * (z * -6.0);
	} else if (z <= -1.4e-10) {
		tmp = t_0;
	} else if (z <= 0.19) {
		tmp = (x * -3.0) + (y * 4.0);
	} else if (z <= 3e+146) {
		tmp = t_0;
	} else if (z <= 2.4e+221) {
		tmp = x - (z * (y * 6.0));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (-3.0 + (z * 6.0))
	t_1 = x * (z * 6.0)
	tmp = 0
	if z <= -3.3e+256:
		tmp = -6.0 * (y * z)
	elif z <= -1.5e+214:
		tmp = t_1
	elif z <= -1.7e+47:
		tmp = y * (z * -6.0)
	elif z <= -1.4e-10:
		tmp = t_0
	elif z <= 0.19:
		tmp = (x * -3.0) + (y * 4.0)
	elif z <= 3e+146:
		tmp = t_0
	elif z <= 2.4e+221:
		tmp = x - (z * (y * 6.0))
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(-3.0 + Float64(z * 6.0)))
	t_1 = Float64(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -3.3e+256)
		tmp = Float64(-6.0 * Float64(y * z));
	elseif (z <= -1.5e+214)
		tmp = t_1;
	elseif (z <= -1.7e+47)
		tmp = Float64(y * Float64(z * -6.0));
	elseif (z <= -1.4e-10)
		tmp = t_0;
	elseif (z <= 0.19)
		tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0));
	elseif (z <= 3e+146)
		tmp = t_0;
	elseif (z <= 2.4e+221)
		tmp = Float64(x - Float64(z * Float64(y * 6.0)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * (-3.0 + (z * 6.0));
	t_1 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -3.3e+256)
		tmp = -6.0 * (y * z);
	elseif (z <= -1.5e+214)
		tmp = t_1;
	elseif (z <= -1.7e+47)
		tmp = y * (z * -6.0);
	elseif (z <= -1.4e-10)
		tmp = t_0;
	elseif (z <= 0.19)
		tmp = (x * -3.0) + (y * 4.0);
	elseif (z <= 3e+146)
		tmp = t_0;
	elseif (z <= 2.4e+221)
		tmp = x - (z * (y * 6.0));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.3e+256], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.5e+214], t$95$1, If[LessEqual[z, -1.7e+47], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.4e-10], t$95$0, If[LessEqual[z, 0.19], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+146], t$95$0, If[LessEqual[z, 2.4e+221], N[(x - N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + z \cdot 6\right)\\
t_1 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{+256}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\

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

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

\mathbf{elif}\;z \leq -1.4 \cdot 10^{-10}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;z \leq 3 \cdot 10^{+146}:\\
\;\;\;\;t\_0\\

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

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


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

    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. +-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.2999999999999999e256 < z < -1.5000000000000001e214 or 2.40000000000000019e221 < 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 x around inf 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5000000000000001e214 < z < -1.6999999999999999e47

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6999999999999999e47 < z < -1.40000000000000008e-10 or 0.19 < z < 3.00000000000000002e146

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.40000000000000008e-10 < z < 0.19

    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 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 z around 0 98.5%

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

    if 3.00000000000000002e146 < z < 2.40000000000000019e221

    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 y around inf 70.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.3 \cdot 10^{+256}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+214}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{+47}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-10}:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{elif}\;z \leq 0.19:\\ \;\;\;\;x \cdot -3 + y \cdot 4\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+146}:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+221}:\\ \;\;\;\;x - z \cdot \left(y \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 60.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \mathbf{if}\;y \leq -7.3 \cdot 10^{-104}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{-205}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;y \leq -6.2 \cdot 10^{-277}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-96}:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* 6.0 (* y (- 0.6666666666666666 z)))))
   (if (<= y -7.3e-104)
     t_0
     (if (<= y -5.6e-205)
       (* x -3.0)
       (if (<= y -6.2e-277)
         (* x (* z 6.0))
         (if (<= y 1.3e-96) (* x -3.0) t_0))))))
double code(double x, double y, double z) {
	double t_0 = 6.0 * (y * (0.6666666666666666 - z));
	double tmp;
	if (y <= -7.3e-104) {
		tmp = t_0;
	} else if (y <= -5.6e-205) {
		tmp = x * -3.0;
	} else if (y <= -6.2e-277) {
		tmp = x * (z * 6.0);
	} else if (y <= 1.3e-96) {
		tmp = x * -3.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 6.0d0 * (y * (0.6666666666666666d0 - z))
    if (y <= (-7.3d-104)) then
        tmp = t_0
    else if (y <= (-5.6d-205)) then
        tmp = x * (-3.0d0)
    else if (y <= (-6.2d-277)) then
        tmp = x * (z * 6.0d0)
    else if (y <= 1.3d-96) then
        tmp = x * (-3.0d0)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 6.0 * (y * (0.6666666666666666 - z));
	double tmp;
	if (y <= -7.3e-104) {
		tmp = t_0;
	} else if (y <= -5.6e-205) {
		tmp = x * -3.0;
	} else if (y <= -6.2e-277) {
		tmp = x * (z * 6.0);
	} else if (y <= 1.3e-96) {
		tmp = x * -3.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 6.0 * (y * (0.6666666666666666 - z))
	tmp = 0
	if y <= -7.3e-104:
		tmp = t_0
	elif y <= -5.6e-205:
		tmp = x * -3.0
	elif y <= -6.2e-277:
		tmp = x * (z * 6.0)
	elif y <= 1.3e-96:
		tmp = x * -3.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z)))
	tmp = 0.0
	if (y <= -7.3e-104)
		tmp = t_0;
	elseif (y <= -5.6e-205)
		tmp = Float64(x * -3.0);
	elseif (y <= -6.2e-277)
		tmp = Float64(x * Float64(z * 6.0));
	elseif (y <= 1.3e-96)
		tmp = Float64(x * -3.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 6.0 * (y * (0.6666666666666666 - z));
	tmp = 0.0;
	if (y <= -7.3e-104)
		tmp = t_0;
	elseif (y <= -5.6e-205)
		tmp = x * -3.0;
	elseif (y <= -6.2e-277)
		tmp = x * (z * 6.0);
	elseif (y <= 1.3e-96)
		tmp = x * -3.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.3e-104], t$95$0, If[LessEqual[y, -5.6e-205], N[(x * -3.0), $MachinePrecision], If[LessEqual[y, -6.2e-277], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e-96], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -5.6 \cdot 10^{-205}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;y \leq -6.2 \cdot 10^{-277}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\

\mathbf{elif}\;y \leq 1.3 \cdot 10^{-96}:\\
\;\;\;\;x \cdot -3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7.3e-104 or 1.3000000000000001e-96 < y

    1. Initial program 99.6%

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

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

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

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

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

        \[\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*32.1%

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

        \[\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*32.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-rr32.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 y around inf 90.2%

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

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

    if -7.3e-104 < y < -5.59999999999999983e-205 or -6.19999999999999958e-277 < y < 1.3000000000000001e-96

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.59999999999999983e-205 < y < -6.19999999999999958e-277

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.3 \cdot 10^{-104}:\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{-205}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;y \leq -6.2 \cdot 10^{-277}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-96}:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 97.8% accurate, 0.7× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.57999999999999996 or 0.5 < 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 x around 0 97.1%

      \[\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 inf 97.8%

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

    if -0.57999999999999996 < z < 0.5

    1. Initial program 99.4%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 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 z around 0 97.5%

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

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

Alternative 12: 97.8% accurate, 0.7× speedup?

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

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

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

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


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

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

      \[\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 inf 97.8%

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

    if -0.52000000000000002 < z < 0.5

    1. Initial program 99.4%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 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 z around 0 97.5%

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

    if 0.5 < z

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

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

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

Alternative 13: 75.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+50} \lor \neg \left(y \leq 9.6 \cdot 10^{+54}\right):\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.3999999999999998e50 or 9.59999999999999993e54 < y

    1. Initial program 99.6%

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

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

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

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

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

        \[\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*21.9%

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

        \[\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*22.0%

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

      \[\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 y around inf 92.7%

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

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

    if -3.3999999999999998e50 < y < 9.59999999999999993e54

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{+50} \lor \neg \left(y \leq 9.6 \cdot 10^{+54}\right):\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 75.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{+50} \lor \neg \left(y \leq 1.12 \cdot 10^{+55}\right):\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.3e50 or 1.12000000000000006e55 < y

    1. Initial program 99.6%

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

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

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

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

    if -3.3e50 < y < 1.12000000000000006e55

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 37.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{+74} \lor \neg \left(x \leq 1.65 \cdot 10^{-59}\right):\\
\;\;\;\;x \cdot -3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.99999999999999952e73 or 1.64999999999999991e-59 < x

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999999952e73 < x < 1.64999999999999991e-59

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

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

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

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

Alternative 16: 99.5% accurate, 1.2× speedup?

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

\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\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(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) \]
  6. Add Preprocessing

Alternative 17: 25.7% 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 53.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 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 y around inf 48.0%

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

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

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

    \[\leadsto \color{blue}{x} \]
  9. Final simplification2.3%

    \[\leadsto x \]
  10. Add Preprocessing

Reproduce

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