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

Percentage Accurate: 99.5% → 99.7%
Time: 13.6s
Alternatives: 16
Speedup: 1.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 99.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.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.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. metadata-eval99.8%

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

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

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

Alternative 2: 50.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ t_1 := 6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -5.8 \cdot 10^{+213}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -0.5:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-68}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -2.25 \cdot 10^{-268}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-86}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-53}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+106} \lor \neg \left(z \leq 6.2 \cdot 10^{+204}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))) (t_1 (* 6.0 (* x z))))
   (if (<= z -5.8e+213)
     t_0
     (if (<= z -0.5)
       t_1
       (if (<= z -8e-68)
         (* x -3.0)
         (if (<= z -2.25e-268)
           (* y 4.0)
           (if (<= z 7.2e-86)
             (* x -3.0)
             (if (<= z 1.02e-53)
               (* y 4.0)
               (if (<= z 0.5)
                 (* x -3.0)
                 (if (or (<= z 2.6e+106) (not (<= z 6.2e+204)))
                   t_1
                   t_0))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -5.8e+213) {
		tmp = t_0;
	} else if (z <= -0.5) {
		tmp = t_1;
	} else if (z <= -8e-68) {
		tmp = x * -3.0;
	} else if (z <= -2.25e-268) {
		tmp = y * 4.0;
	} else if (z <= 7.2e-86) {
		tmp = x * -3.0;
	} else if (z <= 1.02e-53) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if ((z <= 2.6e+106) || !(z <= 6.2e+204)) {
		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) * (y * z)
    t_1 = 6.0d0 * (x * z)
    if (z <= (-5.8d+213)) then
        tmp = t_0
    else if (z <= (-0.5d0)) then
        tmp = t_1
    else if (z <= (-8d-68)) then
        tmp = x * (-3.0d0)
    else if (z <= (-2.25d-268)) then
        tmp = y * 4.0d0
    else if (z <= 7.2d-86) then
        tmp = x * (-3.0d0)
    else if (z <= 1.02d-53) then
        tmp = y * 4.0d0
    else if (z <= 0.5d0) then
        tmp = x * (-3.0d0)
    else if ((z <= 2.6d+106) .or. (.not. (z <= 6.2d+204))) 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 * (y * z);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -5.8e+213) {
		tmp = t_0;
	} else if (z <= -0.5) {
		tmp = t_1;
	} else if (z <= -8e-68) {
		tmp = x * -3.0;
	} else if (z <= -2.25e-268) {
		tmp = y * 4.0;
	} else if (z <= 7.2e-86) {
		tmp = x * -3.0;
	} else if (z <= 1.02e-53) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if ((z <= 2.6e+106) || !(z <= 6.2e+204)) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	t_1 = 6.0 * (x * z)
	tmp = 0
	if z <= -5.8e+213:
		tmp = t_0
	elif z <= -0.5:
		tmp = t_1
	elif z <= -8e-68:
		tmp = x * -3.0
	elif z <= -2.25e-268:
		tmp = y * 4.0
	elif z <= 7.2e-86:
		tmp = x * -3.0
	elif z <= 1.02e-53:
		tmp = y * 4.0
	elif z <= 0.5:
		tmp = x * -3.0
	elif (z <= 2.6e+106) or not (z <= 6.2e+204):
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	t_1 = Float64(6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -5.8e+213)
		tmp = t_0;
	elseif (z <= -0.5)
		tmp = t_1;
	elseif (z <= -8e-68)
		tmp = Float64(x * -3.0);
	elseif (z <= -2.25e-268)
		tmp = Float64(y * 4.0);
	elseif (z <= 7.2e-86)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.02e-53)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.5)
		tmp = Float64(x * -3.0);
	elseif ((z <= 2.6e+106) || !(z <= 6.2e+204))
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	t_1 = 6.0 * (x * z);
	tmp = 0.0;
	if (z <= -5.8e+213)
		tmp = t_0;
	elseif (z <= -0.5)
		tmp = t_1;
	elseif (z <= -8e-68)
		tmp = x * -3.0;
	elseif (z <= -2.25e-268)
		tmp = y * 4.0;
	elseif (z <= 7.2e-86)
		tmp = x * -3.0;
	elseif (z <= 1.02e-53)
		tmp = y * 4.0;
	elseif (z <= 0.5)
		tmp = x * -3.0;
	elseif ((z <= 2.6e+106) || ~((z <= 6.2e+204)))
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.8e+213], t$95$0, If[LessEqual[z, -0.5], t$95$1, If[LessEqual[z, -8e-68], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.25e-268], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7.2e-86], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.02e-53], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[Or[LessEqual[z, 2.6e+106], N[Not[LessEqual[z, 6.2e+204]], $MachinePrecision]], t$95$1, t$95$0]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -0.5:\\
\;\;\;\;t_1\\

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

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

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

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

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

\mathbf{elif}\;z \leq 2.6 \cdot 10^{+106} \lor \neg \left(z \leq 6.2 \cdot 10^{+204}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.8000000000000006e213 or 2.6000000000000002e106 < z < 6.2000000000000003e204

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.8000000000000006e213 < z < -0.5 or 0.5 < z < 2.6000000000000002e106 or 6.2000000000000003e204 < z

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, -3, x \cdot \left(z \cdot 6\right)\right)} \]
    8. Applied egg-rr67.7%

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

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

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

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

        \[\leadsto \frac{\left(x \cdot -3\right) \cdot \left(x \cdot -3\right) - {\left(x \cdot \color{blue}{\left(6 \cdot z\right)}\right)}^{2}}{x \cdot -3 - x \cdot \left(z \cdot 6\right)} \]
      5. *-commutative24.3%

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

      \[\leadsto \color{blue}{\frac{\left(x \cdot -3\right) \cdot \left(x \cdot -3\right) - {\left(x \cdot \left(6 \cdot z\right)\right)}^{2}}{x \cdot -3 - x \cdot \left(6 \cdot z\right)}} \]
    11. Step-by-step derivation
      1. swap-sqr24.3%

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

        \[\leadsto \frac{\left(x \cdot x\right) \cdot \color{blue}{9} - {\left(x \cdot \left(6 \cdot z\right)\right)}^{2}}{x \cdot -3 - x \cdot \left(6 \cdot z\right)} \]
      3. *-commutative24.3%

        \[\leadsto \frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \color{blue}{\left(z \cdot 6\right)}\right)}^{2}}{x \cdot -3 - x \cdot \left(6 \cdot z\right)} \]
      4. distribute-lft-out--24.3%

        \[\leadsto \frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \left(z \cdot 6\right)\right)}^{2}}{\color{blue}{x \cdot \left(-3 - 6 \cdot z\right)}} \]
      5. *-commutative24.3%

        \[\leadsto \frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \left(z \cdot 6\right)\right)}^{2}}{x \cdot \left(-3 - \color{blue}{z \cdot 6}\right)} \]
    12. Simplified24.3%

      \[\leadsto \color{blue}{\frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \left(z \cdot 6\right)\right)}^{2}}{x \cdot \left(-3 - z \cdot 6\right)}} \]
    13. Taylor expanded in z around inf 65.7%

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

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

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

    if -0.5 < z < -8.00000000000000053e-68 or -2.2500000000000001e-268 < z < 7.19999999999999932e-86 or 1.02000000000000002e-53 < z < 0.5

    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 inf 65.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.00000000000000053e-68 < z < -2.2500000000000001e-268 or 7.19999999999999932e-86 < z < 1.02000000000000002e-53

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+213}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -0.5:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-68}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -2.25 \cdot 10^{-268}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-86}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-53}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+106} \lor \neg \left(z \leq 6.2 \cdot 10^{+204}\right):\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]

Alternative 3: 50.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ t_1 := 6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -6 \cdot 10^{+213}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -0.5:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-66}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-268}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.04 \cdot 10^{-85}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-55}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{+99}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+199}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(6 \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))) (t_1 (* 6.0 (* x z))))
   (if (<= z -6e+213)
     t_0
     (if (<= z -0.5)
       t_1
       (if (<= z -1.3e-66)
         (* x -3.0)
         (if (<= z -1.45e-268)
           (* y 4.0)
           (if (<= z 1.04e-85)
             (* x -3.0)
             (if (<= z 2.5e-55)
               (* y 4.0)
               (if (<= z 0.5)
                 (* x -3.0)
                 (if (<= z 9.2e+99)
                   t_1
                   (if (<= z 4.5e+199) t_0 (* x (* 6.0 z)))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -6e+213) {
		tmp = t_0;
	} else if (z <= -0.5) {
		tmp = t_1;
	} else if (z <= -1.3e-66) {
		tmp = x * -3.0;
	} else if (z <= -1.45e-268) {
		tmp = y * 4.0;
	} else if (z <= 1.04e-85) {
		tmp = x * -3.0;
	} else if (z <= 2.5e-55) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if (z <= 9.2e+99) {
		tmp = t_1;
	} else if (z <= 4.5e+199) {
		tmp = t_0;
	} else {
		tmp = x * (6.0 * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (-6.0d0) * (y * z)
    t_1 = 6.0d0 * (x * z)
    if (z <= (-6d+213)) then
        tmp = t_0
    else if (z <= (-0.5d0)) then
        tmp = t_1
    else if (z <= (-1.3d-66)) then
        tmp = x * (-3.0d0)
    else if (z <= (-1.45d-268)) then
        tmp = y * 4.0d0
    else if (z <= 1.04d-85) then
        tmp = x * (-3.0d0)
    else if (z <= 2.5d-55) then
        tmp = y * 4.0d0
    else if (z <= 0.5d0) then
        tmp = x * (-3.0d0)
    else if (z <= 9.2d+99) then
        tmp = t_1
    else if (z <= 4.5d+199) then
        tmp = t_0
    else
        tmp = x * (6.0d0 * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -6e+213) {
		tmp = t_0;
	} else if (z <= -0.5) {
		tmp = t_1;
	} else if (z <= -1.3e-66) {
		tmp = x * -3.0;
	} else if (z <= -1.45e-268) {
		tmp = y * 4.0;
	} else if (z <= 1.04e-85) {
		tmp = x * -3.0;
	} else if (z <= 2.5e-55) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if (z <= 9.2e+99) {
		tmp = t_1;
	} else if (z <= 4.5e+199) {
		tmp = t_0;
	} else {
		tmp = x * (6.0 * z);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	t_1 = 6.0 * (x * z)
	tmp = 0
	if z <= -6e+213:
		tmp = t_0
	elif z <= -0.5:
		tmp = t_1
	elif z <= -1.3e-66:
		tmp = x * -3.0
	elif z <= -1.45e-268:
		tmp = y * 4.0
	elif z <= 1.04e-85:
		tmp = x * -3.0
	elif z <= 2.5e-55:
		tmp = y * 4.0
	elif z <= 0.5:
		tmp = x * -3.0
	elif z <= 9.2e+99:
		tmp = t_1
	elif z <= 4.5e+199:
		tmp = t_0
	else:
		tmp = x * (6.0 * z)
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	t_1 = Float64(6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -6e+213)
		tmp = t_0;
	elseif (z <= -0.5)
		tmp = t_1;
	elseif (z <= -1.3e-66)
		tmp = Float64(x * -3.0);
	elseif (z <= -1.45e-268)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.04e-85)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.5e-55)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.5)
		tmp = Float64(x * -3.0);
	elseif (z <= 9.2e+99)
		tmp = t_1;
	elseif (z <= 4.5e+199)
		tmp = t_0;
	else
		tmp = Float64(x * Float64(6.0 * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	t_1 = 6.0 * (x * z);
	tmp = 0.0;
	if (z <= -6e+213)
		tmp = t_0;
	elseif (z <= -0.5)
		tmp = t_1;
	elseif (z <= -1.3e-66)
		tmp = x * -3.0;
	elseif (z <= -1.45e-268)
		tmp = y * 4.0;
	elseif (z <= 1.04e-85)
		tmp = x * -3.0;
	elseif (z <= 2.5e-55)
		tmp = y * 4.0;
	elseif (z <= 0.5)
		tmp = x * -3.0;
	elseif (z <= 9.2e+99)
		tmp = t_1;
	elseif (z <= 4.5e+199)
		tmp = t_0;
	else
		tmp = x * (6.0 * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6e+213], t$95$0, If[LessEqual[z, -0.5], t$95$1, If[LessEqual[z, -1.3e-66], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.45e-268], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.04e-85], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.5e-55], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 9.2e+99], t$95$1, If[LessEqual[z, 4.5e+199], t$95$0, N[(x * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -0.5:\\
\;\;\;\;t_1\\

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

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

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

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

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

\mathbf{elif}\;z \leq 9.2 \cdot 10^{+99}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 4.5 \cdot 10^{+199}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -6.0000000000000002e213 or 9.20000000000000077e99 < z < 4.4999999999999997e199

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.0000000000000002e213 < z < -0.5 or 0.5 < z < 9.20000000000000077e99

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, -3, x \cdot \left(z \cdot 6\right)\right)} \]
    8. Applied egg-rr68.8%

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

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

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

        \[\leadsto \frac{\left(x \cdot -3\right) \cdot \left(x \cdot -3\right) - \color{blue}{{\left(x \cdot \left(z \cdot 6\right)\right)}^{2}}}{x \cdot -3 - x \cdot \left(z \cdot 6\right)} \]
      4. *-commutative27.5%

        \[\leadsto \frac{\left(x \cdot -3\right) \cdot \left(x \cdot -3\right) - {\left(x \cdot \color{blue}{\left(6 \cdot z\right)}\right)}^{2}}{x \cdot -3 - x \cdot \left(z \cdot 6\right)} \]
      5. *-commutative27.5%

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

      \[\leadsto \color{blue}{\frac{\left(x \cdot -3\right) \cdot \left(x \cdot -3\right) - {\left(x \cdot \left(6 \cdot z\right)\right)}^{2}}{x \cdot -3 - x \cdot \left(6 \cdot z\right)}} \]
    11. Step-by-step derivation
      1. swap-sqr27.5%

        \[\leadsto \frac{\color{blue}{\left(x \cdot x\right) \cdot \left(-3 \cdot -3\right)} - {\left(x \cdot \left(6 \cdot z\right)\right)}^{2}}{x \cdot -3 - x \cdot \left(6 \cdot z\right)} \]
      2. metadata-eval27.5%

        \[\leadsto \frac{\left(x \cdot x\right) \cdot \color{blue}{9} - {\left(x \cdot \left(6 \cdot z\right)\right)}^{2}}{x \cdot -3 - x \cdot \left(6 \cdot z\right)} \]
      3. *-commutative27.5%

        \[\leadsto \frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \color{blue}{\left(z \cdot 6\right)}\right)}^{2}}{x \cdot -3 - x \cdot \left(6 \cdot z\right)} \]
      4. distribute-lft-out--27.5%

        \[\leadsto \frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \left(z \cdot 6\right)\right)}^{2}}{\color{blue}{x \cdot \left(-3 - 6 \cdot z\right)}} \]
      5. *-commutative27.5%

        \[\leadsto \frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \left(z \cdot 6\right)\right)}^{2}}{x \cdot \left(-3 - \color{blue}{z \cdot 6}\right)} \]
    12. Simplified27.5%

      \[\leadsto \color{blue}{\frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \left(z \cdot 6\right)\right)}^{2}}{x \cdot \left(-3 - z \cdot 6\right)}} \]
    13. Taylor expanded in z around inf 66.2%

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

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

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

    if -0.5 < z < -1.2999999999999999e-66 or -1.4500000000000001e-268 < z < 1.04e-85 or 2.5000000000000001e-55 < z < 0.5

    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 inf 65.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2999999999999999e-66 < z < -1.4500000000000001e-268 or 1.04e-85 < z < 2.5000000000000001e-55

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.4999999999999997e199 < 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 64.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6 \cdot 10^{+213}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -0.5:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-66}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-268}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.04 \cdot 10^{-85}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-55}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{+99}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+199}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(6 \cdot z\right)\\ \end{array} \]

Alternative 4: 50.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -4.5 \cdot 10^{+213}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -0.5:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -8.6 \cdot 10^{-70}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-268}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-87}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-56}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+101}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+199}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(6 \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* 6.0 (* x z))))
   (if (<= z -4.5e+213)
     (* -6.0 (* y z))
     (if (<= z -0.5)
       t_0
       (if (<= z -8.6e-70)
         (* x -3.0)
         (if (<= z -2.2e-268)
           (* y 4.0)
           (if (<= z 1.05e-87)
             (* x -3.0)
             (if (<= z 1.4e-56)
               (* y 4.0)
               (if (<= z 0.5)
                 (* x -3.0)
                 (if (<= z 2.8e+101)
                   t_0
                   (if (<= z 1.7e+199)
                     (* y (* z -6.0))
                     (* x (* 6.0 z)))))))))))))
double code(double x, double y, double z) {
	double t_0 = 6.0 * (x * z);
	double tmp;
	if (z <= -4.5e+213) {
		tmp = -6.0 * (y * z);
	} else if (z <= -0.5) {
		tmp = t_0;
	} else if (z <= -8.6e-70) {
		tmp = x * -3.0;
	} else if (z <= -2.2e-268) {
		tmp = y * 4.0;
	} else if (z <= 1.05e-87) {
		tmp = x * -3.0;
	} else if (z <= 1.4e-56) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if (z <= 2.8e+101) {
		tmp = t_0;
	} else if (z <= 1.7e+199) {
		tmp = y * (z * -6.0);
	} else {
		tmp = x * (6.0 * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 6.0d0 * (x * z)
    if (z <= (-4.5d+213)) then
        tmp = (-6.0d0) * (y * z)
    else if (z <= (-0.5d0)) then
        tmp = t_0
    else if (z <= (-8.6d-70)) then
        tmp = x * (-3.0d0)
    else if (z <= (-2.2d-268)) then
        tmp = y * 4.0d0
    else if (z <= 1.05d-87) then
        tmp = x * (-3.0d0)
    else if (z <= 1.4d-56) then
        tmp = y * 4.0d0
    else if (z <= 0.5d0) then
        tmp = x * (-3.0d0)
    else if (z <= 2.8d+101) then
        tmp = t_0
    else if (z <= 1.7d+199) then
        tmp = y * (z * (-6.0d0))
    else
        tmp = x * (6.0d0 * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 6.0 * (x * z);
	double tmp;
	if (z <= -4.5e+213) {
		tmp = -6.0 * (y * z);
	} else if (z <= -0.5) {
		tmp = t_0;
	} else if (z <= -8.6e-70) {
		tmp = x * -3.0;
	} else if (z <= -2.2e-268) {
		tmp = y * 4.0;
	} else if (z <= 1.05e-87) {
		tmp = x * -3.0;
	} else if (z <= 1.4e-56) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if (z <= 2.8e+101) {
		tmp = t_0;
	} else if (z <= 1.7e+199) {
		tmp = y * (z * -6.0);
	} else {
		tmp = x * (6.0 * z);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 6.0 * (x * z)
	tmp = 0
	if z <= -4.5e+213:
		tmp = -6.0 * (y * z)
	elif z <= -0.5:
		tmp = t_0
	elif z <= -8.6e-70:
		tmp = x * -3.0
	elif z <= -2.2e-268:
		tmp = y * 4.0
	elif z <= 1.05e-87:
		tmp = x * -3.0
	elif z <= 1.4e-56:
		tmp = y * 4.0
	elif z <= 0.5:
		tmp = x * -3.0
	elif z <= 2.8e+101:
		tmp = t_0
	elif z <= 1.7e+199:
		tmp = y * (z * -6.0)
	else:
		tmp = x * (6.0 * z)
	return tmp
function code(x, y, z)
	t_0 = Float64(6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -4.5e+213)
		tmp = Float64(-6.0 * Float64(y * z));
	elseif (z <= -0.5)
		tmp = t_0;
	elseif (z <= -8.6e-70)
		tmp = Float64(x * -3.0);
	elseif (z <= -2.2e-268)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.05e-87)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.4e-56)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.5)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.8e+101)
		tmp = t_0;
	elseif (z <= 1.7e+199)
		tmp = Float64(y * Float64(z * -6.0));
	else
		tmp = Float64(x * Float64(6.0 * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 6.0 * (x * z);
	tmp = 0.0;
	if (z <= -4.5e+213)
		tmp = -6.0 * (y * z);
	elseif (z <= -0.5)
		tmp = t_0;
	elseif (z <= -8.6e-70)
		tmp = x * -3.0;
	elseif (z <= -2.2e-268)
		tmp = y * 4.0;
	elseif (z <= 1.05e-87)
		tmp = x * -3.0;
	elseif (z <= 1.4e-56)
		tmp = y * 4.0;
	elseif (z <= 0.5)
		tmp = x * -3.0;
	elseif (z <= 2.8e+101)
		tmp = t_0;
	elseif (z <= 1.7e+199)
		tmp = y * (z * -6.0);
	else
		tmp = x * (6.0 * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e+213], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.5], t$95$0, If[LessEqual[z, -8.6e-70], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.2e-268], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.05e-87], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.4e-56], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.8e+101], t$95$0, If[LessEqual[z, 1.7e+199], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.5000000000000002e213 < z < -0.5 or 0.5 < z < 2.79999999999999981e101

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, -3, x \cdot \left(z \cdot 6\right)\right)} \]
    8. Applied egg-rr68.8%

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

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

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

        \[\leadsto \frac{\left(x \cdot -3\right) \cdot \left(x \cdot -3\right) - \color{blue}{{\left(x \cdot \left(z \cdot 6\right)\right)}^{2}}}{x \cdot -3 - x \cdot \left(z \cdot 6\right)} \]
      4. *-commutative27.5%

        \[\leadsto \frac{\left(x \cdot -3\right) \cdot \left(x \cdot -3\right) - {\left(x \cdot \color{blue}{\left(6 \cdot z\right)}\right)}^{2}}{x \cdot -3 - x \cdot \left(z \cdot 6\right)} \]
      5. *-commutative27.5%

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

      \[\leadsto \color{blue}{\frac{\left(x \cdot -3\right) \cdot \left(x \cdot -3\right) - {\left(x \cdot \left(6 \cdot z\right)\right)}^{2}}{x \cdot -3 - x \cdot \left(6 \cdot z\right)}} \]
    11. Step-by-step derivation
      1. swap-sqr27.5%

        \[\leadsto \frac{\color{blue}{\left(x \cdot x\right) \cdot \left(-3 \cdot -3\right)} - {\left(x \cdot \left(6 \cdot z\right)\right)}^{2}}{x \cdot -3 - x \cdot \left(6 \cdot z\right)} \]
      2. metadata-eval27.5%

        \[\leadsto \frac{\left(x \cdot x\right) \cdot \color{blue}{9} - {\left(x \cdot \left(6 \cdot z\right)\right)}^{2}}{x \cdot -3 - x \cdot \left(6 \cdot z\right)} \]
      3. *-commutative27.5%

        \[\leadsto \frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \color{blue}{\left(z \cdot 6\right)}\right)}^{2}}{x \cdot -3 - x \cdot \left(6 \cdot z\right)} \]
      4. distribute-lft-out--27.5%

        \[\leadsto \frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \left(z \cdot 6\right)\right)}^{2}}{\color{blue}{x \cdot \left(-3 - 6 \cdot z\right)}} \]
      5. *-commutative27.5%

        \[\leadsto \frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \left(z \cdot 6\right)\right)}^{2}}{x \cdot \left(-3 - \color{blue}{z \cdot 6}\right)} \]
    12. Simplified27.5%

      \[\leadsto \color{blue}{\frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \left(z \cdot 6\right)\right)}^{2}}{x \cdot \left(-3 - z \cdot 6\right)}} \]
    13. Taylor expanded in z around inf 66.2%

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

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

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

    if -0.5 < z < -8.6e-70 or -2.20000000000000004e-268 < z < 1.05000000000000004e-87 or 1.39999999999999997e-56 < z < 0.5

    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 inf 65.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.6e-70 < z < -2.20000000000000004e-268 or 1.05000000000000004e-87 < z < 1.39999999999999997e-56

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.79999999999999981e101 < z < 1.7e199

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.7e199 < 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 64.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+213}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -0.5:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -8.6 \cdot 10^{-70}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-268}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-87}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-56}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+101}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+199}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(6 \cdot z\right)\\ \end{array} \]

Alternative 5: 50.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+213}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -0.5:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -1.08 \cdot 10^{-69}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-268}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 9.8 \cdot 10^{-87}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-56}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+99}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+202}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(6 \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -5e+213)
   (* -6.0 (* y z))
   (if (<= z -0.5)
     (* 6.0 (* x z))
     (if (<= z -1.08e-69)
       (* x -3.0)
       (if (<= z -2.8e-268)
         (* y 4.0)
         (if (<= z 9.8e-87)
           (* x -3.0)
           (if (<= z 2.9e-56)
             (* y 4.0)
             (if (<= z 0.5)
               (* x -3.0)
               (if (<= z 1.05e+99)
                 (* z (* x 6.0))
                 (if (<= z 1.25e+202)
                   (* y (* z -6.0))
                   (* x (* 6.0 z))))))))))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -5e+213) {
		tmp = -6.0 * (y * z);
	} else if (z <= -0.5) {
		tmp = 6.0 * (x * z);
	} else if (z <= -1.08e-69) {
		tmp = x * -3.0;
	} else if (z <= -2.8e-268) {
		tmp = y * 4.0;
	} else if (z <= 9.8e-87) {
		tmp = x * -3.0;
	} else if (z <= 2.9e-56) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if (z <= 1.05e+99) {
		tmp = z * (x * 6.0);
	} else if (z <= 1.25e+202) {
		tmp = y * (z * -6.0);
	} else {
		tmp = x * (6.0 * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z <= (-5d+213)) then
        tmp = (-6.0d0) * (y * z)
    else if (z <= (-0.5d0)) then
        tmp = 6.0d0 * (x * z)
    else if (z <= (-1.08d-69)) then
        tmp = x * (-3.0d0)
    else if (z <= (-2.8d-268)) then
        tmp = y * 4.0d0
    else if (z <= 9.8d-87) then
        tmp = x * (-3.0d0)
    else if (z <= 2.9d-56) then
        tmp = y * 4.0d0
    else if (z <= 0.5d0) then
        tmp = x * (-3.0d0)
    else if (z <= 1.05d+99) then
        tmp = z * (x * 6.0d0)
    else if (z <= 1.25d+202) then
        tmp = y * (z * (-6.0d0))
    else
        tmp = x * (6.0d0 * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -5e+213) {
		tmp = -6.0 * (y * z);
	} else if (z <= -0.5) {
		tmp = 6.0 * (x * z);
	} else if (z <= -1.08e-69) {
		tmp = x * -3.0;
	} else if (z <= -2.8e-268) {
		tmp = y * 4.0;
	} else if (z <= 9.8e-87) {
		tmp = x * -3.0;
	} else if (z <= 2.9e-56) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if (z <= 1.05e+99) {
		tmp = z * (x * 6.0);
	} else if (z <= 1.25e+202) {
		tmp = y * (z * -6.0);
	} else {
		tmp = x * (6.0 * z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -5e+213:
		tmp = -6.0 * (y * z)
	elif z <= -0.5:
		tmp = 6.0 * (x * z)
	elif z <= -1.08e-69:
		tmp = x * -3.0
	elif z <= -2.8e-268:
		tmp = y * 4.0
	elif z <= 9.8e-87:
		tmp = x * -3.0
	elif z <= 2.9e-56:
		tmp = y * 4.0
	elif z <= 0.5:
		tmp = x * -3.0
	elif z <= 1.05e+99:
		tmp = z * (x * 6.0)
	elif z <= 1.25e+202:
		tmp = y * (z * -6.0)
	else:
		tmp = x * (6.0 * z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -5e+213)
		tmp = Float64(-6.0 * Float64(y * z));
	elseif (z <= -0.5)
		tmp = Float64(6.0 * Float64(x * z));
	elseif (z <= -1.08e-69)
		tmp = Float64(x * -3.0);
	elseif (z <= -2.8e-268)
		tmp = Float64(y * 4.0);
	elseif (z <= 9.8e-87)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.9e-56)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.5)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.05e+99)
		tmp = Float64(z * Float64(x * 6.0));
	elseif (z <= 1.25e+202)
		tmp = Float64(y * Float64(z * -6.0));
	else
		tmp = Float64(x * Float64(6.0 * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -5e+213)
		tmp = -6.0 * (y * z);
	elseif (z <= -0.5)
		tmp = 6.0 * (x * z);
	elseif (z <= -1.08e-69)
		tmp = x * -3.0;
	elseif (z <= -2.8e-268)
		tmp = y * 4.0;
	elseif (z <= 9.8e-87)
		tmp = x * -3.0;
	elseif (z <= 2.9e-56)
		tmp = y * 4.0;
	elseif (z <= 0.5)
		tmp = x * -3.0;
	elseif (z <= 1.05e+99)
		tmp = z * (x * 6.0);
	elseif (z <= 1.25e+202)
		tmp = y * (z * -6.0);
	else
		tmp = x * (6.0 * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -5e+213], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.5], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.08e-69], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.8e-268], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 9.8e-87], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.9e-56], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.05e+99], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e+202], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+213}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\

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

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

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

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

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

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999998e213 < z < -0.5

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, -3, x \cdot \left(z \cdot 6\right)\right)} \]
    8. Applied egg-rr68.6%

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

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

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

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

        \[\leadsto \frac{\left(x \cdot -3\right) \cdot \left(x \cdot -3\right) - {\left(x \cdot \color{blue}{\left(6 \cdot z\right)}\right)}^{2}}{x \cdot -3 - x \cdot \left(z \cdot 6\right)} \]
      5. *-commutative22.6%

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

      \[\leadsto \color{blue}{\frac{\left(x \cdot -3\right) \cdot \left(x \cdot -3\right) - {\left(x \cdot \left(6 \cdot z\right)\right)}^{2}}{x \cdot -3 - x \cdot \left(6 \cdot z\right)}} \]
    11. Step-by-step derivation
      1. swap-sqr22.6%

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

        \[\leadsto \frac{\left(x \cdot x\right) \cdot \color{blue}{9} - {\left(x \cdot \left(6 \cdot z\right)\right)}^{2}}{x \cdot -3 - x \cdot \left(6 \cdot z\right)} \]
      3. *-commutative22.6%

        \[\leadsto \frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \color{blue}{\left(z \cdot 6\right)}\right)}^{2}}{x \cdot -3 - x \cdot \left(6 \cdot z\right)} \]
      4. distribute-lft-out--22.6%

        \[\leadsto \frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \left(z \cdot 6\right)\right)}^{2}}{\color{blue}{x \cdot \left(-3 - 6 \cdot z\right)}} \]
      5. *-commutative22.6%

        \[\leadsto \frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \left(z \cdot 6\right)\right)}^{2}}{x \cdot \left(-3 - \color{blue}{z \cdot 6}\right)} \]
    12. Simplified22.6%

      \[\leadsto \color{blue}{\frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \left(z \cdot 6\right)\right)}^{2}}{x \cdot \left(-3 - z \cdot 6\right)}} \]
    13. Taylor expanded in z around inf 67.0%

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

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

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

    if -0.5 < z < -1.0800000000000001e-69 or -2.80000000000000015e-268 < z < 9.7999999999999994e-87 or 2.89999999999999991e-56 < z < 0.5

    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 inf 65.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.0800000000000001e-69 < z < -2.80000000000000015e-268 or 9.7999999999999994e-87 < z < 2.89999999999999991e-56

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.5 < z < 1.05000000000000005e99

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(-3 + z \cdot 6\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-in69.4%

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

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

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

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

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

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

        \[\leadsto \frac{\left(x \cdot -3\right) \cdot \left(x \cdot -3\right) - {\left(x \cdot \color{blue}{\left(6 \cdot z\right)}\right)}^{2}}{x \cdot -3 - x \cdot \left(z \cdot 6\right)} \]
      5. *-commutative37.4%

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

      \[\leadsto \color{blue}{\frac{\left(x \cdot -3\right) \cdot \left(x \cdot -3\right) - {\left(x \cdot \left(6 \cdot z\right)\right)}^{2}}{x \cdot -3 - x \cdot \left(6 \cdot z\right)}} \]
    11. Step-by-step derivation
      1. swap-sqr37.4%

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

        \[\leadsto \frac{\left(x \cdot x\right) \cdot \color{blue}{9} - {\left(x \cdot \left(6 \cdot z\right)\right)}^{2}}{x \cdot -3 - x \cdot \left(6 \cdot z\right)} \]
      3. *-commutative37.4%

        \[\leadsto \frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \color{blue}{\left(z \cdot 6\right)}\right)}^{2}}{x \cdot -3 - x \cdot \left(6 \cdot z\right)} \]
      4. distribute-lft-out--37.3%

        \[\leadsto \frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \left(z \cdot 6\right)\right)}^{2}}{\color{blue}{x \cdot \left(-3 - 6 \cdot z\right)}} \]
      5. *-commutative37.3%

        \[\leadsto \frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \left(z \cdot 6\right)\right)}^{2}}{x \cdot \left(-3 - \color{blue}{z \cdot 6}\right)} \]
    12. Simplified37.3%

      \[\leadsto \color{blue}{\frac{\left(x \cdot x\right) \cdot 9 - {\left(x \cdot \left(z \cdot 6\right)\right)}^{2}}{x \cdot \left(-3 - z \cdot 6\right)}} \]
    13. Taylor expanded in z around inf 64.5%

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

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

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

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

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

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

    if 1.05000000000000005e99 < z < 1.25e202

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.25e202 < 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 64.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+213}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -0.5:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -1.08 \cdot 10^{-69}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-268}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 9.8 \cdot 10^{-87}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-56}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+99}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+202}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(6 \cdot z\right)\\ \end{array} \]

Alternative 6: 73.4% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

    if -0.010999999999999999 < z < -1.80000000000000009e-69 or -2.3999999999999999e-268 < z < 1.25e-86 or 5.3999999999999999e-56 < z < 0.5

    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 inf 65.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.80000000000000009e-69 < z < -2.3999999999999999e-268 or 1.25e-86 < z < 5.3999999999999999e-56

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.011:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-69}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-268}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-86}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 5.4 \cdot 10^{-56}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \end{array} \]

Alternative 7: 74.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(-3 + 6 \cdot z\right)\\ t_1 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{if}\;z \leq -54000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-69}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-268}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{-88}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-56}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1450000000:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (+ -3.0 (* 6.0 z)))) (t_1 (* -6.0 (* (- y x) z))))
   (if (<= z -54000.0)
     t_1
     (if (<= z -4.2e-69)
       t_0
       (if (<= z -2.5e-268)
         (* y 4.0)
         (if (<= z 7.8e-88)
           (* x -3.0)
           (if (<= z 1.7e-56) (* y 4.0) (if (<= z 1450000000.0) t_0 t_1))))))))
double code(double x, double y, double z) {
	double t_0 = x * (-3.0 + (6.0 * z));
	double t_1 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -54000.0) {
		tmp = t_1;
	} else if (z <= -4.2e-69) {
		tmp = t_0;
	} else if (z <= -2.5e-268) {
		tmp = y * 4.0;
	} else if (z <= 7.8e-88) {
		tmp = x * -3.0;
	} else if (z <= 1.7e-56) {
		tmp = y * 4.0;
	} else if (z <= 1450000000.0) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = x * ((-3.0d0) + (6.0d0 * z))
    t_1 = (-6.0d0) * ((y - x) * z)
    if (z <= (-54000.0d0)) then
        tmp = t_1
    else if (z <= (-4.2d-69)) then
        tmp = t_0
    else if (z <= (-2.5d-268)) then
        tmp = y * 4.0d0
    else if (z <= 7.8d-88) then
        tmp = x * (-3.0d0)
    else if (z <= 1.7d-56) then
        tmp = y * 4.0d0
    else if (z <= 1450000000.0d0) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x * (-3.0 + (6.0 * z));
	double t_1 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -54000.0) {
		tmp = t_1;
	} else if (z <= -4.2e-69) {
		tmp = t_0;
	} else if (z <= -2.5e-268) {
		tmp = y * 4.0;
	} else if (z <= 7.8e-88) {
		tmp = x * -3.0;
	} else if (z <= 1.7e-56) {
		tmp = y * 4.0;
	} else if (z <= 1450000000.0) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (-3.0 + (6.0 * z))
	t_1 = -6.0 * ((y - x) * z)
	tmp = 0
	if z <= -54000.0:
		tmp = t_1
	elif z <= -4.2e-69:
		tmp = t_0
	elif z <= -2.5e-268:
		tmp = y * 4.0
	elif z <= 7.8e-88:
		tmp = x * -3.0
	elif z <= 1.7e-56:
		tmp = y * 4.0
	elif z <= 1450000000.0:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(-3.0 + Float64(6.0 * z)))
	t_1 = Float64(-6.0 * Float64(Float64(y - x) * z))
	tmp = 0.0
	if (z <= -54000.0)
		tmp = t_1;
	elseif (z <= -4.2e-69)
		tmp = t_0;
	elseif (z <= -2.5e-268)
		tmp = Float64(y * 4.0);
	elseif (z <= 7.8e-88)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.7e-56)
		tmp = Float64(y * 4.0);
	elseif (z <= 1450000000.0)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * (-3.0 + (6.0 * z));
	t_1 = -6.0 * ((y - x) * z);
	tmp = 0.0;
	if (z <= -54000.0)
		tmp = t_1;
	elseif (z <= -4.2e-69)
		tmp = t_0;
	elseif (z <= -2.5e-268)
		tmp = y * 4.0;
	elseif (z <= 7.8e-88)
		tmp = x * -3.0;
	elseif (z <= 1.7e-56)
		tmp = y * 4.0;
	elseif (z <= 1450000000.0)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-3.0 + N[(6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -54000.0], t$95$1, If[LessEqual[z, -4.2e-69], t$95$0, If[LessEqual[z, -2.5e-268], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7.8e-88], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.7e-56], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1450000000.0], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -4.2 \cdot 10^{-69}:\\
\;\;\;\;t_0\\

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -54000 or 1.45e9 < z

    1. Initial program 99.7%

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

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

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

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

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

    if -54000 < z < -4.1999999999999999e-69 or 1.69999999999999991e-56 < z < 1.45e9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.1999999999999999e-69 < z < -2.5e-268 or 7.79999999999999985e-88 < z < 1.69999999999999991e-56

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5e-268 < z < 7.79999999999999985e-88

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -54000:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-69}:\\ \;\;\;\;x \cdot \left(-3 + 6 \cdot z\right)\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-268}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{-88}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-56}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1450000000:\\ \;\;\;\;x \cdot \left(-3 + 6 \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \end{array} \]

Alternative 8: 50.9% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -110 < z < -1.5500000000000001e-67 or -1.7e-268 < z < 2.69999999999999992e-86 or 2.0000000000000001e-56 < z < 0.640000000000000013

    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 inf 66.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5500000000000001e-67 < z < -1.7e-268 or 2.69999999999999992e-86 < z < 2.0000000000000001e-56

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -110:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{-67}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{-268}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-86}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-56}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.64:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]

Alternative 9: 99.7% accurate, 0.9× speedup?

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

\\
x + \left(-6 \cdot \left(\left(y - x\right) \cdot z\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. metadata-eval99.6%

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

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

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

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

Alternative 10: 99.5% accurate, 1.0× speedup?

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

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

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

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

Alternative 11: 74.6% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3e-73 or 1.05e13 < 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 77.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3e-73 < x < 1.05e13

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 99.6%

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

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

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

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

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

    if -0.52000000000000002 < z < 0.5

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

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

    if 0.5 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

Alternative 13: 97.7% accurate, 1.2× speedup?

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

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

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

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


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

    1. Initial program 99.6%

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

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

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

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

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

    if -0.56000000000000005 < z < 0.650000000000000022

    1. Initial program 99.4%

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

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

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

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

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

    if 0.650000000000000022 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.56:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq 0.65:\\ \;\;\;\;y \cdot 4 + x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\ \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: 36.6% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;y \leq 2.7 \cdot 10^{+150}:\\
\;\;\;\;x \cdot -3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.5000000000000001e-25 or 2.70000000000000008e150 < 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.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.5000000000000001e-25 < y < 2.70000000000000008e150

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{-25}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{+150}:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;y \cdot 4\\ \end{array} \]

Alternative 16: 26.0% 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 56.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto x \cdot -3 \]

Reproduce

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