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

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

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

Initial Program: 99.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.2× speedup?

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

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

    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
  2. Simplified0

    \[\leadsto expr\]
  3. Add Preprocessing
  4. Add Preprocessing

Alternative 2: 51.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -2.35 \cdot 10^{+182}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -5 \cdot 10^{+153}:\\ \;\;\;\;\left(z \cdot -6\right) \cdot y\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{+98}:\\ \;\;\;\;z \cdot \left(6 \cdot x\right)\\ \mathbf{elif}\;z \leq -1.35:\\ \;\;\;\;z \cdot \left(-6 \cdot y\right)\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-149}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-176}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-50}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.52:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (* z 6.0))))
   (if (<= z -2.35e+182)
     t_0
     (if (<= z -5e+153)
       (* (* z -6.0) y)
       (if (<= z -3.2e+98)
         (* z (* 6.0 x))
         (if (<= z -1.35)
           (* z (* -6.0 y))
           (if (<= z -1e-149)
             (* x -3.0)
             (if (<= z -2.4e-176)
               (* y 4.0)
               (if (<= z 2.6e-50)
                 (* x -3.0)
                 (if (<= z 0.52) (* y 4.0) t_0))))))))))
double code(double x, double y, double z) {
	double t_0 = x * (z * 6.0);
	double tmp;
	if (z <= -2.35e+182) {
		tmp = t_0;
	} else if (z <= -5e+153) {
		tmp = (z * -6.0) * y;
	} else if (z <= -3.2e+98) {
		tmp = z * (6.0 * x);
	} else if (z <= -1.35) {
		tmp = z * (-6.0 * y);
	} else if (z <= -1e-149) {
		tmp = x * -3.0;
	} else if (z <= -2.4e-176) {
		tmp = y * 4.0;
	} else if (z <= 2.6e-50) {
		tmp = x * -3.0;
	} else if (z <= 0.52) {
		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 = x * (z * 6.0d0)
    if (z <= (-2.35d+182)) then
        tmp = t_0
    else if (z <= (-5d+153)) then
        tmp = (z * (-6.0d0)) * y
    else if (z <= (-3.2d+98)) then
        tmp = z * (6.0d0 * x)
    else if (z <= (-1.35d0)) then
        tmp = z * ((-6.0d0) * y)
    else if (z <= (-1d-149)) then
        tmp = x * (-3.0d0)
    else if (z <= (-2.4d-176)) then
        tmp = y * 4.0d0
    else if (z <= 2.6d-50) then
        tmp = x * (-3.0d0)
    else if (z <= 0.52d0) 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 = x * (z * 6.0);
	double tmp;
	if (z <= -2.35e+182) {
		tmp = t_0;
	} else if (z <= -5e+153) {
		tmp = (z * -6.0) * y;
	} else if (z <= -3.2e+98) {
		tmp = z * (6.0 * x);
	} else if (z <= -1.35) {
		tmp = z * (-6.0 * y);
	} else if (z <= -1e-149) {
		tmp = x * -3.0;
	} else if (z <= -2.4e-176) {
		tmp = y * 4.0;
	} else if (z <= 2.6e-50) {
		tmp = x * -3.0;
	} else if (z <= 0.52) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (z * 6.0)
	tmp = 0
	if z <= -2.35e+182:
		tmp = t_0
	elif z <= -5e+153:
		tmp = (z * -6.0) * y
	elif z <= -3.2e+98:
		tmp = z * (6.0 * x)
	elif z <= -1.35:
		tmp = z * (-6.0 * y)
	elif z <= -1e-149:
		tmp = x * -3.0
	elif z <= -2.4e-176:
		tmp = y * 4.0
	elif z <= 2.6e-50:
		tmp = x * -3.0
	elif z <= 0.52:
		tmp = y * 4.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -2.35e+182)
		tmp = t_0;
	elseif (z <= -5e+153)
		tmp = Float64(Float64(z * -6.0) * y);
	elseif (z <= -3.2e+98)
		tmp = Float64(z * Float64(6.0 * x));
	elseif (z <= -1.35)
		tmp = Float64(z * Float64(-6.0 * y));
	elseif (z <= -1e-149)
		tmp = Float64(x * -3.0);
	elseif (z <= -2.4e-176)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.6e-50)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.52)
		tmp = Float64(y * 4.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -2.35e+182)
		tmp = t_0;
	elseif (z <= -5e+153)
		tmp = (z * -6.0) * y;
	elseif (z <= -3.2e+98)
		tmp = z * (6.0 * x);
	elseif (z <= -1.35)
		tmp = z * (-6.0 * y);
	elseif (z <= -1e-149)
		tmp = x * -3.0;
	elseif (z <= -2.4e-176)
		tmp = y * 4.0;
	elseif (z <= 2.6e-50)
		tmp = x * -3.0;
	elseif (z <= 0.52)
		tmp = y * 4.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.35e+182], t$95$0, If[LessEqual[z, -5e+153], N[(N[(z * -6.0), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, -3.2e+98], N[(z * N[(6.0 * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.35], N[(z * N[(-6.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1e-149], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.4e-176], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.6e-50], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.52], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]]
\begin{array}{l}

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

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

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

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

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

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

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

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

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


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

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -2.34999999999999992e182 < z < -5.00000000000000018e153

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]
    9. Applied egg-rr0

      \[\leadsto expr\]

    if -5.00000000000000018e153 < z < -3.2000000000000002e98

    1. Initial program 99.9%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -3.2000000000000002e98 < z < -1.3500000000000001

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -1.3500000000000001 < z < -9.99999999999999979e-150 or -2.40000000000000006e-176 < z < 2.6000000000000001e-50

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]

    if -9.99999999999999979e-150 < z < -2.40000000000000006e-176 or 2.6000000000000001e-50 < z < 0.52000000000000002

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]
  3. Recombined 6 regimes into one program.
  4. Add Preprocessing

Alternative 3: 51.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -4.3 \cdot 10^{+181}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{+153}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{+98}:\\ \;\;\;\;z \cdot \left(6 \cdot x\right)\\ \mathbf{elif}\;z \leq -0.78:\\ \;\;\;\;z \cdot \left(-6 \cdot y\right)\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{-134}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -5.4 \cdot 10^{-176}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-50}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.55:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (* z 6.0))))
   (if (<= z -4.3e+181)
     t_0
     (if (<= z -3.5e+153)
       (* -6.0 (* z y))
       (if (<= z -3.5e+98)
         (* z (* 6.0 x))
         (if (<= z -0.78)
           (* z (* -6.0 y))
           (if (<= z -7.2e-134)
             (* x -3.0)
             (if (<= z -5.4e-176)
               (* y 4.0)
               (if (<= z 2.8e-50)
                 (* x -3.0)
                 (if (<= z 0.55) (* y 4.0) t_0))))))))))
double code(double x, double y, double z) {
	double t_0 = x * (z * 6.0);
	double tmp;
	if (z <= -4.3e+181) {
		tmp = t_0;
	} else if (z <= -3.5e+153) {
		tmp = -6.0 * (z * y);
	} else if (z <= -3.5e+98) {
		tmp = z * (6.0 * x);
	} else if (z <= -0.78) {
		tmp = z * (-6.0 * y);
	} else if (z <= -7.2e-134) {
		tmp = x * -3.0;
	} else if (z <= -5.4e-176) {
		tmp = y * 4.0;
	} else if (z <= 2.8e-50) {
		tmp = x * -3.0;
	} else if (z <= 0.55) {
		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 = x * (z * 6.0d0)
    if (z <= (-4.3d+181)) then
        tmp = t_0
    else if (z <= (-3.5d+153)) then
        tmp = (-6.0d0) * (z * y)
    else if (z <= (-3.5d+98)) then
        tmp = z * (6.0d0 * x)
    else if (z <= (-0.78d0)) then
        tmp = z * ((-6.0d0) * y)
    else if (z <= (-7.2d-134)) then
        tmp = x * (-3.0d0)
    else if (z <= (-5.4d-176)) then
        tmp = y * 4.0d0
    else if (z <= 2.8d-50) then
        tmp = x * (-3.0d0)
    else if (z <= 0.55d0) 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 = x * (z * 6.0);
	double tmp;
	if (z <= -4.3e+181) {
		tmp = t_0;
	} else if (z <= -3.5e+153) {
		tmp = -6.0 * (z * y);
	} else if (z <= -3.5e+98) {
		tmp = z * (6.0 * x);
	} else if (z <= -0.78) {
		tmp = z * (-6.0 * y);
	} else if (z <= -7.2e-134) {
		tmp = x * -3.0;
	} else if (z <= -5.4e-176) {
		tmp = y * 4.0;
	} else if (z <= 2.8e-50) {
		tmp = x * -3.0;
	} else if (z <= 0.55) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (z * 6.0)
	tmp = 0
	if z <= -4.3e+181:
		tmp = t_0
	elif z <= -3.5e+153:
		tmp = -6.0 * (z * y)
	elif z <= -3.5e+98:
		tmp = z * (6.0 * x)
	elif z <= -0.78:
		tmp = z * (-6.0 * y)
	elif z <= -7.2e-134:
		tmp = x * -3.0
	elif z <= -5.4e-176:
		tmp = y * 4.0
	elif z <= 2.8e-50:
		tmp = x * -3.0
	elif z <= 0.55:
		tmp = y * 4.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -4.3e+181)
		tmp = t_0;
	elseif (z <= -3.5e+153)
		tmp = Float64(-6.0 * Float64(z * y));
	elseif (z <= -3.5e+98)
		tmp = Float64(z * Float64(6.0 * x));
	elseif (z <= -0.78)
		tmp = Float64(z * Float64(-6.0 * y));
	elseif (z <= -7.2e-134)
		tmp = Float64(x * -3.0);
	elseif (z <= -5.4e-176)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.8e-50)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.55)
		tmp = Float64(y * 4.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -4.3e+181)
		tmp = t_0;
	elseif (z <= -3.5e+153)
		tmp = -6.0 * (z * y);
	elseif (z <= -3.5e+98)
		tmp = z * (6.0 * x);
	elseif (z <= -0.78)
		tmp = z * (-6.0 * y);
	elseif (z <= -7.2e-134)
		tmp = x * -3.0;
	elseif (z <= -5.4e-176)
		tmp = y * 4.0;
	elseif (z <= 2.8e-50)
		tmp = x * -3.0;
	elseif (z <= 0.55)
		tmp = y * 4.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.3e+181], t$95$0, If[LessEqual[z, -3.5e+153], N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.5e+98], N[(z * N[(6.0 * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.78], N[(z * N[(-6.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.2e-134], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -5.4e-176], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.8e-50], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.55], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]]
\begin{array}{l}

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -4.29999999999999972e181 or 0.55000000000000004 < z

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -4.29999999999999972e181 < z < -3.4999999999999999e153

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -3.4999999999999999e153 < z < -3.5e98

    1. Initial program 99.9%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -3.5e98 < z < -0.78000000000000003

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -0.78000000000000003 < z < -7.1999999999999998e-134 or -5.3999999999999997e-176 < z < 2.7999999999999998e-50

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]

    if -7.1999999999999998e-134 < z < -5.3999999999999997e-176 or 2.7999999999999998e-50 < z < 0.55000000000000004

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]
  3. Recombined 6 regimes into one program.
  4. Add Preprocessing

Alternative 4: 51.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -3.1 \cdot 10^{+181}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{+153}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{+98}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.42:\\ \;\;\;\;z \cdot \left(-6 \cdot y\right)\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-129}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{-176}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{-50}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.6:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (* z 6.0))))
   (if (<= z -3.1e+181)
     t_0
     (if (<= z -8.5e+153)
       (* -6.0 (* z y))
       (if (<= z -2.8e+98)
         t_0
         (if (<= z -1.42)
           (* z (* -6.0 y))
           (if (<= z -1.15e-129)
             (* x -3.0)
             (if (<= z -6.2e-176)
               (* y 4.0)
               (if (<= z 3.5e-50)
                 (* x -3.0)
                 (if (<= z 0.6) (* y 4.0) t_0))))))))))
double code(double x, double y, double z) {
	double t_0 = x * (z * 6.0);
	double tmp;
	if (z <= -3.1e+181) {
		tmp = t_0;
	} else if (z <= -8.5e+153) {
		tmp = -6.0 * (z * y);
	} else if (z <= -2.8e+98) {
		tmp = t_0;
	} else if (z <= -1.42) {
		tmp = z * (-6.0 * y);
	} else if (z <= -1.15e-129) {
		tmp = x * -3.0;
	} else if (z <= -6.2e-176) {
		tmp = y * 4.0;
	} else if (z <= 3.5e-50) {
		tmp = x * -3.0;
	} else if (z <= 0.6) {
		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 = x * (z * 6.0d0)
    if (z <= (-3.1d+181)) then
        tmp = t_0
    else if (z <= (-8.5d+153)) then
        tmp = (-6.0d0) * (z * y)
    else if (z <= (-2.8d+98)) then
        tmp = t_0
    else if (z <= (-1.42d0)) then
        tmp = z * ((-6.0d0) * y)
    else if (z <= (-1.15d-129)) then
        tmp = x * (-3.0d0)
    else if (z <= (-6.2d-176)) then
        tmp = y * 4.0d0
    else if (z <= 3.5d-50) then
        tmp = x * (-3.0d0)
    else if (z <= 0.6d0) 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 = x * (z * 6.0);
	double tmp;
	if (z <= -3.1e+181) {
		tmp = t_0;
	} else if (z <= -8.5e+153) {
		tmp = -6.0 * (z * y);
	} else if (z <= -2.8e+98) {
		tmp = t_0;
	} else if (z <= -1.42) {
		tmp = z * (-6.0 * y);
	} else if (z <= -1.15e-129) {
		tmp = x * -3.0;
	} else if (z <= -6.2e-176) {
		tmp = y * 4.0;
	} else if (z <= 3.5e-50) {
		tmp = x * -3.0;
	} else if (z <= 0.6) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (z * 6.0)
	tmp = 0
	if z <= -3.1e+181:
		tmp = t_0
	elif z <= -8.5e+153:
		tmp = -6.0 * (z * y)
	elif z <= -2.8e+98:
		tmp = t_0
	elif z <= -1.42:
		tmp = z * (-6.0 * y)
	elif z <= -1.15e-129:
		tmp = x * -3.0
	elif z <= -6.2e-176:
		tmp = y * 4.0
	elif z <= 3.5e-50:
		tmp = x * -3.0
	elif z <= 0.6:
		tmp = y * 4.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -3.1e+181)
		tmp = t_0;
	elseif (z <= -8.5e+153)
		tmp = Float64(-6.0 * Float64(z * y));
	elseif (z <= -2.8e+98)
		tmp = t_0;
	elseif (z <= -1.42)
		tmp = Float64(z * Float64(-6.0 * y));
	elseif (z <= -1.15e-129)
		tmp = Float64(x * -3.0);
	elseif (z <= -6.2e-176)
		tmp = Float64(y * 4.0);
	elseif (z <= 3.5e-50)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.6)
		tmp = Float64(y * 4.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -3.1e+181)
		tmp = t_0;
	elseif (z <= -8.5e+153)
		tmp = -6.0 * (z * y);
	elseif (z <= -2.8e+98)
		tmp = t_0;
	elseif (z <= -1.42)
		tmp = z * (-6.0 * y);
	elseif (z <= -1.15e-129)
		tmp = x * -3.0;
	elseif (z <= -6.2e-176)
		tmp = y * 4.0;
	elseif (z <= 3.5e-50)
		tmp = x * -3.0;
	elseif (z <= 0.6)
		tmp = y * 4.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.1e+181], t$95$0, If[LessEqual[z, -8.5e+153], N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.8e+98], t$95$0, If[LessEqual[z, -1.42], N[(z * N[(-6.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.15e-129], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -6.2e-176], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.5e-50], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.6], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]]
\begin{array}{l}

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -3.09999999999999989e181 or -8.49999999999999935e153 < z < -2.8000000000000001e98 or 0.599999999999999978 < z

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -3.09999999999999989e181 < z < -8.49999999999999935e153

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -2.8000000000000001e98 < z < -1.4199999999999999

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -1.4199999999999999 < z < -1.15e-129 or -6.19999999999999983e-176 < z < 3.49999999999999997e-50

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]

    if -1.15e-129 < z < -6.19999999999999983e-176 or 3.49999999999999997e-50 < z < 0.599999999999999978

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 5: 51.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(z \cdot 6\right)\\ t_1 := -6 \cdot \left(z \cdot y\right)\\ \mathbf{if}\;z \leq -2.95 \cdot 10^{+181}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -7 \cdot 10^{+153}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{+98}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -3.1:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{-139}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-176}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.55 \cdot 10^{-50}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.52:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (* z 6.0))) (t_1 (* -6.0 (* z y))))
   (if (<= z -2.95e+181)
     t_0
     (if (<= z -7e+153)
       t_1
       (if (<= z -3.8e+98)
         t_0
         (if (<= z -3.1)
           t_1
           (if (<= z -6.6e-139)
             (* x -3.0)
             (if (<= z -1.8e-176)
               (* y 4.0)
               (if (<= z 3.55e-50)
                 (* x -3.0)
                 (if (<= z 0.52) (* y 4.0) t_0))))))))))
double code(double x, double y, double z) {
	double t_0 = x * (z * 6.0);
	double t_1 = -6.0 * (z * y);
	double tmp;
	if (z <= -2.95e+181) {
		tmp = t_0;
	} else if (z <= -7e+153) {
		tmp = t_1;
	} else if (z <= -3.8e+98) {
		tmp = t_0;
	} else if (z <= -3.1) {
		tmp = t_1;
	} else if (z <= -6.6e-139) {
		tmp = x * -3.0;
	} else if (z <= -1.8e-176) {
		tmp = y * 4.0;
	} else if (z <= 3.55e-50) {
		tmp = x * -3.0;
	} else if (z <= 0.52) {
		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) :: t_1
    real(8) :: tmp
    t_0 = x * (z * 6.0d0)
    t_1 = (-6.0d0) * (z * y)
    if (z <= (-2.95d+181)) then
        tmp = t_0
    else if (z <= (-7d+153)) then
        tmp = t_1
    else if (z <= (-3.8d+98)) then
        tmp = t_0
    else if (z <= (-3.1d0)) then
        tmp = t_1
    else if (z <= (-6.6d-139)) then
        tmp = x * (-3.0d0)
    else if (z <= (-1.8d-176)) then
        tmp = y * 4.0d0
    else if (z <= 3.55d-50) then
        tmp = x * (-3.0d0)
    else if (z <= 0.52d0) 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 = x * (z * 6.0);
	double t_1 = -6.0 * (z * y);
	double tmp;
	if (z <= -2.95e+181) {
		tmp = t_0;
	} else if (z <= -7e+153) {
		tmp = t_1;
	} else if (z <= -3.8e+98) {
		tmp = t_0;
	} else if (z <= -3.1) {
		tmp = t_1;
	} else if (z <= -6.6e-139) {
		tmp = x * -3.0;
	} else if (z <= -1.8e-176) {
		tmp = y * 4.0;
	} else if (z <= 3.55e-50) {
		tmp = x * -3.0;
	} else if (z <= 0.52) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (z * 6.0)
	t_1 = -6.0 * (z * y)
	tmp = 0
	if z <= -2.95e+181:
		tmp = t_0
	elif z <= -7e+153:
		tmp = t_1
	elif z <= -3.8e+98:
		tmp = t_0
	elif z <= -3.1:
		tmp = t_1
	elif z <= -6.6e-139:
		tmp = x * -3.0
	elif z <= -1.8e-176:
		tmp = y * 4.0
	elif z <= 3.55e-50:
		tmp = x * -3.0
	elif z <= 0.52:
		tmp = y * 4.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(z * 6.0))
	t_1 = Float64(-6.0 * Float64(z * y))
	tmp = 0.0
	if (z <= -2.95e+181)
		tmp = t_0;
	elseif (z <= -7e+153)
		tmp = t_1;
	elseif (z <= -3.8e+98)
		tmp = t_0;
	elseif (z <= -3.1)
		tmp = t_1;
	elseif (z <= -6.6e-139)
		tmp = Float64(x * -3.0);
	elseif (z <= -1.8e-176)
		tmp = Float64(y * 4.0);
	elseif (z <= 3.55e-50)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.52)
		tmp = Float64(y * 4.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * (z * 6.0);
	t_1 = -6.0 * (z * y);
	tmp = 0.0;
	if (z <= -2.95e+181)
		tmp = t_0;
	elseif (z <= -7e+153)
		tmp = t_1;
	elseif (z <= -3.8e+98)
		tmp = t_0;
	elseif (z <= -3.1)
		tmp = t_1;
	elseif (z <= -6.6e-139)
		tmp = x * -3.0;
	elseif (z <= -1.8e-176)
		tmp = y * 4.0;
	elseif (z <= 3.55e-50)
		tmp = x * -3.0;
	elseif (z <= 0.52)
		tmp = y * 4.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.95e+181], t$95$0, If[LessEqual[z, -7e+153], t$95$1, If[LessEqual[z, -3.8e+98], t$95$0, If[LessEqual[z, -3.1], t$95$1, If[LessEqual[z, -6.6e-139], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.8e-176], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.55e-50], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.52], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]]]
\begin{array}{l}

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.9499999999999999e181 or -6.9999999999999998e153 < z < -3.7999999999999999e98 or 0.52000000000000002 < z

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -2.9499999999999999e181 < z < -6.9999999999999998e153 or -3.7999999999999999e98 < z < -3.10000000000000009

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -3.10000000000000009 < z < -6.5999999999999999e-139 or -1.8000000000000001e-176 < z < 3.5499999999999999e-50

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]

    if -6.5999999999999999e-139 < z < -1.8000000000000001e-176 or 3.5499999999999999e-50 < z < 0.52000000000000002

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 6: 74.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(z \cdot 6 + -3\right)\\ t_1 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{if}\;z \leq -3400:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.42 \cdot 10^{-151}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{-177}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-49}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 0.58:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (+ (* z 6.0) -3.0))) (t_1 (* -6.0 (* z (- y x)))))
   (if (<= z -3400.0)
     t_1
     (if (<= z -1.42e-151)
       t_0
       (if (<= z -5.8e-177)
         (* y 4.0)
         (if (<= z 7.6e-49) t_0 (if (<= z 0.58) (* y 4.0) t_1)))))))
double code(double x, double y, double z) {
	double t_0 = x * ((z * 6.0) + -3.0);
	double t_1 = -6.0 * (z * (y - x));
	double tmp;
	if (z <= -3400.0) {
		tmp = t_1;
	} else if (z <= -1.42e-151) {
		tmp = t_0;
	} else if (z <= -5.8e-177) {
		tmp = y * 4.0;
	} else if (z <= 7.6e-49) {
		tmp = t_0;
	} else if (z <= 0.58) {
		tmp = y * 4.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = x * ((z * 6.0d0) + (-3.0d0))
    t_1 = (-6.0d0) * (z * (y - x))
    if (z <= (-3400.0d0)) then
        tmp = t_1
    else if (z <= (-1.42d-151)) then
        tmp = t_0
    else if (z <= (-5.8d-177)) then
        tmp = y * 4.0d0
    else if (z <= 7.6d-49) then
        tmp = t_0
    else if (z <= 0.58d0) then
        tmp = y * 4.0d0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x * ((z * 6.0) + -3.0);
	double t_1 = -6.0 * (z * (y - x));
	double tmp;
	if (z <= -3400.0) {
		tmp = t_1;
	} else if (z <= -1.42e-151) {
		tmp = t_0;
	} else if (z <= -5.8e-177) {
		tmp = y * 4.0;
	} else if (z <= 7.6e-49) {
		tmp = t_0;
	} else if (z <= 0.58) {
		tmp = y * 4.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * ((z * 6.0) + -3.0)
	t_1 = -6.0 * (z * (y - x))
	tmp = 0
	if z <= -3400.0:
		tmp = t_1
	elif z <= -1.42e-151:
		tmp = t_0
	elif z <= -5.8e-177:
		tmp = y * 4.0
	elif z <= 7.6e-49:
		tmp = t_0
	elif z <= 0.58:
		tmp = y * 4.0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(Float64(z * 6.0) + -3.0))
	t_1 = Float64(-6.0 * Float64(z * Float64(y - x)))
	tmp = 0.0
	if (z <= -3400.0)
		tmp = t_1;
	elseif (z <= -1.42e-151)
		tmp = t_0;
	elseif (z <= -5.8e-177)
		tmp = Float64(y * 4.0);
	elseif (z <= 7.6e-49)
		tmp = t_0;
	elseif (z <= 0.58)
		tmp = Float64(y * 4.0);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * ((z * 6.0) + -3.0);
	t_1 = -6.0 * (z * (y - x));
	tmp = 0.0;
	if (z <= -3400.0)
		tmp = t_1;
	elseif (z <= -1.42e-151)
		tmp = t_0;
	elseif (z <= -5.8e-177)
		tmp = y * 4.0;
	elseif (z <= 7.6e-49)
		tmp = t_0;
	elseif (z <= 0.58)
		tmp = y * 4.0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[(z * 6.0), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3400.0], t$95$1, If[LessEqual[z, -1.42e-151], t$95$0, If[LessEqual[z, -5.8e-177], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7.6e-49], t$95$0, If[LessEqual[z, 0.58], N[(y * 4.0), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.42 \cdot 10^{-151}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;z \leq 7.6 \cdot 10^{-49}:\\
\;\;\;\;t\_0\\

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

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


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

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -3400 < z < -1.42000000000000002e-151 or -5.79999999999999994e-177 < z < 7.5999999999999994e-49

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -1.42000000000000002e-151 < z < -5.79999999999999994e-177 or 7.5999999999999994e-49 < z < 0.57999999999999996

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 74.0% accurate, 0.4× speedup?

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

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

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

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

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

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

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


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

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -0.00419999999999999974 < z < -4.0000000000000003e-133 or -9.50000000000000031e-177 < z < 1.04999999999999994e-48

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]

    if -4.0000000000000003e-133 < z < -9.50000000000000031e-177 or 1.04999999999999994e-48 < z < 0.599999999999999978

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 8: 50.9% accurate, 0.4× speedup?

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

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

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

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

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

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

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


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

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -0.80000000000000004 < z < -9.50000000000000069e-148 or -5.19999999999999984e-176 < z < 8.2000000000000003e-49

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]

    if -9.50000000000000069e-148 < z < -5.19999999999999984e-176 or 8.2000000000000003e-49 < z < 215

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 9: 75.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(z \cdot -6 + 4\right)\\ t_1 := x \cdot \left(z \cdot 6 + -3\right)\\ \mathbf{if}\;x \leq -2.7 \cdot 10^{+59}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -6.5 \cdot 10^{-49}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq -1.65 \cdot 10^{-69}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-18}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (+ (* z -6.0) 4.0))) (t_1 (* x (+ (* z 6.0) -3.0))))
   (if (<= x -2.7e+59)
     t_1
     (if (<= x -6.5e-49)
       t_0
       (if (<= x -1.65e-69) t_1 (if (<= x 4.8e-18) t_0 t_1))))))
double code(double x, double y, double z) {
	double t_0 = y * ((z * -6.0) + 4.0);
	double t_1 = x * ((z * 6.0) + -3.0);
	double tmp;
	if (x <= -2.7e+59) {
		tmp = t_1;
	} else if (x <= -6.5e-49) {
		tmp = t_0;
	} else if (x <= -1.65e-69) {
		tmp = t_1;
	} else if (x <= 4.8e-18) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = y * ((z * (-6.0d0)) + 4.0d0)
    t_1 = x * ((z * 6.0d0) + (-3.0d0))
    if (x <= (-2.7d+59)) then
        tmp = t_1
    else if (x <= (-6.5d-49)) then
        tmp = t_0
    else if (x <= (-1.65d-69)) then
        tmp = t_1
    else if (x <= 4.8d-18) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = y * ((z * -6.0) + 4.0);
	double t_1 = x * ((z * 6.0) + -3.0);
	double tmp;
	if (x <= -2.7e+59) {
		tmp = t_1;
	} else if (x <= -6.5e-49) {
		tmp = t_0;
	} else if (x <= -1.65e-69) {
		tmp = t_1;
	} else if (x <= 4.8e-18) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * ((z * -6.0) + 4.0)
	t_1 = x * ((z * 6.0) + -3.0)
	tmp = 0
	if x <= -2.7e+59:
		tmp = t_1
	elif x <= -6.5e-49:
		tmp = t_0
	elif x <= -1.65e-69:
		tmp = t_1
	elif x <= 4.8e-18:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(y * Float64(Float64(z * -6.0) + 4.0))
	t_1 = Float64(x * Float64(Float64(z * 6.0) + -3.0))
	tmp = 0.0
	if (x <= -2.7e+59)
		tmp = t_1;
	elseif (x <= -6.5e-49)
		tmp = t_0;
	elseif (x <= -1.65e-69)
		tmp = t_1;
	elseif (x <= 4.8e-18)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * ((z * -6.0) + 4.0);
	t_1 = x * ((z * 6.0) + -3.0);
	tmp = 0.0;
	if (x <= -2.7e+59)
		tmp = t_1;
	elseif (x <= -6.5e-49)
		tmp = t_0;
	elseif (x <= -1.65e-69)
		tmp = t_1;
	elseif (x <= 4.8e-18)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(N[(z * -6.0), $MachinePrecision] + 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(N[(z * 6.0), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.7e+59], t$95$1, If[LessEqual[x, -6.5e-49], t$95$0, If[LessEqual[x, -1.65e-69], t$95$1, If[LessEqual[x, 4.8e-18], t$95$0, t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y \cdot \left(z \cdot -6 + 4\right)\\
t_1 := x \cdot \left(z \cdot 6 + -3\right)\\
\mathbf{if}\;x \leq -2.7 \cdot 10^{+59}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -6.5 \cdot 10^{-49}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq -1.65 \cdot 10^{-69}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 4.8 \cdot 10^{-18}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.7000000000000001e59 or -6.49999999999999968e-49 < x < -1.65e-69 or 4.79999999999999988e-18 < x

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -2.7000000000000001e59 < x < -6.49999999999999968e-49 or -1.65e-69 < x < 4.79999999999999988e-18

    1. Initial program 99.5%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 10: 97.7% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]

    if -0.55000000000000004 < z < 0.5

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if 0.5 < z

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 11: 97.7% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]

    if -0.569999999999999951 < z < 0.5

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if 0.5 < z

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 12: 38.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+123}:\\
\;\;\;\;y \cdot 4\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.19999999999999988e123 or 6.5000000000000003e-10 < y

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]

    if -4.19999999999999988e123 < y < 6.5000000000000003e-10

    1. Initial program 99.5%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 13: 99.5% accurate, 1.2× speedup?

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

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

    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
  2. Add Preprocessing
  3. Applied egg-rr0

    \[\leadsto expr\]
  4. Add Preprocessing

Alternative 14: 26.6% accurate, 4.3× speedup?

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

\\
x \cdot -3
\end{array}
Derivation
  1. Initial program 99.6%

    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
  2. Simplified0

    \[\leadsto expr\]
  3. Add Preprocessing
  4. Taylor expanded in z around 0 0

    \[\leadsto expr\]
  5. Simplified0

    \[\leadsto expr\]
  6. Taylor expanded in x around inf 0

    \[\leadsto expr\]
  7. Simplified0

    \[\leadsto expr\]
  8. Add Preprocessing

Reproduce

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