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

Percentage Accurate: 99.5% → 99.7%
Time: 11.7s
Alternatives: 14
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 14 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.7% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \mathsf{fma}\left(y - x, \mathsf{fma}\left(z, -6, 4\right), x\right) \]

Alternative 2: 51.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \left(x \cdot z\right)\\ t_1 := -6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -4.2 \cdot 10^{+252}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{+192}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -0.98:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-239}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 10^{-177}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-123}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-54}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 15000000000:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.55 \cdot 10^{+81} \lor \neg \left(z \leq 5 \cdot 10^{+226}\right) \land z \leq 3.1 \cdot 10^{+264}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* 6.0 (* x z))) (t_1 (* -6.0 (* y z))))
   (if (<= z -4.2e+252)
     t_0
     (if (<= z -9.5e+192)
       t_1
       (if (<= z -0.98)
         t_0
         (if (<= z -1.4e-239)
           (* y 4.0)
           (if (<= z 1e-177)
             (* x -3.0)
             (if (<= z 3.8e-123)
               (* y 4.0)
               (if (<= z 1.35e-54)
                 (* x -3.0)
                 (if (<= z 15000000000.0)
                   (* y 4.0)
                   (if (or (<= z 3.55e+81)
                           (and (not (<= z 5e+226)) (<= z 3.1e+264)))
                     t_1
                     t_0)))))))))))
double code(double x, double y, double z) {
	double t_0 = 6.0 * (x * z);
	double t_1 = -6.0 * (y * z);
	double tmp;
	if (z <= -4.2e+252) {
		tmp = t_0;
	} else if (z <= -9.5e+192) {
		tmp = t_1;
	} else if (z <= -0.98) {
		tmp = t_0;
	} else if (z <= -1.4e-239) {
		tmp = y * 4.0;
	} else if (z <= 1e-177) {
		tmp = x * -3.0;
	} else if (z <= 3.8e-123) {
		tmp = y * 4.0;
	} else if (z <= 1.35e-54) {
		tmp = x * -3.0;
	} else if (z <= 15000000000.0) {
		tmp = y * 4.0;
	} else if ((z <= 3.55e+81) || (!(z <= 5e+226) && (z <= 3.1e+264))) {
		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 * (x * z)
    t_1 = (-6.0d0) * (y * z)
    if (z <= (-4.2d+252)) then
        tmp = t_0
    else if (z <= (-9.5d+192)) then
        tmp = t_1
    else if (z <= (-0.98d0)) then
        tmp = t_0
    else if (z <= (-1.4d-239)) then
        tmp = y * 4.0d0
    else if (z <= 1d-177) then
        tmp = x * (-3.0d0)
    else if (z <= 3.8d-123) then
        tmp = y * 4.0d0
    else if (z <= 1.35d-54) then
        tmp = x * (-3.0d0)
    else if (z <= 15000000000.0d0) then
        tmp = y * 4.0d0
    else if ((z <= 3.55d+81) .or. (.not. (z <= 5d+226)) .and. (z <= 3.1d+264)) 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 * (x * z);
	double t_1 = -6.0 * (y * z);
	double tmp;
	if (z <= -4.2e+252) {
		tmp = t_0;
	} else if (z <= -9.5e+192) {
		tmp = t_1;
	} else if (z <= -0.98) {
		tmp = t_0;
	} else if (z <= -1.4e-239) {
		tmp = y * 4.0;
	} else if (z <= 1e-177) {
		tmp = x * -3.0;
	} else if (z <= 3.8e-123) {
		tmp = y * 4.0;
	} else if (z <= 1.35e-54) {
		tmp = x * -3.0;
	} else if (z <= 15000000000.0) {
		tmp = y * 4.0;
	} else if ((z <= 3.55e+81) || (!(z <= 5e+226) && (z <= 3.1e+264))) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 6.0 * (x * z)
	t_1 = -6.0 * (y * z)
	tmp = 0
	if z <= -4.2e+252:
		tmp = t_0
	elif z <= -9.5e+192:
		tmp = t_1
	elif z <= -0.98:
		tmp = t_0
	elif z <= -1.4e-239:
		tmp = y * 4.0
	elif z <= 1e-177:
		tmp = x * -3.0
	elif z <= 3.8e-123:
		tmp = y * 4.0
	elif z <= 1.35e-54:
		tmp = x * -3.0
	elif z <= 15000000000.0:
		tmp = y * 4.0
	elif (z <= 3.55e+81) or (not (z <= 5e+226) and (z <= 3.1e+264)):
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(6.0 * Float64(x * z))
	t_1 = Float64(-6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -4.2e+252)
		tmp = t_0;
	elseif (z <= -9.5e+192)
		tmp = t_1;
	elseif (z <= -0.98)
		tmp = t_0;
	elseif (z <= -1.4e-239)
		tmp = Float64(y * 4.0);
	elseif (z <= 1e-177)
		tmp = Float64(x * -3.0);
	elseif (z <= 3.8e-123)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.35e-54)
		tmp = Float64(x * -3.0);
	elseif (z <= 15000000000.0)
		tmp = Float64(y * 4.0);
	elseif ((z <= 3.55e+81) || (!(z <= 5e+226) && (z <= 3.1e+264)))
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 6.0 * (x * z);
	t_1 = -6.0 * (y * z);
	tmp = 0.0;
	if (z <= -4.2e+252)
		tmp = t_0;
	elseif (z <= -9.5e+192)
		tmp = t_1;
	elseif (z <= -0.98)
		tmp = t_0;
	elseif (z <= -1.4e-239)
		tmp = y * 4.0;
	elseif (z <= 1e-177)
		tmp = x * -3.0;
	elseif (z <= 3.8e-123)
		tmp = y * 4.0;
	elseif (z <= 1.35e-54)
		tmp = x * -3.0;
	elseif (z <= 15000000000.0)
		tmp = y * 4.0;
	elseif ((z <= 3.55e+81) || (~((z <= 5e+226)) && (z <= 3.1e+264)))
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e+252], t$95$0, If[LessEqual[z, -9.5e+192], t$95$1, If[LessEqual[z, -0.98], t$95$0, If[LessEqual[z, -1.4e-239], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1e-177], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.8e-123], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.35e-54], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 15000000000.0], N[(y * 4.0), $MachinePrecision], If[Or[LessEqual[z, 3.55e+81], And[N[Not[LessEqual[z, 5e+226]], $MachinePrecision], LessEqual[z, 3.1e+264]]], t$95$1, t$95$0]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -9.5 \cdot 10^{+192}:\\
\;\;\;\;t_1\\

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

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

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

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

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

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

\mathbf{elif}\;z \leq 3.55 \cdot 10^{+81} \lor \neg \left(z \leq 5 \cdot 10^{+226}\right) \land z \leq 3.1 \cdot 10^{+264}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.2000000000000003e252 or -9.49999999999999931e192 < z < -0.97999999999999998 or 3.54999999999999984e81 < z < 5.0000000000000005e226 or 3.09999999999999981e264 < z

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in x around inf 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.2000000000000003e252 < z < -9.49999999999999931e192 or 1.5e10 < z < 3.54999999999999984e81 or 5.0000000000000005e226 < z < 3.09999999999999981e264

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in x around 0 99.7%

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

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

        \[\leadsto \mathsf{fma}\left(1 + -6 \cdot \left(0.6666666666666666 - z\right), x, \color{blue}{\left(y \cdot \left(0.6666666666666666 - z\right)\right) \cdot 6}\right) \]
      3. associate-*r*99.7%

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

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

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

        \[\leadsto \mathsf{fma}\left(1 + -6 \cdot \left(0.6666666666666666 - z\right), x, \color{blue}{\left(-6 \cdot y\right) \cdot z}\right) \]
      2. *-commutative99.8%

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

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

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

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

    if -0.97999999999999998 < z < -1.40000000000000006e-239 or 9.99999999999999952e-178 < z < 3.79999999999999996e-123 or 1.35000000000000013e-54 < z < 1.5e10

    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. associate-*r*99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    7. Simplified60.0%

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

    if -1.40000000000000006e-239 < z < 9.99999999999999952e-178 or 3.79999999999999996e-123 < z < 1.35000000000000013e-54

    1. Initial program 99.3%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in x around inf 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+252}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{+192}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -0.98:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-239}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 10^{-177}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-123}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-54}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 15000000000:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.55 \cdot 10^{+81} \lor \neg \left(z \leq 5 \cdot 10^{+226}\right) \land z \leq 3.1 \cdot 10^{+264}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \end{array} \]

Alternative 3: 51.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(z \cdot 6\right)\\ t_1 := -6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -1.7 \cdot 10^{+254}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -2.25 \cdot 10^{+189}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -0.42:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-238}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-177}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-122}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-55}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 15000000000:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+81} \lor \neg \left(z \leq 5.5 \cdot 10^{+237}\right) \land z \leq 1.2 \cdot 10^{+262}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (* z 6.0))) (t_1 (* -6.0 (* y z))))
   (if (<= z -1.7e+254)
     t_0
     (if (<= z -2.25e+189)
       t_1
       (if (<= z -0.42)
         t_0
         (if (<= z -1.2e-238)
           (* y 4.0)
           (if (<= z 1.9e-177)
             (* x -3.0)
             (if (<= z 2.6e-122)
               (* y 4.0)
               (if (<= z 2.2e-55)
                 (* x -3.0)
                 (if (<= z 15000000000.0)
                   (* y 4.0)
                   (if (or (<= z 1.8e+81)
                           (and (not (<= z 5.5e+237)) (<= z 1.2e+262)))
                     t_1
                     t_0)))))))))))
double code(double x, double y, double z) {
	double t_0 = x * (z * 6.0);
	double t_1 = -6.0 * (y * z);
	double tmp;
	if (z <= -1.7e+254) {
		tmp = t_0;
	} else if (z <= -2.25e+189) {
		tmp = t_1;
	} else if (z <= -0.42) {
		tmp = t_0;
	} else if (z <= -1.2e-238) {
		tmp = y * 4.0;
	} else if (z <= 1.9e-177) {
		tmp = x * -3.0;
	} else if (z <= 2.6e-122) {
		tmp = y * 4.0;
	} else if (z <= 2.2e-55) {
		tmp = x * -3.0;
	} else if (z <= 15000000000.0) {
		tmp = y * 4.0;
	} else if ((z <= 1.8e+81) || (!(z <= 5.5e+237) && (z <= 1.2e+262))) {
		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 = x * (z * 6.0d0)
    t_1 = (-6.0d0) * (y * z)
    if (z <= (-1.7d+254)) then
        tmp = t_0
    else if (z <= (-2.25d+189)) then
        tmp = t_1
    else if (z <= (-0.42d0)) then
        tmp = t_0
    else if (z <= (-1.2d-238)) then
        tmp = y * 4.0d0
    else if (z <= 1.9d-177) then
        tmp = x * (-3.0d0)
    else if (z <= 2.6d-122) then
        tmp = y * 4.0d0
    else if (z <= 2.2d-55) then
        tmp = x * (-3.0d0)
    else if (z <= 15000000000.0d0) then
        tmp = y * 4.0d0
    else if ((z <= 1.8d+81) .or. (.not. (z <= 5.5d+237)) .and. (z <= 1.2d+262)) 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 = x * (z * 6.0);
	double t_1 = -6.0 * (y * z);
	double tmp;
	if (z <= -1.7e+254) {
		tmp = t_0;
	} else if (z <= -2.25e+189) {
		tmp = t_1;
	} else if (z <= -0.42) {
		tmp = t_0;
	} else if (z <= -1.2e-238) {
		tmp = y * 4.0;
	} else if (z <= 1.9e-177) {
		tmp = x * -3.0;
	} else if (z <= 2.6e-122) {
		tmp = y * 4.0;
	} else if (z <= 2.2e-55) {
		tmp = x * -3.0;
	} else if (z <= 15000000000.0) {
		tmp = y * 4.0;
	} else if ((z <= 1.8e+81) || (!(z <= 5.5e+237) && (z <= 1.2e+262))) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (z * 6.0)
	t_1 = -6.0 * (y * z)
	tmp = 0
	if z <= -1.7e+254:
		tmp = t_0
	elif z <= -2.25e+189:
		tmp = t_1
	elif z <= -0.42:
		tmp = t_0
	elif z <= -1.2e-238:
		tmp = y * 4.0
	elif z <= 1.9e-177:
		tmp = x * -3.0
	elif z <= 2.6e-122:
		tmp = y * 4.0
	elif z <= 2.2e-55:
		tmp = x * -3.0
	elif z <= 15000000000.0:
		tmp = y * 4.0
	elif (z <= 1.8e+81) or (not (z <= 5.5e+237) and (z <= 1.2e+262)):
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(z * 6.0))
	t_1 = Float64(-6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -1.7e+254)
		tmp = t_0;
	elseif (z <= -2.25e+189)
		tmp = t_1;
	elseif (z <= -0.42)
		tmp = t_0;
	elseif (z <= -1.2e-238)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.9e-177)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.6e-122)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.2e-55)
		tmp = Float64(x * -3.0);
	elseif (z <= 15000000000.0)
		tmp = Float64(y * 4.0);
	elseif ((z <= 1.8e+81) || (!(z <= 5.5e+237) && (z <= 1.2e+262)))
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * (z * 6.0);
	t_1 = -6.0 * (y * z);
	tmp = 0.0;
	if (z <= -1.7e+254)
		tmp = t_0;
	elseif (z <= -2.25e+189)
		tmp = t_1;
	elseif (z <= -0.42)
		tmp = t_0;
	elseif (z <= -1.2e-238)
		tmp = y * 4.0;
	elseif (z <= 1.9e-177)
		tmp = x * -3.0;
	elseif (z <= 2.6e-122)
		tmp = y * 4.0;
	elseif (z <= 2.2e-55)
		tmp = x * -3.0;
	elseif (z <= 15000000000.0)
		tmp = y * 4.0;
	elseif ((z <= 1.8e+81) || (~((z <= 5.5e+237)) && (z <= 1.2e+262)))
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e+254], t$95$0, If[LessEqual[z, -2.25e+189], t$95$1, If[LessEqual[z, -0.42], t$95$0, If[LessEqual[z, -1.2e-238], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.9e-177], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.6e-122], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.2e-55], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 15000000000.0], N[(y * 4.0), $MachinePrecision], If[Or[LessEqual[z, 1.8e+81], And[N[Not[LessEqual[z, 5.5e+237]], $MachinePrecision], LessEqual[z, 1.2e+262]]], t$95$1, t$95$0]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.25 \cdot 10^{+189}:\\
\;\;\;\;t_1\\

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

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

\mathbf{elif}\;z \leq 1.9 \cdot 10^{-177}:\\
\;\;\;\;x \cdot -3\\

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

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

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

\mathbf{elif}\;z \leq 1.8 \cdot 10^{+81} \lor \neg \left(z \leq 5.5 \cdot 10^{+237}\right) \land z \leq 1.2 \cdot 10^{+262}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.7e254 or -2.24999999999999987e189 < z < -0.419999999999999984 or 1.80000000000000003e81 < z < 5.5000000000000001e237 or 1.19999999999999991e262 < z

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in x around inf 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.7e254 < z < -2.24999999999999987e189 or 1.5e10 < z < 1.80000000000000003e81 or 5.5000000000000001e237 < z < 1.19999999999999991e262

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in x around 0 99.7%

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

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

        \[\leadsto \mathsf{fma}\left(1 + -6 \cdot \left(0.6666666666666666 - z\right), x, \color{blue}{\left(y \cdot \left(0.6666666666666666 - z\right)\right) \cdot 6}\right) \]
      3. associate-*r*99.7%

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

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

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

        \[\leadsto \mathsf{fma}\left(1 + -6 \cdot \left(0.6666666666666666 - z\right), x, \color{blue}{\left(-6 \cdot y\right) \cdot z}\right) \]
      2. *-commutative99.8%

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

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

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

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

    if -0.419999999999999984 < z < -1.1999999999999999e-238 or 1.90000000000000002e-177 < z < 2.59999999999999975e-122 or 2.2e-55 < z < 1.5e10

    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. associate-*r*99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    7. Simplified60.0%

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

    if -1.1999999999999999e-238 < z < 1.90000000000000002e-177 or 2.59999999999999975e-122 < z < 2.2e-55

    1. Initial program 99.3%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in x around inf 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+254}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -2.25 \cdot 10^{+189}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -0.42:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-238}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-177}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-122}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-55}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 15000000000:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+81} \lor \neg \left(z \leq 5.5 \cdot 10^{+237}\right) \land z \leq 1.2 \cdot 10^{+262}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \]

Alternative 4: 51.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(z \cdot 6\right)\\ t_1 := z \cdot \left(y \cdot -6\right)\\ \mathbf{if}\;z \leq -1.25 \cdot 10^{+248}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{+192}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -0.25:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{-238}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-178}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-120}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-54}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 15000000000:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{+83}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+236} \lor \neg \left(z \leq 7.5 \cdot 10^{+262}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (* z 6.0))) (t_1 (* z (* y -6.0))))
   (if (<= z -1.25e+248)
     t_0
     (if (<= z -9.5e+192)
       t_1
       (if (<= z -0.25)
         t_0
         (if (<= z -3.2e-238)
           (* y 4.0)
           (if (<= z 1.3e-178)
             (* x -3.0)
             (if (<= z 3e-120)
               (* y 4.0)
               (if (<= z 1.02e-54)
                 (* x -3.0)
                 (if (<= z 15000000000.0)
                   (* y 4.0)
                   (if (<= z 2.35e+83)
                     (* -6.0 (* y z))
                     (if (or (<= z 3.8e+236) (not (<= z 7.5e+262)))
                       t_0
                       t_1))))))))))))
double code(double x, double y, double z) {
	double t_0 = x * (z * 6.0);
	double t_1 = z * (y * -6.0);
	double tmp;
	if (z <= -1.25e+248) {
		tmp = t_0;
	} else if (z <= -9.5e+192) {
		tmp = t_1;
	} else if (z <= -0.25) {
		tmp = t_0;
	} else if (z <= -3.2e-238) {
		tmp = y * 4.0;
	} else if (z <= 1.3e-178) {
		tmp = x * -3.0;
	} else if (z <= 3e-120) {
		tmp = y * 4.0;
	} else if (z <= 1.02e-54) {
		tmp = x * -3.0;
	} else if (z <= 15000000000.0) {
		tmp = y * 4.0;
	} else if (z <= 2.35e+83) {
		tmp = -6.0 * (y * z);
	} else if ((z <= 3.8e+236) || !(z <= 7.5e+262)) {
		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 * (z * 6.0d0)
    t_1 = z * (y * (-6.0d0))
    if (z <= (-1.25d+248)) then
        tmp = t_0
    else if (z <= (-9.5d+192)) then
        tmp = t_1
    else if (z <= (-0.25d0)) then
        tmp = t_0
    else if (z <= (-3.2d-238)) then
        tmp = y * 4.0d0
    else if (z <= 1.3d-178) then
        tmp = x * (-3.0d0)
    else if (z <= 3d-120) then
        tmp = y * 4.0d0
    else if (z <= 1.02d-54) then
        tmp = x * (-3.0d0)
    else if (z <= 15000000000.0d0) then
        tmp = y * 4.0d0
    else if (z <= 2.35d+83) then
        tmp = (-6.0d0) * (y * z)
    else if ((z <= 3.8d+236) .or. (.not. (z <= 7.5d+262))) 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 * (z * 6.0);
	double t_1 = z * (y * -6.0);
	double tmp;
	if (z <= -1.25e+248) {
		tmp = t_0;
	} else if (z <= -9.5e+192) {
		tmp = t_1;
	} else if (z <= -0.25) {
		tmp = t_0;
	} else if (z <= -3.2e-238) {
		tmp = y * 4.0;
	} else if (z <= 1.3e-178) {
		tmp = x * -3.0;
	} else if (z <= 3e-120) {
		tmp = y * 4.0;
	} else if (z <= 1.02e-54) {
		tmp = x * -3.0;
	} else if (z <= 15000000000.0) {
		tmp = y * 4.0;
	} else if (z <= 2.35e+83) {
		tmp = -6.0 * (y * z);
	} else if ((z <= 3.8e+236) || !(z <= 7.5e+262)) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (z * 6.0)
	t_1 = z * (y * -6.0)
	tmp = 0
	if z <= -1.25e+248:
		tmp = t_0
	elif z <= -9.5e+192:
		tmp = t_1
	elif z <= -0.25:
		tmp = t_0
	elif z <= -3.2e-238:
		tmp = y * 4.0
	elif z <= 1.3e-178:
		tmp = x * -3.0
	elif z <= 3e-120:
		tmp = y * 4.0
	elif z <= 1.02e-54:
		tmp = x * -3.0
	elif z <= 15000000000.0:
		tmp = y * 4.0
	elif z <= 2.35e+83:
		tmp = -6.0 * (y * z)
	elif (z <= 3.8e+236) or not (z <= 7.5e+262):
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(z * 6.0))
	t_1 = Float64(z * Float64(y * -6.0))
	tmp = 0.0
	if (z <= -1.25e+248)
		tmp = t_0;
	elseif (z <= -9.5e+192)
		tmp = t_1;
	elseif (z <= -0.25)
		tmp = t_0;
	elseif (z <= -3.2e-238)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.3e-178)
		tmp = Float64(x * -3.0);
	elseif (z <= 3e-120)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.02e-54)
		tmp = Float64(x * -3.0);
	elseif (z <= 15000000000.0)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.35e+83)
		tmp = Float64(-6.0 * Float64(y * z));
	elseif ((z <= 3.8e+236) || !(z <= 7.5e+262))
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * (z * 6.0);
	t_1 = z * (y * -6.0);
	tmp = 0.0;
	if (z <= -1.25e+248)
		tmp = t_0;
	elseif (z <= -9.5e+192)
		tmp = t_1;
	elseif (z <= -0.25)
		tmp = t_0;
	elseif (z <= -3.2e-238)
		tmp = y * 4.0;
	elseif (z <= 1.3e-178)
		tmp = x * -3.0;
	elseif (z <= 3e-120)
		tmp = y * 4.0;
	elseif (z <= 1.02e-54)
		tmp = x * -3.0;
	elseif (z <= 15000000000.0)
		tmp = y * 4.0;
	elseif (z <= 2.35e+83)
		tmp = -6.0 * (y * z);
	elseif ((z <= 3.8e+236) || ~((z <= 7.5e+262)))
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.25e+248], t$95$0, If[LessEqual[z, -9.5e+192], t$95$1, If[LessEqual[z, -0.25], t$95$0, If[LessEqual[z, -3.2e-238], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.3e-178], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3e-120], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.02e-54], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 15000000000.0], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.35e+83], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 3.8e+236], N[Not[LessEqual[z, 7.5e+262]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -9.5 \cdot 10^{+192}:\\
\;\;\;\;t_1\\

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

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

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

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

\mathbf{elif}\;z \leq 1.02 \cdot 10^{-54}:\\
\;\;\;\;x \cdot -3\\

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

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

\mathbf{elif}\;z \leq 3.8 \cdot 10^{+236} \lor \neg \left(z \leq 7.5 \cdot 10^{+262}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.2499999999999999e248 or -9.49999999999999931e192 < z < -0.25 or 2.3499999999999999e83 < z < 3.79999999999999986e236 or 7.49999999999999977e262 < z

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in x around inf 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2499999999999999e248 < z < -9.49999999999999931e192 or 3.79999999999999986e236 < z < 7.49999999999999977e262

    1. Initial program 100.0%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in x around 0 99.8%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(1 + -6 \cdot \left(0.6666666666666666 - z\right), x, 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\right)} \]
      2. *-commutative99.8%

        \[\leadsto \mathsf{fma}\left(1 + -6 \cdot \left(0.6666666666666666 - z\right), x, \color{blue}{\left(y \cdot \left(0.6666666666666666 - z\right)\right) \cdot 6}\right) \]
      3. associate-*r*99.8%

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

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

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

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

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

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

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

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

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

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

    if -0.25 < z < -3.2000000000000002e-238 or 1.29999999999999999e-178 < z < 3.00000000000000011e-120 or 1.01999999999999999e-54 < z < 1.5e10

    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. associate-*r*99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    7. Simplified60.0%

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

    if -3.2000000000000002e-238 < z < 1.29999999999999999e-178 or 3.00000000000000011e-120 < z < 1.01999999999999999e-54

    1. Initial program 99.3%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in x around inf 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.5e10 < z < 2.3499999999999999e83

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in x around 0 99.6%

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

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

        \[\leadsto \mathsf{fma}\left(1 + -6 \cdot \left(0.6666666666666666 - z\right), x, \color{blue}{\left(y \cdot \left(0.6666666666666666 - z\right)\right) \cdot 6}\right) \]
      3. associate-*r*99.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{+248}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{+192}:\\ \;\;\;\;z \cdot \left(y \cdot -6\right)\\ \mathbf{elif}\;z \leq -0.25:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{-238}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-178}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-120}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-54}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 15000000000:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{+83}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+236} \lor \neg \left(z \leq 7.5 \cdot 10^{+262}\right):\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y \cdot -6\right)\\ \end{array} \]

Alternative 5: 74.1% accurate, 0.7× speedup?

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

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

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

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

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

\mathbf{elif}\;z \leq 1.16 \cdot 10^{-55}:\\
\;\;\;\;x \cdot -3\\

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

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


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

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in z around 0 99.6%

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

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

    if -0.0519999999999999976 < z < -7.6000000000000004e-239 or 2.8000000000000001e-179 < z < 1.3999999999999999e-123 or 1.15999999999999996e-55 < z < 0.660000000000000031

    1. Initial program 99.4%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}{x - \left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)}} \]
      4. clear-num45.7%

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

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

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

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

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

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

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

    if -7.6000000000000004e-239 < z < 2.8000000000000001e-179 or 1.3999999999999999e-123 < z < 1.15999999999999996e-55

    1. Initial program 99.3%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in x around inf 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.052:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq -7.6 \cdot 10^{-239}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-179}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-123}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.16 \cdot 10^{-55}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.66:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \end{array} \]

Alternative 6: 74.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ t_1 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{if}\;z \leq -800:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.22 \cdot 10^{-173}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-176}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-122}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-55}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 260000:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* 6.0 (* y (- 0.6666666666666666 z))))
        (t_1 (* -6.0 (* (- y x) z))))
   (if (<= z -800.0)
     t_1
     (if (<= z -1.22e-173)
       t_0
       (if (<= z 3.2e-176)
         (* x -3.0)
         (if (<= z 4e-122)
           (* y 4.0)
           (if (<= z 3.8e-55) (* x -3.0) (if (<= z 260000.0) t_0 t_1))))))))
double code(double x, double y, double z) {
	double t_0 = 6.0 * (y * (0.6666666666666666 - z));
	double t_1 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -800.0) {
		tmp = t_1;
	} else if (z <= -1.22e-173) {
		tmp = t_0;
	} else if (z <= 3.2e-176) {
		tmp = x * -3.0;
	} else if (z <= 4e-122) {
		tmp = y * 4.0;
	} else if (z <= 3.8e-55) {
		tmp = x * -3.0;
	} else if (z <= 260000.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 = 6.0d0 * (y * (0.6666666666666666d0 - z))
    t_1 = (-6.0d0) * ((y - x) * z)
    if (z <= (-800.0d0)) then
        tmp = t_1
    else if (z <= (-1.22d-173)) then
        tmp = t_0
    else if (z <= 3.2d-176) then
        tmp = x * (-3.0d0)
    else if (z <= 4d-122) then
        tmp = y * 4.0d0
    else if (z <= 3.8d-55) then
        tmp = x * (-3.0d0)
    else if (z <= 260000.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 = 6.0 * (y * (0.6666666666666666 - z));
	double t_1 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -800.0) {
		tmp = t_1;
	} else if (z <= -1.22e-173) {
		tmp = t_0;
	} else if (z <= 3.2e-176) {
		tmp = x * -3.0;
	} else if (z <= 4e-122) {
		tmp = y * 4.0;
	} else if (z <= 3.8e-55) {
		tmp = x * -3.0;
	} else if (z <= 260000.0) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 6.0 * (y * (0.6666666666666666 - z))
	t_1 = -6.0 * ((y - x) * z)
	tmp = 0
	if z <= -800.0:
		tmp = t_1
	elif z <= -1.22e-173:
		tmp = t_0
	elif z <= 3.2e-176:
		tmp = x * -3.0
	elif z <= 4e-122:
		tmp = y * 4.0
	elif z <= 3.8e-55:
		tmp = x * -3.0
	elif z <= 260000.0:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z)))
	t_1 = Float64(-6.0 * Float64(Float64(y - x) * z))
	tmp = 0.0
	if (z <= -800.0)
		tmp = t_1;
	elseif (z <= -1.22e-173)
		tmp = t_0;
	elseif (z <= 3.2e-176)
		tmp = Float64(x * -3.0);
	elseif (z <= 4e-122)
		tmp = Float64(y * 4.0);
	elseif (z <= 3.8e-55)
		tmp = Float64(x * -3.0);
	elseif (z <= 260000.0)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 6.0 * (y * (0.6666666666666666 - z));
	t_1 = -6.0 * ((y - x) * z);
	tmp = 0.0;
	if (z <= -800.0)
		tmp = t_1;
	elseif (z <= -1.22e-173)
		tmp = t_0;
	elseif (z <= 3.2e-176)
		tmp = x * -3.0;
	elseif (z <= 4e-122)
		tmp = y * 4.0;
	elseif (z <= 3.8e-55)
		tmp = x * -3.0;
	elseif (z <= 260000.0)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -800.0], t$95$1, If[LessEqual[z, -1.22e-173], t$95$0, If[LessEqual[z, 3.2e-176], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4e-122], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.8e-55], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 260000.0], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.22 \cdot 10^{-173}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq 3.2 \cdot 10^{-176}:\\
\;\;\;\;x \cdot -3\\

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

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

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

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


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

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in z around 0 99.6%

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

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

    if -800 < z < -1.21999999999999993e-173 or 3.7999999999999997e-55 < z < 2.6e5

    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. associate-*r*99.7%

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

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

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

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

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

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

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

    if -1.21999999999999993e-173 < z < 3.19999999999999985e-176 or 4.00000000000000024e-122 < z < 3.7999999999999997e-55

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in x around inf 66.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    7. Simplified66.5%

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

    if 3.19999999999999985e-176 < z < 4.00000000000000024e-122

    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. associate-*r*100.0%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    7. Simplified83.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -800:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq -1.22 \cdot 10^{-173}:\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-176}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-122}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-55}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 260000:\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \end{array} \]

Alternative 7: 50.5% accurate, 0.7× speedup?

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

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

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

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

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

\mathbf{elif}\;z \leq 1.52 \cdot 10^{-55}:\\
\;\;\;\;x \cdot -3\\

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

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


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

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in x around 0 95.9%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(1 + -6 \cdot \left(0.6666666666666666 - z\right), x, 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\right)} \]
      2. *-commutative97.4%

        \[\leadsto \mathsf{fma}\left(1 + -6 \cdot \left(0.6666666666666666 - z\right), x, \color{blue}{\left(y \cdot \left(0.6666666666666666 - z\right)\right) \cdot 6}\right) \]
      3. associate-*r*97.5%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(1 + -6 \cdot \left(0.6666666666666666 - z\right), x, \color{blue}{\left(y \cdot -6\right)} \cdot z\right) \]
      3. associate-*l*97.2%

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

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

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

    if -0.650000000000000022 < z < -4.60000000000000009e-238 or 1.6e-178 < z < 2.9e-120 or 1.5200000000000001e-55 < z < 1.5e10

    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. associate-*r*99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    7. Simplified60.0%

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

    if -4.60000000000000009e-238 < z < 1.6e-178 or 2.9e-120 < z < 1.5200000000000001e-55

    1. Initial program 99.3%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in x around inf 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.65:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -4.6 \cdot 10^{-238}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-178}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-120}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.52 \cdot 10^{-55}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 15000000000:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]

Alternative 8: 97.7% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in z around 0 99.6%

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

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

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

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

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

    if -0.56000000000000005 < z < 0.56000000000000005

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in z around 0 96.7%

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

    if 0.56000000000000005 < z

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in z around inf 99.4%

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

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

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

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

Alternative 9: 74.6% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{+53} \lor \neg \left(x \leq 3.3 \cdot 10^{+103}\right):\\
\;\;\;\;x \cdot \left(z \cdot 6 + -3\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.6000000000000004e53 or 3.30000000000000009e103 < x

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in x around inf 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.6000000000000004e53 < x < 3.30000000000000009e103

    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. associate-*r*99.8%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{x - \left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)}{x \cdot x - \left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}}} \]
      5. pow252.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.6 \cdot 10^{+53} \lor \neg \left(x \leq 3.3 \cdot 10^{+103}\right):\\ \;\;\;\;x \cdot \left(z \cdot 6 + -3\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \end{array} \]

Alternative 10: 74.7% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{+54} \lor \neg \left(x \leq 4 \cdot 10^{+103}\right):\\
\;\;\;\;x \cdot \left(z \cdot 6 + -3\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.9999999999999998e54 or 4e103 < x

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in x around inf 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.9999999999999998e54 < x < 4e103

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6 \cdot 10^{+54} \lor \neg \left(x \leq 4 \cdot 10^{+103}\right):\\ \;\;\;\;x \cdot \left(z \cdot 6 + -3\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\ \end{array} \]

Alternative 11: 97.7% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in z around 0 99.6%

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

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

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

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

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

    if -0.56000000000000005 < z < 0.52000000000000002

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in z around 0 96.7%

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

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

Alternative 12: 99.7% accurate, 1.2× speedup?

\[\begin{array}{l} \\ x + \left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\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(y - x) * Float64(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[(y - x), $MachinePrecision] * N[(6.0 * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)
\end{array}
Derivation
  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. associate-*l*99.8%

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

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

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

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

Alternative 13: 38.0% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-43}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;y \leq 17000:\\
\;\;\;\;x \cdot -3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.49999999999999997e-43 or 17000 < y

    1. Initial program 99.6%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}{x - \left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)}} \]
      4. clear-num25.5%

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

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

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

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

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

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

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

    if -3.49999999999999997e-43 < y < 17000

    1. Initial program 99.6%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Taylor expanded in x around inf 73.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    7. Simplified35.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{-43}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;y \leq 17000:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;y \cdot 4\\ \end{array} \]

Alternative 14: 25.9% accurate, 4.3× speedup?

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

\\
x \cdot -3
\end{array}
Derivation
  1. Initial program 99.6%

    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
  2. Taylor expanded in x around inf 53.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto x \cdot -3 \]

Reproduce

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