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

Percentage Accurate: 99.5% → 99.8%
Time: 12.6s
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.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 50.8% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ t_1 := 6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -7 \cdot 10^{+241}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+130}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.06 \cdot 10^{+71}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -3700:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-160}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-191}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{-297}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-182}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+217}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))) (t_1 (* 6.0 (* x z))))
   (if (<= z -7e+241)
     t_0
     (if (<= z -1.5e+130)
       t_1
       (if (<= z -1.06e+71)
         t_0
         (if (<= z -3700.0)
           t_1
           (if (<= z -6e-160)
             (* x -3.0)
             (if (<= z -7e-191)
               (* y 4.0)
               (if (<= z 2.25e-297)
                 (* x -3.0)
                 (if (<= z 2.7e-182)
                   (* y 4.0)
                   (if (<= z 0.5)
                     (* x -3.0)
                     (if (<= z 1.8e+217) t_0 t_1))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -7e+241) {
		tmp = t_0;
	} else if (z <= -1.5e+130) {
		tmp = t_1;
	} else if (z <= -1.06e+71) {
		tmp = t_0;
	} else if (z <= -3700.0) {
		tmp = t_1;
	} else if (z <= -6e-160) {
		tmp = x * -3.0;
	} else if (z <= -7e-191) {
		tmp = y * 4.0;
	} else if (z <= 2.25e-297) {
		tmp = x * -3.0;
	} else if (z <= 2.7e-182) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if (z <= 1.8e+217) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (-6.0d0) * (y * z)
    t_1 = 6.0d0 * (x * z)
    if (z <= (-7d+241)) then
        tmp = t_0
    else if (z <= (-1.5d+130)) then
        tmp = t_1
    else if (z <= (-1.06d+71)) then
        tmp = t_0
    else if (z <= (-3700.0d0)) then
        tmp = t_1
    else if (z <= (-6d-160)) then
        tmp = x * (-3.0d0)
    else if (z <= (-7d-191)) then
        tmp = y * 4.0d0
    else if (z <= 2.25d-297) then
        tmp = x * (-3.0d0)
    else if (z <= 2.7d-182) then
        tmp = y * 4.0d0
    else if (z <= 0.5d0) then
        tmp = x * (-3.0d0)
    else if (z <= 1.8d+217) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -7e+241) {
		tmp = t_0;
	} else if (z <= -1.5e+130) {
		tmp = t_1;
	} else if (z <= -1.06e+71) {
		tmp = t_0;
	} else if (z <= -3700.0) {
		tmp = t_1;
	} else if (z <= -6e-160) {
		tmp = x * -3.0;
	} else if (z <= -7e-191) {
		tmp = y * 4.0;
	} else if (z <= 2.25e-297) {
		tmp = x * -3.0;
	} else if (z <= 2.7e-182) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if (z <= 1.8e+217) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	t_1 = 6.0 * (x * z)
	tmp = 0
	if z <= -7e+241:
		tmp = t_0
	elif z <= -1.5e+130:
		tmp = t_1
	elif z <= -1.06e+71:
		tmp = t_0
	elif z <= -3700.0:
		tmp = t_1
	elif z <= -6e-160:
		tmp = x * -3.0
	elif z <= -7e-191:
		tmp = y * 4.0
	elif z <= 2.25e-297:
		tmp = x * -3.0
	elif z <= 2.7e-182:
		tmp = y * 4.0
	elif z <= 0.5:
		tmp = x * -3.0
	elif z <= 1.8e+217:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	t_1 = Float64(6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -7e+241)
		tmp = t_0;
	elseif (z <= -1.5e+130)
		tmp = t_1;
	elseif (z <= -1.06e+71)
		tmp = t_0;
	elseif (z <= -3700.0)
		tmp = t_1;
	elseif (z <= -6e-160)
		tmp = Float64(x * -3.0);
	elseif (z <= -7e-191)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.25e-297)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.7e-182)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.5)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.8e+217)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	t_1 = 6.0 * (x * z);
	tmp = 0.0;
	if (z <= -7e+241)
		tmp = t_0;
	elseif (z <= -1.5e+130)
		tmp = t_1;
	elseif (z <= -1.06e+71)
		tmp = t_0;
	elseif (z <= -3700.0)
		tmp = t_1;
	elseif (z <= -6e-160)
		tmp = x * -3.0;
	elseif (z <= -7e-191)
		tmp = y * 4.0;
	elseif (z <= 2.25e-297)
		tmp = x * -3.0;
	elseif (z <= 2.7e-182)
		tmp = y * 4.0;
	elseif (z <= 0.5)
		tmp = x * -3.0;
	elseif (z <= 1.8e+217)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7e+241], t$95$0, If[LessEqual[z, -1.5e+130], t$95$1, If[LessEqual[z, -1.06e+71], t$95$0, If[LessEqual[z, -3700.0], t$95$1, If[LessEqual[z, -6e-160], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -7e-191], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.25e-297], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.7e-182], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.8e+217], t$95$0, t$95$1]]]]]]]]]]]]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -7e241 or -1.5e130 < z < -1.06e71 or 0.5 < z < 1.8000000000000001e217

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7e241 < z < -1.5e130 or -1.06e71 < z < -3700 or 1.8000000000000001e217 < 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 68.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3700 < z < -5.99999999999999993e-160 or -7.00000000000000013e-191 < z < 2.24999999999999988e-297 or 2.69999999999999999e-182 < z < 0.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.99999999999999993e-160 < z < -7.00000000000000013e-191 or 2.24999999999999988e-297 < z < 2.69999999999999999e-182

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+241}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+130}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -1.06 \cdot 10^{+71}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -3700:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-160}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-191}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{-297}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-182}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+217}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 50.9% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ t_1 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -1.85 \cdot 10^{+242}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{+130}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -8 \cdot 10^{+70}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -3700:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-158}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-191}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-297}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-182}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.6:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+222}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))) (t_1 (* x (* z 6.0))))
   (if (<= z -1.85e+242)
     t_0
     (if (<= z -6.2e+130)
       (* 6.0 (* x z))
       (if (<= z -8e+70)
         t_0
         (if (<= z -3700.0)
           t_1
           (if (<= z -2e-158)
             (* x -3.0)
             (if (<= z -1.6e-191)
               (* y 4.0)
               (if (<= z 4.8e-297)
                 (* x -3.0)
                 (if (<= z 6.2e-182)
                   (* y 4.0)
                   (if (<= z 0.6)
                     (* x -3.0)
                     (if (<= z 9e+222) t_0 t_1))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -1.85e+242) {
		tmp = t_0;
	} else if (z <= -6.2e+130) {
		tmp = 6.0 * (x * z);
	} else if (z <= -8e+70) {
		tmp = t_0;
	} else if (z <= -3700.0) {
		tmp = t_1;
	} else if (z <= -2e-158) {
		tmp = x * -3.0;
	} else if (z <= -1.6e-191) {
		tmp = y * 4.0;
	} else if (z <= 4.8e-297) {
		tmp = x * -3.0;
	} else if (z <= 6.2e-182) {
		tmp = y * 4.0;
	} else if (z <= 0.6) {
		tmp = x * -3.0;
	} else if (z <= 9e+222) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (-6.0d0) * (y * z)
    t_1 = x * (z * 6.0d0)
    if (z <= (-1.85d+242)) then
        tmp = t_0
    else if (z <= (-6.2d+130)) then
        tmp = 6.0d0 * (x * z)
    else if (z <= (-8d+70)) then
        tmp = t_0
    else if (z <= (-3700.0d0)) then
        tmp = t_1
    else if (z <= (-2d-158)) then
        tmp = x * (-3.0d0)
    else if (z <= (-1.6d-191)) then
        tmp = y * 4.0d0
    else if (z <= 4.8d-297) then
        tmp = x * (-3.0d0)
    else if (z <= 6.2d-182) then
        tmp = y * 4.0d0
    else if (z <= 0.6d0) then
        tmp = x * (-3.0d0)
    else if (z <= 9d+222) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -1.85e+242) {
		tmp = t_0;
	} else if (z <= -6.2e+130) {
		tmp = 6.0 * (x * z);
	} else if (z <= -8e+70) {
		tmp = t_0;
	} else if (z <= -3700.0) {
		tmp = t_1;
	} else if (z <= -2e-158) {
		tmp = x * -3.0;
	} else if (z <= -1.6e-191) {
		tmp = y * 4.0;
	} else if (z <= 4.8e-297) {
		tmp = x * -3.0;
	} else if (z <= 6.2e-182) {
		tmp = y * 4.0;
	} else if (z <= 0.6) {
		tmp = x * -3.0;
	} else if (z <= 9e+222) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	t_1 = x * (z * 6.0)
	tmp = 0
	if z <= -1.85e+242:
		tmp = t_0
	elif z <= -6.2e+130:
		tmp = 6.0 * (x * z)
	elif z <= -8e+70:
		tmp = t_0
	elif z <= -3700.0:
		tmp = t_1
	elif z <= -2e-158:
		tmp = x * -3.0
	elif z <= -1.6e-191:
		tmp = y * 4.0
	elif z <= 4.8e-297:
		tmp = x * -3.0
	elif z <= 6.2e-182:
		tmp = y * 4.0
	elif z <= 0.6:
		tmp = x * -3.0
	elif z <= 9e+222:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	t_1 = Float64(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -1.85e+242)
		tmp = t_0;
	elseif (z <= -6.2e+130)
		tmp = Float64(6.0 * Float64(x * z));
	elseif (z <= -8e+70)
		tmp = t_0;
	elseif (z <= -3700.0)
		tmp = t_1;
	elseif (z <= -2e-158)
		tmp = Float64(x * -3.0);
	elseif (z <= -1.6e-191)
		tmp = Float64(y * 4.0);
	elseif (z <= 4.8e-297)
		tmp = Float64(x * -3.0);
	elseif (z <= 6.2e-182)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.6)
		tmp = Float64(x * -3.0);
	elseif (z <= 9e+222)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	t_1 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -1.85e+242)
		tmp = t_0;
	elseif (z <= -6.2e+130)
		tmp = 6.0 * (x * z);
	elseif (z <= -8e+70)
		tmp = t_0;
	elseif (z <= -3700.0)
		tmp = t_1;
	elseif (z <= -2e-158)
		tmp = x * -3.0;
	elseif (z <= -1.6e-191)
		tmp = y * 4.0;
	elseif (z <= 4.8e-297)
		tmp = x * -3.0;
	elseif (z <= 6.2e-182)
		tmp = y * 4.0;
	elseif (z <= 0.6)
		tmp = x * -3.0;
	elseif (z <= 9e+222)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.85e+242], t$95$0, If[LessEqual[z, -6.2e+130], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8e+70], t$95$0, If[LessEqual[z, -3700.0], t$95$1, If[LessEqual[z, -2e-158], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.6e-191], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 4.8e-297], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.2e-182], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.6], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 9e+222], t$95$0, t$95$1]]]]]]]]]]]]
\begin{array}{l}

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

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

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

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

\mathbf{elif}\;z \leq -2 \cdot 10^{-158}:\\
\;\;\;\;x \cdot -3\\

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.85e242 or -6.1999999999999999e130 < z < -8.00000000000000058e70 or 0.599999999999999978 < z < 8.99999999999999978e222

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.85e242 < z < -6.1999999999999999e130

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.00000000000000058e70 < z < -3700 or 8.99999999999999978e222 < 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 67.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3700 < z < -2.00000000000000013e-158 or -1.6000000000000002e-191 < z < 4.7999999999999999e-297 or 6.20000000000000016e-182 < z < 0.599999999999999978

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000013e-158 < z < -1.6000000000000002e-191 or 4.7999999999999999e-297 < z < 6.20000000000000016e-182

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.85 \cdot 10^{+242}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{+130}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -8 \cdot 10^{+70}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -3700:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-158}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-191}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-297}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-182}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.6:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+222}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 50.7% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(z \cdot -6\right)\\ t_1 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -1.8 \cdot 10^{+242}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.06 \cdot 10^{+130}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{+78}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -3700:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-160}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-190}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{-300}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-182}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+215}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (* z -6.0))) (t_1 (* x (* z 6.0))))
   (if (<= z -1.8e+242)
     (* -6.0 (* y z))
     (if (<= z -1.06e+130)
       (* 6.0 (* x z))
       (if (<= z -1.3e+78)
         t_0
         (if (<= z -3700.0)
           t_1
           (if (<= z -2.2e-160)
             (* x -3.0)
             (if (<= z -5.2e-190)
               (* y 4.0)
               (if (<= z 3.5e-300)
                 (* x -3.0)
                 (if (<= z 1.4e-182)
                   (* y 4.0)
                   (if (<= z 0.5)
                     (* x -3.0)
                     (if (<= z 6.8e+215) t_0 t_1))))))))))))
double code(double x, double y, double z) {
	double t_0 = y * (z * -6.0);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -1.8e+242) {
		tmp = -6.0 * (y * z);
	} else if (z <= -1.06e+130) {
		tmp = 6.0 * (x * z);
	} else if (z <= -1.3e+78) {
		tmp = t_0;
	} else if (z <= -3700.0) {
		tmp = t_1;
	} else if (z <= -2.2e-160) {
		tmp = x * -3.0;
	} else if (z <= -5.2e-190) {
		tmp = y * 4.0;
	} else if (z <= 3.5e-300) {
		tmp = x * -3.0;
	} else if (z <= 1.4e-182) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if (z <= 6.8e+215) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = y * (z * (-6.0d0))
    t_1 = x * (z * 6.0d0)
    if (z <= (-1.8d+242)) then
        tmp = (-6.0d0) * (y * z)
    else if (z <= (-1.06d+130)) then
        tmp = 6.0d0 * (x * z)
    else if (z <= (-1.3d+78)) then
        tmp = t_0
    else if (z <= (-3700.0d0)) then
        tmp = t_1
    else if (z <= (-2.2d-160)) then
        tmp = x * (-3.0d0)
    else if (z <= (-5.2d-190)) then
        tmp = y * 4.0d0
    else if (z <= 3.5d-300) then
        tmp = x * (-3.0d0)
    else if (z <= 1.4d-182) then
        tmp = y * 4.0d0
    else if (z <= 0.5d0) then
        tmp = x * (-3.0d0)
    else if (z <= 6.8d+215) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = y * (z * -6.0);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -1.8e+242) {
		tmp = -6.0 * (y * z);
	} else if (z <= -1.06e+130) {
		tmp = 6.0 * (x * z);
	} else if (z <= -1.3e+78) {
		tmp = t_0;
	} else if (z <= -3700.0) {
		tmp = t_1;
	} else if (z <= -2.2e-160) {
		tmp = x * -3.0;
	} else if (z <= -5.2e-190) {
		tmp = y * 4.0;
	} else if (z <= 3.5e-300) {
		tmp = x * -3.0;
	} else if (z <= 1.4e-182) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if (z <= 6.8e+215) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * (z * -6.0)
	t_1 = x * (z * 6.0)
	tmp = 0
	if z <= -1.8e+242:
		tmp = -6.0 * (y * z)
	elif z <= -1.06e+130:
		tmp = 6.0 * (x * z)
	elif z <= -1.3e+78:
		tmp = t_0
	elif z <= -3700.0:
		tmp = t_1
	elif z <= -2.2e-160:
		tmp = x * -3.0
	elif z <= -5.2e-190:
		tmp = y * 4.0
	elif z <= 3.5e-300:
		tmp = x * -3.0
	elif z <= 1.4e-182:
		tmp = y * 4.0
	elif z <= 0.5:
		tmp = x * -3.0
	elif z <= 6.8e+215:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(y * Float64(z * -6.0))
	t_1 = Float64(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -1.8e+242)
		tmp = Float64(-6.0 * Float64(y * z));
	elseif (z <= -1.06e+130)
		tmp = Float64(6.0 * Float64(x * z));
	elseif (z <= -1.3e+78)
		tmp = t_0;
	elseif (z <= -3700.0)
		tmp = t_1;
	elseif (z <= -2.2e-160)
		tmp = Float64(x * -3.0);
	elseif (z <= -5.2e-190)
		tmp = Float64(y * 4.0);
	elseif (z <= 3.5e-300)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.4e-182)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.5)
		tmp = Float64(x * -3.0);
	elseif (z <= 6.8e+215)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * (z * -6.0);
	t_1 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -1.8e+242)
		tmp = -6.0 * (y * z);
	elseif (z <= -1.06e+130)
		tmp = 6.0 * (x * z);
	elseif (z <= -1.3e+78)
		tmp = t_0;
	elseif (z <= -3700.0)
		tmp = t_1;
	elseif (z <= -2.2e-160)
		tmp = x * -3.0;
	elseif (z <= -5.2e-190)
		tmp = y * 4.0;
	elseif (z <= 3.5e-300)
		tmp = x * -3.0;
	elseif (z <= 1.4e-182)
		tmp = y * 4.0;
	elseif (z <= 0.5)
		tmp = x * -3.0;
	elseif (z <= 6.8e+215)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e+242], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.06e+130], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.3e+78], t$95$0, If[LessEqual[z, -3700.0], t$95$1, If[LessEqual[z, -2.2e-160], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -5.2e-190], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.5e-300], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.4e-182], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.8e+215], t$95$0, t$95$1]]]]]]]]]]]]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;z \leq 6.8 \cdot 10^{+215}:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.79999999999999997e242 < z < -1.06e130

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.06e130 < z < -1.3e78 or 0.5 < z < 6.80000000000000036e215

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3e78 < z < -3700 or 6.80000000000000036e215 < 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 66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
      2. associate-*l*62.1%

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

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

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

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

    if -3700 < z < -2.2e-160 or -5.1999999999999996e-190 < z < 3.5000000000000002e-300 or 1.39999999999999997e-182 < z < 0.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.2e-160 < z < -5.1999999999999996e-190 or 3.5000000000000002e-300 < z < 1.39999999999999997e-182

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+242}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.06 \cdot 10^{+130}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{+78}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -3700:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-160}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-190}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{-300}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-182}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+215}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 50.8% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -7 \cdot 10^{+241}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{+130}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{+75}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -3700:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-159}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{-192}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 5.1 \cdot 10^{-300}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-182}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.6:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{+219}:\\ \;\;\;\;z \cdot \left(y \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (* z 6.0))))
   (if (<= z -7e+241)
     (* -6.0 (* y z))
     (if (<= z -2.8e+130)
       (* 6.0 (* x z))
       (if (<= z -1.75e+75)
         (* y (* z -6.0))
         (if (<= z -3700.0)
           t_0
           (if (<= z -3.4e-159)
             (* x -3.0)
             (if (<= z -7.8e-192)
               (* y 4.0)
               (if (<= z 5.1e-300)
                 (* x -3.0)
                 (if (<= z 8.5e-182)
                   (* y 4.0)
                   (if (<= z 0.6)
                     (* x -3.0)
                     (if (<= z 4.7e+219) (* z (* y -6.0)) t_0))))))))))))
double code(double x, double y, double z) {
	double t_0 = x * (z * 6.0);
	double tmp;
	if (z <= -7e+241) {
		tmp = -6.0 * (y * z);
	} else if (z <= -2.8e+130) {
		tmp = 6.0 * (x * z);
	} else if (z <= -1.75e+75) {
		tmp = y * (z * -6.0);
	} else if (z <= -3700.0) {
		tmp = t_0;
	} else if (z <= -3.4e-159) {
		tmp = x * -3.0;
	} else if (z <= -7.8e-192) {
		tmp = y * 4.0;
	} else if (z <= 5.1e-300) {
		tmp = x * -3.0;
	} else if (z <= 8.5e-182) {
		tmp = y * 4.0;
	} else if (z <= 0.6) {
		tmp = x * -3.0;
	} else if (z <= 4.7e+219) {
		tmp = z * (y * -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 = x * (z * 6.0d0)
    if (z <= (-7d+241)) then
        tmp = (-6.0d0) * (y * z)
    else if (z <= (-2.8d+130)) then
        tmp = 6.0d0 * (x * z)
    else if (z <= (-1.75d+75)) then
        tmp = y * (z * (-6.0d0))
    else if (z <= (-3700.0d0)) then
        tmp = t_0
    else if (z <= (-3.4d-159)) then
        tmp = x * (-3.0d0)
    else if (z <= (-7.8d-192)) then
        tmp = y * 4.0d0
    else if (z <= 5.1d-300) then
        tmp = x * (-3.0d0)
    else if (z <= 8.5d-182) then
        tmp = y * 4.0d0
    else if (z <= 0.6d0) then
        tmp = x * (-3.0d0)
    else if (z <= 4.7d+219) then
        tmp = z * (y * (-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 = x * (z * 6.0);
	double tmp;
	if (z <= -7e+241) {
		tmp = -6.0 * (y * z);
	} else if (z <= -2.8e+130) {
		tmp = 6.0 * (x * z);
	} else if (z <= -1.75e+75) {
		tmp = y * (z * -6.0);
	} else if (z <= -3700.0) {
		tmp = t_0;
	} else if (z <= -3.4e-159) {
		tmp = x * -3.0;
	} else if (z <= -7.8e-192) {
		tmp = y * 4.0;
	} else if (z <= 5.1e-300) {
		tmp = x * -3.0;
	} else if (z <= 8.5e-182) {
		tmp = y * 4.0;
	} else if (z <= 0.6) {
		tmp = x * -3.0;
	} else if (z <= 4.7e+219) {
		tmp = z * (y * -6.0);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (z * 6.0)
	tmp = 0
	if z <= -7e+241:
		tmp = -6.0 * (y * z)
	elif z <= -2.8e+130:
		tmp = 6.0 * (x * z)
	elif z <= -1.75e+75:
		tmp = y * (z * -6.0)
	elif z <= -3700.0:
		tmp = t_0
	elif z <= -3.4e-159:
		tmp = x * -3.0
	elif z <= -7.8e-192:
		tmp = y * 4.0
	elif z <= 5.1e-300:
		tmp = x * -3.0
	elif z <= 8.5e-182:
		tmp = y * 4.0
	elif z <= 0.6:
		tmp = x * -3.0
	elif z <= 4.7e+219:
		tmp = z * (y * -6.0)
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -7e+241)
		tmp = Float64(-6.0 * Float64(y * z));
	elseif (z <= -2.8e+130)
		tmp = Float64(6.0 * Float64(x * z));
	elseif (z <= -1.75e+75)
		tmp = Float64(y * Float64(z * -6.0));
	elseif (z <= -3700.0)
		tmp = t_0;
	elseif (z <= -3.4e-159)
		tmp = Float64(x * -3.0);
	elseif (z <= -7.8e-192)
		tmp = Float64(y * 4.0);
	elseif (z <= 5.1e-300)
		tmp = Float64(x * -3.0);
	elseif (z <= 8.5e-182)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.6)
		tmp = Float64(x * -3.0);
	elseif (z <= 4.7e+219)
		tmp = Float64(z * Float64(y * -6.0));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -7e+241)
		tmp = -6.0 * (y * z);
	elseif (z <= -2.8e+130)
		tmp = 6.0 * (x * z);
	elseif (z <= -1.75e+75)
		tmp = y * (z * -6.0);
	elseif (z <= -3700.0)
		tmp = t_0;
	elseif (z <= -3.4e-159)
		tmp = x * -3.0;
	elseif (z <= -7.8e-192)
		tmp = y * 4.0;
	elseif (z <= 5.1e-300)
		tmp = x * -3.0;
	elseif (z <= 8.5e-182)
		tmp = y * 4.0;
	elseif (z <= 0.6)
		tmp = x * -3.0;
	elseif (z <= 4.7e+219)
		tmp = z * (y * -6.0);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7e+241], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.8e+130], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.75e+75], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3700.0], t$95$0, If[LessEqual[z, -3.4e-159], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -7.8e-192], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5.1e-300], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 8.5e-182], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.6], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.7e+219], N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]]]]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7e241 < z < -2.7999999999999999e130

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.7999999999999999e130 < z < -1.7499999999999999e75

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.7499999999999999e75 < z < -3700 or 4.70000000000000013e219 < 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 66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
      2. associate-*l*62.1%

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

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

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

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

    if -3700 < z < -3.39999999999999984e-159 or -7.8000000000000005e-192 < z < 5.0999999999999999e-300 or 8.5000000000000001e-182 < z < 0.599999999999999978

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.39999999999999984e-159 < z < -7.8000000000000005e-192 or 5.0999999999999999e-300 < z < 8.5000000000000001e-182

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.599999999999999978 < z < 4.70000000000000013e219

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+241}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{+130}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{+75}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -3700:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-159}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{-192}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 5.1 \cdot 10^{-300}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-182}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.6:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{+219}:\\ \;\;\;\;z \cdot \left(y \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 74.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(-3 + z \cdot 6\right)\\ t_1 := z \cdot \left(\left(y - x\right) \cdot -6\right)\\ \mathbf{if}\;z \leq -1150000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-159}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{-190}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-297}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.42 \cdot 10^{-182}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 150000000:\\ \;\;\;\;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 (* z (* (- y x) -6.0))))
   (if (<= z -1150000000000.0)
     t_1
     (if (<= z -2.3e-159)
       t_0
       (if (<= z -3.2e-190)
         (* y 4.0)
         (if (<= z 7.5e-297)
           (* x -3.0)
           (if (<= z 1.42e-182)
             (* y 4.0)
             (if (<= z 150000000.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 = z * ((y - x) * -6.0);
	double tmp;
	if (z <= -1150000000000.0) {
		tmp = t_1;
	} else if (z <= -2.3e-159) {
		tmp = t_0;
	} else if (z <= -3.2e-190) {
		tmp = y * 4.0;
	} else if (z <= 7.5e-297) {
		tmp = x * -3.0;
	} else if (z <= 1.42e-182) {
		tmp = y * 4.0;
	} else if (z <= 150000000.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 = z * ((y - x) * (-6.0d0))
    if (z <= (-1150000000000.0d0)) then
        tmp = t_1
    else if (z <= (-2.3d-159)) then
        tmp = t_0
    else if (z <= (-3.2d-190)) then
        tmp = y * 4.0d0
    else if (z <= 7.5d-297) then
        tmp = x * (-3.0d0)
    else if (z <= 1.42d-182) then
        tmp = y * 4.0d0
    else if (z <= 150000000.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 = z * ((y - x) * -6.0);
	double tmp;
	if (z <= -1150000000000.0) {
		tmp = t_1;
	} else if (z <= -2.3e-159) {
		tmp = t_0;
	} else if (z <= -3.2e-190) {
		tmp = y * 4.0;
	} else if (z <= 7.5e-297) {
		tmp = x * -3.0;
	} else if (z <= 1.42e-182) {
		tmp = y * 4.0;
	} else if (z <= 150000000.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 = z * ((y - x) * -6.0)
	tmp = 0
	if z <= -1150000000000.0:
		tmp = t_1
	elif z <= -2.3e-159:
		tmp = t_0
	elif z <= -3.2e-190:
		tmp = y * 4.0
	elif z <= 7.5e-297:
		tmp = x * -3.0
	elif z <= 1.42e-182:
		tmp = y * 4.0
	elif z <= 150000000.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(z * Float64(Float64(y - x) * -6.0))
	tmp = 0.0
	if (z <= -1150000000000.0)
		tmp = t_1;
	elseif (z <= -2.3e-159)
		tmp = t_0;
	elseif (z <= -3.2e-190)
		tmp = Float64(y * 4.0);
	elseif (z <= 7.5e-297)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.42e-182)
		tmp = Float64(y * 4.0);
	elseif (z <= 150000000.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 = z * ((y - x) * -6.0);
	tmp = 0.0;
	if (z <= -1150000000000.0)
		tmp = t_1;
	elseif (z <= -2.3e-159)
		tmp = t_0;
	elseif (z <= -3.2e-190)
		tmp = y * 4.0;
	elseif (z <= 7.5e-297)
		tmp = x * -3.0;
	elseif (z <= 1.42e-182)
		tmp = y * 4.0;
	elseif (z <= 150000000.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[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1150000000000.0], t$95$1, If[LessEqual[z, -2.3e-159], t$95$0, If[LessEqual[z, -3.2e-190], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7.5e-297], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.42e-182], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 150000000.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 := z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{if}\;z \leq -1150000000000:\\
\;\;\;\;t\_1\\

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.15e12 or 1.5e8 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(\left(-6 \cdot y + 12 \cdot x\right) - 6 \cdot x\right)} \]
    9. Step-by-step derivation
      1. associate--l+99.7%

        \[\leadsto z \cdot \color{blue}{\left(-6 \cdot y + \left(12 \cdot x - 6 \cdot x\right)\right)} \]
      2. distribute-lft-in95.2%

        \[\leadsto \color{blue}{z \cdot \left(-6 \cdot y\right) + z \cdot \left(12 \cdot x - 6 \cdot x\right)} \]
      3. distribute-rgt-out--95.2%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-6 \cdot z\right)} \cdot y - \left(-6 \cdot z\right) \cdot x \]
      12. distribute-lft-out--99.8%

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

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

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

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

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

    if -1.15e12 < z < -2.29999999999999978e-159 or 1.4199999999999999e-182 < z < 1.5e8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.29999999999999978e-159 < z < -3.2000000000000001e-190 or 7.4999999999999994e-297 < z < 1.4199999999999999e-182

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.2000000000000001e-190 < z < 7.4999999999999994e-297

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1150000000000:\\ \;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-159}:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{-190}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-297}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.42 \cdot 10^{-182}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 150000000:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 50.8% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -10.5 < z < -3.3e-160 or -1.65000000000000009e-190 < z < 7.9999999999999993e-298 or 2.2499999999999999e-182 < z < 0.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.3e-160 < z < -1.65000000000000009e-190 or 7.9999999999999993e-298 < z < 2.2499999999999999e-182

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -10.5:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-160}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{-190}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-298}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{-182}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 97.9% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(\left(-6 \cdot y + 12 \cdot x\right) - 6 \cdot x\right)} \]
    9. Step-by-step derivation
      1. associate--l+94.8%

        \[\leadsto z \cdot \color{blue}{\left(-6 \cdot y + \left(12 \cdot x - 6 \cdot x\right)\right)} \]
      2. distribute-lft-in92.2%

        \[\leadsto \color{blue}{z \cdot \left(-6 \cdot y\right) + z \cdot \left(12 \cdot x - 6 \cdot x\right)} \]
      3. distribute-rgt-out--92.2%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-6 \cdot z\right)} \cdot y - \left(-6 \cdot z\right) \cdot x \]
      12. distribute-lft-out--94.9%

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

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

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

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

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

    if -0.57999999999999996 < z < 0.57999999999999996

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

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

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

    if 0.57999999999999996 < z

    1. Initial program 99.8%

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

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

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

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

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

      \[\leadsto x + \left(\left(y - x\right) \cdot 6\right) \cdot \color{blue}{\left(-z\right)} \]
    8. Step-by-step derivation
      1. distribute-rgt-neg-out99.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\left(6 \cdot \left(-z\right)\right)} \cdot \left(y - x\right) \]
      13. add-sqr-sqrt0.0%

        \[\leadsto x - \left(6 \cdot \color{blue}{\left(\sqrt{-z} \cdot \sqrt{-z}\right)}\right) \cdot \left(y - x\right) \]
      14. sqrt-unprod80.1%

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

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

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

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

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

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

Alternative 9: 74.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{-39} \lor \neg \left(x \leq 1.2 \cdot 10^{+100}\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 -1.25e-39) (not (<= x 1.2e+100)))
   (* x (+ -3.0 (* z 6.0)))
   (* y (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1.25e-39) || !(x <= 1.2e+100)) {
		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 <= (-1.25d-39)) .or. (.not. (x <= 1.2d+100))) 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 <= -1.25e-39) || !(x <= 1.2e+100)) {
		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 <= -1.25e-39) or not (x <= 1.2e+100):
		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 <= -1.25e-39) || !(x <= 1.2e+100))
		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 <= -1.25e-39) || ~((x <= 1.2e+100)))
		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, -1.25e-39], N[Not[LessEqual[x, 1.2e+100]], $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 -1.25 \cdot 10^{-39} \lor \neg \left(x \leq 1.2 \cdot 10^{+100}\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 < -1.25e-39 or 1.20000000000000006e100 < x

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.25e-39 < x < 1.20000000000000006e100

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{-39} \lor \neg \left(x \leq 1.2 \cdot 10^{+100}\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.8× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(\left(-6 \cdot y + 12 \cdot x\right) - 6 \cdot x\right)} \]
    9. Step-by-step derivation
      1. associate--l+97.1%

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

        \[\leadsto \color{blue}{z \cdot \left(-6 \cdot y\right) + z \cdot \left(12 \cdot x - 6 \cdot x\right)} \]
      3. distribute-rgt-out--92.9%

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

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

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

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

        \[\leadsto z \cdot \left(-6 \cdot y\right) + \color{blue}{\left(--6\right)} \cdot \left(z \cdot x\right) \]
      8. cancel-sign-sub-inv92.9%

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

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

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

        \[\leadsto \color{blue}{\left(-6 \cdot z\right)} \cdot y - \left(-6 \cdot z\right) \cdot x \]
      12. distribute-lft-out--97.2%

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

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

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

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

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

    if -0.57999999999999996 < z < 0.57999999999999996

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

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

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

Alternative 11: 97.9% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(\left(-6 \cdot y + 12 \cdot x\right) - 6 \cdot x\right)} \]
    9. Step-by-step derivation
      1. associate--l+97.1%

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

        \[\leadsto \color{blue}{z \cdot \left(-6 \cdot y\right) + z \cdot \left(12 \cdot x - 6 \cdot x\right)} \]
      3. distribute-rgt-out--92.9%

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

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

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

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

        \[\leadsto z \cdot \left(-6 \cdot y\right) + \color{blue}{\left(--6\right)} \cdot \left(z \cdot x\right) \]
      8. cancel-sign-sub-inv92.9%

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

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

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

        \[\leadsto \color{blue}{\left(-6 \cdot z\right)} \cdot y - \left(-6 \cdot z\right) \cdot x \]
      12. distribute-lft-out--97.2%

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

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

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

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

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

    if -0.55000000000000004 < z < 0.5

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

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

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

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

Alternative 12: 58.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{-14}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.19999999999999993e-14

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.19999999999999993e-14 < y < 7.7999999999999994e156

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.7999999999999994e156 < y

    1. Initial program 99.9%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. +-commutative99.9%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) + x} \]
      2. associate-*l*99.9%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot \left(\frac{2}{3} - z\right)\right)} + x \]
      3. fma-def99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, 6 \cdot \left(\frac{2}{3} - z\right), x\right)} \]
      4. sub-neg99.9%

        \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
      5. distribute-rgt-in99.9%

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{\frac{2}{3} \cdot 6 + \left(-z\right) \cdot 6}, x\right) \]
      6. metadata-eval99.9%

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{0.6666666666666666} \cdot 6 + \left(-z\right) \cdot 6, x\right) \]
      7. metadata-eval99.9%

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
      8. distribute-lft-neg-out99.9%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
      9. distribute-rgt-neg-in99.9%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{z \cdot \left(-6\right)}, x\right) \]
      10. metadata-eval99.9%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + z \cdot \color{blue}{-6}, x\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 92.6%

      \[\leadsto \color{blue}{y \cdot \left(4 + -6 \cdot z\right)} \]
    6. Taylor expanded in z around inf 58.6%

      \[\leadsto y \cdot \color{blue}{\left(-6 \cdot z\right)} \]
    7. Taylor expanded in y around 0 58.7%

      \[\leadsto \color{blue}{-6 \cdot \left(y \cdot z\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.2 \cdot 10^{-14}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+156}:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 37.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.18 \cdot 10^{-39} \lor \neg \left(x \leq 3.4 \cdot 10^{+114}\right):\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;y \cdot 4\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -1.18e-39) (not (<= x 3.4e+114))) (* x -3.0) (* y 4.0)))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1.18e-39) || !(x <= 3.4e+114)) {
		tmp = x * -3.0;
	} else {
		tmp = y * 4.0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((x <= (-1.18d-39)) .or. (.not. (x <= 3.4d+114))) then
        tmp = x * (-3.0d0)
    else
        tmp = y * 4.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1.18e-39) || !(x <= 3.4e+114)) {
		tmp = x * -3.0;
	} else {
		tmp = y * 4.0;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -1.18e-39) or not (x <= 3.4e+114):
		tmp = x * -3.0
	else:
		tmp = y * 4.0
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -1.18e-39) || !(x <= 3.4e+114))
		tmp = Float64(x * -3.0);
	else
		tmp = Float64(y * 4.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((x <= -1.18e-39) || ~((x <= 3.4e+114)))
		tmp = x * -3.0;
	else
		tmp = y * 4.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.18e-39], N[Not[LessEqual[x, 3.4e+114]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.18 \cdot 10^{-39} \lor \neg \left(x \leq 3.4 \cdot 10^{+114}\right):\\
\;\;\;\;x \cdot -3\\

\mathbf{else}:\\
\;\;\;\;y \cdot 4\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.17999999999999993e-39 or 3.4000000000000001e114 < x

    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 85.5%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg85.5%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      2. distribute-rgt-in85.5%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      3. metadata-eval85.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      4. metadata-eval85.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
      5. neg-mul-185.5%

        \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{\left(-1 \cdot z\right)} \cdot -6\right)\right) \]
      6. associate-*r*85.5%

        \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{-1 \cdot \left(z \cdot -6\right)}\right)\right) \]
      7. *-commutative85.5%

        \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + -1 \cdot \color{blue}{\left(-6 \cdot z\right)}\right)\right) \]
      8. distribute-lft-in85.5%

        \[\leadsto x \cdot \left(1 + \color{blue}{-1 \cdot \left(4 + -6 \cdot z\right)}\right) \]
      9. distribute-rgt-in85.5%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(4 \cdot -1 + \left(-6 \cdot z\right) \cdot -1\right)}\right) \]
      10. metadata-eval85.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-6 \cdot z\right) \cdot -1\right)\right) \]
      11. metadata-eval85.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + \left(-6 \cdot z\right) \cdot -1\right)\right) \]
      12. associate-+r+85.5%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + \left(-6 \cdot z\right) \cdot -1\right)} \]
      13. metadata-eval85.5%

        \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + \left(-6 \cdot z\right) \cdot -1\right) \]
      14. metadata-eval85.5%

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-6 \cdot z\right) \cdot -1\right) \]
      15. *-commutative85.5%

        \[\leadsto x \cdot \left(-3 + \color{blue}{\left(z \cdot -6\right)} \cdot -1\right) \]
      16. associate-*l*85.5%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot \left(-6 \cdot -1\right)}\right) \]
      17. metadata-eval85.5%

        \[\leadsto x \cdot \left(-3 + z \cdot \color{blue}{6}\right) \]
    7. Simplified85.5%

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
    8. Taylor expanded in z around 0 44.6%

      \[\leadsto \color{blue}{-3 \cdot x} \]
    9. Step-by-step derivation
      1. *-commutative44.6%

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified44.6%

      \[\leadsto \color{blue}{x \cdot -3} \]

    if -1.17999999999999993e-39 < x < 3.4000000000000001e114

    1. Initial program 99.6%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. +-commutative99.6%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) + x} \]
      2. associate-*l*99.8%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot \left(\frac{2}{3} - z\right)\right)} + x \]
      3. fma-def99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, 6 \cdot \left(\frac{2}{3} - z\right), x\right)} \]
      4. sub-neg99.8%

        \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
      5. distribute-rgt-in99.8%

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{\frac{2}{3} \cdot 6 + \left(-z\right) \cdot 6}, x\right) \]
      6. metadata-eval99.8%

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{0.6666666666666666} \cdot 6 + \left(-z\right) \cdot 6, x\right) \]
      7. metadata-eval99.8%

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
      8. distribute-lft-neg-out99.8%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
      9. distribute-rgt-neg-in99.8%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{z \cdot \left(-6\right)}, x\right) \]
      10. metadata-eval99.8%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + z \cdot \color{blue}{-6}, x\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 71.1%

      \[\leadsto \color{blue}{y \cdot \left(4 + -6 \cdot z\right)} \]
    6. Taylor expanded in z around 0 32.6%

      \[\leadsto y \cdot \color{blue}{4} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification38.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.18 \cdot 10^{-39} \lor \neg \left(x \leq 3.4 \cdot 10^{+114}\right):\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;y \cdot 4\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 99.5% accurate, 1.2× speedup?

\[\begin{array}{l} \\ x + \left(6 \cdot \left(x - y\right)\right) \cdot \left(z - 0.6666666666666666\right) \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+ x (* (* 6.0 (- x y)) (- z 0.6666666666666666))))
double code(double x, double y, double z) {
	return x + ((6.0 * (x - y)) * (z - 0.6666666666666666));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x + ((6.0d0 * (x - y)) * (z - 0.6666666666666666d0))
end function
public static double code(double x, double y, double z) {
	return x + ((6.0 * (x - y)) * (z - 0.6666666666666666));
}
def code(x, y, z):
	return x + ((6.0 * (x - y)) * (z - 0.6666666666666666))
function code(x, y, z)
	return Float64(x + Float64(Float64(6.0 * Float64(x - y)) * Float64(z - 0.6666666666666666)))
end
function tmp = code(x, y, z)
	tmp = x + ((6.0 * (x - y)) * (z - 0.6666666666666666));
end
code[x_, y_, z_] := N[(x + N[(N[(6.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] * N[(z - 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(6 \cdot \left(x - y\right)\right) \cdot \left(z - 0.6666666666666666\right)
\end{array}
Derivation
  1. Initial program 99.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. Final simplification99.7%

    \[\leadsto x + \left(6 \cdot \left(x - y\right)\right) \cdot \left(z - 0.6666666666666666\right) \]
  6. Add Preprocessing

Alternative 15: 26.2% 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.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 55.7%

    \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
  6. Step-by-step derivation
    1. sub-neg55.7%

      \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
    2. distribute-rgt-in55.7%

      \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
    3. metadata-eval55.7%

      \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
    4. metadata-eval55.7%

      \[\leadsto x \cdot \left(1 + \left(\color{blue}{-1 \cdot 4} + \left(-z\right) \cdot -6\right)\right) \]
    5. neg-mul-155.7%

      \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{\left(-1 \cdot z\right)} \cdot -6\right)\right) \]
    6. associate-*r*55.7%

      \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + \color{blue}{-1 \cdot \left(z \cdot -6\right)}\right)\right) \]
    7. *-commutative55.7%

      \[\leadsto x \cdot \left(1 + \left(-1 \cdot 4 + -1 \cdot \color{blue}{\left(-6 \cdot z\right)}\right)\right) \]
    8. distribute-lft-in55.7%

      \[\leadsto x \cdot \left(1 + \color{blue}{-1 \cdot \left(4 + -6 \cdot z\right)}\right) \]
    9. distribute-rgt-in55.7%

      \[\leadsto x \cdot \left(1 + \color{blue}{\left(4 \cdot -1 + \left(-6 \cdot z\right) \cdot -1\right)}\right) \]
    10. metadata-eval55.7%

      \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-6 \cdot z\right) \cdot -1\right)\right) \]
    11. metadata-eval55.7%

      \[\leadsto x \cdot \left(1 + \left(\color{blue}{\left(-4\right)} + \left(-6 \cdot z\right) \cdot -1\right)\right) \]
    12. associate-+r+55.7%

      \[\leadsto x \cdot \color{blue}{\left(\left(1 + \left(-4\right)\right) + \left(-6 \cdot z\right) \cdot -1\right)} \]
    13. metadata-eval55.7%

      \[\leadsto x \cdot \left(\left(1 + \color{blue}{-4}\right) + \left(-6 \cdot z\right) \cdot -1\right) \]
    14. metadata-eval55.7%

      \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-6 \cdot z\right) \cdot -1\right) \]
    15. *-commutative55.7%

      \[\leadsto x \cdot \left(-3 + \color{blue}{\left(z \cdot -6\right)} \cdot -1\right) \]
    16. associate-*l*55.7%

      \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot \left(-6 \cdot -1\right)}\right) \]
    17. metadata-eval55.7%

      \[\leadsto x \cdot \left(-3 + z \cdot \color{blue}{6}\right) \]
  7. Simplified55.7%

    \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
  8. Taylor expanded in z around 0 27.8%

    \[\leadsto \color{blue}{-3 \cdot x} \]
  9. Step-by-step derivation
    1. *-commutative27.8%

      \[\leadsto \color{blue}{x \cdot -3} \]
  10. Simplified27.8%

    \[\leadsto \color{blue}{x \cdot -3} \]
  11. Final simplification27.8%

    \[\leadsto x \cdot -3 \]
  12. Add Preprocessing

Alternative 16: 2.7% accurate, 13.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
	return x;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x
end function
public static double code(double x, double y, double z) {
	return x;
}
def code(x, y, z):
	return x
function code(x, y, z)
	return x
end
function tmp = code(x, y, z)
	tmp = x;
end
code[x_, y_, z_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 99.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 54.8%

    \[\leadsto x + \color{blue}{-6 \cdot \left(z \cdot \left(y - x\right)\right)} \]
  6. Taylor expanded in z around 0 2.4%

    \[\leadsto \color{blue}{x} \]
  7. Final simplification2.4%

    \[\leadsto x \]
  8. Add Preprocessing

Reproduce

?
herbie shell --seed 2024040 
(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))))