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

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

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

Initial Program: 99.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 50.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ t_1 := z \cdot \left(x \cdot 6\right)\\ \mathbf{if}\;z \leq -1.16 \cdot 10^{+198}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{+97}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-11}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -4.9 \cdot 10^{-67}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-174}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-306}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-222}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-153}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{-115}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-70}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.54:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))) (t_1 (* z (* x 6.0))))
   (if (<= z -1.16e+198)
     t_0
     (if (<= z -1.25e+97)
       t_1
       (if (<= z -2.6e-11)
         t_0
         (if (<= z -4.9e-67)
           (* x -3.0)
           (if (<= z -2.2e-174)
             (* y 4.0)
             (if (<= z 1.15e-306)
               (* x -3.0)
               (if (<= z 1.1e-222)
                 (* y 4.0)
                 (if (<= z 9.5e-153)
                   (* x -3.0)
                   (if (<= z 2.4e-115)
                     (* y 4.0)
                     (if (<= z 5e-70)
                       (* x -3.0)
                       (if (<= z 0.54) (* y 4.0) t_1)))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = z * (x * 6.0);
	double tmp;
	if (z <= -1.16e+198) {
		tmp = t_0;
	} else if (z <= -1.25e+97) {
		tmp = t_1;
	} else if (z <= -2.6e-11) {
		tmp = t_0;
	} else if (z <= -4.9e-67) {
		tmp = x * -3.0;
	} else if (z <= -2.2e-174) {
		tmp = y * 4.0;
	} else if (z <= 1.15e-306) {
		tmp = x * -3.0;
	} else if (z <= 1.1e-222) {
		tmp = y * 4.0;
	} else if (z <= 9.5e-153) {
		tmp = x * -3.0;
	} else if (z <= 2.4e-115) {
		tmp = y * 4.0;
	} else if (z <= 5e-70) {
		tmp = x * -3.0;
	} else if (z <= 0.54) {
		tmp = y * 4.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 = z * (x * 6.0d0)
    if (z <= (-1.16d+198)) then
        tmp = t_0
    else if (z <= (-1.25d+97)) then
        tmp = t_1
    else if (z <= (-2.6d-11)) then
        tmp = t_0
    else if (z <= (-4.9d-67)) then
        tmp = x * (-3.0d0)
    else if (z <= (-2.2d-174)) then
        tmp = y * 4.0d0
    else if (z <= 1.15d-306) then
        tmp = x * (-3.0d0)
    else if (z <= 1.1d-222) then
        tmp = y * 4.0d0
    else if (z <= 9.5d-153) then
        tmp = x * (-3.0d0)
    else if (z <= 2.4d-115) then
        tmp = y * 4.0d0
    else if (z <= 5d-70) then
        tmp = x * (-3.0d0)
    else if (z <= 0.54d0) then
        tmp = y * 4.0d0
    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 = z * (x * 6.0);
	double tmp;
	if (z <= -1.16e+198) {
		tmp = t_0;
	} else if (z <= -1.25e+97) {
		tmp = t_1;
	} else if (z <= -2.6e-11) {
		tmp = t_0;
	} else if (z <= -4.9e-67) {
		tmp = x * -3.0;
	} else if (z <= -2.2e-174) {
		tmp = y * 4.0;
	} else if (z <= 1.15e-306) {
		tmp = x * -3.0;
	} else if (z <= 1.1e-222) {
		tmp = y * 4.0;
	} else if (z <= 9.5e-153) {
		tmp = x * -3.0;
	} else if (z <= 2.4e-115) {
		tmp = y * 4.0;
	} else if (z <= 5e-70) {
		tmp = x * -3.0;
	} else if (z <= 0.54) {
		tmp = y * 4.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	t_1 = z * (x * 6.0)
	tmp = 0
	if z <= -1.16e+198:
		tmp = t_0
	elif z <= -1.25e+97:
		tmp = t_1
	elif z <= -2.6e-11:
		tmp = t_0
	elif z <= -4.9e-67:
		tmp = x * -3.0
	elif z <= -2.2e-174:
		tmp = y * 4.0
	elif z <= 1.15e-306:
		tmp = x * -3.0
	elif z <= 1.1e-222:
		tmp = y * 4.0
	elif z <= 9.5e-153:
		tmp = x * -3.0
	elif z <= 2.4e-115:
		tmp = y * 4.0
	elif z <= 5e-70:
		tmp = x * -3.0
	elif z <= 0.54:
		tmp = y * 4.0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	t_1 = Float64(z * Float64(x * 6.0))
	tmp = 0.0
	if (z <= -1.16e+198)
		tmp = t_0;
	elseif (z <= -1.25e+97)
		tmp = t_1;
	elseif (z <= -2.6e-11)
		tmp = t_0;
	elseif (z <= -4.9e-67)
		tmp = Float64(x * -3.0);
	elseif (z <= -2.2e-174)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.15e-306)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.1e-222)
		tmp = Float64(y * 4.0);
	elseif (z <= 9.5e-153)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.4e-115)
		tmp = Float64(y * 4.0);
	elseif (z <= 5e-70)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.54)
		tmp = Float64(y * 4.0);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	t_1 = z * (x * 6.0);
	tmp = 0.0;
	if (z <= -1.16e+198)
		tmp = t_0;
	elseif (z <= -1.25e+97)
		tmp = t_1;
	elseif (z <= -2.6e-11)
		tmp = t_0;
	elseif (z <= -4.9e-67)
		tmp = x * -3.0;
	elseif (z <= -2.2e-174)
		tmp = y * 4.0;
	elseif (z <= 1.15e-306)
		tmp = x * -3.0;
	elseif (z <= 1.1e-222)
		tmp = y * 4.0;
	elseif (z <= 9.5e-153)
		tmp = x * -3.0;
	elseif (z <= 2.4e-115)
		tmp = y * 4.0;
	elseif (z <= 5e-70)
		tmp = x * -3.0;
	elseif (z <= 0.54)
		tmp = y * 4.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[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.16e+198], t$95$0, If[LessEqual[z, -1.25e+97], t$95$1, If[LessEqual[z, -2.6e-11], t$95$0, If[LessEqual[z, -4.9e-67], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.2e-174], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.15e-306], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.1e-222], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 9.5e-153], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.4e-115], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5e-70], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.54], N[(y * 4.0), $MachinePrecision], t$95$1]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.25 \cdot 10^{+97}:\\
\;\;\;\;t_1\\

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.16000000000000001e198 or -1.25e97 < z < -2.6000000000000001e-11

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.16000000000000001e198 < z < -1.25e97 or 0.54000000000000004 < z

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{-1}{x}}{3 + -6 \cdot z}}} \]
      2. *-commutative67.0%

        \[\leadsto \frac{1}{\frac{\frac{-1}{x}}{3 + \color{blue}{z \cdot -6}}} \]
    8. Simplified67.0%

      \[\leadsto \frac{1}{\color{blue}{\frac{\frac{-1}{x}}{3 + z \cdot -6}}} \]
    9. Taylor expanded in z around inf 67.1%

      \[\leadsto \frac{1}{\color{blue}{\frac{0.16666666666666666}{x \cdot z}}} \]
    10. Step-by-step derivation
      1. associate-/r/67.0%

        \[\leadsto \color{blue}{\frac{1}{0.16666666666666666} \cdot \left(x \cdot z\right)} \]
      2. associate-*r*67.2%

        \[\leadsto \color{blue}{\left(\frac{1}{0.16666666666666666} \cdot x\right) \cdot z} \]
      3. *-commutative67.2%

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

        \[\leadsto \left(x \cdot \color{blue}{6}\right) \cdot z \]
    11. Applied egg-rr67.2%

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

    if -2.6000000000000001e-11 < z < -4.89999999999999993e-67 or -2.20000000000000022e-174 < z < 1.14999999999999995e-306 or 1.1e-222 < z < 9.50000000000000031e-153 or 2.40000000000000021e-115 < z < 4.9999999999999998e-70

    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. metadata-eval99.2%

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

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

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

      \[\leadsto \color{blue}{x + -4 \cdot x} \]
    6. Step-by-step derivation
      1. distribute-rgt1-in70.8%

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

        \[\leadsto \color{blue}{-3} \cdot x \]
      3. *-commutative70.8%

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

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

    if -4.89999999999999993e-67 < z < -2.20000000000000022e-174 or 1.14999999999999995e-306 < z < 1.1e-222 or 9.50000000000000031e-153 < z < 2.40000000000000021e-115 or 4.9999999999999998e-70 < z < 0.54000000000000004

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.16 \cdot 10^{+198}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{+97}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-11}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -4.9 \cdot 10^{-67}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-174}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-306}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-222}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-153}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{-115}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-70}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.54:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \end{array} \]

Alternative 3: 51.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -2.95 \cdot 10^{+198}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -7 \cdot 10^{+97}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-11}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -5.9 \cdot 10^{-68}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-167}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-306}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-217}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-152}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 10^{-114}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-61}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.65:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))))
   (if (<= z -2.95e+198)
     t_0
     (if (<= z -7e+97)
       (* x (* z 6.0))
       (if (<= z -2.6e-11)
         t_0
         (if (<= z -5.9e-68)
           (* x -3.0)
           (if (<= z -1.2e-167)
             (* y 4.0)
             (if (<= z 1.9e-306)
               (* x -3.0)
               (if (<= z 6.8e-217)
                 (* y 4.0)
                 (if (<= z 2.3e-152)
                   (* x -3.0)
                   (if (<= z 1e-114)
                     (* y 4.0)
                     (if (<= z 7.6e-61)
                       (* x -3.0)
                       (if (<= z 0.65) (* y 4.0) (* z (* x 6.0)))))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double tmp;
	if (z <= -2.95e+198) {
		tmp = t_0;
	} else if (z <= -7e+97) {
		tmp = x * (z * 6.0);
	} else if (z <= -2.6e-11) {
		tmp = t_0;
	} else if (z <= -5.9e-68) {
		tmp = x * -3.0;
	} else if (z <= -1.2e-167) {
		tmp = y * 4.0;
	} else if (z <= 1.9e-306) {
		tmp = x * -3.0;
	} else if (z <= 6.8e-217) {
		tmp = y * 4.0;
	} else if (z <= 2.3e-152) {
		tmp = x * -3.0;
	} else if (z <= 1e-114) {
		tmp = y * 4.0;
	} else if (z <= 7.6e-61) {
		tmp = x * -3.0;
	} else if (z <= 0.65) {
		tmp = y * 4.0;
	} else {
		tmp = z * (x * 6.0);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-6.0d0) * (y * z)
    if (z <= (-2.95d+198)) then
        tmp = t_0
    else if (z <= (-7d+97)) then
        tmp = x * (z * 6.0d0)
    else if (z <= (-2.6d-11)) then
        tmp = t_0
    else if (z <= (-5.9d-68)) then
        tmp = x * (-3.0d0)
    else if (z <= (-1.2d-167)) then
        tmp = y * 4.0d0
    else if (z <= 1.9d-306) then
        tmp = x * (-3.0d0)
    else if (z <= 6.8d-217) then
        tmp = y * 4.0d0
    else if (z <= 2.3d-152) then
        tmp = x * (-3.0d0)
    else if (z <= 1d-114) then
        tmp = y * 4.0d0
    else if (z <= 7.6d-61) then
        tmp = x * (-3.0d0)
    else if (z <= 0.65d0) then
        tmp = y * 4.0d0
    else
        tmp = z * (x * 6.0d0)
    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 <= -2.95e+198) {
		tmp = t_0;
	} else if (z <= -7e+97) {
		tmp = x * (z * 6.0);
	} else if (z <= -2.6e-11) {
		tmp = t_0;
	} else if (z <= -5.9e-68) {
		tmp = x * -3.0;
	} else if (z <= -1.2e-167) {
		tmp = y * 4.0;
	} else if (z <= 1.9e-306) {
		tmp = x * -3.0;
	} else if (z <= 6.8e-217) {
		tmp = y * 4.0;
	} else if (z <= 2.3e-152) {
		tmp = x * -3.0;
	} else if (z <= 1e-114) {
		tmp = y * 4.0;
	} else if (z <= 7.6e-61) {
		tmp = x * -3.0;
	} else if (z <= 0.65) {
		tmp = y * 4.0;
	} else {
		tmp = z * (x * 6.0);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	tmp = 0
	if z <= -2.95e+198:
		tmp = t_0
	elif z <= -7e+97:
		tmp = x * (z * 6.0)
	elif z <= -2.6e-11:
		tmp = t_0
	elif z <= -5.9e-68:
		tmp = x * -3.0
	elif z <= -1.2e-167:
		tmp = y * 4.0
	elif z <= 1.9e-306:
		tmp = x * -3.0
	elif z <= 6.8e-217:
		tmp = y * 4.0
	elif z <= 2.3e-152:
		tmp = x * -3.0
	elif z <= 1e-114:
		tmp = y * 4.0
	elif z <= 7.6e-61:
		tmp = x * -3.0
	elif z <= 0.65:
		tmp = y * 4.0
	else:
		tmp = z * (x * 6.0)
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -2.95e+198)
		tmp = t_0;
	elseif (z <= -7e+97)
		tmp = Float64(x * Float64(z * 6.0));
	elseif (z <= -2.6e-11)
		tmp = t_0;
	elseif (z <= -5.9e-68)
		tmp = Float64(x * -3.0);
	elseif (z <= -1.2e-167)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.9e-306)
		tmp = Float64(x * -3.0);
	elseif (z <= 6.8e-217)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.3e-152)
		tmp = Float64(x * -3.0);
	elseif (z <= 1e-114)
		tmp = Float64(y * 4.0);
	elseif (z <= 7.6e-61)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.65)
		tmp = Float64(y * 4.0);
	else
		tmp = Float64(z * Float64(x * 6.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	tmp = 0.0;
	if (z <= -2.95e+198)
		tmp = t_0;
	elseif (z <= -7e+97)
		tmp = x * (z * 6.0);
	elseif (z <= -2.6e-11)
		tmp = t_0;
	elseif (z <= -5.9e-68)
		tmp = x * -3.0;
	elseif (z <= -1.2e-167)
		tmp = y * 4.0;
	elseif (z <= 1.9e-306)
		tmp = x * -3.0;
	elseif (z <= 6.8e-217)
		tmp = y * 4.0;
	elseif (z <= 2.3e-152)
		tmp = x * -3.0;
	elseif (z <= 1e-114)
		tmp = y * 4.0;
	elseif (z <= 7.6e-61)
		tmp = x * -3.0;
	elseif (z <= 0.65)
		tmp = y * 4.0;
	else
		tmp = z * (x * 6.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, -2.95e+198], t$95$0, If[LessEqual[z, -7e+97], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.6e-11], t$95$0, If[LessEqual[z, -5.9e-68], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.2e-167], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.9e-306], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.8e-217], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.3e-152], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1e-114], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7.6e-61], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.94999999999999987e198 or -7.0000000000000001e97 < z < -2.6000000000000001e-11

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.94999999999999987e198 < z < -7.0000000000000001e97

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{-1}{x}}{3 + -6 \cdot z}}} \]
      2. *-commutative69.8%

        \[\leadsto \frac{1}{\frac{\frac{-1}{x}}{3 + \color{blue}{z \cdot -6}}} \]
    8. Simplified69.8%

      \[\leadsto \frac{1}{\color{blue}{\frac{\frac{-1}{x}}{3 + z \cdot -6}}} \]
    9. Taylor expanded in z around inf 69.7%

      \[\leadsto \frac{1}{\color{blue}{\frac{0.16666666666666666}{x \cdot z}}} \]
    10. Step-by-step derivation
      1. associate-/r/69.7%

        \[\leadsto \color{blue}{\frac{1}{0.16666666666666666} \cdot \left(x \cdot z\right)} \]
      2. associate-*r*69.7%

        \[\leadsto \color{blue}{\left(\frac{1}{0.16666666666666666} \cdot x\right) \cdot z} \]
      3. *-commutative69.7%

        \[\leadsto \color{blue}{z \cdot \left(\frac{1}{0.16666666666666666} \cdot x\right)} \]
      4. associate-*l*69.9%

        \[\leadsto \color{blue}{\left(z \cdot \frac{1}{0.16666666666666666}\right) \cdot x} \]
      5. metadata-eval69.9%

        \[\leadsto \left(z \cdot \color{blue}{6}\right) \cdot x \]
    11. Applied egg-rr69.9%

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

    if -2.6000000000000001e-11 < z < -5.9e-68 or -1.19999999999999997e-167 < z < 1.9e-306 or 6.80000000000000032e-217 < z < 2.3000000000000001e-152 or 1.0000000000000001e-114 < z < 7.59999999999999961e-61

    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. metadata-eval99.2%

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

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

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

      \[\leadsto \color{blue}{x + -4 \cdot x} \]
    6. Step-by-step derivation
      1. distribute-rgt1-in70.8%

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

        \[\leadsto \color{blue}{-3} \cdot x \]
      3. *-commutative70.8%

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

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

    if -5.9e-68 < z < -1.19999999999999997e-167 or 1.9e-306 < z < 6.80000000000000032e-217 or 2.3000000000000001e-152 < z < 1.0000000000000001e-114 or 7.59999999999999961e-61 < z < 0.650000000000000022

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.650000000000000022 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{-1}{x}}{3 + -6 \cdot z}}} \]
      2. *-commutative66.0%

        \[\leadsto \frac{1}{\frac{\frac{-1}{x}}{3 + \color{blue}{z \cdot -6}}} \]
    8. Simplified66.0%

      \[\leadsto \frac{1}{\color{blue}{\frac{\frac{-1}{x}}{3 + z \cdot -6}}} \]
    9. Taylor expanded in z around inf 66.1%

      \[\leadsto \frac{1}{\color{blue}{\frac{0.16666666666666666}{x \cdot z}}} \]
    10. Step-by-step derivation
      1. associate-/r/66.1%

        \[\leadsto \color{blue}{\frac{1}{0.16666666666666666} \cdot \left(x \cdot z\right)} \]
      2. associate-*r*66.3%

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

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{0.16666666666666666}\right)} \cdot z \]
      4. metadata-eval66.3%

        \[\leadsto \left(x \cdot \color{blue}{6}\right) \cdot z \]
    11. Applied egg-rr66.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.95 \cdot 10^{+198}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -7 \cdot 10^{+97}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-11}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -5.9 \cdot 10^{-68}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-167}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-306}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-217}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-152}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 10^{-114}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-61}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.65:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \end{array} \]

Alternative 4: 50.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -1.6 \cdot 10^{+198}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{+97}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-11}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.46 \cdot 10^{-68}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-166}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-307}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-223}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-151}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-117}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-64}:\\ \;\;\;\;\frac{1}{\frac{-0.3333333333333333}{x}}\\ \mathbf{elif}\;z \leq 0.65:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))))
   (if (<= z -1.6e+198)
     t_0
     (if (<= z -1.15e+97)
       (* x (* z 6.0))
       (if (<= z -2.6e-11)
         t_0
         (if (<= z -1.46e-68)
           (* x -3.0)
           (if (<= z -1.15e-166)
             (* y 4.0)
             (if (<= z 5.8e-307)
               (* x -3.0)
               (if (<= z 1.8e-223)
                 (* y 4.0)
                 (if (<= z 1.35e-151)
                   (* x -3.0)
                   (if (<= z 5.8e-117)
                     (* y 4.0)
                     (if (<= z 5.5e-64)
                       (/ 1.0 (/ -0.3333333333333333 x))
                       (if (<= z 0.65) (* y 4.0) (* z (* x 6.0)))))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double tmp;
	if (z <= -1.6e+198) {
		tmp = t_0;
	} else if (z <= -1.15e+97) {
		tmp = x * (z * 6.0);
	} else if (z <= -2.6e-11) {
		tmp = t_0;
	} else if (z <= -1.46e-68) {
		tmp = x * -3.0;
	} else if (z <= -1.15e-166) {
		tmp = y * 4.0;
	} else if (z <= 5.8e-307) {
		tmp = x * -3.0;
	} else if (z <= 1.8e-223) {
		tmp = y * 4.0;
	} else if (z <= 1.35e-151) {
		tmp = x * -3.0;
	} else if (z <= 5.8e-117) {
		tmp = y * 4.0;
	} else if (z <= 5.5e-64) {
		tmp = 1.0 / (-0.3333333333333333 / x);
	} else if (z <= 0.65) {
		tmp = y * 4.0;
	} else {
		tmp = z * (x * 6.0);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-6.0d0) * (y * z)
    if (z <= (-1.6d+198)) then
        tmp = t_0
    else if (z <= (-1.15d+97)) then
        tmp = x * (z * 6.0d0)
    else if (z <= (-2.6d-11)) then
        tmp = t_0
    else if (z <= (-1.46d-68)) then
        tmp = x * (-3.0d0)
    else if (z <= (-1.15d-166)) then
        tmp = y * 4.0d0
    else if (z <= 5.8d-307) then
        tmp = x * (-3.0d0)
    else if (z <= 1.8d-223) then
        tmp = y * 4.0d0
    else if (z <= 1.35d-151) then
        tmp = x * (-3.0d0)
    else if (z <= 5.8d-117) then
        tmp = y * 4.0d0
    else if (z <= 5.5d-64) then
        tmp = 1.0d0 / ((-0.3333333333333333d0) / x)
    else if (z <= 0.65d0) then
        tmp = y * 4.0d0
    else
        tmp = z * (x * 6.0d0)
    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 <= -1.6e+198) {
		tmp = t_0;
	} else if (z <= -1.15e+97) {
		tmp = x * (z * 6.0);
	} else if (z <= -2.6e-11) {
		tmp = t_0;
	} else if (z <= -1.46e-68) {
		tmp = x * -3.0;
	} else if (z <= -1.15e-166) {
		tmp = y * 4.0;
	} else if (z <= 5.8e-307) {
		tmp = x * -3.0;
	} else if (z <= 1.8e-223) {
		tmp = y * 4.0;
	} else if (z <= 1.35e-151) {
		tmp = x * -3.0;
	} else if (z <= 5.8e-117) {
		tmp = y * 4.0;
	} else if (z <= 5.5e-64) {
		tmp = 1.0 / (-0.3333333333333333 / x);
	} else if (z <= 0.65) {
		tmp = y * 4.0;
	} else {
		tmp = z * (x * 6.0);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	tmp = 0
	if z <= -1.6e+198:
		tmp = t_0
	elif z <= -1.15e+97:
		tmp = x * (z * 6.0)
	elif z <= -2.6e-11:
		tmp = t_0
	elif z <= -1.46e-68:
		tmp = x * -3.0
	elif z <= -1.15e-166:
		tmp = y * 4.0
	elif z <= 5.8e-307:
		tmp = x * -3.0
	elif z <= 1.8e-223:
		tmp = y * 4.0
	elif z <= 1.35e-151:
		tmp = x * -3.0
	elif z <= 5.8e-117:
		tmp = y * 4.0
	elif z <= 5.5e-64:
		tmp = 1.0 / (-0.3333333333333333 / x)
	elif z <= 0.65:
		tmp = y * 4.0
	else:
		tmp = z * (x * 6.0)
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -1.6e+198)
		tmp = t_0;
	elseif (z <= -1.15e+97)
		tmp = Float64(x * Float64(z * 6.0));
	elseif (z <= -2.6e-11)
		tmp = t_0;
	elseif (z <= -1.46e-68)
		tmp = Float64(x * -3.0);
	elseif (z <= -1.15e-166)
		tmp = Float64(y * 4.0);
	elseif (z <= 5.8e-307)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.8e-223)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.35e-151)
		tmp = Float64(x * -3.0);
	elseif (z <= 5.8e-117)
		tmp = Float64(y * 4.0);
	elseif (z <= 5.5e-64)
		tmp = Float64(1.0 / Float64(-0.3333333333333333 / x));
	elseif (z <= 0.65)
		tmp = Float64(y * 4.0);
	else
		tmp = Float64(z * Float64(x * 6.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	tmp = 0.0;
	if (z <= -1.6e+198)
		tmp = t_0;
	elseif (z <= -1.15e+97)
		tmp = x * (z * 6.0);
	elseif (z <= -2.6e-11)
		tmp = t_0;
	elseif (z <= -1.46e-68)
		tmp = x * -3.0;
	elseif (z <= -1.15e-166)
		tmp = y * 4.0;
	elseif (z <= 5.8e-307)
		tmp = x * -3.0;
	elseif (z <= 1.8e-223)
		tmp = y * 4.0;
	elseif (z <= 1.35e-151)
		tmp = x * -3.0;
	elseif (z <= 5.8e-117)
		tmp = y * 4.0;
	elseif (z <= 5.5e-64)
		tmp = 1.0 / (-0.3333333333333333 / x);
	elseif (z <= 0.65)
		tmp = y * 4.0;
	else
		tmp = z * (x * 6.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, -1.6e+198], t$95$0, If[LessEqual[z, -1.15e+97], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.6e-11], t$95$0, If[LessEqual[z, -1.46e-68], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.15e-166], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5.8e-307], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.8e-223], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.35e-151], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 5.8e-117], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5.5e-64], N[(1.0 / N[(-0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.15 \cdot 10^{+97}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\

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

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

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

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

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

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

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

\mathbf{elif}\;z \leq 5.5 \cdot 10^{-64}:\\
\;\;\;\;\frac{1}{\frac{-0.3333333333333333}{x}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -1.5999999999999999e198 or -1.15000000000000003e97 < z < -2.6000000000000001e-11

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5999999999999999e198 < z < -1.15000000000000003e97

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{-1}{x}}{3 + -6 \cdot z}}} \]
      2. *-commutative69.8%

        \[\leadsto \frac{1}{\frac{\frac{-1}{x}}{3 + \color{blue}{z \cdot -6}}} \]
    8. Simplified69.8%

      \[\leadsto \frac{1}{\color{blue}{\frac{\frac{-1}{x}}{3 + z \cdot -6}}} \]
    9. Taylor expanded in z around inf 69.7%

      \[\leadsto \frac{1}{\color{blue}{\frac{0.16666666666666666}{x \cdot z}}} \]
    10. Step-by-step derivation
      1. associate-/r/69.7%

        \[\leadsto \color{blue}{\frac{1}{0.16666666666666666} \cdot \left(x \cdot z\right)} \]
      2. associate-*r*69.7%

        \[\leadsto \color{blue}{\left(\frac{1}{0.16666666666666666} \cdot x\right) \cdot z} \]
      3. *-commutative69.7%

        \[\leadsto \color{blue}{z \cdot \left(\frac{1}{0.16666666666666666} \cdot x\right)} \]
      4. associate-*l*69.9%

        \[\leadsto \color{blue}{\left(z \cdot \frac{1}{0.16666666666666666}\right) \cdot x} \]
      5. metadata-eval69.9%

        \[\leadsto \left(z \cdot \color{blue}{6}\right) \cdot x \]
    11. Applied egg-rr69.9%

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

    if -2.6000000000000001e-11 < z < -1.45999999999999998e-68 or -1.14999999999999999e-166 < z < 5.8000000000000001e-307 or 1.8000000000000002e-223 < z < 1.35000000000000004e-151

    1. Initial program 99.3%

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

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

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

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

      \[\leadsto \color{blue}{x + -4 \cdot x} \]
    6. Step-by-step derivation
      1. distribute-rgt1-in69.8%

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

        \[\leadsto \color{blue}{-3} \cdot x \]
      3. *-commutative69.8%

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

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

    if -1.45999999999999998e-68 < z < -1.14999999999999999e-166 or 5.8000000000000001e-307 < z < 1.8000000000000002e-223 or 1.35000000000000004e-151 < z < 5.8000000000000001e-117 or 5.4999999999999999e-64 < z < 0.650000000000000022

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.8000000000000001e-117 < z < 5.4999999999999999e-64

    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. metadata-eval99.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{-1}{x}}{3 + -6 \cdot z}}} \]
      2. *-commutative77.7%

        \[\leadsto \frac{1}{\frac{\frac{-1}{x}}{3 + \color{blue}{z \cdot -6}}} \]
    8. Simplified77.7%

      \[\leadsto \frac{1}{\color{blue}{\frac{\frac{-1}{x}}{3 + z \cdot -6}}} \]
    9. Taylor expanded in z around 0 77.7%

      \[\leadsto \frac{1}{\color{blue}{\frac{-0.3333333333333333}{x}}} \]

    if 0.650000000000000022 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{-1}{x}}{3 + -6 \cdot z}}} \]
      2. *-commutative66.0%

        \[\leadsto \frac{1}{\frac{\frac{-1}{x}}{3 + \color{blue}{z \cdot -6}}} \]
    8. Simplified66.0%

      \[\leadsto \frac{1}{\color{blue}{\frac{\frac{-1}{x}}{3 + z \cdot -6}}} \]
    9. Taylor expanded in z around inf 66.1%

      \[\leadsto \frac{1}{\color{blue}{\frac{0.16666666666666666}{x \cdot z}}} \]
    10. Step-by-step derivation
      1. associate-/r/66.1%

        \[\leadsto \color{blue}{\frac{1}{0.16666666666666666} \cdot \left(x \cdot z\right)} \]
      2. associate-*r*66.3%

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

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{0.16666666666666666}\right)} \cdot z \]
      4. metadata-eval66.3%

        \[\leadsto \left(x \cdot \color{blue}{6}\right) \cdot z \]
    11. Applied egg-rr66.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+198}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{+97}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-11}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.46 \cdot 10^{-68}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-166}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-307}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-223}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-151}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-117}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-64}:\\ \;\;\;\;\frac{1}{\frac{-0.3333333333333333}{x}}\\ \mathbf{elif}\;z \leq 0.65:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \end{array} \]

Alternative 5: 51.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -2.6 \cdot 10^{-11}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{-68}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-175}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{-306}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-216}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-152}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-115}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{-73}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.048:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))))
   (if (<= z -2.6e-11)
     t_0
     (if (<= z -1.5e-68)
       (* x -3.0)
       (if (<= z -8e-175)
         (* y 4.0)
         (if (<= z 2.25e-306)
           (* x -3.0)
           (if (<= z 1.7e-216)
             (* y 4.0)
             (if (<= z 1.1e-152)
               (* x -3.0)
               (if (<= z 3.2e-115)
                 (* y 4.0)
                 (if (<= z 4.7e-73)
                   (* x -3.0)
                   (if (<= z 0.048) (* y 4.0) t_0)))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double tmp;
	if (z <= -2.6e-11) {
		tmp = t_0;
	} else if (z <= -1.5e-68) {
		tmp = x * -3.0;
	} else if (z <= -8e-175) {
		tmp = y * 4.0;
	} else if (z <= 2.25e-306) {
		tmp = x * -3.0;
	} else if (z <= 1.7e-216) {
		tmp = y * 4.0;
	} else if (z <= 1.1e-152) {
		tmp = x * -3.0;
	} else if (z <= 3.2e-115) {
		tmp = y * 4.0;
	} else if (z <= 4.7e-73) {
		tmp = x * -3.0;
	} else if (z <= 0.048) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-6.0d0) * (y * z)
    if (z <= (-2.6d-11)) then
        tmp = t_0
    else if (z <= (-1.5d-68)) then
        tmp = x * (-3.0d0)
    else if (z <= (-8d-175)) then
        tmp = y * 4.0d0
    else if (z <= 2.25d-306) then
        tmp = x * (-3.0d0)
    else if (z <= 1.7d-216) then
        tmp = y * 4.0d0
    else if (z <= 1.1d-152) then
        tmp = x * (-3.0d0)
    else if (z <= 3.2d-115) then
        tmp = y * 4.0d0
    else if (z <= 4.7d-73) then
        tmp = x * (-3.0d0)
    else if (z <= 0.048d0) then
        tmp = y * 4.0d0
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double tmp;
	if (z <= -2.6e-11) {
		tmp = t_0;
	} else if (z <= -1.5e-68) {
		tmp = x * -3.0;
	} else if (z <= -8e-175) {
		tmp = y * 4.0;
	} else if (z <= 2.25e-306) {
		tmp = x * -3.0;
	} else if (z <= 1.7e-216) {
		tmp = y * 4.0;
	} else if (z <= 1.1e-152) {
		tmp = x * -3.0;
	} else if (z <= 3.2e-115) {
		tmp = y * 4.0;
	} else if (z <= 4.7e-73) {
		tmp = x * -3.0;
	} else if (z <= 0.048) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	tmp = 0
	if z <= -2.6e-11:
		tmp = t_0
	elif z <= -1.5e-68:
		tmp = x * -3.0
	elif z <= -8e-175:
		tmp = y * 4.0
	elif z <= 2.25e-306:
		tmp = x * -3.0
	elif z <= 1.7e-216:
		tmp = y * 4.0
	elif z <= 1.1e-152:
		tmp = x * -3.0
	elif z <= 3.2e-115:
		tmp = y * 4.0
	elif z <= 4.7e-73:
		tmp = x * -3.0
	elif z <= 0.048:
		tmp = y * 4.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -2.6e-11)
		tmp = t_0;
	elseif (z <= -1.5e-68)
		tmp = Float64(x * -3.0);
	elseif (z <= -8e-175)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.25e-306)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.7e-216)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.1e-152)
		tmp = Float64(x * -3.0);
	elseif (z <= 3.2e-115)
		tmp = Float64(y * 4.0);
	elseif (z <= 4.7e-73)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.048)
		tmp = Float64(y * 4.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	tmp = 0.0;
	if (z <= -2.6e-11)
		tmp = t_0;
	elseif (z <= -1.5e-68)
		tmp = x * -3.0;
	elseif (z <= -8e-175)
		tmp = y * 4.0;
	elseif (z <= 2.25e-306)
		tmp = x * -3.0;
	elseif (z <= 1.7e-216)
		tmp = y * 4.0;
	elseif (z <= 1.1e-152)
		tmp = x * -3.0;
	elseif (z <= 3.2e-115)
		tmp = y * 4.0;
	elseif (z <= 4.7e-73)
		tmp = x * -3.0;
	elseif (z <= 0.048)
		tmp = y * 4.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e-11], t$95$0, If[LessEqual[z, -1.5e-68], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -8e-175], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.25e-306], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.7e-216], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.1e-152], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.2e-115], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 4.7e-73], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.048], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]]]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.6000000000000001e-11 or 0.048000000000000001 < z

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.6000000000000001e-11 < z < -1.5e-68 or -8e-175 < z < 2.25000000000000002e-306 or 1.6999999999999999e-216 < z < 1.09999999999999992e-152 or 3.2e-115 < z < 4.69999999999999994e-73

    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. metadata-eval99.2%

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

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

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

      \[\leadsto \color{blue}{x + -4 \cdot x} \]
    6. Step-by-step derivation
      1. distribute-rgt1-in70.8%

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

        \[\leadsto \color{blue}{-3} \cdot x \]
      3. *-commutative70.8%

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

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

    if -1.5e-68 < z < -8e-175 or 2.25000000000000002e-306 < z < 1.6999999999999999e-216 or 1.09999999999999992e-152 < z < 3.2e-115 or 4.69999999999999994e-73 < z < 0.048000000000000001

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{-11}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{-68}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-175}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{-306}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-216}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-152}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-115}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{-73}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.048:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]

Alternative 6: 58.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(4 + z \cdot -6\right)\\ \mathbf{if}\;y \leq -8 \cdot 10^{-74}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -1.65 \cdot 10^{-274}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-171}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;y \leq 1900000000000:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (+ 4.0 (* z -6.0)))))
   (if (<= y -8e-74)
     t_0
     (if (<= y -1.65e-274)
       (* x (* z 6.0))
       (if (<= y 4.2e-171)
         (* x -3.0)
         (if (<= y 1900000000000.0) (* z (* x 6.0)) t_0))))))
double code(double x, double y, double z) {
	double t_0 = y * (4.0 + (z * -6.0));
	double tmp;
	if (y <= -8e-74) {
		tmp = t_0;
	} else if (y <= -1.65e-274) {
		tmp = x * (z * 6.0);
	} else if (y <= 4.2e-171) {
		tmp = x * -3.0;
	} else if (y <= 1900000000000.0) {
		tmp = z * (x * 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 = y * (4.0d0 + (z * (-6.0d0)))
    if (y <= (-8d-74)) then
        tmp = t_0
    else if (y <= (-1.65d-274)) then
        tmp = x * (z * 6.0d0)
    else if (y <= 4.2d-171) then
        tmp = x * (-3.0d0)
    else if (y <= 1900000000000.0d0) then
        tmp = z * (x * 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 = y * (4.0 + (z * -6.0));
	double tmp;
	if (y <= -8e-74) {
		tmp = t_0;
	} else if (y <= -1.65e-274) {
		tmp = x * (z * 6.0);
	} else if (y <= 4.2e-171) {
		tmp = x * -3.0;
	} else if (y <= 1900000000000.0) {
		tmp = z * (x * 6.0);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * (4.0 + (z * -6.0))
	tmp = 0
	if y <= -8e-74:
		tmp = t_0
	elif y <= -1.65e-274:
		tmp = x * (z * 6.0)
	elif y <= 4.2e-171:
		tmp = x * -3.0
	elif y <= 1900000000000.0:
		tmp = z * (x * 6.0)
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(y * Float64(4.0 + Float64(z * -6.0)))
	tmp = 0.0
	if (y <= -8e-74)
		tmp = t_0;
	elseif (y <= -1.65e-274)
		tmp = Float64(x * Float64(z * 6.0));
	elseif (y <= 4.2e-171)
		tmp = Float64(x * -3.0);
	elseif (y <= 1900000000000.0)
		tmp = Float64(z * Float64(x * 6.0));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * (4.0 + (z * -6.0));
	tmp = 0.0;
	if (y <= -8e-74)
		tmp = t_0;
	elseif (y <= -1.65e-274)
		tmp = x * (z * 6.0);
	elseif (y <= 4.2e-171)
		tmp = x * -3.0;
	elseif (y <= 1900000000000.0)
		tmp = z * (x * 6.0);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8e-74], t$95$0, If[LessEqual[y, -1.65e-274], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e-171], N[(x * -3.0), $MachinePrecision], If[LessEqual[y, 1900000000000.0], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.65 \cdot 10^{-274}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{-171}:\\
\;\;\;\;x \cdot -3\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -7.99999999999999966e-74 or 1.9e12 < 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. distribute-rgt-in99.8%

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

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

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

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

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

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

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

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

    if -7.99999999999999966e-74 < y < -1.6499999999999999e-274

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{-1}{x}}{3 + -6 \cdot z}}} \]
      2. *-commutative82.6%

        \[\leadsto \frac{1}{\frac{\frac{-1}{x}}{3 + \color{blue}{z \cdot -6}}} \]
    8. Simplified82.6%

      \[\leadsto \frac{1}{\color{blue}{\frac{\frac{-1}{x}}{3 + z \cdot -6}}} \]
    9. Taylor expanded in z around inf 55.4%

      \[\leadsto \frac{1}{\color{blue}{\frac{0.16666666666666666}{x \cdot z}}} \]
    10. Step-by-step derivation
      1. associate-/r/55.2%

        \[\leadsto \color{blue}{\frac{1}{0.16666666666666666} \cdot \left(x \cdot z\right)} \]
      2. associate-*r*55.4%

        \[\leadsto \color{blue}{\left(\frac{1}{0.16666666666666666} \cdot x\right) \cdot z} \]
      3. *-commutative55.4%

        \[\leadsto \color{blue}{z \cdot \left(\frac{1}{0.16666666666666666} \cdot x\right)} \]
      4. associate-*l*55.4%

        \[\leadsto \color{blue}{\left(z \cdot \frac{1}{0.16666666666666666}\right) \cdot x} \]
      5. metadata-eval55.4%

        \[\leadsto \left(z \cdot \color{blue}{6}\right) \cdot x \]
    11. Applied egg-rr55.4%

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

    if -1.6499999999999999e-274 < y < 4.2e-171

    1. Initial program 99.4%

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

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

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

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

      \[\leadsto \color{blue}{x + -4 \cdot x} \]
    6. Step-by-step derivation
      1. distribute-rgt1-in60.8%

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

        \[\leadsto \color{blue}{-3} \cdot x \]
      3. *-commutative60.8%

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

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

    if 4.2e-171 < y < 1.9e12

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{-1}{x}}{3 + -6 \cdot z}}} \]
      2. *-commutative77.0%

        \[\leadsto \frac{1}{\frac{\frac{-1}{x}}{3 + \color{blue}{z \cdot -6}}} \]
    8. Simplified77.0%

      \[\leadsto \frac{1}{\color{blue}{\frac{\frac{-1}{x}}{3 + z \cdot -6}}} \]
    9. Taylor expanded in z around inf 51.0%

      \[\leadsto \frac{1}{\color{blue}{\frac{0.16666666666666666}{x \cdot z}}} \]
    10. Step-by-step derivation
      1. associate-/r/51.0%

        \[\leadsto \color{blue}{\frac{1}{0.16666666666666666} \cdot \left(x \cdot z\right)} \]
      2. associate-*r*51.1%

        \[\leadsto \color{blue}{\left(\frac{1}{0.16666666666666666} \cdot x\right) \cdot z} \]
      3. *-commutative51.1%

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{0.16666666666666666}\right)} \cdot z \]
      4. metadata-eval51.1%

        \[\leadsto \left(x \cdot \color{blue}{6}\right) \cdot z \]
    11. Applied egg-rr51.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{-74}:\\ \;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\ \mathbf{elif}\;y \leq -1.65 \cdot 10^{-274}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-171}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;y \leq 1900000000000:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\ \end{array} \]

Alternative 7: 97.7% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

    if -0.660000000000000031 < z < 0.57999999999999996

    1. Initial program 99.4%

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

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

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

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

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

Alternative 8: 99.7% accurate, 1.0× speedup?

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

\\
x + \frac{y - x}{\frac{\frac{1}{0.6666666666666666 - z}}{6}}
\end{array}
Derivation
  1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{\frac{1}{0.6666666666666666 - z}}{6}}} \]
  7. Simplified99.7%

    \[\leadsto x + \color{blue}{\frac{y - x}{\frac{\frac{1}{0.6666666666666666 - z}}{6}}} \]
  8. Final simplification99.7%

    \[\leadsto x + \frac{y - x}{\frac{\frac{1}{0.6666666666666666 - z}}{6}} \]

Alternative 9: 75.3% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.8 \cdot 10^{-73} \lor \neg \left(y \leq 1.5 \cdot 10^{-5}\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 -2.8e-73) (not (<= y 1.5e-5)))
   (* y (+ 4.0 (* z -6.0)))
   (* x (- -3.0 (* z -6.0)))))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -2.8e-73) || !(y <= 1.5e-5)) {
		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 <= (-2.8d-73)) .or. (.not. (y <= 1.5d-5))) 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 <= -2.8e-73) || !(y <= 1.5e-5)) {
		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 <= -2.8e-73) or not (y <= 1.5e-5):
		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 <= -2.8e-73) || !(y <= 1.5e-5))
		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 <= -2.8e-73) || ~((y <= 1.5e-5)))
		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, -2.8e-73], N[Not[LessEqual[y, 1.5e-5]], $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 -2.8 \cdot 10^{-73} \lor \neg \left(y \leq 1.5 \cdot 10^{-5}\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 < -2.80000000000000012e-73 or 1.50000000000000004e-5 < 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. distribute-rgt-in99.8%

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

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

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

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

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

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

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

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

    if -2.80000000000000012e-73 < y < 1.50000000000000004e-5

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{-1}{x}}{3 + -6 \cdot z}}} \]
      2. *-commutative85.4%

        \[\leadsto \frac{1}{\frac{\frac{-1}{x}}{3 + \color{blue}{z \cdot -6}}} \]
    8. Simplified85.4%

      \[\leadsto \frac{1}{\color{blue}{\frac{\frac{-1}{x}}{3 + z \cdot -6}}} \]
    9. Step-by-step derivation
      1. associate-/l/85.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(0 - 3\right) - z \cdot -6\right)} \cdot x \]
      8. metadata-eval85.5%

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

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

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

Alternative 10: 99.5% accurate, 1.2× speedup?

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

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

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

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

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

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

Alternative 11: 36.8% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+28}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;x \leq 1.05 \cdot 10^{+117}:\\
\;\;\;\;y \cdot 4\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.04999999999999995e28 or 1.0500000000000001e117 < x

    1. Initial program 99.6%

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

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

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

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

      \[\leadsto \color{blue}{x + -4 \cdot x} \]
    6. Step-by-step derivation
      1. distribute-rgt1-in43.1%

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

        \[\leadsto \color{blue}{-3} \cdot x \]
      3. *-commutative43.1%

        \[\leadsto \color{blue}{x \cdot -3} \]
    7. Simplified43.1%

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

    if -1.04999999999999995e28 < x < 1.0500000000000001e117

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.05 \cdot 10^{+28}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{+117}:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;x \cdot -3\\ \end{array} \]

Alternative 12: 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.6%

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

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

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

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

    \[\leadsto \color{blue}{x + -4 \cdot x} \]
  6. Step-by-step derivation
    1. distribute-rgt1-in26.4%

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

      \[\leadsto \color{blue}{-3} \cdot x \]
    3. *-commutative26.4%

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

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

    \[\leadsto x \cdot -3 \]

Reproduce

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