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

Percentage Accurate: 99.6% → 99.7%
Time: 12.4s
Alternatives: 18
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 18 alternatives:

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

Initial Program: 99.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 0.1× speedup?

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

\\
x + \mathsf{fma}\left(-6, \left(y - x\right) \cdot z, \left(y - x\right) \cdot 4\right)
\end{array}
Derivation
  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. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutative99.2%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.5% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(\left(y - x\right) \cdot \left(0.6666666666666666 - z\right), 6, x\right)
\end{array}
Derivation
  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. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutative99.2%

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

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

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

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

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

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

Alternative 3: 50.3% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(x \cdot 6\right)\\ \mathbf{if}\;z \leq -2.35 \cdot 10^{+175}:\\ \;\;\;\;z \cdot \left(-6 \cdot y\right)\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{+136}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -2.55 \cdot 10^{+127}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -360:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{-180}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-272}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-194}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-66}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.68:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{+127}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-6 \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (* x 6.0))))
   (if (<= z -2.35e+175)
     (* z (* -6.0 y))
     (if (<= z -1.25e+136)
       t_0
       (if (<= z -2.55e+127)
         (* -6.0 (* y z))
         (if (<= z -360.0)
           (* x (* z 6.0))
           (if (<= z -9.5e-180)
             (* y 4.0)
             (if (<= z 1.95e-272)
               (* x -3.0)
               (if (<= z 2.9e-194)
                 (* y 4.0)
                 (if (<= z 2.1e-66)
                   (* x -3.0)
                   (if (<= z 0.68)
                     (* y 4.0)
                     (if (<= z 1.85e+127) t_0 (* y (* -6.0 z))))))))))))))
double code(double x, double y, double z) {
	double t_0 = z * (x * 6.0);
	double tmp;
	if (z <= -2.35e+175) {
		tmp = z * (-6.0 * y);
	} else if (z <= -1.25e+136) {
		tmp = t_0;
	} else if (z <= -2.55e+127) {
		tmp = -6.0 * (y * z);
	} else if (z <= -360.0) {
		tmp = x * (z * 6.0);
	} else if (z <= -9.5e-180) {
		tmp = y * 4.0;
	} else if (z <= 1.95e-272) {
		tmp = x * -3.0;
	} else if (z <= 2.9e-194) {
		tmp = y * 4.0;
	} else if (z <= 2.1e-66) {
		tmp = x * -3.0;
	} else if (z <= 0.68) {
		tmp = y * 4.0;
	} else if (z <= 1.85e+127) {
		tmp = t_0;
	} else {
		tmp = y * (-6.0 * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = z * (x * 6.0d0)
    if (z <= (-2.35d+175)) then
        tmp = z * ((-6.0d0) * y)
    else if (z <= (-1.25d+136)) then
        tmp = t_0
    else if (z <= (-2.55d+127)) then
        tmp = (-6.0d0) * (y * z)
    else if (z <= (-360.0d0)) then
        tmp = x * (z * 6.0d0)
    else if (z <= (-9.5d-180)) then
        tmp = y * 4.0d0
    else if (z <= 1.95d-272) then
        tmp = x * (-3.0d0)
    else if (z <= 2.9d-194) then
        tmp = y * 4.0d0
    else if (z <= 2.1d-66) then
        tmp = x * (-3.0d0)
    else if (z <= 0.68d0) then
        tmp = y * 4.0d0
    else if (z <= 1.85d+127) then
        tmp = t_0
    else
        tmp = y * ((-6.0d0) * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = z * (x * 6.0);
	double tmp;
	if (z <= -2.35e+175) {
		tmp = z * (-6.0 * y);
	} else if (z <= -1.25e+136) {
		tmp = t_0;
	} else if (z <= -2.55e+127) {
		tmp = -6.0 * (y * z);
	} else if (z <= -360.0) {
		tmp = x * (z * 6.0);
	} else if (z <= -9.5e-180) {
		tmp = y * 4.0;
	} else if (z <= 1.95e-272) {
		tmp = x * -3.0;
	} else if (z <= 2.9e-194) {
		tmp = y * 4.0;
	} else if (z <= 2.1e-66) {
		tmp = x * -3.0;
	} else if (z <= 0.68) {
		tmp = y * 4.0;
	} else if (z <= 1.85e+127) {
		tmp = t_0;
	} else {
		tmp = y * (-6.0 * z);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * (x * 6.0)
	tmp = 0
	if z <= -2.35e+175:
		tmp = z * (-6.0 * y)
	elif z <= -1.25e+136:
		tmp = t_0
	elif z <= -2.55e+127:
		tmp = -6.0 * (y * z)
	elif z <= -360.0:
		tmp = x * (z * 6.0)
	elif z <= -9.5e-180:
		tmp = y * 4.0
	elif z <= 1.95e-272:
		tmp = x * -3.0
	elif z <= 2.9e-194:
		tmp = y * 4.0
	elif z <= 2.1e-66:
		tmp = x * -3.0
	elif z <= 0.68:
		tmp = y * 4.0
	elif z <= 1.85e+127:
		tmp = t_0
	else:
		tmp = y * (-6.0 * z)
	return tmp
function code(x, y, z)
	t_0 = Float64(z * Float64(x * 6.0))
	tmp = 0.0
	if (z <= -2.35e+175)
		tmp = Float64(z * Float64(-6.0 * y));
	elseif (z <= -1.25e+136)
		tmp = t_0;
	elseif (z <= -2.55e+127)
		tmp = Float64(-6.0 * Float64(y * z));
	elseif (z <= -360.0)
		tmp = Float64(x * Float64(z * 6.0));
	elseif (z <= -9.5e-180)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.95e-272)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.9e-194)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.1e-66)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.68)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.85e+127)
		tmp = t_0;
	else
		tmp = Float64(y * Float64(-6.0 * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * (x * 6.0);
	tmp = 0.0;
	if (z <= -2.35e+175)
		tmp = z * (-6.0 * y);
	elseif (z <= -1.25e+136)
		tmp = t_0;
	elseif (z <= -2.55e+127)
		tmp = -6.0 * (y * z);
	elseif (z <= -360.0)
		tmp = x * (z * 6.0);
	elseif (z <= -9.5e-180)
		tmp = y * 4.0;
	elseif (z <= 1.95e-272)
		tmp = x * -3.0;
	elseif (z <= 2.9e-194)
		tmp = y * 4.0;
	elseif (z <= 2.1e-66)
		tmp = x * -3.0;
	elseif (z <= 0.68)
		tmp = y * 4.0;
	elseif (z <= 1.85e+127)
		tmp = t_0;
	else
		tmp = y * (-6.0 * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.35e+175], N[(z * N[(-6.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.25e+136], t$95$0, If[LessEqual[z, -2.55e+127], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -360.0], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9.5e-180], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.95e-272], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.9e-194], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.1e-66], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.68], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.85e+127], t$95$0, N[(y * N[(-6.0 * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.25 \cdot 10^{+136}:\\
\;\;\;\;t\_0\\

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

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

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

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

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

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

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

\mathbf{elif}\;z \leq 1.85 \cdot 10^{+127}:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.34999999999999998e175 < z < -1.25e136 or 0.680000000000000049 < z < 1.8499999999999999e127

    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. Add Preprocessing
    5. Taylor expanded in x around inf 68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.25e136 < z < -2.55000000000000019e127

    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. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.7%

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

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

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

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

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

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

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

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

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

    if -2.55000000000000019e127 < z < -360

    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. Add Preprocessing
    5. Taylor expanded in x around inf 66.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -360 < z < -9.49999999999999934e-180 or 1.9499999999999999e-272 < z < 2.8999999999999997e-194 or 2.1e-66 < z < 0.680000000000000049

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    10. Simplified62.1%

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

    if -9.49999999999999934e-180 < z < 1.9499999999999999e-272 or 2.8999999999999997e-194 < z < 2.1e-66

    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. Add Preprocessing
    5. Taylor expanded in x around inf 63.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.8499999999999999e127 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.35 \cdot 10^{+175}:\\ \;\;\;\;z \cdot \left(-6 \cdot y\right)\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{+136}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \mathbf{elif}\;z \leq -2.55 \cdot 10^{+127}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -360:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{-180}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-272}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-194}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-66}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.68:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{+127}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-6 \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 50.3% accurate, 0.2× 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 -7.5 \cdot 10^{+175}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{+137}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.55 \cdot 10^{+127}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -16:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{-181}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-272}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{-194}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-66}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+133}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-6 \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))) (t_1 (* z (* x 6.0))))
   (if (<= z -7.5e+175)
     t_0
     (if (<= z -6.5e+137)
       t_1
       (if (<= z -2.55e+127)
         t_0
         (if (<= z -16.0)
           (* x (* z 6.0))
           (if (<= z -8.2e-181)
             (* y 4.0)
             (if (<= z 1.95e-272)
               (* x -3.0)
               (if (<= z 3.3e-194)
                 (* y 4.0)
                 (if (<= z 2.2e-66)
                   (* x -3.0)
                   (if (<= z 0.5)
                     (* y 4.0)
                     (if (<= z 8.5e+133) t_1 (* y (* -6.0 z))))))))))))))
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 <= -7.5e+175) {
		tmp = t_0;
	} else if (z <= -6.5e+137) {
		tmp = t_1;
	} else if (z <= -2.55e+127) {
		tmp = t_0;
	} else if (z <= -16.0) {
		tmp = x * (z * 6.0);
	} else if (z <= -8.2e-181) {
		tmp = y * 4.0;
	} else if (z <= 1.95e-272) {
		tmp = x * -3.0;
	} else if (z <= 3.3e-194) {
		tmp = y * 4.0;
	} else if (z <= 2.2e-66) {
		tmp = x * -3.0;
	} else if (z <= 0.5) {
		tmp = y * 4.0;
	} else if (z <= 8.5e+133) {
		tmp = t_1;
	} else {
		tmp = y * (-6.0 * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (-6.0d0) * (y * z)
    t_1 = z * (x * 6.0d0)
    if (z <= (-7.5d+175)) then
        tmp = t_0
    else if (z <= (-6.5d+137)) then
        tmp = t_1
    else if (z <= (-2.55d+127)) then
        tmp = t_0
    else if (z <= (-16.0d0)) then
        tmp = x * (z * 6.0d0)
    else if (z <= (-8.2d-181)) then
        tmp = y * 4.0d0
    else if (z <= 1.95d-272) then
        tmp = x * (-3.0d0)
    else if (z <= 3.3d-194) then
        tmp = y * 4.0d0
    else if (z <= 2.2d-66) then
        tmp = x * (-3.0d0)
    else if (z <= 0.5d0) then
        tmp = y * 4.0d0
    else if (z <= 8.5d+133) then
        tmp = t_1
    else
        tmp = y * ((-6.0d0) * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = z * (x * 6.0);
	double tmp;
	if (z <= -7.5e+175) {
		tmp = t_0;
	} else if (z <= -6.5e+137) {
		tmp = t_1;
	} else if (z <= -2.55e+127) {
		tmp = t_0;
	} else if (z <= -16.0) {
		tmp = x * (z * 6.0);
	} else if (z <= -8.2e-181) {
		tmp = y * 4.0;
	} else if (z <= 1.95e-272) {
		tmp = x * -3.0;
	} else if (z <= 3.3e-194) {
		tmp = y * 4.0;
	} else if (z <= 2.2e-66) {
		tmp = x * -3.0;
	} else if (z <= 0.5) {
		tmp = y * 4.0;
	} else if (z <= 8.5e+133) {
		tmp = t_1;
	} else {
		tmp = y * (-6.0 * z);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	t_1 = z * (x * 6.0)
	tmp = 0
	if z <= -7.5e+175:
		tmp = t_0
	elif z <= -6.5e+137:
		tmp = t_1
	elif z <= -2.55e+127:
		tmp = t_0
	elif z <= -16.0:
		tmp = x * (z * 6.0)
	elif z <= -8.2e-181:
		tmp = y * 4.0
	elif z <= 1.95e-272:
		tmp = x * -3.0
	elif z <= 3.3e-194:
		tmp = y * 4.0
	elif z <= 2.2e-66:
		tmp = x * -3.0
	elif z <= 0.5:
		tmp = y * 4.0
	elif z <= 8.5e+133:
		tmp = t_1
	else:
		tmp = y * (-6.0 * z)
	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 <= -7.5e+175)
		tmp = t_0;
	elseif (z <= -6.5e+137)
		tmp = t_1;
	elseif (z <= -2.55e+127)
		tmp = t_0;
	elseif (z <= -16.0)
		tmp = Float64(x * Float64(z * 6.0));
	elseif (z <= -8.2e-181)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.95e-272)
		tmp = Float64(x * -3.0);
	elseif (z <= 3.3e-194)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.2e-66)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.5)
		tmp = Float64(y * 4.0);
	elseif (z <= 8.5e+133)
		tmp = t_1;
	else
		tmp = Float64(y * Float64(-6.0 * z));
	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 <= -7.5e+175)
		tmp = t_0;
	elseif (z <= -6.5e+137)
		tmp = t_1;
	elseif (z <= -2.55e+127)
		tmp = t_0;
	elseif (z <= -16.0)
		tmp = x * (z * 6.0);
	elseif (z <= -8.2e-181)
		tmp = y * 4.0;
	elseif (z <= 1.95e-272)
		tmp = x * -3.0;
	elseif (z <= 3.3e-194)
		tmp = y * 4.0;
	elseif (z <= 2.2e-66)
		tmp = x * -3.0;
	elseif (z <= 0.5)
		tmp = y * 4.0;
	elseif (z <= 8.5e+133)
		tmp = t_1;
	else
		tmp = y * (-6.0 * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.5e+175], t$95$0, If[LessEqual[z, -6.5e+137], t$95$1, If[LessEqual[z, -2.55e+127], t$95$0, If[LessEqual[z, -16.0], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.2e-181], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.95e-272], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.3e-194], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.2e-66], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 8.5e+133], t$95$1, N[(y * N[(-6.0 * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\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 -7.5 \cdot 10^{+175}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -6.5 \cdot 10^{+137}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -2.55 \cdot 10^{+127}:\\
\;\;\;\;t\_0\\

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

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

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

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

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

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

\mathbf{elif}\;z \leq 8.5 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -7.5000000000000001e175 or -6.5000000000000002e137 < z < -2.55000000000000019e127

    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. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.8%

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

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

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

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

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

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

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

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

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

    if -7.5000000000000001e175 < z < -6.5000000000000002e137 or 0.5 < z < 8.50000000000000044e133

    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. Add Preprocessing
    5. Taylor expanded in x around inf 68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.55000000000000019e127 < z < -16

    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. Add Preprocessing
    5. Taylor expanded in x around inf 66.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -16 < z < -8.2000000000000003e-181 or 1.9499999999999999e-272 < z < 3.2999999999999999e-194 or 2.2000000000000001e-66 < z < 0.5

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    10. Simplified62.1%

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

    if -8.2000000000000003e-181 < z < 1.9499999999999999e-272 or 3.2999999999999999e-194 < z < 2.2000000000000001e-66

    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. Add Preprocessing
    5. Taylor expanded in x around inf 63.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.50000000000000044e133 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+175}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{+137}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \mathbf{elif}\;z \leq -2.55 \cdot 10^{+127}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -16:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{-181}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-272}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{-194}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-66}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+133}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-6 \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 50.3% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ t_1 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -4.2 \cdot 10^{+175}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{+136}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.46 \cdot 10^{+128}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -18:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-180}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.65 \cdot 10^{-270}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-193}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-66}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.68:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{+130}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-6 \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))) (t_1 (* x (* z 6.0))))
   (if (<= z -4.2e+175)
     t_0
     (if (<= z -1.2e+136)
       t_1
       (if (<= z -1.46e+128)
         t_0
         (if (<= z -18.0)
           t_1
           (if (<= z -3e-180)
             (* y 4.0)
             (if (<= z 2.65e-270)
               (* x -3.0)
               (if (<= z 3.2e-193)
                 (* y 4.0)
                 (if (<= z 4e-66)
                   (* x -3.0)
                   (if (<= z 0.68)
                     (* y 4.0)
                     (if (<= z 7.6e+130) t_1 (* y (* -6.0 z))))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -4.2e+175) {
		tmp = t_0;
	} else if (z <= -1.2e+136) {
		tmp = t_1;
	} else if (z <= -1.46e+128) {
		tmp = t_0;
	} else if (z <= -18.0) {
		tmp = t_1;
	} else if (z <= -3e-180) {
		tmp = y * 4.0;
	} else if (z <= 2.65e-270) {
		tmp = x * -3.0;
	} else if (z <= 3.2e-193) {
		tmp = y * 4.0;
	} else if (z <= 4e-66) {
		tmp = x * -3.0;
	} else if (z <= 0.68) {
		tmp = y * 4.0;
	} else if (z <= 7.6e+130) {
		tmp = t_1;
	} else {
		tmp = y * (-6.0 * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (-6.0d0) * (y * z)
    t_1 = x * (z * 6.0d0)
    if (z <= (-4.2d+175)) then
        tmp = t_0
    else if (z <= (-1.2d+136)) then
        tmp = t_1
    else if (z <= (-1.46d+128)) then
        tmp = t_0
    else if (z <= (-18.0d0)) then
        tmp = t_1
    else if (z <= (-3d-180)) then
        tmp = y * 4.0d0
    else if (z <= 2.65d-270) then
        tmp = x * (-3.0d0)
    else if (z <= 3.2d-193) then
        tmp = y * 4.0d0
    else if (z <= 4d-66) then
        tmp = x * (-3.0d0)
    else if (z <= 0.68d0) then
        tmp = y * 4.0d0
    else if (z <= 7.6d+130) then
        tmp = t_1
    else
        tmp = y * ((-6.0d0) * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -4.2e+175) {
		tmp = t_0;
	} else if (z <= -1.2e+136) {
		tmp = t_1;
	} else if (z <= -1.46e+128) {
		tmp = t_0;
	} else if (z <= -18.0) {
		tmp = t_1;
	} else if (z <= -3e-180) {
		tmp = y * 4.0;
	} else if (z <= 2.65e-270) {
		tmp = x * -3.0;
	} else if (z <= 3.2e-193) {
		tmp = y * 4.0;
	} else if (z <= 4e-66) {
		tmp = x * -3.0;
	} else if (z <= 0.68) {
		tmp = y * 4.0;
	} else if (z <= 7.6e+130) {
		tmp = t_1;
	} else {
		tmp = y * (-6.0 * z);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	t_1 = x * (z * 6.0)
	tmp = 0
	if z <= -4.2e+175:
		tmp = t_0
	elif z <= -1.2e+136:
		tmp = t_1
	elif z <= -1.46e+128:
		tmp = t_0
	elif z <= -18.0:
		tmp = t_1
	elif z <= -3e-180:
		tmp = y * 4.0
	elif z <= 2.65e-270:
		tmp = x * -3.0
	elif z <= 3.2e-193:
		tmp = y * 4.0
	elif z <= 4e-66:
		tmp = x * -3.0
	elif z <= 0.68:
		tmp = y * 4.0
	elif z <= 7.6e+130:
		tmp = t_1
	else:
		tmp = y * (-6.0 * z)
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	t_1 = Float64(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -4.2e+175)
		tmp = t_0;
	elseif (z <= -1.2e+136)
		tmp = t_1;
	elseif (z <= -1.46e+128)
		tmp = t_0;
	elseif (z <= -18.0)
		tmp = t_1;
	elseif (z <= -3e-180)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.65e-270)
		tmp = Float64(x * -3.0);
	elseif (z <= 3.2e-193)
		tmp = Float64(y * 4.0);
	elseif (z <= 4e-66)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.68)
		tmp = Float64(y * 4.0);
	elseif (z <= 7.6e+130)
		tmp = t_1;
	else
		tmp = Float64(y * Float64(-6.0 * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	t_1 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -4.2e+175)
		tmp = t_0;
	elseif (z <= -1.2e+136)
		tmp = t_1;
	elseif (z <= -1.46e+128)
		tmp = t_0;
	elseif (z <= -18.0)
		tmp = t_1;
	elseif (z <= -3e-180)
		tmp = y * 4.0;
	elseif (z <= 2.65e-270)
		tmp = x * -3.0;
	elseif (z <= 3.2e-193)
		tmp = y * 4.0;
	elseif (z <= 4e-66)
		tmp = x * -3.0;
	elseif (z <= 0.68)
		tmp = y * 4.0;
	elseif (z <= 7.6e+130)
		tmp = t_1;
	else
		tmp = y * (-6.0 * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e+175], t$95$0, If[LessEqual[z, -1.2e+136], t$95$1, If[LessEqual[z, -1.46e+128], t$95$0, If[LessEqual[z, -18.0], t$95$1, If[LessEqual[z, -3e-180], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.65e-270], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.2e-193], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 4e-66], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.68], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7.6e+130], t$95$1, N[(y * N[(-6.0 * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.2 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.46 \cdot 10^{+128}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -18:\\
\;\;\;\;t\_1\\

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

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

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

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

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

\mathbf{elif}\;z \leq 7.6 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -4.1999999999999998e175 or -1.2e136 < z < -1.4599999999999999e128

    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. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.8%

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

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

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

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

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

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

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

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

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

    if -4.1999999999999998e175 < z < -1.2e136 or -1.4599999999999999e128 < z < -18 or 0.680000000000000049 < z < 7.6000000000000004e130

    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. Add Preprocessing
    5. Taylor expanded in x around inf 67.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -18 < z < -3.0000000000000001e-180 or 2.6499999999999999e-270 < z < 3.20000000000000006e-193 or 3.9999999999999999e-66 < z < 0.680000000000000049

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    10. Simplified62.1%

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

    if -3.0000000000000001e-180 < z < 2.6499999999999999e-270 or 3.20000000000000006e-193 < z < 3.9999999999999999e-66

    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. Add Preprocessing
    5. Taylor expanded in x around inf 63.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.6000000000000004e130 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+175}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{+136}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -1.46 \cdot 10^{+128}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -18:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-180}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.65 \cdot 10^{-270}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-193}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-66}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.68:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{+130}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-6 \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 50.3% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ t_1 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -7.2 \cdot 10^{+174}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -2 \cdot 10^{+137}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{+127}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -35:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -4.7 \cdot 10^{-181}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.08 \cdot 10^{-271}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{-193}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-66}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.68:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+131}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))) (t_1 (* x (* z 6.0))))
   (if (<= z -7.2e+174)
     t_0
     (if (<= z -2e+137)
       t_1
       (if (<= z -2.7e+127)
         t_0
         (if (<= z -35.0)
           t_1
           (if (<= z -4.7e-181)
             (* y 4.0)
             (if (<= z 1.08e-271)
               (* x -3.0)
               (if (<= z 1.75e-193)
                 (* y 4.0)
                 (if (<= z 1.8e-66)
                   (* x -3.0)
                   (if (<= z 0.68)
                     (* y 4.0)
                     (if (<= z 1.2e+131) t_1 t_0))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -7.2e+174) {
		tmp = t_0;
	} else if (z <= -2e+137) {
		tmp = t_1;
	} else if (z <= -2.7e+127) {
		tmp = t_0;
	} else if (z <= -35.0) {
		tmp = t_1;
	} else if (z <= -4.7e-181) {
		tmp = y * 4.0;
	} else if (z <= 1.08e-271) {
		tmp = x * -3.0;
	} else if (z <= 1.75e-193) {
		tmp = y * 4.0;
	} else if (z <= 1.8e-66) {
		tmp = x * -3.0;
	} else if (z <= 0.68) {
		tmp = y * 4.0;
	} else if (z <= 1.2e+131) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (-6.0d0) * (y * z)
    t_1 = x * (z * 6.0d0)
    if (z <= (-7.2d+174)) then
        tmp = t_0
    else if (z <= (-2d+137)) then
        tmp = t_1
    else if (z <= (-2.7d+127)) then
        tmp = t_0
    else if (z <= (-35.0d0)) then
        tmp = t_1
    else if (z <= (-4.7d-181)) then
        tmp = y * 4.0d0
    else if (z <= 1.08d-271) then
        tmp = x * (-3.0d0)
    else if (z <= 1.75d-193) then
        tmp = y * 4.0d0
    else if (z <= 1.8d-66) then
        tmp = x * (-3.0d0)
    else if (z <= 0.68d0) then
        tmp = y * 4.0d0
    else if (z <= 1.2d+131) then
        tmp = t_1
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -7.2e+174) {
		tmp = t_0;
	} else if (z <= -2e+137) {
		tmp = t_1;
	} else if (z <= -2.7e+127) {
		tmp = t_0;
	} else if (z <= -35.0) {
		tmp = t_1;
	} else if (z <= -4.7e-181) {
		tmp = y * 4.0;
	} else if (z <= 1.08e-271) {
		tmp = x * -3.0;
	} else if (z <= 1.75e-193) {
		tmp = y * 4.0;
	} else if (z <= 1.8e-66) {
		tmp = x * -3.0;
	} else if (z <= 0.68) {
		tmp = y * 4.0;
	} else if (z <= 1.2e+131) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	t_1 = x * (z * 6.0)
	tmp = 0
	if z <= -7.2e+174:
		tmp = t_0
	elif z <= -2e+137:
		tmp = t_1
	elif z <= -2.7e+127:
		tmp = t_0
	elif z <= -35.0:
		tmp = t_1
	elif z <= -4.7e-181:
		tmp = y * 4.0
	elif z <= 1.08e-271:
		tmp = x * -3.0
	elif z <= 1.75e-193:
		tmp = y * 4.0
	elif z <= 1.8e-66:
		tmp = x * -3.0
	elif z <= 0.68:
		tmp = y * 4.0
	elif z <= 1.2e+131:
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	t_1 = Float64(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -7.2e+174)
		tmp = t_0;
	elseif (z <= -2e+137)
		tmp = t_1;
	elseif (z <= -2.7e+127)
		tmp = t_0;
	elseif (z <= -35.0)
		tmp = t_1;
	elseif (z <= -4.7e-181)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.08e-271)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.75e-193)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.8e-66)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.68)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.2e+131)
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	t_1 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -7.2e+174)
		tmp = t_0;
	elseif (z <= -2e+137)
		tmp = t_1;
	elseif (z <= -2.7e+127)
		tmp = t_0;
	elseif (z <= -35.0)
		tmp = t_1;
	elseif (z <= -4.7e-181)
		tmp = y * 4.0;
	elseif (z <= 1.08e-271)
		tmp = x * -3.0;
	elseif (z <= 1.75e-193)
		tmp = y * 4.0;
	elseif (z <= 1.8e-66)
		tmp = x * -3.0;
	elseif (z <= 0.68)
		tmp = y * 4.0;
	elseif (z <= 1.2e+131)
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.2e+174], t$95$0, If[LessEqual[z, -2e+137], t$95$1, If[LessEqual[z, -2.7e+127], t$95$0, If[LessEqual[z, -35.0], t$95$1, If[LessEqual[z, -4.7e-181], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.08e-271], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.75e-193], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.8e-66], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.68], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.2e+131], t$95$1, t$95$0]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2 \cdot 10^{+137}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -2.7 \cdot 10^{+127}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -35:\\
\;\;\;\;t\_1\\

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

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

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

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

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

\mathbf{elif}\;z \leq 1.2 \cdot 10^{+131}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -7.2000000000000003e174 or -2.0000000000000001e137 < z < -2.7000000000000002e127 or 1.2e131 < 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. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.8%

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

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

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

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

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

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

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

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

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

    if -7.2000000000000003e174 < z < -2.0000000000000001e137 or -2.7000000000000002e127 < z < -35 or 0.680000000000000049 < z < 1.2e131

    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. Add Preprocessing
    5. Taylor expanded in x around inf 67.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -35 < z < -4.6999999999999998e-181 or 1.07999999999999997e-271 < z < 1.75000000000000002e-193 or 1.80000000000000006e-66 < z < 0.680000000000000049

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    10. Simplified62.1%

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

    if -4.6999999999999998e-181 < z < 1.07999999999999997e-271 or 1.75000000000000002e-193 < z < 1.80000000000000006e-66

    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. Add Preprocessing
    5. Taylor expanded in x around inf 63.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{+174}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -2 \cdot 10^{+137}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{+127}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -35:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -4.7 \cdot 10^{-181}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.08 \cdot 10^{-271}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{-193}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-66}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.68:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+131}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 50.3% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ t_1 := 6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -1.9 \cdot 10^{+174}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{+135}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -6.1 \cdot 10^{+128}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -16.5:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-179}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{-272}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.6 \cdot 10^{-193}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{-66}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+133}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))) (t_1 (* 6.0 (* x z))))
   (if (<= z -1.9e+174)
     t_0
     (if (<= z -1.9e+135)
       t_1
       (if (<= z -6.1e+128)
         t_0
         (if (<= z -16.5)
           t_1
           (if (<= z -1.15e-179)
             (* y 4.0)
             (if (<= z 4.3e-272)
               (* x -3.0)
               (if (<= z 6.6e-193)
                 (* y 4.0)
                 (if (<= z 1.75e-66)
                   (* x -3.0)
                   (if (<= z 0.5)
                     (* y 4.0)
                     (if (<= z 2.6e+133) t_1 t_0))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -1.9e+174) {
		tmp = t_0;
	} else if (z <= -1.9e+135) {
		tmp = t_1;
	} else if (z <= -6.1e+128) {
		tmp = t_0;
	} else if (z <= -16.5) {
		tmp = t_1;
	} else if (z <= -1.15e-179) {
		tmp = y * 4.0;
	} else if (z <= 4.3e-272) {
		tmp = x * -3.0;
	} else if (z <= 6.6e-193) {
		tmp = y * 4.0;
	} else if (z <= 1.75e-66) {
		tmp = x * -3.0;
	} else if (z <= 0.5) {
		tmp = y * 4.0;
	} else if (z <= 2.6e+133) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (-6.0d0) * (y * z)
    t_1 = 6.0d0 * (x * z)
    if (z <= (-1.9d+174)) then
        tmp = t_0
    else if (z <= (-1.9d+135)) then
        tmp = t_1
    else if (z <= (-6.1d+128)) then
        tmp = t_0
    else if (z <= (-16.5d0)) then
        tmp = t_1
    else if (z <= (-1.15d-179)) then
        tmp = y * 4.0d0
    else if (z <= 4.3d-272) then
        tmp = x * (-3.0d0)
    else if (z <= 6.6d-193) then
        tmp = y * 4.0d0
    else if (z <= 1.75d-66) then
        tmp = x * (-3.0d0)
    else if (z <= 0.5d0) then
        tmp = y * 4.0d0
    else if (z <= 2.6d+133) then
        tmp = t_1
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = 6.0 * (x * z);
	double tmp;
	if (z <= -1.9e+174) {
		tmp = t_0;
	} else if (z <= -1.9e+135) {
		tmp = t_1;
	} else if (z <= -6.1e+128) {
		tmp = t_0;
	} else if (z <= -16.5) {
		tmp = t_1;
	} else if (z <= -1.15e-179) {
		tmp = y * 4.0;
	} else if (z <= 4.3e-272) {
		tmp = x * -3.0;
	} else if (z <= 6.6e-193) {
		tmp = y * 4.0;
	} else if (z <= 1.75e-66) {
		tmp = x * -3.0;
	} else if (z <= 0.5) {
		tmp = y * 4.0;
	} else if (z <= 2.6e+133) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	t_1 = 6.0 * (x * z)
	tmp = 0
	if z <= -1.9e+174:
		tmp = t_0
	elif z <= -1.9e+135:
		tmp = t_1
	elif z <= -6.1e+128:
		tmp = t_0
	elif z <= -16.5:
		tmp = t_1
	elif z <= -1.15e-179:
		tmp = y * 4.0
	elif z <= 4.3e-272:
		tmp = x * -3.0
	elif z <= 6.6e-193:
		tmp = y * 4.0
	elif z <= 1.75e-66:
		tmp = x * -3.0
	elif z <= 0.5:
		tmp = y * 4.0
	elif z <= 2.6e+133:
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	t_1 = Float64(6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -1.9e+174)
		tmp = t_0;
	elseif (z <= -1.9e+135)
		tmp = t_1;
	elseif (z <= -6.1e+128)
		tmp = t_0;
	elseif (z <= -16.5)
		tmp = t_1;
	elseif (z <= -1.15e-179)
		tmp = Float64(y * 4.0);
	elseif (z <= 4.3e-272)
		tmp = Float64(x * -3.0);
	elseif (z <= 6.6e-193)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.75e-66)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.5)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.6e+133)
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	t_1 = 6.0 * (x * z);
	tmp = 0.0;
	if (z <= -1.9e+174)
		tmp = t_0;
	elseif (z <= -1.9e+135)
		tmp = t_1;
	elseif (z <= -6.1e+128)
		tmp = t_0;
	elseif (z <= -16.5)
		tmp = t_1;
	elseif (z <= -1.15e-179)
		tmp = y * 4.0;
	elseif (z <= 4.3e-272)
		tmp = x * -3.0;
	elseif (z <= 6.6e-193)
		tmp = y * 4.0;
	elseif (z <= 1.75e-66)
		tmp = x * -3.0;
	elseif (z <= 0.5)
		tmp = y * 4.0;
	elseif (z <= 2.6e+133)
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.9e+174], t$95$0, If[LessEqual[z, -1.9e+135], t$95$1, If[LessEqual[z, -6.1e+128], t$95$0, If[LessEqual[z, -16.5], t$95$1, If[LessEqual[z, -1.15e-179], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 4.3e-272], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.6e-193], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.75e-66], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.6e+133], t$95$1, t$95$0]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.9 \cdot 10^{+135}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -6.1 \cdot 10^{+128}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -16.5:\\
\;\;\;\;t\_1\\

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

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

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

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

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

\mathbf{elif}\;z \leq 2.6 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.9000000000000001e174 or -1.9000000000000001e135 < z < -6.1000000000000003e128 or 2.5999999999999998e133 < 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. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.8%

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

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

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

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

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

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

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

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

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

    if -1.9000000000000001e174 < z < -1.9000000000000001e135 or -6.1000000000000003e128 < z < -16.5 or 0.5 < z < 2.5999999999999998e133

    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. Add Preprocessing
    5. Taylor expanded in x around inf 67.8%

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

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

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

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

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

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

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

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

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

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

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

    if -16.5 < z < -1.14999999999999994e-179 or 4.2999999999999997e-272 < z < 6.5999999999999998e-193 or 1.75e-66 < z < 0.5

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    10. Simplified62.1%

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

    if -1.14999999999999994e-179 < z < 4.2999999999999997e-272 or 6.5999999999999998e-193 < z < 1.75e-66

    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. Add Preprocessing
    5. Taylor expanded in x around inf 63.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+174}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{+135}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -6.1 \cdot 10^{+128}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -16.5:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-179}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{-272}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.6 \cdot 10^{-193}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{-66}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+133}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 50.2% accurate, 0.5× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_0\\


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

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

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

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

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

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

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

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

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

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

    if -1.2e-5 < z < -1.6499999999999999e-179 or 2.40000000000000026e-66 < z < 0.680000000000000049

    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. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.4%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    10. Simplified63.2%

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

    if -1.6499999999999999e-179 < z < 2.40000000000000026e-66

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified56.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{-5}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{-179}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{-66}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.68:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 58.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_0 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{if}\;y \leq -3.05 \cdot 10^{-183}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;y \leq 2.75 \cdot 10^{-146}:\\
\;\;\;\;x \cdot -3\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.0500000000000001e-183 or 2.74999999999999999e-146 < y

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

    if -3.0500000000000001e-183 < y < -2.45000000000000011e-259

    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. Add Preprocessing
    5. Taylor expanded in x around inf 92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.45000000000000011e-259 < y < 2.74999999999999999e-146

    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. Add Preprocessing
    5. Taylor expanded in x around inf 85.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified49.8%

      \[\leadsto \color{blue}{x \cdot -3} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 10: 97.8% accurate, 0.7× speedup?

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

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


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

    1. Initial program 99.7%

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

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

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

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

    if -0.660000000000000031 < z < 0.52000000000000002

    1. Initial program 98.7%

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

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

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

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

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

Alternative 11: 97.8% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

    if -0.599999999999999978 < z < 0.599999999999999978

    1. Initial program 98.7%

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

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

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

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

    if 0.599999999999999978 < z

    1. Initial program 99.8%

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

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

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

Alternative 12: 97.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.56 \lor \neg \left(z \leq 0.68\right):\\
\;\;\;\;\left(y - x\right) \cdot \left(-6 \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.56000000000000005 or 0.680000000000000049 < 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. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.7%

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

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

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

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

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

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

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

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

    if -0.56000000000000005 < z < 0.680000000000000049

    1. Initial program 98.7%

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

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

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

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

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

Alternative 13: 75.8% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.5e12 or 7.7999999999999996e-14 < x

    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. Add Preprocessing
    5. Taylor expanded in x around inf 80.8%

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

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

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

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

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

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

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

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

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

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

    if -8.5e12 < x < 7.7999999999999996e-14

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8500000000000 \lor \neg \left(x \leq 7.8 \cdot 10^{-14}\right):\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(4 + -6 \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 75.7% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.8e10 or 3.1999999999999999e-15 < x

    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. Add Preprocessing
    5. Taylor expanded in x around inf 80.8%

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

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

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

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

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

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

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

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

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

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

    if -4.8e10 < x < 3.1999999999999999e-15

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -48000000000 \lor \neg \left(x \leq 3.2 \cdot 10^{-15}\right):\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 38.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{-30} \lor \neg \left(x \leq 1.02 \cdot 10^{-13}\right):\\
\;\;\;\;x \cdot -3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.000000000000001e-30 or 1.0199999999999999e-13 < x

    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. Add Preprocessing
    5. Taylor expanded in x around inf 77.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.000000000000001e-30 < x < 1.0199999999999999e-13

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    10. Simplified42.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{-30} \lor \neg \left(x \leq 1.02 \cdot 10^{-13}\right):\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;y \cdot 4\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 99.6% 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.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. Add Preprocessing
  5. Final simplification99.2%

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

Alternative 17: 26.3% 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.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. Add Preprocessing
  5. Taylor expanded in x around inf 48.9%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot -3} \]
  10. Simplified23.8%

    \[\leadsto \color{blue}{x \cdot -3} \]
  11. Add Preprocessing

Alternative 18: 2.7% accurate, 13.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
	return x;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x
end function
public static double code(double x, double y, double z) {
	return x;
}
def code(x, y, z):
	return x
function code(x, y, z)
	return x
end
function tmp = code(x, y, z)
	tmp = x;
end
code[x_, y_, z_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 99.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. Add Preprocessing
  5. Taylor expanded in y around inf 53.5%

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

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

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

    \[\leadsto \color{blue}{x} \]
  9. Add Preprocessing

Reproduce

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