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

Percentage Accurate: 99.5% → 99.8%
Time: 10.2s
Alternatives: 17
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 17 alternatives:

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

Initial Program: 99.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.1× speedup?

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

\\
x + \mathsf{fma}\left(-6, z \cdot \left(y - x\right), \left(y - x\right) \cdot 4\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. *-commutative99.6%

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(6, \frac{\left(y - x\right) \cdot \left(0.4444444444444444 - \color{blue}{{z}^{2}}\right)}{0.6666666666666666 + z}, x\right) \]
  5. Applied egg-rr84.3%

    \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{\left(y - x\right) \cdot \left(0.4444444444444444 - {z}^{2}\right)}{0.6666666666666666 + z}}, x\right) \]
  6. Step-by-step derivation
    1. *-commutative84.3%

      \[\leadsto \mathsf{fma}\left(6, \frac{\color{blue}{\left(0.4444444444444444 - {z}^{2}\right) \cdot \left(y - x\right)}}{0.6666666666666666 + z}, x\right) \]
    2. associate-/l*89.1%

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

    \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
  8. Taylor expanded in z around inf 99.7%

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

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

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

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

Alternative 2: 99.7% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(y - x, 6 \cdot \left(0.6666666666666666 - z\right), x\right)
\end{array}
Derivation
  1. Initial program 99.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.7%

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

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

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

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

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

Alternative 3: 51.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot y\right)\\ t_1 := 6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -8 \cdot 10^{+224}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -4 \cdot 10^{+209}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -0.112:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-225}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-205}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-91}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.65:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+114} \lor \neg \left(z \leq 5.8 \cdot 10^{+251}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* z y))) (t_1 (* 6.0 (* x z))))
   (if (<= z -8e+224)
     t_0
     (if (<= z -4e+209)
       t_1
       (if (<= z -0.112)
         t_0
         (if (<= z -1.3e-225)
           (* x -3.0)
           (if (<= z 2.9e-205)
             (* y 4.0)
             (if (<= z 1.9e-91)
               (* x -3.0)
               (if (<= z 0.65)
                 (* y 4.0)
                 (if (or (<= z 2.7e+114) (not (<= z 5.8e+251)))
                   t_1
                   t_0))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -8e+224) {
		tmp = t_0;
	} else if (z <= -4e+209) {
		tmp = t_1;
	} else if (z <= -0.112) {
		tmp = t_0;
	} else if (z <= -1.3e-225) {
		tmp = x * -3.0;
	} else if (z <= 2.9e-205) {
		tmp = y * 4.0;
	} else if (z <= 1.9e-91) {
		tmp = x * -3.0;
	} else if (z <= 0.65) {
		tmp = y * 4.0;
	} else if ((z <= 2.7e+114) || !(z <= 5.8e+251)) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (-6.0d0) * (z * y)
    t_1 = 6.0d0 * (x * z)
    if (z <= (-8d+224)) then
        tmp = t_0
    else if (z <= (-4d+209)) then
        tmp = t_1
    else if (z <= (-0.112d0)) then
        tmp = t_0
    else if (z <= (-1.3d-225)) then
        tmp = x * (-3.0d0)
    else if (z <= 2.9d-205) then
        tmp = y * 4.0d0
    else if (z <= 1.9d-91) then
        tmp = x * (-3.0d0)
    else if (z <= 0.65d0) then
        tmp = y * 4.0d0
    else if ((z <= 2.7d+114) .or. (.not. (z <= 5.8d+251))) then
        tmp = t_1
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -8e+224) {
		tmp = t_0;
	} else if (z <= -4e+209) {
		tmp = t_1;
	} else if (z <= -0.112) {
		tmp = t_0;
	} else if (z <= -1.3e-225) {
		tmp = x * -3.0;
	} else if (z <= 2.9e-205) {
		tmp = y * 4.0;
	} else if (z <= 1.9e-91) {
		tmp = x * -3.0;
	} else if (z <= 0.65) {
		tmp = y * 4.0;
	} else if ((z <= 2.7e+114) || !(z <= 5.8e+251)) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (z * y)
	t_1 = 6.0 * (x * z)
	tmp = 0
	if z <= -8e+224:
		tmp = t_0
	elif z <= -4e+209:
		tmp = t_1
	elif z <= -0.112:
		tmp = t_0
	elif z <= -1.3e-225:
		tmp = x * -3.0
	elif z <= 2.9e-205:
		tmp = y * 4.0
	elif z <= 1.9e-91:
		tmp = x * -3.0
	elif z <= 0.65:
		tmp = y * 4.0
	elif (z <= 2.7e+114) or not (z <= 5.8e+251):
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(z * y))
	t_1 = Float64(6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -8e+224)
		tmp = t_0;
	elseif (z <= -4e+209)
		tmp = t_1;
	elseif (z <= -0.112)
		tmp = t_0;
	elseif (z <= -1.3e-225)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.9e-205)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.9e-91)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.65)
		tmp = Float64(y * 4.0);
	elseif ((z <= 2.7e+114) || !(z <= 5.8e+251))
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (z * y);
	t_1 = 6.0 * (x * z);
	tmp = 0.0;
	if (z <= -8e+224)
		tmp = t_0;
	elseif (z <= -4e+209)
		tmp = t_1;
	elseif (z <= -0.112)
		tmp = t_0;
	elseif (z <= -1.3e-225)
		tmp = x * -3.0;
	elseif (z <= 2.9e-205)
		tmp = y * 4.0;
	elseif (z <= 1.9e-91)
		tmp = x * -3.0;
	elseif (z <= 0.65)
		tmp = y * 4.0;
	elseif ((z <= 2.7e+114) || ~((z <= 5.8e+251)))
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e+224], t$95$0, If[LessEqual[z, -4e+209], t$95$1, If[LessEqual[z, -0.112], t$95$0, If[LessEqual[z, -1.3e-225], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.9e-205], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.9e-91], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], If[Or[LessEqual[z, 2.7e+114], N[Not[LessEqual[z, 5.8e+251]], $MachinePrecision]], t$95$1, t$95$0]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -4 \cdot 10^{+209}:\\
\;\;\;\;t_1\\

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

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

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

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

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

\mathbf{elif}\;z \leq 2.7 \cdot 10^{+114} \lor \neg \left(z \leq 5.8 \cdot 10^{+251}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -7.99999999999999976e224 or -4.0000000000000003e209 < z < -0.112000000000000002 or 2.7e114 < z < 5.7999999999999999e251

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.99999999999999976e224 < z < -4.0000000000000003e209 or 0.650000000000000022 < z < 2.7e114 or 5.7999999999999999e251 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(6, \frac{\left(y - x\right) \cdot \left(0.4444444444444444 - \color{blue}{{z}^{2}}\right)}{0.6666666666666666 + z}, x\right) \]
    5. Applied egg-rr76.1%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{\left(y - x\right) \cdot \left(0.4444444444444444 - {z}^{2}\right)}{0.6666666666666666 + z}}, x\right) \]
    6. Step-by-step derivation
      1. *-commutative76.1%

        \[\leadsto \mathsf{fma}\left(6, \frac{\color{blue}{\left(0.4444444444444444 - {z}^{2}\right) \cdot \left(y - x\right)}}{0.6666666666666666 + z}, x\right) \]
      2. associate-/l*83.4%

        \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
    7. Simplified83.4%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
    8. Taylor expanded in z around inf 98.9%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{-1 \cdot \left(z \cdot \left(y - x\right)\right)}, x\right) \]
    9. Step-by-step derivation
      1. mul-1-neg98.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.112000000000000002 < z < -1.30000000000000007e-225 or 2.90000000000000018e-205 < z < 1.89999999999999989e-91

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.30000000000000007e-225 < z < 2.90000000000000018e-205 or 1.89999999999999989e-91 < z < 0.650000000000000022

    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. distribute-rgt-neg-out99.8%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{z \cdot \left(-6\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, 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 63.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+224}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -4 \cdot 10^{+209}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -0.112:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-225}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-205}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-91}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.65:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+114} \lor \neg \left(z \leq 5.8 \cdot 10^{+251}\right):\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \end{array} \]

Alternative 4: 51.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot y\right)\\ t_1 := 6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -1 \cdot 10^{+225}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{+192}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -0.039:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-230}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-204}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 10^{-92}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.56:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+114}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+249}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* z y))) (t_1 (* 6.0 (* x z))))
   (if (<= z -1e+225)
     t_0
     (if (<= z -3.6e+192)
       t_1
       (if (<= z -0.039)
         t_0
         (if (<= z -3.8e-230)
           (* x -3.0)
           (if (<= z 1.4e-204)
             (* y 4.0)
             (if (<= z 1e-92)
               (* x -3.0)
               (if (<= z 0.56)
                 (* y 4.0)
                 (if (<= z 2.9e+114)
                   t_1
                   (if (<= z 6.2e+249) t_0 (* x (* z 6.0)))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -1e+225) {
		tmp = t_0;
	} else if (z <= -3.6e+192) {
		tmp = t_1;
	} else if (z <= -0.039) {
		tmp = t_0;
	} else if (z <= -3.8e-230) {
		tmp = x * -3.0;
	} else if (z <= 1.4e-204) {
		tmp = y * 4.0;
	} else if (z <= 1e-92) {
		tmp = x * -3.0;
	} else if (z <= 0.56) {
		tmp = y * 4.0;
	} else if (z <= 2.9e+114) {
		tmp = t_1;
	} else if (z <= 6.2e+249) {
		tmp = t_0;
	} else {
		tmp = x * (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) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (-6.0d0) * (z * y)
    t_1 = 6.0d0 * (x * z)
    if (z <= (-1d+225)) then
        tmp = t_0
    else if (z <= (-3.6d+192)) then
        tmp = t_1
    else if (z <= (-0.039d0)) then
        tmp = t_0
    else if (z <= (-3.8d-230)) then
        tmp = x * (-3.0d0)
    else if (z <= 1.4d-204) then
        tmp = y * 4.0d0
    else if (z <= 1d-92) then
        tmp = x * (-3.0d0)
    else if (z <= 0.56d0) then
        tmp = y * 4.0d0
    else if (z <= 2.9d+114) then
        tmp = t_1
    else if (z <= 6.2d+249) then
        tmp = t_0
    else
        tmp = x * (z * 6.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -1e+225) {
		tmp = t_0;
	} else if (z <= -3.6e+192) {
		tmp = t_1;
	} else if (z <= -0.039) {
		tmp = t_0;
	} else if (z <= -3.8e-230) {
		tmp = x * -3.0;
	} else if (z <= 1.4e-204) {
		tmp = y * 4.0;
	} else if (z <= 1e-92) {
		tmp = x * -3.0;
	} else if (z <= 0.56) {
		tmp = y * 4.0;
	} else if (z <= 2.9e+114) {
		tmp = t_1;
	} else if (z <= 6.2e+249) {
		tmp = t_0;
	} else {
		tmp = x * (z * 6.0);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (z * y)
	t_1 = 6.0 * (x * z)
	tmp = 0
	if z <= -1e+225:
		tmp = t_0
	elif z <= -3.6e+192:
		tmp = t_1
	elif z <= -0.039:
		tmp = t_0
	elif z <= -3.8e-230:
		tmp = x * -3.0
	elif z <= 1.4e-204:
		tmp = y * 4.0
	elif z <= 1e-92:
		tmp = x * -3.0
	elif z <= 0.56:
		tmp = y * 4.0
	elif z <= 2.9e+114:
		tmp = t_1
	elif z <= 6.2e+249:
		tmp = t_0
	else:
		tmp = x * (z * 6.0)
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(z * y))
	t_1 = Float64(6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -1e+225)
		tmp = t_0;
	elseif (z <= -3.6e+192)
		tmp = t_1;
	elseif (z <= -0.039)
		tmp = t_0;
	elseif (z <= -3.8e-230)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.4e-204)
		tmp = Float64(y * 4.0);
	elseif (z <= 1e-92)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.56)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.9e+114)
		tmp = t_1;
	elseif (z <= 6.2e+249)
		tmp = t_0;
	else
		tmp = Float64(x * Float64(z * 6.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (z * y);
	t_1 = 6.0 * (x * z);
	tmp = 0.0;
	if (z <= -1e+225)
		tmp = t_0;
	elseif (z <= -3.6e+192)
		tmp = t_1;
	elseif (z <= -0.039)
		tmp = t_0;
	elseif (z <= -3.8e-230)
		tmp = x * -3.0;
	elseif (z <= 1.4e-204)
		tmp = y * 4.0;
	elseif (z <= 1e-92)
		tmp = x * -3.0;
	elseif (z <= 0.56)
		tmp = y * 4.0;
	elseif (z <= 2.9e+114)
		tmp = t_1;
	elseif (z <= 6.2e+249)
		tmp = t_0;
	else
		tmp = x * (z * 6.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e+225], t$95$0, If[LessEqual[z, -3.6e+192], t$95$1, If[LessEqual[z, -0.039], t$95$0, If[LessEqual[z, -3.8e-230], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.4e-204], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1e-92], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.56], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.9e+114], t$95$1, If[LessEqual[z, 6.2e+249], t$95$0, N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

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

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

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

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

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

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

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

\mathbf{elif}\;z \leq 2.9 \cdot 10^{+114}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 6.2 \cdot 10^{+249}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -9.99999999999999928e224 or -3.6000000000000002e192 < z < -0.0389999999999999999 or 2.9e114 < z < 6.20000000000000031e249

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999999928e224 < z < -3.6000000000000002e192 or 0.56000000000000005 < z < 2.9e114

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(6, \frac{\left(y - x\right) \cdot \left(0.4444444444444444 - \color{blue}{{z}^{2}}\right)}{0.6666666666666666 + z}, x\right) \]
    5. Applied egg-rr78.0%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{\left(y - x\right) \cdot \left(0.4444444444444444 - {z}^{2}\right)}{0.6666666666666666 + z}}, x\right) \]
    6. Step-by-step derivation
      1. *-commutative78.0%

        \[\leadsto \mathsf{fma}\left(6, \frac{\color{blue}{\left(0.4444444444444444 - {z}^{2}\right) \cdot \left(y - x\right)}}{0.6666666666666666 + z}, x\right) \]
      2. associate-/l*88.4%

        \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
    7. Simplified88.4%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
    8. Taylor expanded in z around inf 98.6%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{-1 \cdot \left(z \cdot \left(y - x\right)\right)}, x\right) \]
    9. Step-by-step derivation
      1. mul-1-neg98.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0389999999999999999 < z < -3.7999999999999998e-230 or 1.4e-204 < z < 9.99999999999999988e-93

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.7999999999999998e-230 < z < 1.4e-204 or 9.99999999999999988e-93 < z < 0.56000000000000005

    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. distribute-rgt-neg-out99.8%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{z \cdot \left(-6\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, 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 63.1%

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

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

    if 6.20000000000000031e249 < z

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+225}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{+192}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -0.039:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-230}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-204}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 10^{-92}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.56:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+114}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+249}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \]

Alternative 5: 51.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot y\right)\\ t_1 := 6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -8.5 \cdot 10^{+225}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{+202}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.5:\\ \;\;\;\;y \cdot \left(-6 \cdot z\right)\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{-227}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-204}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-91}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+114}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 6.7 \cdot 10^{+242}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* z y))) (t_1 (* 6.0 (* x z))))
   (if (<= z -8.5e+225)
     t_0
     (if (<= z -2.7e+202)
       t_1
       (if (<= z -4.5)
         (* y (* -6.0 z))
         (if (<= z -7.8e-227)
           (* x -3.0)
           (if (<= z 2.5e-204)
             (* y 4.0)
             (if (<= z 1.2e-91)
               (* x -3.0)
               (if (<= z 0.5)
                 (* y 4.0)
                 (if (<= z 5e+114)
                   t_1
                   (if (<= z 6.7e+242) t_0 (* x (* z 6.0)))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -8.5e+225) {
		tmp = t_0;
	} else if (z <= -2.7e+202) {
		tmp = t_1;
	} else if (z <= -4.5) {
		tmp = y * (-6.0 * z);
	} else if (z <= -7.8e-227) {
		tmp = x * -3.0;
	} else if (z <= 2.5e-204) {
		tmp = y * 4.0;
	} else if (z <= 1.2e-91) {
		tmp = x * -3.0;
	} else if (z <= 0.5) {
		tmp = y * 4.0;
	} else if (z <= 5e+114) {
		tmp = t_1;
	} else if (z <= 6.7e+242) {
		tmp = t_0;
	} else {
		tmp = x * (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) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (-6.0d0) * (z * y)
    t_1 = 6.0d0 * (x * z)
    if (z <= (-8.5d+225)) then
        tmp = t_0
    else if (z <= (-2.7d+202)) then
        tmp = t_1
    else if (z <= (-4.5d0)) then
        tmp = y * ((-6.0d0) * z)
    else if (z <= (-7.8d-227)) then
        tmp = x * (-3.0d0)
    else if (z <= 2.5d-204) then
        tmp = y * 4.0d0
    else if (z <= 1.2d-91) then
        tmp = x * (-3.0d0)
    else if (z <= 0.5d0) then
        tmp = y * 4.0d0
    else if (z <= 5d+114) then
        tmp = t_1
    else if (z <= 6.7d+242) then
        tmp = t_0
    else
        tmp = x * (z * 6.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -8.5e+225) {
		tmp = t_0;
	} else if (z <= -2.7e+202) {
		tmp = t_1;
	} else if (z <= -4.5) {
		tmp = y * (-6.0 * z);
	} else if (z <= -7.8e-227) {
		tmp = x * -3.0;
	} else if (z <= 2.5e-204) {
		tmp = y * 4.0;
	} else if (z <= 1.2e-91) {
		tmp = x * -3.0;
	} else if (z <= 0.5) {
		tmp = y * 4.0;
	} else if (z <= 5e+114) {
		tmp = t_1;
	} else if (z <= 6.7e+242) {
		tmp = t_0;
	} else {
		tmp = x * (z * 6.0);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (z * y)
	t_1 = 6.0 * (x * z)
	tmp = 0
	if z <= -8.5e+225:
		tmp = t_0
	elif z <= -2.7e+202:
		tmp = t_1
	elif z <= -4.5:
		tmp = y * (-6.0 * z)
	elif z <= -7.8e-227:
		tmp = x * -3.0
	elif z <= 2.5e-204:
		tmp = y * 4.0
	elif z <= 1.2e-91:
		tmp = x * -3.0
	elif z <= 0.5:
		tmp = y * 4.0
	elif z <= 5e+114:
		tmp = t_1
	elif z <= 6.7e+242:
		tmp = t_0
	else:
		tmp = x * (z * 6.0)
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(z * y))
	t_1 = Float64(6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -8.5e+225)
		tmp = t_0;
	elseif (z <= -2.7e+202)
		tmp = t_1;
	elseif (z <= -4.5)
		tmp = Float64(y * Float64(-6.0 * z));
	elseif (z <= -7.8e-227)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.5e-204)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.2e-91)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.5)
		tmp = Float64(y * 4.0);
	elseif (z <= 5e+114)
		tmp = t_1;
	elseif (z <= 6.7e+242)
		tmp = t_0;
	else
		tmp = Float64(x * Float64(z * 6.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (z * y);
	t_1 = 6.0 * (x * z);
	tmp = 0.0;
	if (z <= -8.5e+225)
		tmp = t_0;
	elseif (z <= -2.7e+202)
		tmp = t_1;
	elseif (z <= -4.5)
		tmp = y * (-6.0 * z);
	elseif (z <= -7.8e-227)
		tmp = x * -3.0;
	elseif (z <= 2.5e-204)
		tmp = y * 4.0;
	elseif (z <= 1.2e-91)
		tmp = x * -3.0;
	elseif (z <= 0.5)
		tmp = y * 4.0;
	elseif (z <= 5e+114)
		tmp = t_1;
	elseif (z <= 6.7e+242)
		tmp = t_0;
	else
		tmp = x * (z * 6.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e+225], t$95$0, If[LessEqual[z, -2.7e+202], t$95$1, If[LessEqual[z, -4.5], N[(y * N[(-6.0 * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.8e-227], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.5e-204], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.2e-91], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5e+114], t$95$1, If[LessEqual[z, 6.7e+242], t$95$0, N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.7 \cdot 10^{+202}:\\
\;\;\;\;t_1\\

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

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

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

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

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

\mathbf{elif}\;z \leq 5 \cdot 10^{+114}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 6.7 \cdot 10^{+242}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -8.49999999999999947e225 or 5.0000000000000001e114 < z < 6.7e242

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.49999999999999947e225 < z < -2.69999999999999995e202 or 0.5 < z < 5.0000000000000001e114

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(6, \frac{\left(y - x\right) \cdot \left(0.4444444444444444 - \color{blue}{{z}^{2}}\right)}{0.6666666666666666 + z}, x\right) \]
    5. Applied egg-rr78.0%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{\left(y - x\right) \cdot \left(0.4444444444444444 - {z}^{2}\right)}{0.6666666666666666 + z}}, x\right) \]
    6. Step-by-step derivation
      1. *-commutative78.0%

        \[\leadsto \mathsf{fma}\left(6, \frac{\color{blue}{\left(0.4444444444444444 - {z}^{2}\right) \cdot \left(y - x\right)}}{0.6666666666666666 + z}, x\right) \]
      2. associate-/l*88.4%

        \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
    7. Simplified88.4%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
    8. Taylor expanded in z around inf 98.6%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{-1 \cdot \left(z \cdot \left(y - x\right)\right)}, x\right) \]
    9. Step-by-step derivation
      1. mul-1-neg98.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.69999999999999995e202 < z < -4.5

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.5 < z < -7.7999999999999999e-227 or 2.5000000000000001e-204 < z < 1.20000000000000005e-91

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.7999999999999999e-227 < z < 2.5000000000000001e-204 or 1.20000000000000005e-91 < z < 0.5

    1. Initial program 99.5%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. +-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. distribute-rgt-neg-out99.8%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{z \cdot \left(-6\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, 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 63.1%

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

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

    if 6.7e242 < z

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+225}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{+202}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -4.5:\\ \;\;\;\;y \cdot \left(-6 \cdot z\right)\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{-227}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-204}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-91}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+114}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq 6.7 \cdot 10^{+242}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \]

Alternative 6: 51.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(-6 \cdot y\right)\\ t_1 := 6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -4.9 \cdot 10^{+225}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{+205}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -26.5:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-231}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-205}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-91}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.62:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+114}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+250}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (* -6.0 y))) (t_1 (* 6.0 (* x z))))
   (if (<= z -4.9e+225)
     (* -6.0 (* z y))
     (if (<= z -3.1e+205)
       t_1
       (if (<= z -26.5)
         t_0
         (if (<= z -7.5e-231)
           (* x -3.0)
           (if (<= z 2.5e-205)
             (* y 4.0)
             (if (<= z 1.25e-91)
               (* x -3.0)
               (if (<= z 0.62)
                 (* y 4.0)
                 (if (<= z 2.6e+114)
                   t_1
                   (if (<= z 1.25e+250) t_0 (* x (* z 6.0)))))))))))))
double code(double x, double y, double z) {
	double t_0 = z * (-6.0 * y);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -4.9e+225) {
		tmp = -6.0 * (z * y);
	} else if (z <= -3.1e+205) {
		tmp = t_1;
	} else if (z <= -26.5) {
		tmp = t_0;
	} else if (z <= -7.5e-231) {
		tmp = x * -3.0;
	} else if (z <= 2.5e-205) {
		tmp = y * 4.0;
	} else if (z <= 1.25e-91) {
		tmp = x * -3.0;
	} else if (z <= 0.62) {
		tmp = y * 4.0;
	} else if (z <= 2.6e+114) {
		tmp = t_1;
	} else if (z <= 1.25e+250) {
		tmp = t_0;
	} else {
		tmp = x * (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) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = z * ((-6.0d0) * y)
    t_1 = 6.0d0 * (x * z)
    if (z <= (-4.9d+225)) then
        tmp = (-6.0d0) * (z * y)
    else if (z <= (-3.1d+205)) then
        tmp = t_1
    else if (z <= (-26.5d0)) then
        tmp = t_0
    else if (z <= (-7.5d-231)) then
        tmp = x * (-3.0d0)
    else if (z <= 2.5d-205) then
        tmp = y * 4.0d0
    else if (z <= 1.25d-91) then
        tmp = x * (-3.0d0)
    else if (z <= 0.62d0) then
        tmp = y * 4.0d0
    else if (z <= 2.6d+114) then
        tmp = t_1
    else if (z <= 1.25d+250) then
        tmp = t_0
    else
        tmp = x * (z * 6.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = z * (-6.0 * y);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -4.9e+225) {
		tmp = -6.0 * (z * y);
	} else if (z <= -3.1e+205) {
		tmp = t_1;
	} else if (z <= -26.5) {
		tmp = t_0;
	} else if (z <= -7.5e-231) {
		tmp = x * -3.0;
	} else if (z <= 2.5e-205) {
		tmp = y * 4.0;
	} else if (z <= 1.25e-91) {
		tmp = x * -3.0;
	} else if (z <= 0.62) {
		tmp = y * 4.0;
	} else if (z <= 2.6e+114) {
		tmp = t_1;
	} else if (z <= 1.25e+250) {
		tmp = t_0;
	} else {
		tmp = x * (z * 6.0);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * (-6.0 * y)
	t_1 = 6.0 * (x * z)
	tmp = 0
	if z <= -4.9e+225:
		tmp = -6.0 * (z * y)
	elif z <= -3.1e+205:
		tmp = t_1
	elif z <= -26.5:
		tmp = t_0
	elif z <= -7.5e-231:
		tmp = x * -3.0
	elif z <= 2.5e-205:
		tmp = y * 4.0
	elif z <= 1.25e-91:
		tmp = x * -3.0
	elif z <= 0.62:
		tmp = y * 4.0
	elif z <= 2.6e+114:
		tmp = t_1
	elif z <= 1.25e+250:
		tmp = t_0
	else:
		tmp = x * (z * 6.0)
	return tmp
function code(x, y, z)
	t_0 = Float64(z * Float64(-6.0 * y))
	t_1 = Float64(6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -4.9e+225)
		tmp = Float64(-6.0 * Float64(z * y));
	elseif (z <= -3.1e+205)
		tmp = t_1;
	elseif (z <= -26.5)
		tmp = t_0;
	elseif (z <= -7.5e-231)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.5e-205)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.25e-91)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.62)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.6e+114)
		tmp = t_1;
	elseif (z <= 1.25e+250)
		tmp = t_0;
	else
		tmp = Float64(x * Float64(z * 6.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * (-6.0 * y);
	t_1 = 6.0 * (x * z);
	tmp = 0.0;
	if (z <= -4.9e+225)
		tmp = -6.0 * (z * y);
	elseif (z <= -3.1e+205)
		tmp = t_1;
	elseif (z <= -26.5)
		tmp = t_0;
	elseif (z <= -7.5e-231)
		tmp = x * -3.0;
	elseif (z <= 2.5e-205)
		tmp = y * 4.0;
	elseif (z <= 1.25e-91)
		tmp = x * -3.0;
	elseif (z <= 0.62)
		tmp = y * 4.0;
	elseif (z <= 2.6e+114)
		tmp = t_1;
	elseif (z <= 1.25e+250)
		tmp = t_0;
	else
		tmp = x * (z * 6.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(-6.0 * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.9e+225], N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.1e+205], t$95$1, If[LessEqual[z, -26.5], t$95$0, If[LessEqual[z, -7.5e-231], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.5e-205], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.25e-91], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.62], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.6e+114], t$95$1, If[LessEqual[z, 1.25e+250], t$95$0, N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -3.1 \cdot 10^{+205}:\\
\;\;\;\;t_1\\

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

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

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

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

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

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

\mathbf{elif}\;z \leq 1.25 \cdot 10^{+250}:\\
\;\;\;\;t_0\\

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.90000000000000032e225 < z < -3.10000000000000017e205 or 0.619999999999999996 < z < 2.6e114

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(6, \frac{\left(y - x\right) \cdot \left(0.4444444444444444 - \color{blue}{{z}^{2}}\right)}{0.6666666666666666 + z}, x\right) \]
    5. Applied egg-rr78.0%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{\left(y - x\right) \cdot \left(0.4444444444444444 - {z}^{2}\right)}{0.6666666666666666 + z}}, x\right) \]
    6. Step-by-step derivation
      1. *-commutative78.0%

        \[\leadsto \mathsf{fma}\left(6, \frac{\color{blue}{\left(0.4444444444444444 - {z}^{2}\right) \cdot \left(y - x\right)}}{0.6666666666666666 + z}, x\right) \]
      2. associate-/l*88.4%

        \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
    7. Simplified88.4%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
    8. Taylor expanded in z around inf 98.6%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{-1 \cdot \left(z \cdot \left(y - x\right)\right)}, x\right) \]
    9. Step-by-step derivation
      1. mul-1-neg98.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.10000000000000017e205 < z < -26.5 or 2.6e114 < z < 1.2500000000000001e250

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(6, \frac{\left(y - x\right) \cdot \left(0.4444444444444444 - \color{blue}{{z}^{2}}\right)}{0.6666666666666666 + z}, x\right) \]
    5. Applied egg-rr67.7%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{\left(y - x\right) \cdot \left(0.4444444444444444 - {z}^{2}\right)}{0.6666666666666666 + z}}, x\right) \]
    6. Step-by-step derivation
      1. *-commutative67.7%

        \[\leadsto \mathsf{fma}\left(6, \frac{\color{blue}{\left(0.4444444444444444 - {z}^{2}\right) \cdot \left(y - x\right)}}{0.6666666666666666 + z}, x\right) \]
      2. associate-/l*80.6%

        \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
    7. Simplified80.6%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
    8. Taylor expanded in z around inf 95.7%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{-1 \cdot \left(z \cdot \left(y - x\right)\right)}, x\right) \]
    9. Step-by-step derivation
      1. mul-1-neg95.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -26.5 < z < -7.5000000000000001e-231 or 2.5e-205 < z < 1.24999999999999999e-91

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.5000000000000001e-231 < z < 2.5e-205 or 1.24999999999999999e-91 < z < 0.619999999999999996

    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. distribute-rgt-neg-out99.8%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{z \cdot \left(-6\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, 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 63.1%

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

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

    if 1.2500000000000001e250 < z

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.9 \cdot 10^{+225}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{+205}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -26.5:\\ \;\;\;\;z \cdot \left(-6 \cdot y\right)\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-231}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-205}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-91}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.62:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+114}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+250}:\\ \;\;\;\;z \cdot \left(-6 \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \]

Alternative 7: 73.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{if}\;z \leq -0.024:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-226}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.76 \cdot 10^{-205}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-93}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.56:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* z (- y x)))))
   (if (<= z -0.024)
     t_0
     (if (<= z -2.6e-226)
       (* x -3.0)
       (if (<= z 1.76e-205)
         (* y 4.0)
         (if (<= z 7e-93) (* x -3.0) (if (<= z 0.56) (* y 4.0) t_0)))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * (y - x));
	double tmp;
	if (z <= -0.024) {
		tmp = t_0;
	} else if (z <= -2.6e-226) {
		tmp = x * -3.0;
	} else if (z <= 1.76e-205) {
		tmp = y * 4.0;
	} else if (z <= 7e-93) {
		tmp = x * -3.0;
	} else if (z <= 0.56) {
		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) * (z * (y - x))
    if (z <= (-0.024d0)) then
        tmp = t_0
    else if (z <= (-2.6d-226)) then
        tmp = x * (-3.0d0)
    else if (z <= 1.76d-205) then
        tmp = y * 4.0d0
    else if (z <= 7d-93) then
        tmp = x * (-3.0d0)
    else if (z <= 0.56d0) 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 * (z * (y - x));
	double tmp;
	if (z <= -0.024) {
		tmp = t_0;
	} else if (z <= -2.6e-226) {
		tmp = x * -3.0;
	} else if (z <= 1.76e-205) {
		tmp = y * 4.0;
	} else if (z <= 7e-93) {
		tmp = x * -3.0;
	} else if (z <= 0.56) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (z * (y - x))
	tmp = 0
	if z <= -0.024:
		tmp = t_0
	elif z <= -2.6e-226:
		tmp = x * -3.0
	elif z <= 1.76e-205:
		tmp = y * 4.0
	elif z <= 7e-93:
		tmp = x * -3.0
	elif z <= 0.56:
		tmp = y * 4.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(z * Float64(y - x)))
	tmp = 0.0
	if (z <= -0.024)
		tmp = t_0;
	elseif (z <= -2.6e-226)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.76e-205)
		tmp = Float64(y * 4.0);
	elseif (z <= 7e-93)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.56)
		tmp = Float64(y * 4.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (z * (y - x));
	tmp = 0.0;
	if (z <= -0.024)
		tmp = t_0;
	elseif (z <= -2.6e-226)
		tmp = x * -3.0;
	elseif (z <= 1.76e-205)
		tmp = y * 4.0;
	elseif (z <= 7e-93)
		tmp = x * -3.0;
	elseif (z <= 0.56)
		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[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.024], t$95$0, If[LessEqual[z, -2.6e-226], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.76e-205], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7e-93], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.56], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -0.024 or 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. Step-by-step derivation
      1. +-commutative99.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(6, \frac{\left(y - x\right) \cdot \left(0.4444444444444444 - \color{blue}{{z}^{2}}\right)}{0.6666666666666666 + z}, x\right) \]
    5. Applied egg-rr70.7%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{\left(y - x\right) \cdot \left(0.4444444444444444 - {z}^{2}\right)}{0.6666666666666666 + z}}, x\right) \]
    6. Step-by-step derivation
      1. *-commutative70.7%

        \[\leadsto \mathsf{fma}\left(6, \frac{\color{blue}{\left(0.4444444444444444 - {z}^{2}\right) \cdot \left(y - x\right)}}{0.6666666666666666 + z}, x\right) \]
      2. associate-/l*79.8%

        \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
    7. Simplified79.8%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
    8. Taylor expanded in z around inf 97.4%

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

    if -0.024 < z < -2.5999999999999998e-226 or 1.7599999999999999e-205 < z < 7e-93

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5999999999999998e-226 < z < 1.7599999999999999e-205 or 7e-93 < z < 0.56000000000000005

    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. distribute-rgt-neg-out99.8%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{z \cdot \left(-6\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, 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 63.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.024:\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-226}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.76 \cdot 10^{-205}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-93}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.56:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \end{array} \]

Alternative 8: 73.5% accurate, 0.8× speedup?

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -0.00220000000000000013 or 3.2e10 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(6, \frac{\left(y - x\right) \cdot \left(0.4444444444444444 - \color{blue}{{z}^{2}}\right)}{0.6666666666666666 + z}, x\right) \]
    5. Applied egg-rr70.5%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{\left(y - x\right) \cdot \left(0.4444444444444444 - {z}^{2}\right)}{0.6666666666666666 + z}}, x\right) \]
    6. Step-by-step derivation
      1. *-commutative70.5%

        \[\leadsto \mathsf{fma}\left(6, \frac{\color{blue}{\left(0.4444444444444444 - {z}^{2}\right) \cdot \left(y - x\right)}}{0.6666666666666666 + z}, x\right) \]
      2. associate-/l*79.6%

        \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
    7. Simplified79.6%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
    8. Taylor expanded in z around inf 97.5%

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

    if -0.00220000000000000013 < z < -4.70000000000000014e-225 or 9.6000000000000007e-205 < z < 4.8000000000000002e-93

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.70000000000000014e-225 < z < 9.6000000000000007e-205

    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. distribute-rgt-neg-out99.8%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{z \cdot \left(-6\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, 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 63.3%

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

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

    if 4.8000000000000002e-93 < z < 3.2e10

    1. Initial program 99.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.0022:\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{elif}\;z \leq -4.7 \cdot 10^{-225}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 9.6 \cdot 10^{-205}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-93}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 32000000000:\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \end{array} \]

Alternative 9: 50.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot y\right)\\ \mathbf{if}\;z \leq -0.49:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-222}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-205}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-92}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.05:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* z y))))
   (if (<= z -0.49)
     t_0
     (if (<= z -3e-222)
       (* x -3.0)
       (if (<= z 1.25e-205)
         (* y 4.0)
         (if (<= z 1.3e-92) (* x -3.0) (if (<= z 0.05) (* y 4.0) t_0)))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double tmp;
	if (z <= -0.49) {
		tmp = t_0;
	} else if (z <= -3e-222) {
		tmp = x * -3.0;
	} else if (z <= 1.25e-205) {
		tmp = y * 4.0;
	} else if (z <= 1.3e-92) {
		tmp = x * -3.0;
	} else if (z <= 0.05) {
		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) * (z * y)
    if (z <= (-0.49d0)) then
        tmp = t_0
    else if (z <= (-3d-222)) then
        tmp = x * (-3.0d0)
    else if (z <= 1.25d-205) then
        tmp = y * 4.0d0
    else if (z <= 1.3d-92) then
        tmp = x * (-3.0d0)
    else if (z <= 0.05d0) 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 * (z * y);
	double tmp;
	if (z <= -0.49) {
		tmp = t_0;
	} else if (z <= -3e-222) {
		tmp = x * -3.0;
	} else if (z <= 1.25e-205) {
		tmp = y * 4.0;
	} else if (z <= 1.3e-92) {
		tmp = x * -3.0;
	} else if (z <= 0.05) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (z * y)
	tmp = 0
	if z <= -0.49:
		tmp = t_0
	elif z <= -3e-222:
		tmp = x * -3.0
	elif z <= 1.25e-205:
		tmp = y * 4.0
	elif z <= 1.3e-92:
		tmp = x * -3.0
	elif z <= 0.05:
		tmp = y * 4.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(z * y))
	tmp = 0.0
	if (z <= -0.49)
		tmp = t_0;
	elseif (z <= -3e-222)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.25e-205)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.3e-92)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.05)
		tmp = Float64(y * 4.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (z * y);
	tmp = 0.0;
	if (z <= -0.49)
		tmp = t_0;
	elseif (z <= -3e-222)
		tmp = x * -3.0;
	elseif (z <= 1.25e-205)
		tmp = y * 4.0;
	elseif (z <= 1.3e-92)
		tmp = x * -3.0;
	elseif (z <= 0.05)
		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[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.49], t$95$0, If[LessEqual[z, -3e-222], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.25e-205], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.3e-92], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.05], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}

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

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

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

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.48999999999999999 < z < -3.0000000000000003e-222 or 1.25e-205 < z < 1.3e-92

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.0000000000000003e-222 < z < 1.25e-205 or 1.3e-92 < z < 0.050000000000000003

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.49:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-222}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-205}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-92}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.05:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \end{array} \]

Alternative 10: 75.8% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+19} \lor \neg \left(y \leq 2.8 \cdot 10^{-49}\right):\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.1e19 or 2.79999999999999997e-49 < y

    1. Initial program 99.7%

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

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

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

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

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

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

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

    if -2.1e19 < y < 2.79999999999999997e-49

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 75.8% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.15e18 or 3.29999999999999973e-51 < y

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
      5. +-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. distribute-rgt-neg-out99.8%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{z \cdot \left(-6\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, 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 83.1%

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

    if -2.15e18 < y < 3.29999999999999973e-51

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 97.7% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.6 \lor \neg \left(z \leq 0.6\right):\\
\;\;\;\;z \cdot \left(6 \cdot \left(x - y\right)\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.599999999999999978 or 0.599999999999999978 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(6, \frac{\left(y - x\right) \cdot \left(0.4444444444444444 - \color{blue}{{z}^{2}}\right)}{0.6666666666666666 + z}, x\right) \]
    5. Applied egg-rr70.7%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{\left(y - x\right) \cdot \left(0.4444444444444444 - {z}^{2}\right)}{0.6666666666666666 + z}}, x\right) \]
    6. Step-by-step derivation
      1. *-commutative70.7%

        \[\leadsto \mathsf{fma}\left(6, \frac{\color{blue}{\left(0.4444444444444444 - {z}^{2}\right) \cdot \left(y - x\right)}}{0.6666666666666666 + z}, x\right) \]
      2. associate-/l*79.8%

        \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
    7. Simplified79.8%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
    8. Taylor expanded in z around inf 97.4%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{-1 \cdot \left(z \cdot \left(y - x\right)\right)}, x\right) \]
    9. Step-by-step derivation
      1. mul-1-neg97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.599999999999999978 < z < 0.599999999999999978

    1. Initial program 99.4%

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

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

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

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

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

Alternative 13: 97.7% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(6, \frac{\left(y - x\right) \cdot \left(0.4444444444444444 - \color{blue}{{z}^{2}}\right)}{0.6666666666666666 + z}, x\right) \]
    5. Applied egg-rr70.7%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{\left(y - x\right) \cdot \left(0.4444444444444444 - {z}^{2}\right)}{0.6666666666666666 + z}}, x\right) \]
    6. Step-by-step derivation
      1. *-commutative70.7%

        \[\leadsto \mathsf{fma}\left(6, \frac{\color{blue}{\left(0.4444444444444444 - {z}^{2}\right) \cdot \left(y - x\right)}}{0.6666666666666666 + z}, x\right) \]
      2. associate-/l*79.8%

        \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
    7. Simplified79.8%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
    8. Taylor expanded in z around inf 97.4%

      \[\leadsto \mathsf{fma}\left(6, \color{blue}{-1 \cdot \left(z \cdot \left(y - x\right)\right)}, x\right) \]
    9. Step-by-step derivation
      1. mul-1-neg97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.57999999999999996 < z < 0.52000000000000002

    1. Initial program 99.4%

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

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

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

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

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

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

Alternative 14: 99.5% accurate, 1.2× speedup?

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

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

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

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

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

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

Alternative 15: 38.7% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -11000000000 \lor \neg \left(x \leq 5.4 \cdot 10^{-37}\right):\\
\;\;\;\;x \cdot -3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.1e10 or 5.40000000000000032e-37 < x

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1e10 < x < 5.40000000000000032e-37

    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. distribute-rgt-neg-out99.8%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{z \cdot \left(-6\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, 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 78.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -11000000000 \lor \neg \left(x \leq 5.4 \cdot 10^{-37}\right):\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;y \cdot 4\\ \end{array} \]

Alternative 16: 26.6% 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. Step-by-step derivation
    1. metadata-eval99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto x \cdot -3 \]

Alternative 17: 2.6% accurate, 13.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 99.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. *-commutative99.6%

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(6, \frac{\left(y - x\right) \cdot \left(0.4444444444444444 - \color{blue}{{z}^{2}}\right)}{0.6666666666666666 + z}, x\right) \]
  5. Applied egg-rr84.3%

    \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{\left(y - x\right) \cdot \left(0.4444444444444444 - {z}^{2}\right)}{0.6666666666666666 + z}}, x\right) \]
  6. Step-by-step derivation
    1. *-commutative84.3%

      \[\leadsto \mathsf{fma}\left(6, \frac{\color{blue}{\left(0.4444444444444444 - {z}^{2}\right) \cdot \left(y - x\right)}}{0.6666666666666666 + z}, x\right) \]
    2. associate-/l*89.1%

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

    \[\leadsto \mathsf{fma}\left(6, \color{blue}{\frac{0.4444444444444444 - {z}^{2}}{\frac{0.6666666666666666 + z}{y - x}}}, x\right) \]
  8. Taylor expanded in z around inf 52.3%

    \[\leadsto \mathsf{fma}\left(6, \color{blue}{-1 \cdot \left(z \cdot \left(y - x\right)\right)}, x\right) \]
  9. Step-by-step derivation
    1. mul-1-neg52.3%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  12. Final simplification2.5%

    \[\leadsto x \]

Reproduce

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