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

Percentage Accurate: 99.5% → 99.8%
Time: 10.2s
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.9× speedup?

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

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

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

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

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

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

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

Alternative 2: 50.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot y\right)\\ t_1 := 6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -8.8 \cdot 10^{+266}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{+170}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{+89}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{+42}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-11}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-176}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-232}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-301}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.36 \cdot 10^{-127}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 5.4 \cdot 10^{-108}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.9 \cdot 10^{+168} \lor \neg \left(z \leq 4.1 \cdot 10^{+207}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* z y))) (t_1 (* 6.0 (* x z))))
   (if (<= z -8.8e+266)
     t_0
     (if (<= z -7.2e+170)
       t_1
       (if (<= z -7.2e+89)
         t_0
         (if (<= z -1.1e+42)
           t_1
           (if (<= z -3.4e-11)
             t_0
             (if (<= z -2.3e-176)
               (* y 4.0)
               (if (<= z -1.3e-232)
                 (* x -3.0)
                 (if (<= z 2.5e-301)
                   (* y 4.0)
                   (if (<= z 1.36e-127)
                     (* x -3.0)
                     (if (<= z 5.4e-108)
                       (* y 4.0)
                       (if (<= z 0.5)
                         (* x -3.0)
                         (if (or (<= z 6.9e+168) (not (<= z 4.1e+207)))
                           t_1
                           t_0))))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -8.8e+266) {
		tmp = t_0;
	} else if (z <= -7.2e+170) {
		tmp = t_1;
	} else if (z <= -7.2e+89) {
		tmp = t_0;
	} else if (z <= -1.1e+42) {
		tmp = t_1;
	} else if (z <= -3.4e-11) {
		tmp = t_0;
	} else if (z <= -2.3e-176) {
		tmp = y * 4.0;
	} else if (z <= -1.3e-232) {
		tmp = x * -3.0;
	} else if (z <= 2.5e-301) {
		tmp = y * 4.0;
	} else if (z <= 1.36e-127) {
		tmp = x * -3.0;
	} else if (z <= 5.4e-108) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if ((z <= 6.9e+168) || !(z <= 4.1e+207)) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (-6.0d0) * (z * y)
    t_1 = 6.0d0 * (x * z)
    if (z <= (-8.8d+266)) then
        tmp = t_0
    else if (z <= (-7.2d+170)) then
        tmp = t_1
    else if (z <= (-7.2d+89)) then
        tmp = t_0
    else if (z <= (-1.1d+42)) then
        tmp = t_1
    else if (z <= (-3.4d-11)) then
        tmp = t_0
    else if (z <= (-2.3d-176)) then
        tmp = y * 4.0d0
    else if (z <= (-1.3d-232)) then
        tmp = x * (-3.0d0)
    else if (z <= 2.5d-301) then
        tmp = y * 4.0d0
    else if (z <= 1.36d-127) then
        tmp = x * (-3.0d0)
    else if (z <= 5.4d-108) then
        tmp = y * 4.0d0
    else if (z <= 0.5d0) then
        tmp = x * (-3.0d0)
    else if ((z <= 6.9d+168) .or. (.not. (z <= 4.1d+207))) then
        tmp = t_1
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -8.8e+266) {
		tmp = t_0;
	} else if (z <= -7.2e+170) {
		tmp = t_1;
	} else if (z <= -7.2e+89) {
		tmp = t_0;
	} else if (z <= -1.1e+42) {
		tmp = t_1;
	} else if (z <= -3.4e-11) {
		tmp = t_0;
	} else if (z <= -2.3e-176) {
		tmp = y * 4.0;
	} else if (z <= -1.3e-232) {
		tmp = x * -3.0;
	} else if (z <= 2.5e-301) {
		tmp = y * 4.0;
	} else if (z <= 1.36e-127) {
		tmp = x * -3.0;
	} else if (z <= 5.4e-108) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if ((z <= 6.9e+168) || !(z <= 4.1e+207)) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (z * y)
	t_1 = 6.0 * (x * z)
	tmp = 0
	if z <= -8.8e+266:
		tmp = t_0
	elif z <= -7.2e+170:
		tmp = t_1
	elif z <= -7.2e+89:
		tmp = t_0
	elif z <= -1.1e+42:
		tmp = t_1
	elif z <= -3.4e-11:
		tmp = t_0
	elif z <= -2.3e-176:
		tmp = y * 4.0
	elif z <= -1.3e-232:
		tmp = x * -3.0
	elif z <= 2.5e-301:
		tmp = y * 4.0
	elif z <= 1.36e-127:
		tmp = x * -3.0
	elif z <= 5.4e-108:
		tmp = y * 4.0
	elif z <= 0.5:
		tmp = x * -3.0
	elif (z <= 6.9e+168) or not (z <= 4.1e+207):
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(z * y))
	t_1 = Float64(6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -8.8e+266)
		tmp = t_0;
	elseif (z <= -7.2e+170)
		tmp = t_1;
	elseif (z <= -7.2e+89)
		tmp = t_0;
	elseif (z <= -1.1e+42)
		tmp = t_1;
	elseif (z <= -3.4e-11)
		tmp = t_0;
	elseif (z <= -2.3e-176)
		tmp = Float64(y * 4.0);
	elseif (z <= -1.3e-232)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.5e-301)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.36e-127)
		tmp = Float64(x * -3.0);
	elseif (z <= 5.4e-108)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.5)
		tmp = Float64(x * -3.0);
	elseif ((z <= 6.9e+168) || !(z <= 4.1e+207))
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (z * y);
	t_1 = 6.0 * (x * z);
	tmp = 0.0;
	if (z <= -8.8e+266)
		tmp = t_0;
	elseif (z <= -7.2e+170)
		tmp = t_1;
	elseif (z <= -7.2e+89)
		tmp = t_0;
	elseif (z <= -1.1e+42)
		tmp = t_1;
	elseif (z <= -3.4e-11)
		tmp = t_0;
	elseif (z <= -2.3e-176)
		tmp = y * 4.0;
	elseif (z <= -1.3e-232)
		tmp = x * -3.0;
	elseif (z <= 2.5e-301)
		tmp = y * 4.0;
	elseif (z <= 1.36e-127)
		tmp = x * -3.0;
	elseif (z <= 5.4e-108)
		tmp = y * 4.0;
	elseif (z <= 0.5)
		tmp = x * -3.0;
	elseif ((z <= 6.9e+168) || ~((z <= 4.1e+207)))
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.8e+266], t$95$0, If[LessEqual[z, -7.2e+170], t$95$1, If[LessEqual[z, -7.2e+89], t$95$0, If[LessEqual[z, -1.1e+42], t$95$1, If[LessEqual[z, -3.4e-11], t$95$0, If[LessEqual[z, -2.3e-176], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.3e-232], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.5e-301], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.36e-127], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 5.4e-108], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[Or[LessEqual[z, 6.9e+168], N[Not[LessEqual[z, 4.1e+207]], $MachinePrecision]], t$95$1, t$95$0]]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -7.2 \cdot 10^{+170}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -7.2 \cdot 10^{+89}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -1.1 \cdot 10^{+42}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -3.4 \cdot 10^{-11}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;z \leq -1.3 \cdot 10^{-232}:\\
\;\;\;\;x \cdot -3\\

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

\mathbf{elif}\;z \leq 1.36 \cdot 10^{-127}:\\
\;\;\;\;x \cdot -3\\

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

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

\mathbf{elif}\;z \leq 6.9 \cdot 10^{+168} \lor \neg \left(z \leq 4.1 \cdot 10^{+207}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.7999999999999996e266 or -7.1999999999999999e170 < z < -7.2e89 or -1.1000000000000001e42 < z < -3.3999999999999999e-11 or 6.8999999999999998e168 < z < 4.1e207

    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. Taylor expanded in z around 0 99.8%

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

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

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

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

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

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

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

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

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

    if -8.7999999999999996e266 < z < -7.1999999999999999e170 or -7.2e89 < z < -1.1000000000000001e42 or 0.5 < z < 6.8999999999999998e168 or 4.1e207 < 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. Taylor expanded in z around 0 99.8%

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

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

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

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

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

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

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

    if -3.3999999999999999e-11 < z < -2.3000000000000001e-176 or -1.29999999999999998e-232 < z < 2.50000000000000006e-301 or 1.3599999999999999e-127 < z < 5.4000000000000001e-108

    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. Taylor expanded in z around 0 99.9%

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

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

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

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

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

    if -2.3000000000000001e-176 < z < -1.29999999999999998e-232 or 2.50000000000000006e-301 < z < 1.3599999999999999e-127 or 5.4000000000000001e-108 < z < 0.5

    1. Initial program 99.3%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    5. 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. neg-mul-164.3%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.8 \cdot 10^{+266}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{+170}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{+89}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{+42}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-11}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-176}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-232}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-301}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.36 \cdot 10^{-127}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 5.4 \cdot 10^{-108}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.9 \cdot 10^{+168} \lor \neg \left(z \leq 4.1 \cdot 10^{+207}\right):\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \end{array} \]

Alternative 3: 50.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot y\right)\\ t_1 := 6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -2.6 \cdot 10^{+266}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{+172}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.9 \cdot 10^{+95}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{+42}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-11}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{-180}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.36 \cdot 10^{-232}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-301}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-130}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-107}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.9 \cdot 10^{+168}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+207}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* z y))) (t_1 (* 6.0 (* x z))))
   (if (<= z -2.6e+266)
     t_0
     (if (<= z -2.6e+172)
       t_1
       (if (<= z -4.9e+95)
         t_0
         (if (<= z -1.05e+42)
           t_1
           (if (<= z -3.4e-11)
             t_0
             (if (<= z -2.7e-180)
               (* y 4.0)
               (if (<= z -1.36e-232)
                 (* x -3.0)
                 (if (<= z 6.5e-301)
                   (* y 4.0)
                   (if (<= z 1.8e-130)
                     (* x -3.0)
                     (if (<= z 6.2e-107)
                       (* y 4.0)
                       (if (<= z 0.5)
                         (* x -3.0)
                         (if (<= z 6.9e+168)
                           (* x (* z 6.0))
                           (if (<= z 5.8e+207) t_0 t_1)))))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -2.6e+266) {
		tmp = t_0;
	} else if (z <= -2.6e+172) {
		tmp = t_1;
	} else if (z <= -4.9e+95) {
		tmp = t_0;
	} else if (z <= -1.05e+42) {
		tmp = t_1;
	} else if (z <= -3.4e-11) {
		tmp = t_0;
	} else if (z <= -2.7e-180) {
		tmp = y * 4.0;
	} else if (z <= -1.36e-232) {
		tmp = x * -3.0;
	} else if (z <= 6.5e-301) {
		tmp = y * 4.0;
	} else if (z <= 1.8e-130) {
		tmp = x * -3.0;
	} else if (z <= 6.2e-107) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if (z <= 6.9e+168) {
		tmp = x * (z * 6.0);
	} else if (z <= 5.8e+207) {
		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) * (z * y)
    t_1 = 6.0d0 * (x * z)
    if (z <= (-2.6d+266)) then
        tmp = t_0
    else if (z <= (-2.6d+172)) then
        tmp = t_1
    else if (z <= (-4.9d+95)) then
        tmp = t_0
    else if (z <= (-1.05d+42)) then
        tmp = t_1
    else if (z <= (-3.4d-11)) then
        tmp = t_0
    else if (z <= (-2.7d-180)) then
        tmp = y * 4.0d0
    else if (z <= (-1.36d-232)) then
        tmp = x * (-3.0d0)
    else if (z <= 6.5d-301) then
        tmp = y * 4.0d0
    else if (z <= 1.8d-130) then
        tmp = x * (-3.0d0)
    else if (z <= 6.2d-107) then
        tmp = y * 4.0d0
    else if (z <= 0.5d0) then
        tmp = x * (-3.0d0)
    else if (z <= 6.9d+168) then
        tmp = x * (z * 6.0d0)
    else if (z <= 5.8d+207) 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 * (z * y);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -2.6e+266) {
		tmp = t_0;
	} else if (z <= -2.6e+172) {
		tmp = t_1;
	} else if (z <= -4.9e+95) {
		tmp = t_0;
	} else if (z <= -1.05e+42) {
		tmp = t_1;
	} else if (z <= -3.4e-11) {
		tmp = t_0;
	} else if (z <= -2.7e-180) {
		tmp = y * 4.0;
	} else if (z <= -1.36e-232) {
		tmp = x * -3.0;
	} else if (z <= 6.5e-301) {
		tmp = y * 4.0;
	} else if (z <= 1.8e-130) {
		tmp = x * -3.0;
	} else if (z <= 6.2e-107) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if (z <= 6.9e+168) {
		tmp = x * (z * 6.0);
	} else if (z <= 5.8e+207) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (z * y)
	t_1 = 6.0 * (x * z)
	tmp = 0
	if z <= -2.6e+266:
		tmp = t_0
	elif z <= -2.6e+172:
		tmp = t_1
	elif z <= -4.9e+95:
		tmp = t_0
	elif z <= -1.05e+42:
		tmp = t_1
	elif z <= -3.4e-11:
		tmp = t_0
	elif z <= -2.7e-180:
		tmp = y * 4.0
	elif z <= -1.36e-232:
		tmp = x * -3.0
	elif z <= 6.5e-301:
		tmp = y * 4.0
	elif z <= 1.8e-130:
		tmp = x * -3.0
	elif z <= 6.2e-107:
		tmp = y * 4.0
	elif z <= 0.5:
		tmp = x * -3.0
	elif z <= 6.9e+168:
		tmp = x * (z * 6.0)
	elif z <= 5.8e+207:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(z * y))
	t_1 = Float64(6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -2.6e+266)
		tmp = t_0;
	elseif (z <= -2.6e+172)
		tmp = t_1;
	elseif (z <= -4.9e+95)
		tmp = t_0;
	elseif (z <= -1.05e+42)
		tmp = t_1;
	elseif (z <= -3.4e-11)
		tmp = t_0;
	elseif (z <= -2.7e-180)
		tmp = Float64(y * 4.0);
	elseif (z <= -1.36e-232)
		tmp = Float64(x * -3.0);
	elseif (z <= 6.5e-301)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.8e-130)
		tmp = Float64(x * -3.0);
	elseif (z <= 6.2e-107)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.5)
		tmp = Float64(x * -3.0);
	elseif (z <= 6.9e+168)
		tmp = Float64(x * Float64(z * 6.0));
	elseif (z <= 5.8e+207)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (z * y);
	t_1 = 6.0 * (x * z);
	tmp = 0.0;
	if (z <= -2.6e+266)
		tmp = t_0;
	elseif (z <= -2.6e+172)
		tmp = t_1;
	elseif (z <= -4.9e+95)
		tmp = t_0;
	elseif (z <= -1.05e+42)
		tmp = t_1;
	elseif (z <= -3.4e-11)
		tmp = t_0;
	elseif (z <= -2.7e-180)
		tmp = y * 4.0;
	elseif (z <= -1.36e-232)
		tmp = x * -3.0;
	elseif (z <= 6.5e-301)
		tmp = y * 4.0;
	elseif (z <= 1.8e-130)
		tmp = x * -3.0;
	elseif (z <= 6.2e-107)
		tmp = y * 4.0;
	elseif (z <= 0.5)
		tmp = x * -3.0;
	elseif (z <= 6.9e+168)
		tmp = x * (z * 6.0);
	elseif (z <= 5.8e+207)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e+266], t$95$0, If[LessEqual[z, -2.6e+172], t$95$1, If[LessEqual[z, -4.9e+95], t$95$0, If[LessEqual[z, -1.05e+42], t$95$1, If[LessEqual[z, -3.4e-11], t$95$0, If[LessEqual[z, -2.7e-180], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.36e-232], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.5e-301], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.8e-130], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.2e-107], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.9e+168], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+207], t$95$0, t$95$1]]]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.6 \cdot 10^{+172}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -4.9 \cdot 10^{+95}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -1.05 \cdot 10^{+42}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -3.4 \cdot 10^{-11}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;z \leq -1.36 \cdot 10^{-232}:\\
\;\;\;\;x \cdot -3\\

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

\mathbf{elif}\;z \leq 1.8 \cdot 10^{-130}:\\
\;\;\;\;x \cdot -3\\

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

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

\mathbf{elif}\;z \leq 6.9 \cdot 10^{+168}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\

\mathbf{elif}\;z \leq 5.8 \cdot 10^{+207}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.60000000000000014e266 or -2.6e172 < z < -4.8999999999999999e95 or -1.04999999999999998e42 < z < -3.3999999999999999e-11 or 6.8999999999999998e168 < z < 5.79999999999999994e207

    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. Taylor expanded in z around 0 99.8%

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

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

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

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

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

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

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

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

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

    if -2.60000000000000014e266 < z < -2.6e172 or -4.8999999999999999e95 < z < -1.04999999999999998e42 or 5.79999999999999994e207 < 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. Taylor expanded in z around 0 99.8%

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

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

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

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

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

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

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

    if -3.3999999999999999e-11 < z < -2.70000000000000014e-180 or -1.3600000000000001e-232 < z < 6.49999999999999991e-301 or 1.8000000000000001e-130 < z < 6.20000000000000043e-107

    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. Taylor expanded in z around 0 99.9%

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

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

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

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

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

    if -2.70000000000000014e-180 < z < -1.3600000000000001e-232 or 6.49999999999999991e-301 < z < 1.8000000000000001e-130 or 6.20000000000000043e-107 < z < 0.5

    1. Initial program 99.3%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    5. 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. neg-mul-164.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.5 < z < 6.8999999999999998e168

    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. Taylor expanded in x around inf 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+266}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{+172}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -4.9 \cdot 10^{+95}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{+42}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-11}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{-180}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.36 \cdot 10^{-232}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-301}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-130}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-107}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.9 \cdot 10^{+168}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+207}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \end{array} \]

Alternative 4: 50.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot y\right)\\ t_1 := 6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -2.9 \cdot 10^{+266}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{+172}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{+90}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{+39}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-11}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -3.9 \cdot 10^{-182}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{-232}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-301}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{-129}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-108}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+168}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{+207}:\\ \;\;\;\;z \cdot \left(-6 \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* z y))) (t_1 (* 6.0 (* x z))))
   (if (<= z -2.9e+266)
     t_0
     (if (<= z -2.6e+172)
       t_1
       (if (<= z -1.9e+90)
         t_0
         (if (<= z -5.5e+39)
           t_1
           (if (<= z -3.4e-11)
             t_0
             (if (<= z -3.9e-182)
               (* y 4.0)
               (if (<= z -1.7e-232)
                 (* x -3.0)
                 (if (<= z 3.4e-301)
                   (* y 4.0)
                   (if (<= z 2.75e-129)
                     (* x -3.0)
                     (if (<= z 4.5e-108)
                       (* y 4.0)
                       (if (<= z 0.5)
                         (* x -3.0)
                         (if (<= z 7e+168)
                           (* x (* z 6.0))
                           (if (<= z 4.4e+207)
                             (* z (* -6.0 y))
                             t_1)))))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -2.9e+266) {
		tmp = t_0;
	} else if (z <= -2.6e+172) {
		tmp = t_1;
	} else if (z <= -1.9e+90) {
		tmp = t_0;
	} else if (z <= -5.5e+39) {
		tmp = t_1;
	} else if (z <= -3.4e-11) {
		tmp = t_0;
	} else if (z <= -3.9e-182) {
		tmp = y * 4.0;
	} else if (z <= -1.7e-232) {
		tmp = x * -3.0;
	} else if (z <= 3.4e-301) {
		tmp = y * 4.0;
	} else if (z <= 2.75e-129) {
		tmp = x * -3.0;
	} else if (z <= 4.5e-108) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if (z <= 7e+168) {
		tmp = x * (z * 6.0);
	} else if (z <= 4.4e+207) {
		tmp = z * (-6.0 * y);
	} 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) * (z * y)
    t_1 = 6.0d0 * (x * z)
    if (z <= (-2.9d+266)) then
        tmp = t_0
    else if (z <= (-2.6d+172)) then
        tmp = t_1
    else if (z <= (-1.9d+90)) then
        tmp = t_0
    else if (z <= (-5.5d+39)) then
        tmp = t_1
    else if (z <= (-3.4d-11)) then
        tmp = t_0
    else if (z <= (-3.9d-182)) then
        tmp = y * 4.0d0
    else if (z <= (-1.7d-232)) then
        tmp = x * (-3.0d0)
    else if (z <= 3.4d-301) then
        tmp = y * 4.0d0
    else if (z <= 2.75d-129) then
        tmp = x * (-3.0d0)
    else if (z <= 4.5d-108) then
        tmp = y * 4.0d0
    else if (z <= 0.5d0) then
        tmp = x * (-3.0d0)
    else if (z <= 7d+168) then
        tmp = x * (z * 6.0d0)
    else if (z <= 4.4d+207) then
        tmp = z * ((-6.0d0) * y)
    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 * (z * y);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -2.9e+266) {
		tmp = t_0;
	} else if (z <= -2.6e+172) {
		tmp = t_1;
	} else if (z <= -1.9e+90) {
		tmp = t_0;
	} else if (z <= -5.5e+39) {
		tmp = t_1;
	} else if (z <= -3.4e-11) {
		tmp = t_0;
	} else if (z <= -3.9e-182) {
		tmp = y * 4.0;
	} else if (z <= -1.7e-232) {
		tmp = x * -3.0;
	} else if (z <= 3.4e-301) {
		tmp = y * 4.0;
	} else if (z <= 2.75e-129) {
		tmp = x * -3.0;
	} else if (z <= 4.5e-108) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if (z <= 7e+168) {
		tmp = x * (z * 6.0);
	} else if (z <= 4.4e+207) {
		tmp = z * (-6.0 * y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (z * y)
	t_1 = 6.0 * (x * z)
	tmp = 0
	if z <= -2.9e+266:
		tmp = t_0
	elif z <= -2.6e+172:
		tmp = t_1
	elif z <= -1.9e+90:
		tmp = t_0
	elif z <= -5.5e+39:
		tmp = t_1
	elif z <= -3.4e-11:
		tmp = t_0
	elif z <= -3.9e-182:
		tmp = y * 4.0
	elif z <= -1.7e-232:
		tmp = x * -3.0
	elif z <= 3.4e-301:
		tmp = y * 4.0
	elif z <= 2.75e-129:
		tmp = x * -3.0
	elif z <= 4.5e-108:
		tmp = y * 4.0
	elif z <= 0.5:
		tmp = x * -3.0
	elif z <= 7e+168:
		tmp = x * (z * 6.0)
	elif z <= 4.4e+207:
		tmp = z * (-6.0 * y)
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(z * y))
	t_1 = Float64(6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -2.9e+266)
		tmp = t_0;
	elseif (z <= -2.6e+172)
		tmp = t_1;
	elseif (z <= -1.9e+90)
		tmp = t_0;
	elseif (z <= -5.5e+39)
		tmp = t_1;
	elseif (z <= -3.4e-11)
		tmp = t_0;
	elseif (z <= -3.9e-182)
		tmp = Float64(y * 4.0);
	elseif (z <= -1.7e-232)
		tmp = Float64(x * -3.0);
	elseif (z <= 3.4e-301)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.75e-129)
		tmp = Float64(x * -3.0);
	elseif (z <= 4.5e-108)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.5)
		tmp = Float64(x * -3.0);
	elseif (z <= 7e+168)
		tmp = Float64(x * Float64(z * 6.0));
	elseif (z <= 4.4e+207)
		tmp = Float64(z * Float64(-6.0 * y));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (z * y);
	t_1 = 6.0 * (x * z);
	tmp = 0.0;
	if (z <= -2.9e+266)
		tmp = t_0;
	elseif (z <= -2.6e+172)
		tmp = t_1;
	elseif (z <= -1.9e+90)
		tmp = t_0;
	elseif (z <= -5.5e+39)
		tmp = t_1;
	elseif (z <= -3.4e-11)
		tmp = t_0;
	elseif (z <= -3.9e-182)
		tmp = y * 4.0;
	elseif (z <= -1.7e-232)
		tmp = x * -3.0;
	elseif (z <= 3.4e-301)
		tmp = y * 4.0;
	elseif (z <= 2.75e-129)
		tmp = x * -3.0;
	elseif (z <= 4.5e-108)
		tmp = y * 4.0;
	elseif (z <= 0.5)
		tmp = x * -3.0;
	elseif (z <= 7e+168)
		tmp = x * (z * 6.0);
	elseif (z <= 4.4e+207)
		tmp = z * (-6.0 * y);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e+266], t$95$0, If[LessEqual[z, -2.6e+172], t$95$1, If[LessEqual[z, -1.9e+90], t$95$0, If[LessEqual[z, -5.5e+39], t$95$1, If[LessEqual[z, -3.4e-11], t$95$0, If[LessEqual[z, -3.9e-182], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.7e-232], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.4e-301], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.75e-129], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.5e-108], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 7e+168], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4e+207], N[(z * N[(-6.0 * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.6 \cdot 10^{+172}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -1.9 \cdot 10^{+90}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -5.5 \cdot 10^{+39}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -3.4 \cdot 10^{-11}:\\
\;\;\;\;t_0\\

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

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

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

\mathbf{elif}\;z \leq 2.75 \cdot 10^{-129}:\\
\;\;\;\;x \cdot -3\\

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

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

\mathbf{elif}\;z \leq 7 \cdot 10^{+168}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -2.90000000000000017e266 or -2.6e172 < z < -1.9000000000000001e90 or -5.4999999999999997e39 < z < -3.3999999999999999e-11

    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. Taylor expanded in z around 0 99.8%

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

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

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

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

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

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

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

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

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

    if -2.90000000000000017e266 < z < -2.6e172 or -1.9000000000000001e90 < z < -5.4999999999999997e39 or 4.40000000000000017e207 < 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. Taylor expanded in z around 0 99.8%

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

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

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

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

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

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

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

    if -3.3999999999999999e-11 < z < -3.9e-182 or -1.7000000000000001e-232 < z < 3.4000000000000002e-301 or 2.75000000000000012e-129 < z < 4.4999999999999997e-108

    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. Taylor expanded in z around 0 99.9%

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

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

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

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

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

    if -3.9e-182 < z < -1.7000000000000001e-232 or 3.4000000000000002e-301 < z < 2.75000000000000012e-129 or 4.4999999999999997e-108 < z < 0.5

    1. Initial program 99.3%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    5. 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. neg-mul-164.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.5 < z < 7.0000000000000004e168

    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. Taylor expanded in x around inf 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.0000000000000004e168 < z < 4.40000000000000017e207

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{+266}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{+172}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{+90}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{+39}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-11}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -3.9 \cdot 10^{-182}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{-232}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-301}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{-129}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-108}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+168}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{+207}:\\ \;\;\;\;z \cdot \left(-6 \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \end{array} \]

Alternative 5: 50.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot y\right)\\ t_1 := 6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -1.35 \cdot 10^{+267}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+172}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{+86}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{+43}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-11}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-175}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-230}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{-301}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-129}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-106}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.9 \cdot 10^{+168}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+207}:\\ \;\;\;\;z \cdot \left(-6 \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* z y))) (t_1 (* 6.0 (* x z))))
   (if (<= z -1.35e+267)
     t_0
     (if (<= z -1.5e+172)
       t_1
       (if (<= z -2.8e+86)
         t_0
         (if (<= z -1.85e+43)
           t_1
           (if (<= z -3.4e-11)
             t_0
             (if (<= z -3.3e-175)
               (* y 4.0)
               (if (<= z -3.4e-230)
                 (* x -3.0)
                 (if (<= z 1.75e-301)
                   (* y 4.0)
                   (if (<= z 6.8e-129)
                     (* x -3.0)
                     (if (<= z 2.5e-106)
                       (* y 4.0)
                       (if (<= z 0.5)
                         (* x -3.0)
                         (if (<= z 6.9e+168)
                           (* z (* x 6.0))
                           (if (<= z 5.8e+207)
                             (* z (* -6.0 y))
                             t_1)))))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -1.35e+267) {
		tmp = t_0;
	} else if (z <= -1.5e+172) {
		tmp = t_1;
	} else if (z <= -2.8e+86) {
		tmp = t_0;
	} else if (z <= -1.85e+43) {
		tmp = t_1;
	} else if (z <= -3.4e-11) {
		tmp = t_0;
	} else if (z <= -3.3e-175) {
		tmp = y * 4.0;
	} else if (z <= -3.4e-230) {
		tmp = x * -3.0;
	} else if (z <= 1.75e-301) {
		tmp = y * 4.0;
	} else if (z <= 6.8e-129) {
		tmp = x * -3.0;
	} else if (z <= 2.5e-106) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if (z <= 6.9e+168) {
		tmp = z * (x * 6.0);
	} else if (z <= 5.8e+207) {
		tmp = z * (-6.0 * y);
	} 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) * (z * y)
    t_1 = 6.0d0 * (x * z)
    if (z <= (-1.35d+267)) then
        tmp = t_0
    else if (z <= (-1.5d+172)) then
        tmp = t_1
    else if (z <= (-2.8d+86)) then
        tmp = t_0
    else if (z <= (-1.85d+43)) then
        tmp = t_1
    else if (z <= (-3.4d-11)) then
        tmp = t_0
    else if (z <= (-3.3d-175)) then
        tmp = y * 4.0d0
    else if (z <= (-3.4d-230)) then
        tmp = x * (-3.0d0)
    else if (z <= 1.75d-301) then
        tmp = y * 4.0d0
    else if (z <= 6.8d-129) then
        tmp = x * (-3.0d0)
    else if (z <= 2.5d-106) then
        tmp = y * 4.0d0
    else if (z <= 0.5d0) then
        tmp = x * (-3.0d0)
    else if (z <= 6.9d+168) then
        tmp = z * (x * 6.0d0)
    else if (z <= 5.8d+207) then
        tmp = z * ((-6.0d0) * y)
    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 * (z * y);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -1.35e+267) {
		tmp = t_0;
	} else if (z <= -1.5e+172) {
		tmp = t_1;
	} else if (z <= -2.8e+86) {
		tmp = t_0;
	} else if (z <= -1.85e+43) {
		tmp = t_1;
	} else if (z <= -3.4e-11) {
		tmp = t_0;
	} else if (z <= -3.3e-175) {
		tmp = y * 4.0;
	} else if (z <= -3.4e-230) {
		tmp = x * -3.0;
	} else if (z <= 1.75e-301) {
		tmp = y * 4.0;
	} else if (z <= 6.8e-129) {
		tmp = x * -3.0;
	} else if (z <= 2.5e-106) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if (z <= 6.9e+168) {
		tmp = z * (x * 6.0);
	} else if (z <= 5.8e+207) {
		tmp = z * (-6.0 * y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (z * y)
	t_1 = 6.0 * (x * z)
	tmp = 0
	if z <= -1.35e+267:
		tmp = t_0
	elif z <= -1.5e+172:
		tmp = t_1
	elif z <= -2.8e+86:
		tmp = t_0
	elif z <= -1.85e+43:
		tmp = t_1
	elif z <= -3.4e-11:
		tmp = t_0
	elif z <= -3.3e-175:
		tmp = y * 4.0
	elif z <= -3.4e-230:
		tmp = x * -3.0
	elif z <= 1.75e-301:
		tmp = y * 4.0
	elif z <= 6.8e-129:
		tmp = x * -3.0
	elif z <= 2.5e-106:
		tmp = y * 4.0
	elif z <= 0.5:
		tmp = x * -3.0
	elif z <= 6.9e+168:
		tmp = z * (x * 6.0)
	elif z <= 5.8e+207:
		tmp = z * (-6.0 * y)
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(z * y))
	t_1 = Float64(6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -1.35e+267)
		tmp = t_0;
	elseif (z <= -1.5e+172)
		tmp = t_1;
	elseif (z <= -2.8e+86)
		tmp = t_0;
	elseif (z <= -1.85e+43)
		tmp = t_1;
	elseif (z <= -3.4e-11)
		tmp = t_0;
	elseif (z <= -3.3e-175)
		tmp = Float64(y * 4.0);
	elseif (z <= -3.4e-230)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.75e-301)
		tmp = Float64(y * 4.0);
	elseif (z <= 6.8e-129)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.5e-106)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.5)
		tmp = Float64(x * -3.0);
	elseif (z <= 6.9e+168)
		tmp = Float64(z * Float64(x * 6.0));
	elseif (z <= 5.8e+207)
		tmp = Float64(z * Float64(-6.0 * y));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (z * y);
	t_1 = 6.0 * (x * z);
	tmp = 0.0;
	if (z <= -1.35e+267)
		tmp = t_0;
	elseif (z <= -1.5e+172)
		tmp = t_1;
	elseif (z <= -2.8e+86)
		tmp = t_0;
	elseif (z <= -1.85e+43)
		tmp = t_1;
	elseif (z <= -3.4e-11)
		tmp = t_0;
	elseif (z <= -3.3e-175)
		tmp = y * 4.0;
	elseif (z <= -3.4e-230)
		tmp = x * -3.0;
	elseif (z <= 1.75e-301)
		tmp = y * 4.0;
	elseif (z <= 6.8e-129)
		tmp = x * -3.0;
	elseif (z <= 2.5e-106)
		tmp = y * 4.0;
	elseif (z <= 0.5)
		tmp = x * -3.0;
	elseif (z <= 6.9e+168)
		tmp = z * (x * 6.0);
	elseif (z <= 5.8e+207)
		tmp = z * (-6.0 * y);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35e+267], t$95$0, If[LessEqual[z, -1.5e+172], t$95$1, If[LessEqual[z, -2.8e+86], t$95$0, If[LessEqual[z, -1.85e+43], t$95$1, If[LessEqual[z, -3.4e-11], t$95$0, If[LessEqual[z, -3.3e-175], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -3.4e-230], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.75e-301], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 6.8e-129], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.5e-106], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.9e+168], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+207], N[(z * N[(-6.0 * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.5 \cdot 10^{+172}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -2.8 \cdot 10^{+86}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -1.85 \cdot 10^{+43}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -3.4 \cdot 10^{-11}:\\
\;\;\;\;t_0\\

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

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

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

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

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

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

\mathbf{elif}\;z \leq 6.9 \cdot 10^{+168}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -1.3500000000000001e267 or -1.5e172 < z < -2.80000000000000004e86 or -1.85e43 < z < -3.3999999999999999e-11

    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. Taylor expanded in z around 0 99.8%

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

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

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

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

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

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

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

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

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

    if -1.3500000000000001e267 < z < -1.5e172 or -2.80000000000000004e86 < z < -1.85e43 or 5.79999999999999994e207 < 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. Taylor expanded in z around 0 99.8%

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

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

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

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

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

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

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

    if -3.3999999999999999e-11 < z < -3.29999999999999999e-175 or -3.4e-230 < z < 1.74999999999999996e-301 or 6.80000000000000026e-129 < z < 2.49999999999999991e-106

    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. Taylor expanded in z around 0 99.9%

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

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

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

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

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

    if -3.29999999999999999e-175 < z < -3.4e-230 or 1.74999999999999996e-301 < z < 6.80000000000000026e-129 or 2.49999999999999991e-106 < z < 0.5

    1. Initial program 99.3%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    5. 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. neg-mul-164.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.5 < z < 6.8999999999999998e168

    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. Taylor expanded in z around 0 99.7%

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

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

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

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

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

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

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

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

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

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

    if 6.8999999999999998e168 < z < 5.79999999999999994e207

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+267}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+172}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{+86}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{+43}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-11}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-175}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-230}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{-301}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-129}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-106}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.9 \cdot 10^{+168}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+207}:\\ \;\;\;\;z \cdot \left(-6 \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \end{array} \]

Alternative 6: 50.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot y\right)\\ t_1 := 6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -1 \cdot 10^{+267}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{+175}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -6 \cdot 10^{+94}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -3.75 \cdot 10^{+40}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-11}:\\ \;\;\;\;y \cdot \left(-6 \cdot z\right)\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-177}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{-231}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-301}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-128}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-107}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.6 \cdot 10^{+168}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+208}:\\ \;\;\;\;z \cdot \left(-6 \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* z y))) (t_1 (* 6.0 (* x z))))
   (if (<= z -1e+267)
     t_0
     (if (<= z -1.2e+175)
       t_1
       (if (<= z -6e+94)
         t_0
         (if (<= z -3.75e+40)
           t_1
           (if (<= z -3.4e-11)
             (* y (* -6.0 z))
             (if (<= z -1.15e-177)
               (* y 4.0)
               (if (<= z -8.5e-231)
                 (* x -3.0)
                 (if (<= z 7.2e-301)
                   (* y 4.0)
                   (if (<= z 2.15e-128)
                     (* x -3.0)
                     (if (<= z 1.3e-107)
                       (* y 4.0)
                       (if (<= z 0.5)
                         (* x -3.0)
                         (if (<= z 6.6e+168)
                           (* z (* x 6.0))
                           (if (<= z 6e+208)
                             (* z (* -6.0 y))
                             t_1)))))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -1e+267) {
		tmp = t_0;
	} else if (z <= -1.2e+175) {
		tmp = t_1;
	} else if (z <= -6e+94) {
		tmp = t_0;
	} else if (z <= -3.75e+40) {
		tmp = t_1;
	} else if (z <= -3.4e-11) {
		tmp = y * (-6.0 * z);
	} else if (z <= -1.15e-177) {
		tmp = y * 4.0;
	} else if (z <= -8.5e-231) {
		tmp = x * -3.0;
	} else if (z <= 7.2e-301) {
		tmp = y * 4.0;
	} else if (z <= 2.15e-128) {
		tmp = x * -3.0;
	} else if (z <= 1.3e-107) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if (z <= 6.6e+168) {
		tmp = z * (x * 6.0);
	} else if (z <= 6e+208) {
		tmp = z * (-6.0 * y);
	} 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) * (z * y)
    t_1 = 6.0d0 * (x * z)
    if (z <= (-1d+267)) then
        tmp = t_0
    else if (z <= (-1.2d+175)) then
        tmp = t_1
    else if (z <= (-6d+94)) then
        tmp = t_0
    else if (z <= (-3.75d+40)) then
        tmp = t_1
    else if (z <= (-3.4d-11)) then
        tmp = y * ((-6.0d0) * z)
    else if (z <= (-1.15d-177)) then
        tmp = y * 4.0d0
    else if (z <= (-8.5d-231)) then
        tmp = x * (-3.0d0)
    else if (z <= 7.2d-301) then
        tmp = y * 4.0d0
    else if (z <= 2.15d-128) then
        tmp = x * (-3.0d0)
    else if (z <= 1.3d-107) then
        tmp = y * 4.0d0
    else if (z <= 0.5d0) then
        tmp = x * (-3.0d0)
    else if (z <= 6.6d+168) then
        tmp = z * (x * 6.0d0)
    else if (z <= 6d+208) then
        tmp = z * ((-6.0d0) * y)
    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 * (z * y);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -1e+267) {
		tmp = t_0;
	} else if (z <= -1.2e+175) {
		tmp = t_1;
	} else if (z <= -6e+94) {
		tmp = t_0;
	} else if (z <= -3.75e+40) {
		tmp = t_1;
	} else if (z <= -3.4e-11) {
		tmp = y * (-6.0 * z);
	} else if (z <= -1.15e-177) {
		tmp = y * 4.0;
	} else if (z <= -8.5e-231) {
		tmp = x * -3.0;
	} else if (z <= 7.2e-301) {
		tmp = y * 4.0;
	} else if (z <= 2.15e-128) {
		tmp = x * -3.0;
	} else if (z <= 1.3e-107) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if (z <= 6.6e+168) {
		tmp = z * (x * 6.0);
	} else if (z <= 6e+208) {
		tmp = z * (-6.0 * y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (z * y)
	t_1 = 6.0 * (x * z)
	tmp = 0
	if z <= -1e+267:
		tmp = t_0
	elif z <= -1.2e+175:
		tmp = t_1
	elif z <= -6e+94:
		tmp = t_0
	elif z <= -3.75e+40:
		tmp = t_1
	elif z <= -3.4e-11:
		tmp = y * (-6.0 * z)
	elif z <= -1.15e-177:
		tmp = y * 4.0
	elif z <= -8.5e-231:
		tmp = x * -3.0
	elif z <= 7.2e-301:
		tmp = y * 4.0
	elif z <= 2.15e-128:
		tmp = x * -3.0
	elif z <= 1.3e-107:
		tmp = y * 4.0
	elif z <= 0.5:
		tmp = x * -3.0
	elif z <= 6.6e+168:
		tmp = z * (x * 6.0)
	elif z <= 6e+208:
		tmp = z * (-6.0 * y)
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(z * y))
	t_1 = Float64(6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -1e+267)
		tmp = t_0;
	elseif (z <= -1.2e+175)
		tmp = t_1;
	elseif (z <= -6e+94)
		tmp = t_0;
	elseif (z <= -3.75e+40)
		tmp = t_1;
	elseif (z <= -3.4e-11)
		tmp = Float64(y * Float64(-6.0 * z));
	elseif (z <= -1.15e-177)
		tmp = Float64(y * 4.0);
	elseif (z <= -8.5e-231)
		tmp = Float64(x * -3.0);
	elseif (z <= 7.2e-301)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.15e-128)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.3e-107)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.5)
		tmp = Float64(x * -3.0);
	elseif (z <= 6.6e+168)
		tmp = Float64(z * Float64(x * 6.0));
	elseif (z <= 6e+208)
		tmp = Float64(z * Float64(-6.0 * y));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (z * y);
	t_1 = 6.0 * (x * z);
	tmp = 0.0;
	if (z <= -1e+267)
		tmp = t_0;
	elseif (z <= -1.2e+175)
		tmp = t_1;
	elseif (z <= -6e+94)
		tmp = t_0;
	elseif (z <= -3.75e+40)
		tmp = t_1;
	elseif (z <= -3.4e-11)
		tmp = y * (-6.0 * z);
	elseif (z <= -1.15e-177)
		tmp = y * 4.0;
	elseif (z <= -8.5e-231)
		tmp = x * -3.0;
	elseif (z <= 7.2e-301)
		tmp = y * 4.0;
	elseif (z <= 2.15e-128)
		tmp = x * -3.0;
	elseif (z <= 1.3e-107)
		tmp = y * 4.0;
	elseif (z <= 0.5)
		tmp = x * -3.0;
	elseif (z <= 6.6e+168)
		tmp = z * (x * 6.0);
	elseif (z <= 6e+208)
		tmp = z * (-6.0 * y);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e+267], t$95$0, If[LessEqual[z, -1.2e+175], t$95$1, If[LessEqual[z, -6e+94], t$95$0, If[LessEqual[z, -3.75e+40], t$95$1, If[LessEqual[z, -3.4e-11], N[(y * N[(-6.0 * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.15e-177], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -8.5e-231], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 7.2e-301], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.15e-128], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.3e-107], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.6e+168], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+208], N[(z * N[(-6.0 * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.2 \cdot 10^{+175}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -6 \cdot 10^{+94}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -3.75 \cdot 10^{+40}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -3.4 \cdot 10^{-11}:\\
\;\;\;\;y \cdot \left(-6 \cdot z\right)\\

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

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

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

\mathbf{elif}\;z \leq 2.15 \cdot 10^{-128}:\\
\;\;\;\;x \cdot -3\\

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

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

\mathbf{elif}\;z \leq 6.6 \cdot 10^{+168}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if z < -9.9999999999999997e266 or -1.2e175 < z < -6.0000000000000001e94

    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. Taylor expanded in z around 0 99.8%

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

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

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

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

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

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

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

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

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

    if -9.9999999999999997e266 < z < -1.2e175 or -6.0000000000000001e94 < z < -3.7499999999999998e40 or 5.99999999999999989e208 < 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. Taylor expanded in z around 0 99.8%

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

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

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

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

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

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

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

    if -3.7499999999999998e40 < z < -3.3999999999999999e-11

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.3999999999999999e-11 < z < -1.15000000000000011e-177 or -8.5e-231 < z < 7.20000000000000015e-301 or 2.14999999999999997e-128 < z < 1.3e-107

    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. Taylor expanded in z around 0 99.9%

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

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

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

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

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

    if -1.15000000000000011e-177 < z < -8.5e-231 or 7.20000000000000015e-301 < z < 2.14999999999999997e-128 or 1.3e-107 < z < 0.5

    1. Initial program 99.3%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    5. 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. neg-mul-164.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.5 < z < 6.5999999999999997e168

    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. Taylor expanded in z around 0 99.7%

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

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

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

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

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

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

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

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

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

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

    if 6.5999999999999997e168 < z < 5.99999999999999989e208

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+267}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{+175}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -6 \cdot 10^{+94}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -3.75 \cdot 10^{+40}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-11}:\\ \;\;\;\;y \cdot \left(-6 \cdot z\right)\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-177}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{-231}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-301}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-128}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-107}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.6 \cdot 10^{+168}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+208}:\\ \;\;\;\;z \cdot \left(-6 \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \end{array} \]

Alternative 7: 73.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{if}\;z \leq -3.4 \cdot 10^{-11}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-173}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -4.3 \cdot 10^{-232}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-301}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-127}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.52 \cdot 10^{-108}:\\ \;\;\;\;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 (* z (- y x)))))
   (if (<= z -3.4e-11)
     t_0
     (if (<= z -1.3e-173)
       (* y 4.0)
       (if (<= z -4.3e-232)
         (* x -3.0)
         (if (<= z 1.85e-301)
           (* y 4.0)
           (if (<= z 1.35e-127)
             (* x -3.0)
             (if (<= z 1.52e-108)
               (* 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 * (z * (y - x));
	double tmp;
	if (z <= -3.4e-11) {
		tmp = t_0;
	} else if (z <= -1.3e-173) {
		tmp = y * 4.0;
	} else if (z <= -4.3e-232) {
		tmp = x * -3.0;
	} else if (z <= 1.85e-301) {
		tmp = y * 4.0;
	} else if (z <= 1.35e-127) {
		tmp = x * -3.0;
	} else if (z <= 1.52e-108) {
		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) * (z * (y - x))
    if (z <= (-3.4d-11)) then
        tmp = t_0
    else if (z <= (-1.3d-173)) then
        tmp = y * 4.0d0
    else if (z <= (-4.3d-232)) then
        tmp = x * (-3.0d0)
    else if (z <= 1.85d-301) then
        tmp = y * 4.0d0
    else if (z <= 1.35d-127) then
        tmp = x * (-3.0d0)
    else if (z <= 1.52d-108) 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 * (z * (y - x));
	double tmp;
	if (z <= -3.4e-11) {
		tmp = t_0;
	} else if (z <= -1.3e-173) {
		tmp = y * 4.0;
	} else if (z <= -4.3e-232) {
		tmp = x * -3.0;
	} else if (z <= 1.85e-301) {
		tmp = y * 4.0;
	} else if (z <= 1.35e-127) {
		tmp = x * -3.0;
	} else if (z <= 1.52e-108) {
		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 * (z * (y - x))
	tmp = 0
	if z <= -3.4e-11:
		tmp = t_0
	elif z <= -1.3e-173:
		tmp = y * 4.0
	elif z <= -4.3e-232:
		tmp = x * -3.0
	elif z <= 1.85e-301:
		tmp = y * 4.0
	elif z <= 1.35e-127:
		tmp = x * -3.0
	elif z <= 1.52e-108:
		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(z * Float64(y - x)))
	tmp = 0.0
	if (z <= -3.4e-11)
		tmp = t_0;
	elseif (z <= -1.3e-173)
		tmp = Float64(y * 4.0);
	elseif (z <= -4.3e-232)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.85e-301)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.35e-127)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.52e-108)
		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 * (z * (y - x));
	tmp = 0.0;
	if (z <= -3.4e-11)
		tmp = t_0;
	elseif (z <= -1.3e-173)
		tmp = y * 4.0;
	elseif (z <= -4.3e-232)
		tmp = x * -3.0;
	elseif (z <= 1.85e-301)
		tmp = y * 4.0;
	elseif (z <= 1.35e-127)
		tmp = x * -3.0;
	elseif (z <= 1.52e-108)
		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[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.4e-11], t$95$0, If[LessEqual[z, -1.3e-173], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -4.3e-232], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.85e-301], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.35e-127], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.52e-108], 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(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{-11}:\\
\;\;\;\;t_0\\

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

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

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

\mathbf{elif}\;z \leq 1.35 \cdot 10^{-127}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq 1.52 \cdot 10^{-108}:\\
\;\;\;\;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 < -3.3999999999999999e-11 or 0.5 < z

    1. Initial program 99.7%

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

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

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

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

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

    if -3.3999999999999999e-11 < z < -1.30000000000000002e-173 or -4.2999999999999997e-232 < z < 1.8499999999999999e-301 or 1.35e-127 < z < 1.52000000000000001e-108

    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. Taylor expanded in z around 0 99.9%

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

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

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

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

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

    if -1.30000000000000002e-173 < z < -4.2999999999999997e-232 or 1.8499999999999999e-301 < z < 1.35e-127 or 1.52000000000000001e-108 < z < 0.5

    1. Initial program 99.3%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    5. 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. neg-mul-164.3%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{-11}:\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-173}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -4.3 \cdot 10^{-232}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-301}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-127}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.52 \cdot 10^{-108}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \end{array} \]

Alternative 8: 73.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(-3 + z \cdot 6\right)\\ t_1 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{if}\;z \leq -3.4 \cdot 10^{-11}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-180}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-231}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{-301}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-130}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-106}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2700000000000:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (+ -3.0 (* z 6.0)))) (t_1 (* -6.0 (* z (- y x)))))
   (if (<= z -3.4e-11)
     t_1
     (if (<= z -1.3e-180)
       (* y 4.0)
       (if (<= z -4.5e-231)
         t_0
         (if (<= z 4.3e-301)
           (* y 4.0)
           (if (<= z 2.7e-130)
             (* x -3.0)
             (if (<= z 1.05e-106)
               (* y 4.0)
               (if (<= z 2700000000000.0) t_0 t_1)))))))))
double code(double x, double y, double z) {
	double t_0 = x * (-3.0 + (z * 6.0));
	double t_1 = -6.0 * (z * (y - x));
	double tmp;
	if (z <= -3.4e-11) {
		tmp = t_1;
	} else if (z <= -1.3e-180) {
		tmp = y * 4.0;
	} else if (z <= -4.5e-231) {
		tmp = t_0;
	} else if (z <= 4.3e-301) {
		tmp = y * 4.0;
	} else if (z <= 2.7e-130) {
		tmp = x * -3.0;
	} else if (z <= 1.05e-106) {
		tmp = y * 4.0;
	} else if (z <= 2700000000000.0) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = x * ((-3.0d0) + (z * 6.0d0))
    t_1 = (-6.0d0) * (z * (y - x))
    if (z <= (-3.4d-11)) then
        tmp = t_1
    else if (z <= (-1.3d-180)) then
        tmp = y * 4.0d0
    else if (z <= (-4.5d-231)) then
        tmp = t_0
    else if (z <= 4.3d-301) then
        tmp = y * 4.0d0
    else if (z <= 2.7d-130) then
        tmp = x * (-3.0d0)
    else if (z <= 1.05d-106) then
        tmp = y * 4.0d0
    else if (z <= 2700000000000.0d0) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x * (-3.0 + (z * 6.0));
	double t_1 = -6.0 * (z * (y - x));
	double tmp;
	if (z <= -3.4e-11) {
		tmp = t_1;
	} else if (z <= -1.3e-180) {
		tmp = y * 4.0;
	} else if (z <= -4.5e-231) {
		tmp = t_0;
	} else if (z <= 4.3e-301) {
		tmp = y * 4.0;
	} else if (z <= 2.7e-130) {
		tmp = x * -3.0;
	} else if (z <= 1.05e-106) {
		tmp = y * 4.0;
	} else if (z <= 2700000000000.0) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (-3.0 + (z * 6.0))
	t_1 = -6.0 * (z * (y - x))
	tmp = 0
	if z <= -3.4e-11:
		tmp = t_1
	elif z <= -1.3e-180:
		tmp = y * 4.0
	elif z <= -4.5e-231:
		tmp = t_0
	elif z <= 4.3e-301:
		tmp = y * 4.0
	elif z <= 2.7e-130:
		tmp = x * -3.0
	elif z <= 1.05e-106:
		tmp = y * 4.0
	elif z <= 2700000000000.0:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(-3.0 + Float64(z * 6.0)))
	t_1 = Float64(-6.0 * Float64(z * Float64(y - x)))
	tmp = 0.0
	if (z <= -3.4e-11)
		tmp = t_1;
	elseif (z <= -1.3e-180)
		tmp = Float64(y * 4.0);
	elseif (z <= -4.5e-231)
		tmp = t_0;
	elseif (z <= 4.3e-301)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.7e-130)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.05e-106)
		tmp = Float64(y * 4.0);
	elseif (z <= 2700000000000.0)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * (-3.0 + (z * 6.0));
	t_1 = -6.0 * (z * (y - x));
	tmp = 0.0;
	if (z <= -3.4e-11)
		tmp = t_1;
	elseif (z <= -1.3e-180)
		tmp = y * 4.0;
	elseif (z <= -4.5e-231)
		tmp = t_0;
	elseif (z <= 4.3e-301)
		tmp = y * 4.0;
	elseif (z <= 2.7e-130)
		tmp = x * -3.0;
	elseif (z <= 1.05e-106)
		tmp = y * 4.0;
	elseif (z <= 2700000000000.0)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.4e-11], t$95$1, If[LessEqual[z, -1.3e-180], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -4.5e-231], t$95$0, If[LessEqual[z, 4.3e-301], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.7e-130], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.05e-106], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2700000000000.0], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -4.5 \cdot 10^{-231}:\\
\;\;\;\;t_0\\

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

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

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

\mathbf{elif}\;z \leq 2700000000000:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.3999999999999999e-11 or 2.7e12 < 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. Taylor expanded in z around 0 99.8%

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

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

    if -3.3999999999999999e-11 < z < -1.2999999999999999e-180 or -4.4999999999999998e-231 < z < 4.29999999999999989e-301 or 2.69999999999999991e-130 < z < 1.05000000000000002e-106

    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. Taylor expanded in z around 0 99.9%

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

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

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

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

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

    if -1.2999999999999999e-180 < z < -4.4999999999999998e-231 or 1.05000000000000002e-106 < z < 2.7e12

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.29999999999999989e-301 < z < 2.69999999999999991e-130

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    9. Simplified61.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{-11}:\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-180}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-231}:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{-301}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-130}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-106}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2700000000000:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \end{array} \]

Alternative 9: 49.9% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;z \leq -5 \cdot 10^{-231}:\\
\;\;\;\;x \cdot -3\\

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

\mathbf{elif}\;z \leq 4.1 \cdot 10^{-128}:\\
\;\;\;\;x \cdot -3\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.3999999999999999e-11 or 0.55000000000000004 < 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. Taylor expanded in z around 0 99.8%

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

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

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

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

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

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

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

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

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

    if -3.3999999999999999e-11 < z < -1.6999999999999999e-173 or -5.00000000000000023e-231 < z < 1.80000000000000004e-301 or 4.1e-128 < z < 4.1000000000000002e-109

    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. Taylor expanded in z around 0 99.9%

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

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

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

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

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

    if -1.6999999999999999e-173 < z < -5.00000000000000023e-231 or 1.80000000000000004e-301 < z < 4.1e-128 or 4.1000000000000002e-109 < z < 0.55000000000000004

    1. Initial program 99.3%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    5. 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. neg-mul-164.3%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{-11}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{-173}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-231}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-301}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{-128}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{-109}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.55:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \end{array} \]

Alternative 10: 75.0% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+28} \lor \neg \left(x \leq -1.45 \cdot 10^{-17} \lor \neg \left(x \leq -2 \cdot 10^{-83}\right) \land x \leq 2 \cdot 10^{-22}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.24999999999999989e28 or -1.4500000000000001e-17 < x < -2.0000000000000001e-83 or 2.0000000000000001e-22 < x

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.24999999999999989e28 < x < -1.4500000000000001e-17 or -2.0000000000000001e-83 < x < 2.0000000000000001e-22

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{+28} \lor \neg \left(x \leq -1.45 \cdot 10^{-17} \lor \neg \left(x \leq -2 \cdot 10^{-83}\right) \land x \leq 2 \cdot 10^{-22}\right):\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(4 + -6 \cdot z\right)\\ \end{array} \]

Alternative 11: 97.7% accurate, 1.2× speedup?

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

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

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

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


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

    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. Taylor expanded in z around 0 99.8%

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

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

    if -0.599999999999999978 < z < 0.650000000000000022

    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. Taylor expanded in z around 0 98.4%

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

    if 0.650000000000000022 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

Alternative 12: 97.8% accurate, 1.2× speedup?

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

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

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

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


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

    1. Initial program 99.6%

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

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

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

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

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

    if -0.55000000000000004 < z < 0.57999999999999996

    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. Taylor expanded in y around 0 99.4%

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

      \[\leadsto \color{blue}{x + 0.6666666666666666 \cdot \left(-6 \cdot x + 6 \cdot y\right)} \]
    6. Step-by-step derivation
      1. distribute-rgt-in97.9%

        \[\leadsto x + \color{blue}{\left(\left(-6 \cdot x\right) \cdot 0.6666666666666666 + \left(6 \cdot y\right) \cdot 0.6666666666666666\right)} \]
      2. associate-+r+98.0%

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

        \[\leadsto \left(x + \color{blue}{0.6666666666666666 \cdot \left(-6 \cdot x\right)}\right) + \left(6 \cdot y\right) \cdot 0.6666666666666666 \]
      4. associate-*r*98.2%

        \[\leadsto \left(x + \color{blue}{\left(0.6666666666666666 \cdot -6\right) \cdot x}\right) + \left(6 \cdot y\right) \cdot 0.6666666666666666 \]
      5. metadata-eval98.2%

        \[\leadsto \left(x + \color{blue}{-4} \cdot x\right) + \left(6 \cdot y\right) \cdot 0.6666666666666666 \]
      6. distribute-rgt1-in98.2%

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

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

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

        \[\leadsto x \cdot -3 + \color{blue}{\left(y \cdot 6\right)} \cdot 0.6666666666666666 \]
      10. associate-*l*98.4%

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

        \[\leadsto x \cdot -3 + y \cdot \color{blue}{4} \]
    7. Simplified98.4%

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

    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. Taylor expanded in z around 0 99.8%

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

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

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

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

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

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

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

Alternative 13: 99.5% accurate, 1.2× speedup?

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

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

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

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

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

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

Alternative 14: 36.3% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{-83}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;x \leq 9.6 \cdot 10^{-79}:\\
\;\;\;\;y \cdot 4\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.75000000000000015e-83 or 9.60000000000000023e-79 < x

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    9. Simplified40.1%

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

    if -1.75000000000000015e-83 < x < 9.60000000000000023e-79

    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. Taylor expanded in z around 0 99.8%

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    8. Simplified52.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{-83}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;x \leq 9.6 \cdot 10^{-79}:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;x \cdot -3\\ \end{array} \]

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.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. Taylor expanded in x around inf 53.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot -3} \]
  9. Simplified27.2%

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

    \[\leadsto x \cdot -3 \]

Alternative 16: 2.6% accurate, 13.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 99.5%

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification2.8%

    \[\leadsto x \]

Reproduce

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