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

Percentage Accurate: 99.6% → 99.8%
Time: 11.0s
Alternatives: 17
Speedup: 1.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 99.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 50.6% accurate, 0.7× 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 -1.2 \cdot 10^{+247}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -0.5:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-305}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-105}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+146} \lor \neg \left(z \leq 8.2 \cdot 10^{+175}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))) (t_1 (* 6.0 (* x z))))
   (if (<= z -1.2e+247)
     t_0
     (if (<= z -0.5)
       t_1
       (if (<= z 2.15e-305)
         (* x -3.0)
         (if (<= z 3.1e-105)
           (* y 4.0)
           (if (<= z 0.5)
             (* x -3.0)
             (if (or (<= z 3.9e+146) (not (<= z 8.2e+175))) t_0 t_1))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -1.2e+247) {
		tmp = t_0;
	} else if (z <= -0.5) {
		tmp = t_1;
	} else if (z <= 2.15e-305) {
		tmp = x * -3.0;
	} else if (z <= 3.1e-105) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if ((z <= 3.9e+146) || !(z <= 8.2e+175)) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (-6.0d0) * (y * z)
    t_1 = 6.0d0 * (x * z)
    if (z <= (-1.2d+247)) then
        tmp = t_0
    else if (z <= (-0.5d0)) then
        tmp = t_1
    else if (z <= 2.15d-305) then
        tmp = x * (-3.0d0)
    else if (z <= 3.1d-105) then
        tmp = y * 4.0d0
    else if (z <= 0.5d0) then
        tmp = x * (-3.0d0)
    else if ((z <= 3.9d+146) .or. (.not. (z <= 8.2d+175))) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -1.2e+247) {
		tmp = t_0;
	} else if (z <= -0.5) {
		tmp = t_1;
	} else if (z <= 2.15e-305) {
		tmp = x * -3.0;
	} else if (z <= 3.1e-105) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else if ((z <= 3.9e+146) || !(z <= 8.2e+175)) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	t_1 = 6.0 * (x * z)
	tmp = 0
	if z <= -1.2e+247:
		tmp = t_0
	elif z <= -0.5:
		tmp = t_1
	elif z <= 2.15e-305:
		tmp = x * -3.0
	elif z <= 3.1e-105:
		tmp = y * 4.0
	elif z <= 0.5:
		tmp = x * -3.0
	elif (z <= 3.9e+146) or not (z <= 8.2e+175):
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	t_1 = Float64(6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -1.2e+247)
		tmp = t_0;
	elseif (z <= -0.5)
		tmp = t_1;
	elseif (z <= 2.15e-305)
		tmp = Float64(x * -3.0);
	elseif (z <= 3.1e-105)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.5)
		tmp = Float64(x * -3.0);
	elseif ((z <= 3.9e+146) || !(z <= 8.2e+175))
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	t_1 = 6.0 * (x * z);
	tmp = 0.0;
	if (z <= -1.2e+247)
		tmp = t_0;
	elseif (z <= -0.5)
		tmp = t_1;
	elseif (z <= 2.15e-305)
		tmp = x * -3.0;
	elseif (z <= 3.1e-105)
		tmp = y * 4.0;
	elseif (z <= 0.5)
		tmp = x * -3.0;
	elseif ((z <= 3.9e+146) || ~((z <= 8.2e+175)))
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.2e+247], t$95$0, If[LessEqual[z, -0.5], t$95$1, If[LessEqual[z, 2.15e-305], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.1e-105], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[Or[LessEqual[z, 3.9e+146], N[Not[LessEqual[z, 8.2e+175]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}

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

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

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

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

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

\mathbf{elif}\;z \leq 3.9 \cdot 10^{+146} \lor \neg \left(z \leq 8.2 \cdot 10^{+175}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.2e247 or 0.5 < z < 3.9e146 or 8.19999999999999955e175 < 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.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2e247 < z < -0.5 or 3.9e146 < z < 8.19999999999999955e175

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.5 < z < 2.1500000000000001e-305 or 3.10000000000000014e-105 < z < 0.5

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-3 \cdot x + 4 \cdot y} \]
    6. Taylor expanded in x around inf 55.6%

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    8. Simplified55.6%

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

    if 2.1500000000000001e-305 < z < 3.10000000000000014e-105

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+247}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -0.5:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-305}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-105}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+146} \lor \neg \left(z \leq 8.2 \cdot 10^{+175}\right):\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \end{array} \]

Alternative 3: 50.7% accurate, 0.7× speedup?

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

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

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

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

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

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

\mathbf{elif}\;z \leq 1.05 \cdot 10^{+147} \lor \neg \left(z \leq 2.9 \cdot 10^{+177}\right):\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -4.4000000000000003e240

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.4000000000000003e240 < z < -0.5 or 1.05000000000000003e147 < z < 2.90000000000000013e177

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.5 < z < 7.799999999999999e-307 or 1.2000000000000001e-103 < z < 0.52000000000000002

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-3 \cdot x + 4 \cdot y} \]
    6. Taylor expanded in x around inf 55.6%

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    8. Simplified55.6%

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

    if 7.799999999999999e-307 < z < 1.2000000000000001e-103

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.52000000000000002 < z < 1.05000000000000003e147 or 2.90000000000000013e177 < 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.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+240}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -0.5:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{-307}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-103}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.52:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+147} \lor \neg \left(z \leq 2.9 \cdot 10^{+177}\right):\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \end{array} \]

Alternative 4: 50.7% accurate, 0.7× speedup?

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

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

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

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

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

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

\mathbf{elif}\;z \leq 4.8 \cdot 10^{+146} \lor \neg \left(z \leq 5.2 \cdot 10^{+175}\right):\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.45e240 < z < -0.5

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.5 < z < 3.99999999999999999e-305 or 2.4000000000000001e-104 < z < 0.57999999999999996

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-3 \cdot x + 4 \cdot y} \]
    6. Taylor expanded in x around inf 55.6%

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    8. Simplified55.6%

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

    if 3.99999999999999999e-305 < z < 2.4000000000000001e-104

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.57999999999999996 < z < 4.8000000000000004e146 or 5.2000000000000001e175 < 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.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.8000000000000004e146 < z < 5.2000000000000001e175

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.45 \cdot 10^{+240}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -0.5:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-305}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{-104}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.58:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{+146} \lor \neg \left(z \leq 5.2 \cdot 10^{+175}\right):\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \end{array} \]

Alternative 5: 74.0% accurate, 0.8× speedup?

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -0.0064999999999999997 or 1.4e9 < 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. associate-*r*99.7%

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

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

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

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

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

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

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

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

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

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

    if -0.0064999999999999997 < z < 1.2000000000000001e-305 or 7.6000000000000004e-107 < z < 1.3499999999999999e-12

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-3 \cdot x + 4 \cdot y} \]
    6. Taylor expanded in x around inf 57.7%

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

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

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

    if 1.2000000000000001e-305 < z < 7.6000000000000004e-107

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3499999999999999e-12 < z < 1.4e9

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.0065:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-305}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-107}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-12}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1400000000:\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \end{array} \]

Alternative 6: 99.7% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 74.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+116} \lor \neg \left(y \leq -3.9 \cdot 10^{+32} \lor \neg \left(y \leq -2.5 \cdot 10^{-79}\right) \land y \leq 1.7 \cdot 10^{-10}\right):\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.50000000000000035e116 or -3.8999999999999999e32 < y < -2.5e-79 or 1.70000000000000007e-10 < y

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

    if -5.50000000000000035e116 < y < -3.8999999999999999e32 or -2.5e-79 < y < 1.70000000000000007e-10

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{+116} \lor \neg \left(y \leq -3.9 \cdot 10^{+32} \lor \neg \left(y \leq -2.5 \cdot 10^{-79}\right) \land y \leq 1.7 \cdot 10^{-10}\right):\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \end{array} \]

Alternative 8: 74.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+116} \lor \neg \left(y \leq -2.8 \cdot 10^{+33} \lor \neg \left(y \leq -1.5 \cdot 10^{-79}\right) \land y \leq 2.65 \cdot 10^{-9}\right):\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.50000000000000035e116 or -2.8000000000000001e33 < y < -1.5e-79 or 2.65000000000000015e-9 < y

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.50000000000000035e116 < y < -2.8000000000000001e33 or -1.5e-79 < y < 2.65000000000000015e-9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{+116} \lor \neg \left(y \leq -2.8 \cdot 10^{+33} \lor \neg \left(y \leq -1.5 \cdot 10^{-79}\right) \land y \leq 2.65 \cdot 10^{-9}\right):\\ \;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \end{array} \]

Alternative 9: 73.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{if}\;z \leq -0.00155:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{-305}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-107}:\\ \;\;\;\;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.00155)
     t_0
     (if (<= z 3.5e-305)
       (* x -3.0)
       (if (<= z 4.5e-107) (* 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.00155) {
		tmp = t_0;
	} else if (z <= 3.5e-305) {
		tmp = x * -3.0;
	} else if (z <= 4.5e-107) {
		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.00155d0)) then
        tmp = t_0
    else if (z <= 3.5d-305) then
        tmp = x * (-3.0d0)
    else if (z <= 4.5d-107) 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.00155) {
		tmp = t_0;
	} else if (z <= 3.5e-305) {
		tmp = x * -3.0;
	} else if (z <= 4.5e-107) {
		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.00155:
		tmp = t_0
	elif z <= 3.5e-305:
		tmp = x * -3.0
	elif z <= 4.5e-107:
		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.00155)
		tmp = t_0;
	elseif (z <= 3.5e-305)
		tmp = Float64(x * -3.0);
	elseif (z <= 4.5e-107)
		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.00155)
		tmp = t_0;
	elseif (z <= 3.5e-305)
		tmp = x * -3.0;
	elseif (z <= 4.5e-107)
		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.00155], t$95$0, If[LessEqual[z, 3.5e-305], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.5e-107], 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.00155:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;z \leq 4.5 \cdot 10^{-107}:\\
\;\;\;\;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.00154999999999999995 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. associate-*r*99.7%

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

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

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

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

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

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

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

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

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

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

    if -0.00154999999999999995 < z < 3.4999999999999998e-305 or 4.50000000000000016e-107 < z < 0.5

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-3 \cdot x + 4 \cdot y} \]
    6. Taylor expanded in x around inf 55.6%

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    8. Simplified55.6%

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

    if 3.4999999999999998e-305 < z < 4.50000000000000016e-107

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.00155:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{-305}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-107}:\\ \;\;\;\;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 10: 74.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(-3 + z \cdot 6\right)\\ t_1 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \mathbf{if}\;y \leq -5.5 \cdot 10^{+116}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -4.5 \cdot 10^{+32}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{-79}:\\ \;\;\;\;\left(0.6666666666666666 - z\right) \cdot \left(y \cdot 6\right)\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-9}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (+ -3.0 (* z 6.0))))
        (t_1 (* 6.0 (* y (- 0.6666666666666666 z)))))
   (if (<= y -5.5e+116)
     t_1
     (if (<= y -4.5e+32)
       t_0
       (if (<= y -2.5e-79)
         (* (- 0.6666666666666666 z) (* y 6.0))
         (if (<= y 1.75e-9) t_0 t_1))))))
double code(double x, double y, double z) {
	double t_0 = x * (-3.0 + (z * 6.0));
	double t_1 = 6.0 * (y * (0.6666666666666666 - z));
	double tmp;
	if (y <= -5.5e+116) {
		tmp = t_1;
	} else if (y <= -4.5e+32) {
		tmp = t_0;
	} else if (y <= -2.5e-79) {
		tmp = (0.6666666666666666 - z) * (y * 6.0);
	} else if (y <= 1.75e-9) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = x * ((-3.0d0) + (z * 6.0d0))
    t_1 = 6.0d0 * (y * (0.6666666666666666d0 - z))
    if (y <= (-5.5d+116)) then
        tmp = t_1
    else if (y <= (-4.5d+32)) then
        tmp = t_0
    else if (y <= (-2.5d-79)) then
        tmp = (0.6666666666666666d0 - z) * (y * 6.0d0)
    else if (y <= 1.75d-9) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x * (-3.0 + (z * 6.0));
	double t_1 = 6.0 * (y * (0.6666666666666666 - z));
	double tmp;
	if (y <= -5.5e+116) {
		tmp = t_1;
	} else if (y <= -4.5e+32) {
		tmp = t_0;
	} else if (y <= -2.5e-79) {
		tmp = (0.6666666666666666 - z) * (y * 6.0);
	} else if (y <= 1.75e-9) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (-3.0 + (z * 6.0))
	t_1 = 6.0 * (y * (0.6666666666666666 - z))
	tmp = 0
	if y <= -5.5e+116:
		tmp = t_1
	elif y <= -4.5e+32:
		tmp = t_0
	elif y <= -2.5e-79:
		tmp = (0.6666666666666666 - z) * (y * 6.0)
	elif y <= 1.75e-9:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(-3.0 + Float64(z * 6.0)))
	t_1 = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z)))
	tmp = 0.0
	if (y <= -5.5e+116)
		tmp = t_1;
	elseif (y <= -4.5e+32)
		tmp = t_0;
	elseif (y <= -2.5e-79)
		tmp = Float64(Float64(0.6666666666666666 - z) * Float64(y * 6.0));
	elseif (y <= 1.75e-9)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * (-3.0 + (z * 6.0));
	t_1 = 6.0 * (y * (0.6666666666666666 - z));
	tmp = 0.0;
	if (y <= -5.5e+116)
		tmp = t_1;
	elseif (y <= -4.5e+32)
		tmp = t_0;
	elseif (y <= -2.5e-79)
		tmp = (0.6666666666666666 - z) * (y * 6.0);
	elseif (y <= 1.75e-9)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.5e+116], t$95$1, If[LessEqual[y, -4.5e+32], t$95$0, If[LessEqual[y, -2.5e-79], N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(y * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e-9], t$95$0, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -4.5 \cdot 10^{+32}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq -2.5 \cdot 10^{-79}:\\
\;\;\;\;\left(0.6666666666666666 - z\right) \cdot \left(y \cdot 6\right)\\

\mathbf{elif}\;y \leq 1.75 \cdot 10^{-9}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.50000000000000035e116 or 1.75e-9 < y

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

    if -5.50000000000000035e116 < y < -4.5000000000000003e32 or -2.5e-79 < y < 1.75e-9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.5000000000000003e32 < y < -2.5e-79

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{+116}:\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \mathbf{elif}\;y \leq -4.5 \cdot 10^{+32}:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{-79}:\\ \;\;\;\;\left(0.6666666666666666 - z\right) \cdot \left(y \cdot 6\right)\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-9}:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \end{array} \]

Alternative 11: 50.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -540000000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-306}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-106}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.6:\\ \;\;\;\;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 -540000000000.0)
     t_0
     (if (<= z 1.45e-306)
       (* x -3.0)
       (if (<= z 3.4e-106) (* y 4.0) (if (<= z 0.6) (* x -3.0) t_0))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double tmp;
	if (z <= -540000000000.0) {
		tmp = t_0;
	} else if (z <= 1.45e-306) {
		tmp = x * -3.0;
	} else if (z <= 3.4e-106) {
		tmp = y * 4.0;
	} else if (z <= 0.6) {
		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 <= (-540000000000.0d0)) then
        tmp = t_0
    else if (z <= 1.45d-306) then
        tmp = x * (-3.0d0)
    else if (z <= 3.4d-106) then
        tmp = y * 4.0d0
    else if (z <= 0.6d0) 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 <= -540000000000.0) {
		tmp = t_0;
	} else if (z <= 1.45e-306) {
		tmp = x * -3.0;
	} else if (z <= 3.4e-106) {
		tmp = y * 4.0;
	} else if (z <= 0.6) {
		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 <= -540000000000.0:
		tmp = t_0
	elif z <= 1.45e-306:
		tmp = x * -3.0
	elif z <= 3.4e-106:
		tmp = y * 4.0
	elif z <= 0.6:
		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 <= -540000000000.0)
		tmp = t_0;
	elseif (z <= 1.45e-306)
		tmp = Float64(x * -3.0);
	elseif (z <= 3.4e-106)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.6)
		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 <= -540000000000.0)
		tmp = t_0;
	elseif (z <= 1.45e-306)
		tmp = x * -3.0;
	elseif (z <= 3.4e-106)
		tmp = y * 4.0;
	elseif (z <= 0.6)
		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, -540000000000.0], t$95$0, If[LessEqual[z, 1.45e-306], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.4e-106], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.6], 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 -540000000000:\\
\;\;\;\;t_0\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.4e11 or 0.599999999999999978 < 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.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.4e11 < z < 1.4499999999999999e-306 or 3.39999999999999982e-106 < z < 0.599999999999999978

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-3 \cdot x + 4 \cdot y} \]
    6. Taylor expanded in x around inf 54.5%

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    8. Simplified54.5%

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

    if 1.4499999999999999e-306 < z < 3.39999999999999982e-106

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -540000000000:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-306}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-106}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.6:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]

Alternative 12: 97.8% accurate, 1.0× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

    if -0.599999999999999978 < z < 0.52000000000000002

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.52000000000000002 < 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.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 97.8% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.599999999999999978 or 0.52000000000000002 < 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. associate-*r*99.7%

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

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

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

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

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

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

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

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

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

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

    if -0.599999999999999978 < z < 0.52000000000000002

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 99.7% accurate, 1.2× speedup?

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

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

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

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

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

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

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

Alternative 15: 38.4% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -8.6 \cdot 10^{-75}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-10}:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;y \cdot 4\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -8.6e-75) (* y 4.0) (if (<= y 1.65e-10) (* x -3.0) (* y 4.0))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -8.6e-75) {
		tmp = y * 4.0;
	} else if (y <= 1.65e-10) {
		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 <= (-8.6d-75)) then
        tmp = y * 4.0d0
    else if (y <= 1.65d-10) 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 <= -8.6e-75) {
		tmp = y * 4.0;
	} else if (y <= 1.65e-10) {
		tmp = x * -3.0;
	} else {
		tmp = y * 4.0;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -8.6e-75:
		tmp = y * 4.0
	elif y <= 1.65e-10:
		tmp = x * -3.0
	else:
		tmp = y * 4.0
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -8.6e-75)
		tmp = Float64(y * 4.0);
	elseif (y <= 1.65e-10)
		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 <= -8.6e-75)
		tmp = y * 4.0;
	elseif (y <= 1.65e-10)
		tmp = x * -3.0;
	else
		tmp = y * 4.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -8.6e-75], N[(y * 4.0), $MachinePrecision], If[LessEqual[y, 1.65e-10], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 1.65 \cdot 10^{-10}:\\
\;\;\;\;x \cdot -3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.5999999999999998e-75 or 1.65e-10 < y

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.5999999999999998e-75 < y < 1.65e-10

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-3 \cdot x + 4 \cdot y} \]
    6. Taylor expanded in x around inf 42.5%

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    8. Simplified42.5%

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

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

Alternative 16: 25.5% accurate, 4.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-3 \cdot x + 4 \cdot y} \]
  6. Taylor expanded in x around inf 24.4%

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

      \[\leadsto \color{blue}{x \cdot -3} \]
  8. Simplified24.4%

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

    \[\leadsto x \cdot -3 \]

Alternative 17: 2.7% accurate, 13.0× speedup?

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

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

    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
  2. Taylor expanded in z around inf 55.5%

    \[\leadsto x + \color{blue}{-6 \cdot \left(z \cdot \left(y - x\right)\right)} \]
  3. Taylor expanded in z around 0 2.6%

    \[\leadsto \color{blue}{x} \]
  4. Final simplification2.6%

    \[\leadsto x \]

Reproduce

?
herbie shell --seed 2023221 
(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))))