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

Percentage Accurate: 99.5% → 99.8%
Time: 13.1s
Alternatives: 16
Speedup: 1.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 99.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

Alternative 3: 50.5% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \left(x \cdot z\right)\\ t_1 := -6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -1.45 \cdot 10^{+218}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{+107}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -0.115:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-101}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -3.55 \cdot 10^{-161}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-204}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-292}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-174}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-152}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.52:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+60} \lor \neg \left(z \leq 6.5 \cdot 10^{+148}\right):\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* 6.0 (* x z))) (t_1 (* -6.0 (* y z))))
   (if (<= z -1.45e+218)
     t_0
     (if (<= z -1.3e+107)
       t_1
       (if (<= z -0.115)
         t_0
         (if (<= z -1.8e-101)
           (* y 4.0)
           (if (<= z -3.55e-161)
             (* x -3.0)
             (if (<= z -1.1e-204)
               (* y 4.0)
               (if (<= z -1.15e-292)
                 (* x -3.0)
                 (if (<= z 8.5e-174)
                   (* y 4.0)
                   (if (<= z 1.2e-152)
                     (* x -3.0)
                     (if (<= z 0.52)
                       (* y 4.0)
                       (if (or (<= z 1.5e+60) (not (<= z 6.5e+148)))
                         t_0
                         t_1)))))))))))))
double code(double x, double y, double z) {
	double t_0 = 6.0 * (x * z);
	double t_1 = -6.0 * (y * z);
	double tmp;
	if (z <= -1.45e+218) {
		tmp = t_0;
	} else if (z <= -1.3e+107) {
		tmp = t_1;
	} else if (z <= -0.115) {
		tmp = t_0;
	} else if (z <= -1.8e-101) {
		tmp = y * 4.0;
	} else if (z <= -3.55e-161) {
		tmp = x * -3.0;
	} else if (z <= -1.1e-204) {
		tmp = y * 4.0;
	} else if (z <= -1.15e-292) {
		tmp = x * -3.0;
	} else if (z <= 8.5e-174) {
		tmp = y * 4.0;
	} else if (z <= 1.2e-152) {
		tmp = x * -3.0;
	} else if (z <= 0.52) {
		tmp = y * 4.0;
	} else if ((z <= 1.5e+60) || !(z <= 6.5e+148)) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 6.0d0 * (x * z)
    t_1 = (-6.0d0) * (y * z)
    if (z <= (-1.45d+218)) then
        tmp = t_0
    else if (z <= (-1.3d+107)) then
        tmp = t_1
    else if (z <= (-0.115d0)) then
        tmp = t_0
    else if (z <= (-1.8d-101)) then
        tmp = y * 4.0d0
    else if (z <= (-3.55d-161)) then
        tmp = x * (-3.0d0)
    else if (z <= (-1.1d-204)) then
        tmp = y * 4.0d0
    else if (z <= (-1.15d-292)) then
        tmp = x * (-3.0d0)
    else if (z <= 8.5d-174) then
        tmp = y * 4.0d0
    else if (z <= 1.2d-152) then
        tmp = x * (-3.0d0)
    else if (z <= 0.52d0) then
        tmp = y * 4.0d0
    else if ((z <= 1.5d+60) .or. (.not. (z <= 6.5d+148))) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 6.0 * (x * z);
	double t_1 = -6.0 * (y * z);
	double tmp;
	if (z <= -1.45e+218) {
		tmp = t_0;
	} else if (z <= -1.3e+107) {
		tmp = t_1;
	} else if (z <= -0.115) {
		tmp = t_0;
	} else if (z <= -1.8e-101) {
		tmp = y * 4.0;
	} else if (z <= -3.55e-161) {
		tmp = x * -3.0;
	} else if (z <= -1.1e-204) {
		tmp = y * 4.0;
	} else if (z <= -1.15e-292) {
		tmp = x * -3.0;
	} else if (z <= 8.5e-174) {
		tmp = y * 4.0;
	} else if (z <= 1.2e-152) {
		tmp = x * -3.0;
	} else if (z <= 0.52) {
		tmp = y * 4.0;
	} else if ((z <= 1.5e+60) || !(z <= 6.5e+148)) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 6.0 * (x * z)
	t_1 = -6.0 * (y * z)
	tmp = 0
	if z <= -1.45e+218:
		tmp = t_0
	elif z <= -1.3e+107:
		tmp = t_1
	elif z <= -0.115:
		tmp = t_0
	elif z <= -1.8e-101:
		tmp = y * 4.0
	elif z <= -3.55e-161:
		tmp = x * -3.0
	elif z <= -1.1e-204:
		tmp = y * 4.0
	elif z <= -1.15e-292:
		tmp = x * -3.0
	elif z <= 8.5e-174:
		tmp = y * 4.0
	elif z <= 1.2e-152:
		tmp = x * -3.0
	elif z <= 0.52:
		tmp = y * 4.0
	elif (z <= 1.5e+60) or not (z <= 6.5e+148):
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(6.0 * Float64(x * z))
	t_1 = Float64(-6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -1.45e+218)
		tmp = t_0;
	elseif (z <= -1.3e+107)
		tmp = t_1;
	elseif (z <= -0.115)
		tmp = t_0;
	elseif (z <= -1.8e-101)
		tmp = Float64(y * 4.0);
	elseif (z <= -3.55e-161)
		tmp = Float64(x * -3.0);
	elseif (z <= -1.1e-204)
		tmp = Float64(y * 4.0);
	elseif (z <= -1.15e-292)
		tmp = Float64(x * -3.0);
	elseif (z <= 8.5e-174)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.2e-152)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.52)
		tmp = Float64(y * 4.0);
	elseif ((z <= 1.5e+60) || !(z <= 6.5e+148))
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 6.0 * (x * z);
	t_1 = -6.0 * (y * z);
	tmp = 0.0;
	if (z <= -1.45e+218)
		tmp = t_0;
	elseif (z <= -1.3e+107)
		tmp = t_1;
	elseif (z <= -0.115)
		tmp = t_0;
	elseif (z <= -1.8e-101)
		tmp = y * 4.0;
	elseif (z <= -3.55e-161)
		tmp = x * -3.0;
	elseif (z <= -1.1e-204)
		tmp = y * 4.0;
	elseif (z <= -1.15e-292)
		tmp = x * -3.0;
	elseif (z <= 8.5e-174)
		tmp = y * 4.0;
	elseif (z <= 1.2e-152)
		tmp = x * -3.0;
	elseif (z <= 0.52)
		tmp = y * 4.0;
	elseif ((z <= 1.5e+60) || ~((z <= 6.5e+148)))
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.45e+218], t$95$0, If[LessEqual[z, -1.3e+107], t$95$1, If[LessEqual[z, -0.115], t$95$0, If[LessEqual[z, -1.8e-101], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -3.55e-161], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.1e-204], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.15e-292], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 8.5e-174], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.2e-152], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.52], N[(y * 4.0), $MachinePrecision], If[Or[LessEqual[z, 1.5e+60], N[Not[LessEqual[z, 6.5e+148]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]]]]]]]
\begin{array}{l}

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

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

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

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

\mathbf{elif}\;z \leq -3.55 \cdot 10^{-161}:\\
\;\;\;\;x \cdot -3\\

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

\mathbf{elif}\;z \leq -1.15 \cdot 10^{-292}:\\
\;\;\;\;x \cdot -3\\

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

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

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

\mathbf{elif}\;z \leq 1.5 \cdot 10^{+60} \lor \neg \left(z \leq 6.5 \cdot 10^{+148}\right):\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.45e218 or -1.3000000000000001e107 < z < -0.115000000000000005 or 0.52000000000000002 < z < 1.4999999999999999e60 or 6.49999999999999947e148 < 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 70.6%

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-6\right)} \cdot \left(0.6666666666666666 - z\right)\right) \]
      2. cancel-sign-sub-inv70.6%

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(0.6666666666666666 - z\right) \cdot 6}\right) \]
      4. cancel-sign-sub-inv70.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.45e218 < z < -1.3000000000000001e107 or 1.4999999999999999e60 < z < 6.49999999999999947e148

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

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

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

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

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

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

    if -0.115000000000000005 < z < -1.8e-101 or -3.55e-161 < z < -1.0999999999999999e-204 or -1.1499999999999999e-292 < z < 8.4999999999999996e-174 or 1.2e-152 < 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 z around 0 95.7%

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

      \[\leadsto \color{blue}{y \cdot \left(4 + \left(-4 \cdot \frac{x}{y} + \frac{x}{y}\right)\right)} \]
    7. Step-by-step derivation
      1. distribute-lft1-in84.8%

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

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

      \[\leadsto \color{blue}{y \cdot \left(4 + -3 \cdot \frac{x}{y}\right)} \]
    9. Taylor expanded in y around inf 59.7%

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    11. Simplified59.7%

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

    if -1.8e-101 < z < -3.55e-161 or -1.0999999999999999e-204 < z < -1.1499999999999999e-292 or 8.4999999999999996e-174 < z < 1.2e-152

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-6\right)} \cdot \left(0.6666666666666666 - z\right)\right) \]
      2. cancel-sign-sub-inv87.7%

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(0.6666666666666666 - z\right) \cdot 6}\right) \]
      4. cancel-sign-sub-inv87.7%

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

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

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{-6} \cdot \left(0.6666666666666666 - z\right)\right) \]
      9. sub-neg87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+218}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{+107}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -0.115:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-101}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -3.55 \cdot 10^{-161}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-204}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-292}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-174}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-152}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.52:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+60} \lor \neg \left(z \leq 6.5 \cdot 10^{+148}\right):\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 50.7% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \left(x \cdot z\right)\\ t_1 := -6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -6.5 \cdot 10^{+212}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -4.7 \cdot 10^{+142}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -0.062:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{-104}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -2.25 \cdot 10^{-161}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-204}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{-293}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-174}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-147}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.52:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{+56} \lor \neg \left(z \leq 4.4 \cdot 10^{+149}\right):\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* 6.0 (* x z))) (t_1 (* -6.0 (* y z))))
   (if (<= z -6.5e+212)
     t_0
     (if (<= z -4.7e+142)
       t_1
       (if (<= z -0.062)
         (* x (* z 6.0))
         (if (<= z -1.55e-104)
           (* y 4.0)
           (if (<= z -2.25e-161)
             (* x -3.0)
             (if (<= z -2.3e-204)
               (* y 4.0)
               (if (<= z -1.85e-293)
                 (* x -3.0)
                 (if (<= z 3e-174)
                   (* y 4.0)
                   (if (<= z 7.5e-147)
                     (* x -3.0)
                     (if (<= z 0.52)
                       (* y 4.0)
                       (if (or (<= z 3.3e+56) (not (<= z 4.4e+149)))
                         t_0
                         t_1)))))))))))))
double code(double x, double y, double z) {
	double t_0 = 6.0 * (x * z);
	double t_1 = -6.0 * (y * z);
	double tmp;
	if (z <= -6.5e+212) {
		tmp = t_0;
	} else if (z <= -4.7e+142) {
		tmp = t_1;
	} else if (z <= -0.062) {
		tmp = x * (z * 6.0);
	} else if (z <= -1.55e-104) {
		tmp = y * 4.0;
	} else if (z <= -2.25e-161) {
		tmp = x * -3.0;
	} else if (z <= -2.3e-204) {
		tmp = y * 4.0;
	} else if (z <= -1.85e-293) {
		tmp = x * -3.0;
	} else if (z <= 3e-174) {
		tmp = y * 4.0;
	} else if (z <= 7.5e-147) {
		tmp = x * -3.0;
	} else if (z <= 0.52) {
		tmp = y * 4.0;
	} else if ((z <= 3.3e+56) || !(z <= 4.4e+149)) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 6.0d0 * (x * z)
    t_1 = (-6.0d0) * (y * z)
    if (z <= (-6.5d+212)) then
        tmp = t_0
    else if (z <= (-4.7d+142)) then
        tmp = t_1
    else if (z <= (-0.062d0)) then
        tmp = x * (z * 6.0d0)
    else if (z <= (-1.55d-104)) then
        tmp = y * 4.0d0
    else if (z <= (-2.25d-161)) then
        tmp = x * (-3.0d0)
    else if (z <= (-2.3d-204)) then
        tmp = y * 4.0d0
    else if (z <= (-1.85d-293)) then
        tmp = x * (-3.0d0)
    else if (z <= 3d-174) then
        tmp = y * 4.0d0
    else if (z <= 7.5d-147) then
        tmp = x * (-3.0d0)
    else if (z <= 0.52d0) then
        tmp = y * 4.0d0
    else if ((z <= 3.3d+56) .or. (.not. (z <= 4.4d+149))) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 6.0 * (x * z);
	double t_1 = -6.0 * (y * z);
	double tmp;
	if (z <= -6.5e+212) {
		tmp = t_0;
	} else if (z <= -4.7e+142) {
		tmp = t_1;
	} else if (z <= -0.062) {
		tmp = x * (z * 6.0);
	} else if (z <= -1.55e-104) {
		tmp = y * 4.0;
	} else if (z <= -2.25e-161) {
		tmp = x * -3.0;
	} else if (z <= -2.3e-204) {
		tmp = y * 4.0;
	} else if (z <= -1.85e-293) {
		tmp = x * -3.0;
	} else if (z <= 3e-174) {
		tmp = y * 4.0;
	} else if (z <= 7.5e-147) {
		tmp = x * -3.0;
	} else if (z <= 0.52) {
		tmp = y * 4.0;
	} else if ((z <= 3.3e+56) || !(z <= 4.4e+149)) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 6.0 * (x * z)
	t_1 = -6.0 * (y * z)
	tmp = 0
	if z <= -6.5e+212:
		tmp = t_0
	elif z <= -4.7e+142:
		tmp = t_1
	elif z <= -0.062:
		tmp = x * (z * 6.0)
	elif z <= -1.55e-104:
		tmp = y * 4.0
	elif z <= -2.25e-161:
		tmp = x * -3.0
	elif z <= -2.3e-204:
		tmp = y * 4.0
	elif z <= -1.85e-293:
		tmp = x * -3.0
	elif z <= 3e-174:
		tmp = y * 4.0
	elif z <= 7.5e-147:
		tmp = x * -3.0
	elif z <= 0.52:
		tmp = y * 4.0
	elif (z <= 3.3e+56) or not (z <= 4.4e+149):
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(6.0 * Float64(x * z))
	t_1 = Float64(-6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -6.5e+212)
		tmp = t_0;
	elseif (z <= -4.7e+142)
		tmp = t_1;
	elseif (z <= -0.062)
		tmp = Float64(x * Float64(z * 6.0));
	elseif (z <= -1.55e-104)
		tmp = Float64(y * 4.0);
	elseif (z <= -2.25e-161)
		tmp = Float64(x * -3.0);
	elseif (z <= -2.3e-204)
		tmp = Float64(y * 4.0);
	elseif (z <= -1.85e-293)
		tmp = Float64(x * -3.0);
	elseif (z <= 3e-174)
		tmp = Float64(y * 4.0);
	elseif (z <= 7.5e-147)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.52)
		tmp = Float64(y * 4.0);
	elseif ((z <= 3.3e+56) || !(z <= 4.4e+149))
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 6.0 * (x * z);
	t_1 = -6.0 * (y * z);
	tmp = 0.0;
	if (z <= -6.5e+212)
		tmp = t_0;
	elseif (z <= -4.7e+142)
		tmp = t_1;
	elseif (z <= -0.062)
		tmp = x * (z * 6.0);
	elseif (z <= -1.55e-104)
		tmp = y * 4.0;
	elseif (z <= -2.25e-161)
		tmp = x * -3.0;
	elseif (z <= -2.3e-204)
		tmp = y * 4.0;
	elseif (z <= -1.85e-293)
		tmp = x * -3.0;
	elseif (z <= 3e-174)
		tmp = y * 4.0;
	elseif (z <= 7.5e-147)
		tmp = x * -3.0;
	elseif (z <= 0.52)
		tmp = y * 4.0;
	elseif ((z <= 3.3e+56) || ~((z <= 4.4e+149)))
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.5e+212], t$95$0, If[LessEqual[z, -4.7e+142], t$95$1, If[LessEqual[z, -0.062], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.55e-104], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -2.25e-161], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.3e-204], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.85e-293], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3e-174], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7.5e-147], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.52], N[(y * 4.0), $MachinePrecision], If[Or[LessEqual[z, 3.3e+56], N[Not[LessEqual[z, 4.4e+149]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]]]]]]]
\begin{array}{l}

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

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

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

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

\mathbf{elif}\;z \leq -2.25 \cdot 10^{-161}:\\
\;\;\;\;x \cdot -3\\

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

\mathbf{elif}\;z \leq -1.85 \cdot 10^{-293}:\\
\;\;\;\;x \cdot -3\\

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

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

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

\mathbf{elif}\;z \leq 3.3 \cdot 10^{+56} \lor \neg \left(z \leq 4.4 \cdot 10^{+149}\right):\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -6.49999999999999997e212 or 0.52000000000000002 < z < 3.30000000000000002e56 or 4.4e149 < 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 72.1%

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-6\right)} \cdot \left(0.6666666666666666 - z\right)\right) \]
      2. cancel-sign-sub-inv72.1%

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(0.6666666666666666 - z\right) \cdot 6}\right) \]
      4. cancel-sign-sub-inv72.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.49999999999999997e212 < z < -4.7e142 or 3.30000000000000002e56 < z < 4.4e149

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

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

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

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

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

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

    if -4.7e142 < z < -0.062

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-6\right)} \cdot \left(0.6666666666666666 - z\right)\right) \]
      2. cancel-sign-sub-inv63.5%

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(0.6666666666666666 - z\right) \cdot 6}\right) \]
      4. cancel-sign-sub-inv63.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.062 < z < -1.54999999999999988e-104 or -2.2499999999999998e-161 < z < -2.2999999999999999e-204 or -1.85000000000000004e-293 < z < 3.00000000000000021e-174 or 7.50000000000000047e-147 < 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 z around 0 95.7%

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

      \[\leadsto \color{blue}{y \cdot \left(4 + \left(-4 \cdot \frac{x}{y} + \frac{x}{y}\right)\right)} \]
    7. Step-by-step derivation
      1. distribute-lft1-in84.8%

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

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

      \[\leadsto \color{blue}{y \cdot \left(4 + -3 \cdot \frac{x}{y}\right)} \]
    9. Taylor expanded in y around inf 59.7%

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    11. Simplified59.7%

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

    if -1.54999999999999988e-104 < z < -2.2499999999999998e-161 or -2.2999999999999999e-204 < z < -1.85000000000000004e-293 or 3.00000000000000021e-174 < z < 7.50000000000000047e-147

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-6\right)} \cdot \left(0.6666666666666666 - z\right)\right) \]
      2. cancel-sign-sub-inv87.7%

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(0.6666666666666666 - z\right) \cdot 6}\right) \]
      4. cancel-sign-sub-inv87.7%

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

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

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{-6} \cdot \left(0.6666666666666666 - z\right)\right) \]
      9. sub-neg87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+212}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -4.7 \cdot 10^{+142}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -0.062:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{-104}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -2.25 \cdot 10^{-161}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-204}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{-293}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-174}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-147}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.52:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{+56} \lor \neg \left(z \leq 4.4 \cdot 10^{+149}\right):\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 50.8% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -4.2 \cdot 10^{+215}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \mathbf{elif}\;z \leq -1.26 \cdot 10^{+144}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -2.1:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-101}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -8.8 \cdot 10^{-160}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.26 \cdot 10^{-204}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-293}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-174}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-141}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.52:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{+60} \lor \neg \left(z \leq 9.2 \cdot 10^{+151}\right):\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))))
   (if (<= z -4.2e+215)
     (* z (* x 6.0))
     (if (<= z -1.26e+144)
       t_0
       (if (<= z -2.1)
         (* x (* z 6.0))
         (if (<= z -2.4e-101)
           (* y 4.0)
           (if (<= z -8.8e-160)
             (* x -3.0)
             (if (<= z -1.26e-204)
               (* y 4.0)
               (if (<= z -1.6e-293)
                 (* x -3.0)
                 (if (<= z 8.8e-174)
                   (* y 4.0)
                   (if (<= z 6.5e-141)
                     (* x -3.0)
                     (if (<= z 0.52)
                       (* y 4.0)
                       (if (or (<= z 1.1e+60) (not (<= z 9.2e+151)))
                         (* 6.0 (* x z))
                         t_0)))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double tmp;
	if (z <= -4.2e+215) {
		tmp = z * (x * 6.0);
	} else if (z <= -1.26e+144) {
		tmp = t_0;
	} else if (z <= -2.1) {
		tmp = x * (z * 6.0);
	} else if (z <= -2.4e-101) {
		tmp = y * 4.0;
	} else if (z <= -8.8e-160) {
		tmp = x * -3.0;
	} else if (z <= -1.26e-204) {
		tmp = y * 4.0;
	} else if (z <= -1.6e-293) {
		tmp = x * -3.0;
	} else if (z <= 8.8e-174) {
		tmp = y * 4.0;
	} else if (z <= 6.5e-141) {
		tmp = x * -3.0;
	} else if (z <= 0.52) {
		tmp = y * 4.0;
	} else if ((z <= 1.1e+60) || !(z <= 9.2e+151)) {
		tmp = 6.0 * (x * z);
	} 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 <= (-4.2d+215)) then
        tmp = z * (x * 6.0d0)
    else if (z <= (-1.26d+144)) then
        tmp = t_0
    else if (z <= (-2.1d0)) then
        tmp = x * (z * 6.0d0)
    else if (z <= (-2.4d-101)) then
        tmp = y * 4.0d0
    else if (z <= (-8.8d-160)) then
        tmp = x * (-3.0d0)
    else if (z <= (-1.26d-204)) then
        tmp = y * 4.0d0
    else if (z <= (-1.6d-293)) then
        tmp = x * (-3.0d0)
    else if (z <= 8.8d-174) then
        tmp = y * 4.0d0
    else if (z <= 6.5d-141) then
        tmp = x * (-3.0d0)
    else if (z <= 0.52d0) then
        tmp = y * 4.0d0
    else if ((z <= 1.1d+60) .or. (.not. (z <= 9.2d+151))) then
        tmp = 6.0d0 * (x * z)
    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 <= -4.2e+215) {
		tmp = z * (x * 6.0);
	} else if (z <= -1.26e+144) {
		tmp = t_0;
	} else if (z <= -2.1) {
		tmp = x * (z * 6.0);
	} else if (z <= -2.4e-101) {
		tmp = y * 4.0;
	} else if (z <= -8.8e-160) {
		tmp = x * -3.0;
	} else if (z <= -1.26e-204) {
		tmp = y * 4.0;
	} else if (z <= -1.6e-293) {
		tmp = x * -3.0;
	} else if (z <= 8.8e-174) {
		tmp = y * 4.0;
	} else if (z <= 6.5e-141) {
		tmp = x * -3.0;
	} else if (z <= 0.52) {
		tmp = y * 4.0;
	} else if ((z <= 1.1e+60) || !(z <= 9.2e+151)) {
		tmp = 6.0 * (x * z);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	tmp = 0
	if z <= -4.2e+215:
		tmp = z * (x * 6.0)
	elif z <= -1.26e+144:
		tmp = t_0
	elif z <= -2.1:
		tmp = x * (z * 6.0)
	elif z <= -2.4e-101:
		tmp = y * 4.0
	elif z <= -8.8e-160:
		tmp = x * -3.0
	elif z <= -1.26e-204:
		tmp = y * 4.0
	elif z <= -1.6e-293:
		tmp = x * -3.0
	elif z <= 8.8e-174:
		tmp = y * 4.0
	elif z <= 6.5e-141:
		tmp = x * -3.0
	elif z <= 0.52:
		tmp = y * 4.0
	elif (z <= 1.1e+60) or not (z <= 9.2e+151):
		tmp = 6.0 * (x * z)
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -4.2e+215)
		tmp = Float64(z * Float64(x * 6.0));
	elseif (z <= -1.26e+144)
		tmp = t_0;
	elseif (z <= -2.1)
		tmp = Float64(x * Float64(z * 6.0));
	elseif (z <= -2.4e-101)
		tmp = Float64(y * 4.0);
	elseif (z <= -8.8e-160)
		tmp = Float64(x * -3.0);
	elseif (z <= -1.26e-204)
		tmp = Float64(y * 4.0);
	elseif (z <= -1.6e-293)
		tmp = Float64(x * -3.0);
	elseif (z <= 8.8e-174)
		tmp = Float64(y * 4.0);
	elseif (z <= 6.5e-141)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.52)
		tmp = Float64(y * 4.0);
	elseif ((z <= 1.1e+60) || !(z <= 9.2e+151))
		tmp = Float64(6.0 * Float64(x * z));
	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 <= -4.2e+215)
		tmp = z * (x * 6.0);
	elseif (z <= -1.26e+144)
		tmp = t_0;
	elseif (z <= -2.1)
		tmp = x * (z * 6.0);
	elseif (z <= -2.4e-101)
		tmp = y * 4.0;
	elseif (z <= -8.8e-160)
		tmp = x * -3.0;
	elseif (z <= -1.26e-204)
		tmp = y * 4.0;
	elseif (z <= -1.6e-293)
		tmp = x * -3.0;
	elseif (z <= 8.8e-174)
		tmp = y * 4.0;
	elseif (z <= 6.5e-141)
		tmp = x * -3.0;
	elseif (z <= 0.52)
		tmp = y * 4.0;
	elseif ((z <= 1.1e+60) || ~((z <= 9.2e+151)))
		tmp = 6.0 * (x * z);
	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, -4.2e+215], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.26e+144], t$95$0, If[LessEqual[z, -2.1], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.4e-101], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -8.8e-160], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.26e-204], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.6e-293], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 8.8e-174], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 6.5e-141], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.52], N[(y * 4.0), $MachinePrecision], If[Or[LessEqual[z, 1.1e+60], N[Not[LessEqual[z, 9.2e+151]], $MachinePrecision]], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]]]]]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;z \leq 1.1 \cdot 10^{+60} \lor \neg \left(z \leq 9.2 \cdot 10^{+151}\right):\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\

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


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

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-6\right)} \cdot \left(0.6666666666666666 - z\right)\right) \]
      2. cancel-sign-sub-inv80.2%

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(0.6666666666666666 - z\right) \cdot 6}\right) \]
      4. cancel-sign-sub-inv80.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.2000000000000003e215 < z < -1.26000000000000001e144 or 1.09999999999999998e60 < z < 9.2000000000000003e151

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

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

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

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

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

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

    if -1.26000000000000001e144 < z < -2.10000000000000009

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-6\right)} \cdot \left(0.6666666666666666 - z\right)\right) \]
      2. cancel-sign-sub-inv63.5%

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(0.6666666666666666 - z\right) \cdot 6}\right) \]
      4. cancel-sign-sub-inv63.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.10000000000000009 < z < -2.4e-101 or -8.8e-160 < z < -1.26e-204 or -1.60000000000000003e-293 < z < 8.80000000000000086e-174 or 6.4999999999999995e-141 < 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 z around 0 95.7%

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

      \[\leadsto \color{blue}{y \cdot \left(4 + \left(-4 \cdot \frac{x}{y} + \frac{x}{y}\right)\right)} \]
    7. Step-by-step derivation
      1. distribute-lft1-in84.8%

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

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

      \[\leadsto \color{blue}{y \cdot \left(4 + -3 \cdot \frac{x}{y}\right)} \]
    9. Taylor expanded in y around inf 59.7%

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    11. Simplified59.7%

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

    if -2.4e-101 < z < -8.8e-160 or -1.26e-204 < z < -1.60000000000000003e-293 or 8.80000000000000086e-174 < z < 6.4999999999999995e-141

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-6\right)} \cdot \left(0.6666666666666666 - z\right)\right) \]
      2. cancel-sign-sub-inv87.7%

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(0.6666666666666666 - z\right) \cdot 6}\right) \]
      4. cancel-sign-sub-inv87.7%

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

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

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{-6} \cdot \left(0.6666666666666666 - z\right)\right) \]
      9. sub-neg87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.52000000000000002 < z < 1.09999999999999998e60 or 9.2000000000000003e151 < z

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-6\right)} \cdot \left(0.6666666666666666 - z\right)\right) \]
      2. cancel-sign-sub-inv68.1%

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(0.6666666666666666 - z\right) \cdot 6}\right) \]
      4. cancel-sign-sub-inv68.1%

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

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

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

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

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

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      10. distribute-lft-in68.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+215}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \mathbf{elif}\;z \leq -1.26 \cdot 10^{+144}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -2.1:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-101}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -8.8 \cdot 10^{-160}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.26 \cdot 10^{-204}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-293}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-174}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-141}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.52:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{+60} \lor \neg \left(z \leq 9.2 \cdot 10^{+151}\right):\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 73.9% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(-3 + z \cdot 6\right)\\ t_1 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{if}\;z \leq -480000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.76 \cdot 10^{-42}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -2.75 \cdot 10^{-102}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-161}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-204}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -5.1 \cdot 10^{-294}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.95 \cdot 10^{-173}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{-151}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-32}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 12000000000000:\\ \;\;\;\;t\_0\\ \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 (* -6.0 (* (- y x) z))))
   (if (<= z -480000.0)
     t_1
     (if (<= z -1.76e-42)
       t_0
       (if (<= z -2.75e-102)
         (* y 4.0)
         (if (<= z -1.15e-161)
           (* x -3.0)
           (if (<= z -1.8e-204)
             (* y 4.0)
             (if (<= z -5.1e-294)
               (* x -3.0)
               (if (<= z 2.95e-173)
                 (* y 4.0)
                 (if (<= z 9.2e-151)
                   (* x -3.0)
                   (if (<= z 1.8e-32)
                     (* y 4.0)
                     (if (<= z 12000000000000.0) t_0 t_1))))))))))))
double code(double x, double y, double z) {
	double t_0 = x * (-3.0 + (z * 6.0));
	double t_1 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -480000.0) {
		tmp = t_1;
	} else if (z <= -1.76e-42) {
		tmp = t_0;
	} else if (z <= -2.75e-102) {
		tmp = y * 4.0;
	} else if (z <= -1.15e-161) {
		tmp = x * -3.0;
	} else if (z <= -1.8e-204) {
		tmp = y * 4.0;
	} else if (z <= -5.1e-294) {
		tmp = x * -3.0;
	} else if (z <= 2.95e-173) {
		tmp = y * 4.0;
	} else if (z <= 9.2e-151) {
		tmp = x * -3.0;
	} else if (z <= 1.8e-32) {
		tmp = y * 4.0;
	} else if (z <= 12000000000000.0) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = x * ((-3.0d0) + (z * 6.0d0))
    t_1 = (-6.0d0) * ((y - x) * z)
    if (z <= (-480000.0d0)) then
        tmp = t_1
    else if (z <= (-1.76d-42)) then
        tmp = t_0
    else if (z <= (-2.75d-102)) then
        tmp = y * 4.0d0
    else if (z <= (-1.15d-161)) then
        tmp = x * (-3.0d0)
    else if (z <= (-1.8d-204)) then
        tmp = y * 4.0d0
    else if (z <= (-5.1d-294)) then
        tmp = x * (-3.0d0)
    else if (z <= 2.95d-173) then
        tmp = y * 4.0d0
    else if (z <= 9.2d-151) then
        tmp = x * (-3.0d0)
    else if (z <= 1.8d-32) then
        tmp = y * 4.0d0
    else if (z <= 12000000000000.0d0) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x * (-3.0 + (z * 6.0));
	double t_1 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -480000.0) {
		tmp = t_1;
	} else if (z <= -1.76e-42) {
		tmp = t_0;
	} else if (z <= -2.75e-102) {
		tmp = y * 4.0;
	} else if (z <= -1.15e-161) {
		tmp = x * -3.0;
	} else if (z <= -1.8e-204) {
		tmp = y * 4.0;
	} else if (z <= -5.1e-294) {
		tmp = x * -3.0;
	} else if (z <= 2.95e-173) {
		tmp = y * 4.0;
	} else if (z <= 9.2e-151) {
		tmp = x * -3.0;
	} else if (z <= 1.8e-32) {
		tmp = y * 4.0;
	} else if (z <= 12000000000000.0) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (-3.0 + (z * 6.0))
	t_1 = -6.0 * ((y - x) * z)
	tmp = 0
	if z <= -480000.0:
		tmp = t_1
	elif z <= -1.76e-42:
		tmp = t_0
	elif z <= -2.75e-102:
		tmp = y * 4.0
	elif z <= -1.15e-161:
		tmp = x * -3.0
	elif z <= -1.8e-204:
		tmp = y * 4.0
	elif z <= -5.1e-294:
		tmp = x * -3.0
	elif z <= 2.95e-173:
		tmp = y * 4.0
	elif z <= 9.2e-151:
		tmp = x * -3.0
	elif z <= 1.8e-32:
		tmp = y * 4.0
	elif z <= 12000000000000.0:
		tmp = t_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(-6.0 * Float64(Float64(y - x) * z))
	tmp = 0.0
	if (z <= -480000.0)
		tmp = t_1;
	elseif (z <= -1.76e-42)
		tmp = t_0;
	elseif (z <= -2.75e-102)
		tmp = Float64(y * 4.0);
	elseif (z <= -1.15e-161)
		tmp = Float64(x * -3.0);
	elseif (z <= -1.8e-204)
		tmp = Float64(y * 4.0);
	elseif (z <= -5.1e-294)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.95e-173)
		tmp = Float64(y * 4.0);
	elseif (z <= 9.2e-151)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.8e-32)
		tmp = Float64(y * 4.0);
	elseif (z <= 12000000000000.0)
		tmp = t_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 = -6.0 * ((y - x) * z);
	tmp = 0.0;
	if (z <= -480000.0)
		tmp = t_1;
	elseif (z <= -1.76e-42)
		tmp = t_0;
	elseif (z <= -2.75e-102)
		tmp = y * 4.0;
	elseif (z <= -1.15e-161)
		tmp = x * -3.0;
	elseif (z <= -1.8e-204)
		tmp = y * 4.0;
	elseif (z <= -5.1e-294)
		tmp = x * -3.0;
	elseif (z <= 2.95e-173)
		tmp = y * 4.0;
	elseif (z <= 9.2e-151)
		tmp = x * -3.0;
	elseif (z <= 1.8e-32)
		tmp = y * 4.0;
	elseif (z <= 12000000000000.0)
		tmp = t_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[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -480000.0], t$95$1, If[LessEqual[z, -1.76e-42], t$95$0, If[LessEqual[z, -2.75e-102], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.15e-161], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.8e-204], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -5.1e-294], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.95e-173], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 9.2e-151], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.8e-32], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 12000000000000.0], t$95$0, t$95$1]]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + z \cdot 6\right)\\
t_1 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -480000:\\
\;\;\;\;t\_1\\

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

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

\mathbf{elif}\;z \leq -1.15 \cdot 10^{-161}:\\
\;\;\;\;x \cdot -3\\

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

\mathbf{elif}\;z \leq -5.1 \cdot 10^{-294}:\\
\;\;\;\;x \cdot -3\\

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

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

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

\mathbf{elif}\;z \leq 12000000000000:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.8e5 or 1.2e13 < z

    1. Initial program 99.7%

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

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

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

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

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

    if -4.8e5 < z < -1.75999999999999998e-42 or 1.79999999999999996e-32 < z < 1.2e13

    1. Initial program 98.9%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(0.6666666666666666 - z\right) \cdot 6}\right) \]
      4. cancel-sign-sub-inv82.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.75999999999999998e-42 < z < -2.7499999999999999e-102 or -1.15e-161 < z < -1.79999999999999982e-204 or -5.10000000000000007e-294 < z < 2.94999999999999998e-173 or 9.19999999999999984e-151 < z < 1.79999999999999996e-32

    1. Initial program 99.5%

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(4 + \left(-4 \cdot \frac{x}{y} + \frac{x}{y}\right)\right)} \]
    7. Step-by-step derivation
      1. distribute-lft1-in89.8%

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

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

      \[\leadsto \color{blue}{y \cdot \left(4 + -3 \cdot \frac{x}{y}\right)} \]
    9. Taylor expanded in y around inf 66.1%

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    11. Simplified66.1%

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

    if -2.7499999999999999e-102 < z < -1.15e-161 or -1.79999999999999982e-204 < z < -5.10000000000000007e-294 or 2.94999999999999998e-173 < z < 9.19999999999999984e-151

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-6\right)} \cdot \left(0.6666666666666666 - z\right)\right) \]
      2. cancel-sign-sub-inv87.7%

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(0.6666666666666666 - z\right) \cdot 6}\right) \]
      4. cancel-sign-sub-inv87.7%

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

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

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{-6} \cdot \left(0.6666666666666666 - z\right)\right) \]
      9. sub-neg87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -480000:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq -1.76 \cdot 10^{-42}:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{elif}\;z \leq -2.75 \cdot 10^{-102}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-161}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-204}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -5.1 \cdot 10^{-294}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.95 \cdot 10^{-173}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{-151}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-32}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 12000000000000:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 73.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{if}\;z \leq -0.023:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{-101}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-162}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.18 \cdot 10^{-204}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-293}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-173}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-143}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.52:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* (- y x) z))))
   (if (<= z -0.023)
     t_0
     (if (<= z -1.25e-101)
       (* y 4.0)
       (if (<= z -5.2e-162)
         (* x -3.0)
         (if (<= z -1.18e-204)
           (* y 4.0)
           (if (<= z -5.2e-293)
             (* x -3.0)
             (if (<= z 1.6e-173)
               (* y 4.0)
               (if (<= z 2.2e-143)
                 (* x -3.0)
                 (if (<= z 0.52) (* y 4.0) t_0))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -0.023) {
		tmp = t_0;
	} else if (z <= -1.25e-101) {
		tmp = y * 4.0;
	} else if (z <= -5.2e-162) {
		tmp = x * -3.0;
	} else if (z <= -1.18e-204) {
		tmp = y * 4.0;
	} else if (z <= -5.2e-293) {
		tmp = x * -3.0;
	} else if (z <= 1.6e-173) {
		tmp = y * 4.0;
	} else if (z <= 2.2e-143) {
		tmp = x * -3.0;
	} else if (z <= 0.52) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-6.0d0) * ((y - x) * z)
    if (z <= (-0.023d0)) then
        tmp = t_0
    else if (z <= (-1.25d-101)) then
        tmp = y * 4.0d0
    else if (z <= (-5.2d-162)) then
        tmp = x * (-3.0d0)
    else if (z <= (-1.18d-204)) then
        tmp = y * 4.0d0
    else if (z <= (-5.2d-293)) then
        tmp = x * (-3.0d0)
    else if (z <= 1.6d-173) then
        tmp = y * 4.0d0
    else if (z <= 2.2d-143) then
        tmp = x * (-3.0d0)
    else if (z <= 0.52d0) then
        tmp = y * 4.0d0
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -0.023) {
		tmp = t_0;
	} else if (z <= -1.25e-101) {
		tmp = y * 4.0;
	} else if (z <= -5.2e-162) {
		tmp = x * -3.0;
	} else if (z <= -1.18e-204) {
		tmp = y * 4.0;
	} else if (z <= -5.2e-293) {
		tmp = x * -3.0;
	} else if (z <= 1.6e-173) {
		tmp = y * 4.0;
	} else if (z <= 2.2e-143) {
		tmp = x * -3.0;
	} else if (z <= 0.52) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * ((y - x) * z)
	tmp = 0
	if z <= -0.023:
		tmp = t_0
	elif z <= -1.25e-101:
		tmp = y * 4.0
	elif z <= -5.2e-162:
		tmp = x * -3.0
	elif z <= -1.18e-204:
		tmp = y * 4.0
	elif z <= -5.2e-293:
		tmp = x * -3.0
	elif z <= 1.6e-173:
		tmp = y * 4.0
	elif z <= 2.2e-143:
		tmp = x * -3.0
	elif z <= 0.52:
		tmp = y * 4.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(Float64(y - x) * z))
	tmp = 0.0
	if (z <= -0.023)
		tmp = t_0;
	elseif (z <= -1.25e-101)
		tmp = Float64(y * 4.0);
	elseif (z <= -5.2e-162)
		tmp = Float64(x * -3.0);
	elseif (z <= -1.18e-204)
		tmp = Float64(y * 4.0);
	elseif (z <= -5.2e-293)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.6e-173)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.2e-143)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.52)
		tmp = Float64(y * 4.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * ((y - x) * z);
	tmp = 0.0;
	if (z <= -0.023)
		tmp = t_0;
	elseif (z <= -1.25e-101)
		tmp = y * 4.0;
	elseif (z <= -5.2e-162)
		tmp = x * -3.0;
	elseif (z <= -1.18e-204)
		tmp = y * 4.0;
	elseif (z <= -5.2e-293)
		tmp = x * -3.0;
	elseif (z <= 1.6e-173)
		tmp = y * 4.0;
	elseif (z <= 2.2e-143)
		tmp = x * -3.0;
	elseif (z <= 0.52)
		tmp = y * 4.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.023], t$95$0, If[LessEqual[z, -1.25e-101], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -5.2e-162], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.18e-204], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -5.2e-293], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.6e-173], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.2e-143], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.52], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]]
\begin{array}{l}

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

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

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

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

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

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

\mathbf{elif}\;z \leq 2.2 \cdot 10^{-143}:\\
\;\;\;\;x \cdot -3\\

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

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


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

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

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

    if -0.023 < z < -1.25e-101 or -5.1999999999999999e-162 < z < -1.17999999999999995e-204 or -5.1999999999999996e-293 < z < 1.6e-173 or 2.19999999999999989e-143 < 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 z around 0 95.7%

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

      \[\leadsto \color{blue}{y \cdot \left(4 + \left(-4 \cdot \frac{x}{y} + \frac{x}{y}\right)\right)} \]
    7. Step-by-step derivation
      1. distribute-lft1-in84.8%

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

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

      \[\leadsto \color{blue}{y \cdot \left(4 + -3 \cdot \frac{x}{y}\right)} \]
    9. Taylor expanded in y around inf 59.7%

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    11. Simplified59.7%

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

    if -1.25e-101 < z < -5.1999999999999999e-162 or -1.17999999999999995e-204 < z < -5.1999999999999996e-293 or 1.6e-173 < z < 2.19999999999999989e-143

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-6\right)} \cdot \left(0.6666666666666666 - z\right)\right) \]
      2. cancel-sign-sub-inv87.7%

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(0.6666666666666666 - z\right) \cdot 6}\right) \]
      4. cancel-sign-sub-inv87.7%

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

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

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{-6} \cdot \left(0.6666666666666666 - z\right)\right) \]
      9. sub-neg87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.023:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{-101}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-162}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.18 \cdot 10^{-204}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-293}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-173}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-143}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.52:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 49.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -0.66:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-103}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{-160}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-204}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-292}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-174}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-145}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.66:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))))
   (if (<= z -0.66)
     t_0
     (if (<= z -2.9e-103)
       (* y 4.0)
       (if (<= z -1.65e-160)
         (* x -3.0)
         (if (<= z -1.9e-204)
           (* y 4.0)
           (if (<= z -1.15e-292)
             (* x -3.0)
             (if (<= z 1.9e-174)
               (* y 4.0)
               (if (<= z 8e-145)
                 (* x -3.0)
                 (if (<= z 0.66) (* y 4.0) t_0))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double tmp;
	if (z <= -0.66) {
		tmp = t_0;
	} else if (z <= -2.9e-103) {
		tmp = y * 4.0;
	} else if (z <= -1.65e-160) {
		tmp = x * -3.0;
	} else if (z <= -1.9e-204) {
		tmp = y * 4.0;
	} else if (z <= -1.15e-292) {
		tmp = x * -3.0;
	} else if (z <= 1.9e-174) {
		tmp = y * 4.0;
	} else if (z <= 8e-145) {
		tmp = x * -3.0;
	} else if (z <= 0.66) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-6.0d0) * (y * z)
    if (z <= (-0.66d0)) then
        tmp = t_0
    else if (z <= (-2.9d-103)) then
        tmp = y * 4.0d0
    else if (z <= (-1.65d-160)) then
        tmp = x * (-3.0d0)
    else if (z <= (-1.9d-204)) then
        tmp = y * 4.0d0
    else if (z <= (-1.15d-292)) then
        tmp = x * (-3.0d0)
    else if (z <= 1.9d-174) then
        tmp = y * 4.0d0
    else if (z <= 8d-145) then
        tmp = x * (-3.0d0)
    else if (z <= 0.66d0) then
        tmp = y * 4.0d0
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double tmp;
	if (z <= -0.66) {
		tmp = t_0;
	} else if (z <= -2.9e-103) {
		tmp = y * 4.0;
	} else if (z <= -1.65e-160) {
		tmp = x * -3.0;
	} else if (z <= -1.9e-204) {
		tmp = y * 4.0;
	} else if (z <= -1.15e-292) {
		tmp = x * -3.0;
	} else if (z <= 1.9e-174) {
		tmp = y * 4.0;
	} else if (z <= 8e-145) {
		tmp = x * -3.0;
	} else if (z <= 0.66) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	tmp = 0
	if z <= -0.66:
		tmp = t_0
	elif z <= -2.9e-103:
		tmp = y * 4.0
	elif z <= -1.65e-160:
		tmp = x * -3.0
	elif z <= -1.9e-204:
		tmp = y * 4.0
	elif z <= -1.15e-292:
		tmp = x * -3.0
	elif z <= 1.9e-174:
		tmp = y * 4.0
	elif z <= 8e-145:
		tmp = x * -3.0
	elif z <= 0.66:
		tmp = y * 4.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -0.66)
		tmp = t_0;
	elseif (z <= -2.9e-103)
		tmp = Float64(y * 4.0);
	elseif (z <= -1.65e-160)
		tmp = Float64(x * -3.0);
	elseif (z <= -1.9e-204)
		tmp = Float64(y * 4.0);
	elseif (z <= -1.15e-292)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.9e-174)
		tmp = Float64(y * 4.0);
	elseif (z <= 8e-145)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.66)
		tmp = Float64(y * 4.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	tmp = 0.0;
	if (z <= -0.66)
		tmp = t_0;
	elseif (z <= -2.9e-103)
		tmp = y * 4.0;
	elseif (z <= -1.65e-160)
		tmp = x * -3.0;
	elseif (z <= -1.9e-204)
		tmp = y * 4.0;
	elseif (z <= -1.15e-292)
		tmp = x * -3.0;
	elseif (z <= 1.9e-174)
		tmp = y * 4.0;
	elseif (z <= 8e-145)
		tmp = x * -3.0;
	elseif (z <= 0.66)
		tmp = y * 4.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.66], t$95$0, If[LessEqual[z, -2.9e-103], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.65e-160], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.9e-204], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.15e-292], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.9e-174], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 8e-145], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.66], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -1.65 \cdot 10^{-160}:\\
\;\;\;\;x \cdot -3\\

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

\mathbf{elif}\;z \leq -1.15 \cdot 10^{-292}:\\
\;\;\;\;x \cdot -3\\

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

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

    if -0.660000000000000031 < z < -2.8999999999999999e-103 or -1.65e-160 < z < -1.89999999999999991e-204 or -1.1499999999999999e-292 < z < 1.9000000000000001e-174 or 7.99999999999999932e-145 < z < 0.660000000000000031

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

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

      \[\leadsto \color{blue}{y \cdot \left(4 + \left(-4 \cdot \frac{x}{y} + \frac{x}{y}\right)\right)} \]
    7. Step-by-step derivation
      1. distribute-lft1-in84.0%

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

        \[\leadsto y \cdot \left(4 + \color{blue}{-3} \cdot \frac{x}{y}\right) \]
    8. Simplified84.0%

      \[\leadsto \color{blue}{y \cdot \left(4 + -3 \cdot \frac{x}{y}\right)} \]
    9. Taylor expanded in y around inf 59.2%

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    11. Simplified59.2%

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

    if -2.8999999999999999e-103 < z < -1.65e-160 or -1.89999999999999991e-204 < z < -1.1499999999999999e-292 or 1.9000000000000001e-174 < z < 7.99999999999999932e-145

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-6\right)} \cdot \left(0.6666666666666666 - z\right)\right) \]
      2. cancel-sign-sub-inv87.7%

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(0.6666666666666666 - z\right) \cdot 6}\right) \]
      4. cancel-sign-sub-inv87.7%

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

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

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{-6} \cdot \left(0.6666666666666666 - z\right)\right) \]
      9. sub-neg87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.66:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-103}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{-160}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-204}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-292}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-174}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-145}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.66:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 74.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -8.5 \cdot 10^{+39} \lor \neg \left(x \leq 5.6 \cdot 10^{-74} \lor \neg \left(x \leq 24000000000\right) \land x \leq 9.8 \cdot 10^{+104}\right):\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -8.5e+39)
         (not
          (or (<= x 5.6e-74)
              (and (not (<= x 24000000000.0)) (<= x 9.8e+104)))))
   (* x (+ -3.0 (* z 6.0)))
   (* y (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -8.5e+39) || !((x <= 5.6e-74) || (!(x <= 24000000000.0) && (x <= 9.8e+104)))) {
		tmp = x * (-3.0 + (z * 6.0));
	} else {
		tmp = y * (4.0 + (z * -6.0));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((x <= (-8.5d+39)) .or. (.not. (x <= 5.6d-74) .or. (.not. (x <= 24000000000.0d0)) .and. (x <= 9.8d+104))) then
        tmp = x * ((-3.0d0) + (z * 6.0d0))
    else
        tmp = y * (4.0d0 + (z * (-6.0d0)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((x <= -8.5e+39) || !((x <= 5.6e-74) || (!(x <= 24000000000.0) && (x <= 9.8e+104)))) {
		tmp = x * (-3.0 + (z * 6.0));
	} else {
		tmp = y * (4.0 + (z * -6.0));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -8.5e+39) or not ((x <= 5.6e-74) or (not (x <= 24000000000.0) and (x <= 9.8e+104))):
		tmp = x * (-3.0 + (z * 6.0))
	else:
		tmp = y * (4.0 + (z * -6.0))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -8.5e+39) || !((x <= 5.6e-74) || (!(x <= 24000000000.0) && (x <= 9.8e+104))))
		tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0)));
	else
		tmp = Float64(y * Float64(4.0 + Float64(z * -6.0)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((x <= -8.5e+39) || ~(((x <= 5.6e-74) || (~((x <= 24000000000.0)) && (x <= 9.8e+104)))))
		tmp = x * (-3.0 + (z * 6.0));
	else
		tmp = y * (4.0 + (z * -6.0));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[x, -8.5e+39], N[Not[Or[LessEqual[x, 5.6e-74], And[N[Not[LessEqual[x, 24000000000.0]], $MachinePrecision], LessEqual[x, 9.8e+104]]]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{+39} \lor \neg \left(x \leq 5.6 \cdot 10^{-74} \lor \neg \left(x \leq 24000000000\right) \land x \leq 9.8 \cdot 10^{+104}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.49999999999999971e39 or 5.59999999999999976e-74 < x < 2.4e10 or 9.7999999999999997e104 < x

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-6\right)} \cdot \left(0.6666666666666666 - z\right)\right) \]
      2. cancel-sign-sub-inv86.2%

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(0.6666666666666666 - z\right) \cdot 6}\right) \]
      4. cancel-sign-sub-inv86.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.49999999999999971e39 < x < 5.59999999999999976e-74 or 2.4e10 < x < 9.7999999999999997e104

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.5 \cdot 10^{+39} \lor \neg \left(x \leq 5.6 \cdot 10^{-74} \lor \neg \left(x \leq 24000000000\right) \land x \leq 9.8 \cdot 10^{+104}\right):\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 97.9% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 1.02 \cdot 10^{-8}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

    if -0.57999999999999996 < z < 1.02000000000000003e-8

    1. Initial program 99.5%

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

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

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

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

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

    if 1.02000000000000003e-8 < z < 1.2e13

    1. Initial program 98.4%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.58:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-8}:\\ \;\;\;\;y \cdot 4 + x \cdot -3\\ \mathbf{elif}\;z \leq 12000000000000:\\ \;\;\;\;z \cdot \left(x \cdot \left(6 - \frac{3}{z}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 97.9% accurate, 0.6× speedup?

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

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

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

    if -0.54000000000000004 < z < 2.4e-9

    1. Initial program 99.5%

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

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

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

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

    if 2.4e-9 < z < 1.2e13

    1. Initial program 98.4%

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

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-6\right)} \cdot \left(0.6666666666666666 - z\right)\right) \]
      2. cancel-sign-sub-inv89.9%

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(0.6666666666666666 - z\right) \cdot 6}\right) \]
      4. cancel-sign-sub-inv89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 97.9% accurate, 0.6× speedup?

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

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

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

    if -0.57999999999999996 < z < 4.00000000000000025e-9

    1. Initial program 99.5%

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

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

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

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

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

    if 4.00000000000000025e-9 < z < 1.2e13

    1. Initial program 98.4%

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

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-6\right)} \cdot \left(0.6666666666666666 - z\right)\right) \]
      2. cancel-sign-sub-inv89.9%

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(0.6666666666666666 - z\right) \cdot 6}\right) \]
      4. cancel-sign-sub-inv89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 37.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{-34} \lor \neg \left(y \leq 9 \cdot 10^{+78}\right):\\
\;\;\;\;y \cdot 4\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.19999999999999996e-34 or 8.9999999999999999e78 < 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. Taylor expanded in z around 0 56.7%

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

      \[\leadsto \color{blue}{y \cdot \left(4 + \left(-4 \cdot \frac{x}{y} + \frac{x}{y}\right)\right)} \]
    7. Step-by-step derivation
      1. distribute-lft1-in56.9%

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

        \[\leadsto y \cdot \left(4 + \color{blue}{-3} \cdot \frac{x}{y}\right) \]
    8. Simplified56.9%

      \[\leadsto \color{blue}{y \cdot \left(4 + -3 \cdot \frac{x}{y}\right)} \]
    9. Taylor expanded in y around inf 47.0%

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    11. Simplified47.0%

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

    if -1.19999999999999996e-34 < y < 8.9999999999999999e78

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-6\right)} \cdot \left(0.6666666666666666 - z\right)\right) \]
      2. cancel-sign-sub-inv79.8%

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(0.6666666666666666 - z\right) \cdot 6}\right) \]
      4. cancel-sign-sub-inv79.8%

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

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

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{-6} \cdot \left(0.6666666666666666 - z\right)\right) \]
      9. sub-neg79.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 99.5% accurate, 1.0× speedup?

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

\\
x + \left(0.6666666666666666 - z\right) \cdot \left(x \cdot -6 + y \cdot 6\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. Taylor expanded in y around 0 99.5%

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

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

Alternative 15: 99.5% accurate, 1.2× speedup?

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

\\
x + \left(0.6666666666666666 - z\right) \cdot \left(\left(y - x\right) \cdot 6\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(0.6666666666666666 - z\right) \cdot \left(\left(y - x\right) \cdot 6\right) \]
  6. Add Preprocessing

Alternative 16: 25.9% 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.6%

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

      \[\leadsto x \cdot \left(1 + \color{blue}{\left(-6\right)} \cdot \left(0.6666666666666666 - z\right)\right) \]
    2. cancel-sign-sub-inv53.6%

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

      \[\leadsto x \cdot \left(1 - \color{blue}{\left(0.6666666666666666 - z\right) \cdot 6}\right) \]
    4. cancel-sign-sub-inv53.6%

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

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

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

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

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

      \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
    10. distribute-lft-in53.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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