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

Percentage Accurate: 99.7% → 99.8%
Time: 8.2s
Alternatives: 13
Speedup: 1.0×

Specification

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

\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
\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 13 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.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 2: 61.3% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(x \cdot -6\right)\\ t_1 := z \cdot \left(6 \cdot y\right)\\ t_2 := y \cdot \left(6 \cdot z\right)\\ t_3 := x \cdot \left(z \cdot -6\right)\\ \mathbf{if}\;z \leq -1.7 \cdot 10^{+237}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -2.25 \cdot 10^{+197}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq -4.4 \cdot 10^{+169}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{+149}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -7.1 \cdot 10^{+93}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{+14}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{-54}:\\ \;\;\;\;6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-39}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.14 \cdot 10^{+114}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{+149}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{+185}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (* x -6.0)))
        (t_1 (* z (* 6.0 y)))
        (t_2 (* y (* 6.0 z)))
        (t_3 (* x (* z -6.0))))
   (if (<= z -1.7e+237)
     t_2
     (if (<= z -2.25e+197)
       t_3
       (if (<= z -4.4e+169)
         t_1
         (if (<= z -1.75e+149)
           (* -6.0 (* x z))
           (if (<= z -7.1e+93)
             t_2
             (if (<= z -3.5e+14)
               t_0
               (if (<= z -4.1e-54)
                 (* 6.0 (* z y))
                 (if (<= z 1.6e-39)
                   x
                   (if (<= z 1.14e+114)
                     t_2
                     (if (<= z 7.8e+149)
                       t_0
                       (if (<= z 1.55e+185) t_1 t_3)))))))))))))
double code(double x, double y, double z) {
	double t_0 = z * (x * -6.0);
	double t_1 = z * (6.0 * y);
	double t_2 = y * (6.0 * z);
	double t_3 = x * (z * -6.0);
	double tmp;
	if (z <= -1.7e+237) {
		tmp = t_2;
	} else if (z <= -2.25e+197) {
		tmp = t_3;
	} else if (z <= -4.4e+169) {
		tmp = t_1;
	} else if (z <= -1.75e+149) {
		tmp = -6.0 * (x * z);
	} else if (z <= -7.1e+93) {
		tmp = t_2;
	} else if (z <= -3.5e+14) {
		tmp = t_0;
	} else if (z <= -4.1e-54) {
		tmp = 6.0 * (z * y);
	} else if (z <= 1.6e-39) {
		tmp = x;
	} else if (z <= 1.14e+114) {
		tmp = t_2;
	} else if (z <= 7.8e+149) {
		tmp = t_0;
	} else if (z <= 1.55e+185) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = z * (x * (-6.0d0))
    t_1 = z * (6.0d0 * y)
    t_2 = y * (6.0d0 * z)
    t_3 = x * (z * (-6.0d0))
    if (z <= (-1.7d+237)) then
        tmp = t_2
    else if (z <= (-2.25d+197)) then
        tmp = t_3
    else if (z <= (-4.4d+169)) then
        tmp = t_1
    else if (z <= (-1.75d+149)) then
        tmp = (-6.0d0) * (x * z)
    else if (z <= (-7.1d+93)) then
        tmp = t_2
    else if (z <= (-3.5d+14)) then
        tmp = t_0
    else if (z <= (-4.1d-54)) then
        tmp = 6.0d0 * (z * y)
    else if (z <= 1.6d-39) then
        tmp = x
    else if (z <= 1.14d+114) then
        tmp = t_2
    else if (z <= 7.8d+149) then
        tmp = t_0
    else if (z <= 1.55d+185) then
        tmp = t_1
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = z * (x * -6.0);
	double t_1 = z * (6.0 * y);
	double t_2 = y * (6.0 * z);
	double t_3 = x * (z * -6.0);
	double tmp;
	if (z <= -1.7e+237) {
		tmp = t_2;
	} else if (z <= -2.25e+197) {
		tmp = t_3;
	} else if (z <= -4.4e+169) {
		tmp = t_1;
	} else if (z <= -1.75e+149) {
		tmp = -6.0 * (x * z);
	} else if (z <= -7.1e+93) {
		tmp = t_2;
	} else if (z <= -3.5e+14) {
		tmp = t_0;
	} else if (z <= -4.1e-54) {
		tmp = 6.0 * (z * y);
	} else if (z <= 1.6e-39) {
		tmp = x;
	} else if (z <= 1.14e+114) {
		tmp = t_2;
	} else if (z <= 7.8e+149) {
		tmp = t_0;
	} else if (z <= 1.55e+185) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * (x * -6.0)
	t_1 = z * (6.0 * y)
	t_2 = y * (6.0 * z)
	t_3 = x * (z * -6.0)
	tmp = 0
	if z <= -1.7e+237:
		tmp = t_2
	elif z <= -2.25e+197:
		tmp = t_3
	elif z <= -4.4e+169:
		tmp = t_1
	elif z <= -1.75e+149:
		tmp = -6.0 * (x * z)
	elif z <= -7.1e+93:
		tmp = t_2
	elif z <= -3.5e+14:
		tmp = t_0
	elif z <= -4.1e-54:
		tmp = 6.0 * (z * y)
	elif z <= 1.6e-39:
		tmp = x
	elif z <= 1.14e+114:
		tmp = t_2
	elif z <= 7.8e+149:
		tmp = t_0
	elif z <= 1.55e+185:
		tmp = t_1
	else:
		tmp = t_3
	return tmp
function code(x, y, z)
	t_0 = Float64(z * Float64(x * -6.0))
	t_1 = Float64(z * Float64(6.0 * y))
	t_2 = Float64(y * Float64(6.0 * z))
	t_3 = Float64(x * Float64(z * -6.0))
	tmp = 0.0
	if (z <= -1.7e+237)
		tmp = t_2;
	elseif (z <= -2.25e+197)
		tmp = t_3;
	elseif (z <= -4.4e+169)
		tmp = t_1;
	elseif (z <= -1.75e+149)
		tmp = Float64(-6.0 * Float64(x * z));
	elseif (z <= -7.1e+93)
		tmp = t_2;
	elseif (z <= -3.5e+14)
		tmp = t_0;
	elseif (z <= -4.1e-54)
		tmp = Float64(6.0 * Float64(z * y));
	elseif (z <= 1.6e-39)
		tmp = x;
	elseif (z <= 1.14e+114)
		tmp = t_2;
	elseif (z <= 7.8e+149)
		tmp = t_0;
	elseif (z <= 1.55e+185)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * (x * -6.0);
	t_1 = z * (6.0 * y);
	t_2 = y * (6.0 * z);
	t_3 = x * (z * -6.0);
	tmp = 0.0;
	if (z <= -1.7e+237)
		tmp = t_2;
	elseif (z <= -2.25e+197)
		tmp = t_3;
	elseif (z <= -4.4e+169)
		tmp = t_1;
	elseif (z <= -1.75e+149)
		tmp = -6.0 * (x * z);
	elseif (z <= -7.1e+93)
		tmp = t_2;
	elseif (z <= -3.5e+14)
		tmp = t_0;
	elseif (z <= -4.1e-54)
		tmp = 6.0 * (z * y);
	elseif (z <= 1.6e-39)
		tmp = x;
	elseif (z <= 1.14e+114)
		tmp = t_2;
	elseif (z <= 7.8e+149)
		tmp = t_0;
	elseif (z <= 1.55e+185)
		tmp = t_1;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(6.0 * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e+237], t$95$2, If[LessEqual[z, -2.25e+197], t$95$3, If[LessEqual[z, -4.4e+169], t$95$1, If[LessEqual[z, -1.75e+149], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.1e+93], t$95$2, If[LessEqual[z, -3.5e+14], t$95$0, If[LessEqual[z, -4.1e-54], N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e-39], x, If[LessEqual[z, 1.14e+114], t$95$2, If[LessEqual[z, 7.8e+149], t$95$0, If[LessEqual[z, 1.55e+185], t$95$1, t$95$3]]]]]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := z \cdot \left(x \cdot -6\right)\\
t_1 := z \cdot \left(6 \cdot y\right)\\
t_2 := y \cdot \left(6 \cdot z\right)\\
t_3 := x \cdot \left(z \cdot -6\right)\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+237}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -2.25 \cdot 10^{+197}:\\
\;\;\;\;t\_3\\

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

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

\mathbf{elif}\;z \leq -7.1 \cdot 10^{+93}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq -4.1 \cdot 10^{-54}:\\
\;\;\;\;6 \cdot \left(z \cdot y\right)\\

\mathbf{elif}\;z \leq 1.6 \cdot 10^{-39}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.14 \cdot 10^{+114}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 7.8 \cdot 10^{+149}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 1.55 \cdot 10^{+185}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if z < -1.7000000000000002e237 or -1.75000000000000006e149 < z < -7.1000000000000004e93 or 1.5999999999999999e-39 < z < 1.14e114

    1. Initial program 99.6%

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

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

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

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

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

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

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

    if -1.7000000000000002e237 < z < -2.2500000000000001e197 or 1.55e185 < z

    1. Initial program 99.8%

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

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

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

    if -2.2500000000000001e197 < z < -4.4e169 or 7.7999999999999998e149 < z < 1.55e185

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\leadsto 6 \cdot \left(y \cdot z\right) + \color{blue}{\left(-6\right)} \cdot \left(z \cdot x\right) \]
      4. cancel-sign-sub-inv99.7%

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

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

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

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

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

        \[\leadsto \left(6 \cdot z\right) \cdot y + \color{blue}{\left(6 \cdot z\right) \cdot \left(-x\right)} \]
      10. distribute-lft-out99.6%

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

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

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

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

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

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

    if -4.4e169 < z < -1.75000000000000006e149

    1. Initial program 99.8%

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

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

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

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

    if -7.1000000000000004e93 < z < -3.5e14 or 1.14e114 < z < 7.7999999999999998e149

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

    if -3.5e14 < z < -4.1000000000000001e-54

    1. Initial program 99.5%

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

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

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

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

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

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

    if -4.1000000000000001e-54 < z < 1.5999999999999999e-39

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 7 regimes into one program.
  4. Final simplification74.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+237}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq -2.25 \cdot 10^{+197}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -4.4 \cdot 10^{+169}:\\ \;\;\;\;z \cdot \left(6 \cdot y\right)\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{+149}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -7.1 \cdot 10^{+93}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{+14}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{-54}:\\ \;\;\;\;6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-39}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.14 \cdot 10^{+114}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{+149}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{+185}:\\ \;\;\;\;z \cdot \left(6 \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 61.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \left(z \cdot y\right)\\ t_1 := -6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -1.7 \cdot 10^{+237}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{+148}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{+103}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.62 \cdot 10^{+14}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{-54}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 6.3 \cdot 10^{-40}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+23} \lor \neg \left(z \leq 3.8 \cdot 10^{+148}\right) \land z \leq 2.2 \cdot 10^{+184}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* 6.0 (* z y))) (t_1 (* -6.0 (* x z))))
   (if (<= z -1.7e+237)
     t_0
     (if (<= z -4.2e+148)
       t_1
       (if (<= z -1.05e+103)
         t_0
         (if (<= z -1.62e+14)
           t_1
           (if (<= z -4.1e-54)
             t_0
             (if (<= z 6.3e-40)
               x
               (if (or (<= z 5e+23)
                       (and (not (<= z 3.8e+148)) (<= z 2.2e+184)))
                 t_0
                 t_1)))))))))
double code(double x, double y, double z) {
	double t_0 = 6.0 * (z * y);
	double t_1 = -6.0 * (x * z);
	double tmp;
	if (z <= -1.7e+237) {
		tmp = t_0;
	} else if (z <= -4.2e+148) {
		tmp = t_1;
	} else if (z <= -1.05e+103) {
		tmp = t_0;
	} else if (z <= -1.62e+14) {
		tmp = t_1;
	} else if (z <= -4.1e-54) {
		tmp = t_0;
	} else if (z <= 6.3e-40) {
		tmp = x;
	} else if ((z <= 5e+23) || (!(z <= 3.8e+148) && (z <= 2.2e+184))) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 6.0d0 * (z * y)
    t_1 = (-6.0d0) * (x * z)
    if (z <= (-1.7d+237)) then
        tmp = t_0
    else if (z <= (-4.2d+148)) then
        tmp = t_1
    else if (z <= (-1.05d+103)) then
        tmp = t_0
    else if (z <= (-1.62d+14)) then
        tmp = t_1
    else if (z <= (-4.1d-54)) then
        tmp = t_0
    else if (z <= 6.3d-40) then
        tmp = x
    else if ((z <= 5d+23) .or. (.not. (z <= 3.8d+148)) .and. (z <= 2.2d+184)) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 6.0 * (z * y);
	double t_1 = -6.0 * (x * z);
	double tmp;
	if (z <= -1.7e+237) {
		tmp = t_0;
	} else if (z <= -4.2e+148) {
		tmp = t_1;
	} else if (z <= -1.05e+103) {
		tmp = t_0;
	} else if (z <= -1.62e+14) {
		tmp = t_1;
	} else if (z <= -4.1e-54) {
		tmp = t_0;
	} else if (z <= 6.3e-40) {
		tmp = x;
	} else if ((z <= 5e+23) || (!(z <= 3.8e+148) && (z <= 2.2e+184))) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 6.0 * (z * y)
	t_1 = -6.0 * (x * z)
	tmp = 0
	if z <= -1.7e+237:
		tmp = t_0
	elif z <= -4.2e+148:
		tmp = t_1
	elif z <= -1.05e+103:
		tmp = t_0
	elif z <= -1.62e+14:
		tmp = t_1
	elif z <= -4.1e-54:
		tmp = t_0
	elif z <= 6.3e-40:
		tmp = x
	elif (z <= 5e+23) or (not (z <= 3.8e+148) and (z <= 2.2e+184)):
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(6.0 * Float64(z * y))
	t_1 = Float64(-6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -1.7e+237)
		tmp = t_0;
	elseif (z <= -4.2e+148)
		tmp = t_1;
	elseif (z <= -1.05e+103)
		tmp = t_0;
	elseif (z <= -1.62e+14)
		tmp = t_1;
	elseif (z <= -4.1e-54)
		tmp = t_0;
	elseif (z <= 6.3e-40)
		tmp = x;
	elseif ((z <= 5e+23) || (!(z <= 3.8e+148) && (z <= 2.2e+184)))
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 6.0 * (z * y);
	t_1 = -6.0 * (x * z);
	tmp = 0.0;
	if (z <= -1.7e+237)
		tmp = t_0;
	elseif (z <= -4.2e+148)
		tmp = t_1;
	elseif (z <= -1.05e+103)
		tmp = t_0;
	elseif (z <= -1.62e+14)
		tmp = t_1;
	elseif (z <= -4.1e-54)
		tmp = t_0;
	elseif (z <= 6.3e-40)
		tmp = x;
	elseif ((z <= 5e+23) || (~((z <= 3.8e+148)) && (z <= 2.2e+184)))
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e+237], t$95$0, If[LessEqual[z, -4.2e+148], t$95$1, If[LessEqual[z, -1.05e+103], t$95$0, If[LessEqual[z, -1.62e+14], t$95$1, If[LessEqual[z, -4.1e-54], t$95$0, If[LessEqual[z, 6.3e-40], x, If[Or[LessEqual[z, 5e+23], And[N[Not[LessEqual[z, 3.8e+148]], $MachinePrecision], LessEqual[z, 2.2e+184]]], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}

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

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

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

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

\mathbf{elif}\;z \leq -4.1 \cdot 10^{-54}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 6.3 \cdot 10^{-40}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 5 \cdot 10^{+23} \lor \neg \left(z \leq 3.8 \cdot 10^{+148}\right) \land z \leq 2.2 \cdot 10^{+184}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.7000000000000002e237 or -4.19999999999999998e148 < z < -1.0500000000000001e103 or -1.62e14 < z < -4.1000000000000001e-54 or 6.3000000000000001e-40 < z < 4.9999999999999999e23 or 3.7999999999999998e148 < z < 2.2e184

    1. Initial program 99.6%

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

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

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

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

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

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

    if -1.7000000000000002e237 < z < -4.19999999999999998e148 or -1.0500000000000001e103 < z < -1.62e14 or 4.9999999999999999e23 < z < 3.7999999999999998e148 or 2.2e184 < z

    1. Initial program 99.8%

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

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

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

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

    if -4.1000000000000001e-54 < z < 6.3000000000000001e-40

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+237}:\\ \;\;\;\;6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{+148}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{+103}:\\ \;\;\;\;6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -1.62 \cdot 10^{+14}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{-54}:\\ \;\;\;\;6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq 6.3 \cdot 10^{-40}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+23} \lor \neg \left(z \leq 3.8 \cdot 10^{+148}\right) \land z \leq 2.2 \cdot 10^{+184}:\\ \;\;\;\;6 \cdot \left(z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 61.7% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \left(z \cdot y\right)\\ t_1 := -6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -2.55 \cdot 10^{+237}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{+149}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1 \cdot 10^{+98}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -6.4 \cdot 10^{+14}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{-54}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-39}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.02 \cdot 10^{+24}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+148}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+184}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* 6.0 (* z y))) (t_1 (* -6.0 (* x z))))
   (if (<= z -2.55e+237)
     t_0
     (if (<= z -1.45e+149)
       t_1
       (if (<= z -1e+98)
         t_0
         (if (<= z -6.4e+14)
           t_1
           (if (<= z -6.8e-54)
             t_0
             (if (<= z 1.55e-39)
               x
               (if (<= z 2.02e+24)
                 t_0
                 (if (<= z 3.8e+148)
                   t_1
                   (if (<= z 1.2e+184) t_0 (* x (* z -6.0)))))))))))))
double code(double x, double y, double z) {
	double t_0 = 6.0 * (z * y);
	double t_1 = -6.0 * (x * z);
	double tmp;
	if (z <= -2.55e+237) {
		tmp = t_0;
	} else if (z <= -1.45e+149) {
		tmp = t_1;
	} else if (z <= -1e+98) {
		tmp = t_0;
	} else if (z <= -6.4e+14) {
		tmp = t_1;
	} else if (z <= -6.8e-54) {
		tmp = t_0;
	} else if (z <= 1.55e-39) {
		tmp = x;
	} else if (z <= 2.02e+24) {
		tmp = t_0;
	} else if (z <= 3.8e+148) {
		tmp = t_1;
	} else if (z <= 1.2e+184) {
		tmp = t_0;
	} else {
		tmp = x * (z * -6.0);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 6.0d0 * (z * y)
    t_1 = (-6.0d0) * (x * z)
    if (z <= (-2.55d+237)) then
        tmp = t_0
    else if (z <= (-1.45d+149)) then
        tmp = t_1
    else if (z <= (-1d+98)) then
        tmp = t_0
    else if (z <= (-6.4d+14)) then
        tmp = t_1
    else if (z <= (-6.8d-54)) then
        tmp = t_0
    else if (z <= 1.55d-39) then
        tmp = x
    else if (z <= 2.02d+24) then
        tmp = t_0
    else if (z <= 3.8d+148) then
        tmp = t_1
    else if (z <= 1.2d+184) then
        tmp = t_0
    else
        tmp = x * (z * (-6.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 6.0 * (z * y);
	double t_1 = -6.0 * (x * z);
	double tmp;
	if (z <= -2.55e+237) {
		tmp = t_0;
	} else if (z <= -1.45e+149) {
		tmp = t_1;
	} else if (z <= -1e+98) {
		tmp = t_0;
	} else if (z <= -6.4e+14) {
		tmp = t_1;
	} else if (z <= -6.8e-54) {
		tmp = t_0;
	} else if (z <= 1.55e-39) {
		tmp = x;
	} else if (z <= 2.02e+24) {
		tmp = t_0;
	} else if (z <= 3.8e+148) {
		tmp = t_1;
	} else if (z <= 1.2e+184) {
		tmp = t_0;
	} else {
		tmp = x * (z * -6.0);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 6.0 * (z * y)
	t_1 = -6.0 * (x * z)
	tmp = 0
	if z <= -2.55e+237:
		tmp = t_0
	elif z <= -1.45e+149:
		tmp = t_1
	elif z <= -1e+98:
		tmp = t_0
	elif z <= -6.4e+14:
		tmp = t_1
	elif z <= -6.8e-54:
		tmp = t_0
	elif z <= 1.55e-39:
		tmp = x
	elif z <= 2.02e+24:
		tmp = t_0
	elif z <= 3.8e+148:
		tmp = t_1
	elif z <= 1.2e+184:
		tmp = t_0
	else:
		tmp = x * (z * -6.0)
	return tmp
function code(x, y, z)
	t_0 = Float64(6.0 * Float64(z * y))
	t_1 = Float64(-6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -2.55e+237)
		tmp = t_0;
	elseif (z <= -1.45e+149)
		tmp = t_1;
	elseif (z <= -1e+98)
		tmp = t_0;
	elseif (z <= -6.4e+14)
		tmp = t_1;
	elseif (z <= -6.8e-54)
		tmp = t_0;
	elseif (z <= 1.55e-39)
		tmp = x;
	elseif (z <= 2.02e+24)
		tmp = t_0;
	elseif (z <= 3.8e+148)
		tmp = t_1;
	elseif (z <= 1.2e+184)
		tmp = t_0;
	else
		tmp = Float64(x * Float64(z * -6.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 6.0 * (z * y);
	t_1 = -6.0 * (x * z);
	tmp = 0.0;
	if (z <= -2.55e+237)
		tmp = t_0;
	elseif (z <= -1.45e+149)
		tmp = t_1;
	elseif (z <= -1e+98)
		tmp = t_0;
	elseif (z <= -6.4e+14)
		tmp = t_1;
	elseif (z <= -6.8e-54)
		tmp = t_0;
	elseif (z <= 1.55e-39)
		tmp = x;
	elseif (z <= 2.02e+24)
		tmp = t_0;
	elseif (z <= 3.8e+148)
		tmp = t_1;
	elseif (z <= 1.2e+184)
		tmp = t_0;
	else
		tmp = x * (z * -6.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.55e+237], t$95$0, If[LessEqual[z, -1.45e+149], t$95$1, If[LessEqual[z, -1e+98], t$95$0, If[LessEqual[z, -6.4e+14], t$95$1, If[LessEqual[z, -6.8e-54], t$95$0, If[LessEqual[z, 1.55e-39], x, If[LessEqual[z, 2.02e+24], t$95$0, If[LessEqual[z, 3.8e+148], t$95$1, If[LessEqual[z, 1.2e+184], t$95$0, N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

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

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

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

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

\mathbf{elif}\;z \leq -6.8 \cdot 10^{-54}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;z \leq 2.02 \cdot 10^{+24}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 3.8 \cdot 10^{+148}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.2 \cdot 10^{+184}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.54999999999999989e237 or -1.4500000000000001e149 < z < -9.99999999999999998e97 or -6.4e14 < z < -6.79999999999999975e-54 or 1.54999999999999985e-39 < z < 2.0199999999999999e24 or 3.7999999999999998e148 < z < 1.19999999999999998e184

    1. Initial program 99.6%

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

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

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

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

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

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

    if -2.54999999999999989e237 < z < -1.4500000000000001e149 or -9.99999999999999998e97 < z < -6.4e14 or 2.0199999999999999e24 < z < 3.7999999999999998e148

    1. Initial program 99.7%

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

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

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

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

    if -6.79999999999999975e-54 < z < 1.54999999999999985e-39

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x} \]

    if 1.19999999999999998e184 < z

    1. Initial program 99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.55 \cdot 10^{+237}:\\ \;\;\;\;6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{+149}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -1 \cdot 10^{+98}:\\ \;\;\;\;6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -6.4 \cdot 10^{+14}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{-54}:\\ \;\;\;\;6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-39}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.02 \cdot 10^{+24}:\\ \;\;\;\;6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+148}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+184}:\\ \;\;\;\;6 \cdot \left(z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 61.4% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(6 \cdot z\right)\\ t_1 := 6 \cdot \left(z \cdot y\right)\\ t_2 := -6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -2.2 \cdot 10^{+237}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.48 \cdot 10^{+150}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{+109}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -5.1 \cdot 10^{+14}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-54}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{-39}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+116}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+149}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+184}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (* 6.0 z))) (t_1 (* 6.0 (* z y))) (t_2 (* -6.0 (* x z))))
   (if (<= z -2.2e+237)
     t_0
     (if (<= z -1.48e+150)
       t_2
       (if (<= z -6.6e+109)
         t_0
         (if (<= z -5.1e+14)
           t_2
           (if (<= z -2.9e-54)
             t_1
             (if (<= z 1.32e-39)
               x
               (if (<= z 2.6e+116)
                 t_0
                 (if (<= z 7.2e+149)
                   t_2
                   (if (<= z 3e+184) t_1 (* x (* z -6.0)))))))))))))
double code(double x, double y, double z) {
	double t_0 = y * (6.0 * z);
	double t_1 = 6.0 * (z * y);
	double t_2 = -6.0 * (x * z);
	double tmp;
	if (z <= -2.2e+237) {
		tmp = t_0;
	} else if (z <= -1.48e+150) {
		tmp = t_2;
	} else if (z <= -6.6e+109) {
		tmp = t_0;
	} else if (z <= -5.1e+14) {
		tmp = t_2;
	} else if (z <= -2.9e-54) {
		tmp = t_1;
	} else if (z <= 1.32e-39) {
		tmp = x;
	} else if (z <= 2.6e+116) {
		tmp = t_0;
	} else if (z <= 7.2e+149) {
		tmp = t_2;
	} else if (z <= 3e+184) {
		tmp = t_1;
	} else {
		tmp = x * (z * -6.0);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = y * (6.0d0 * z)
    t_1 = 6.0d0 * (z * y)
    t_2 = (-6.0d0) * (x * z)
    if (z <= (-2.2d+237)) then
        tmp = t_0
    else if (z <= (-1.48d+150)) then
        tmp = t_2
    else if (z <= (-6.6d+109)) then
        tmp = t_0
    else if (z <= (-5.1d+14)) then
        tmp = t_2
    else if (z <= (-2.9d-54)) then
        tmp = t_1
    else if (z <= 1.32d-39) then
        tmp = x
    else if (z <= 2.6d+116) then
        tmp = t_0
    else if (z <= 7.2d+149) then
        tmp = t_2
    else if (z <= 3d+184) then
        tmp = t_1
    else
        tmp = x * (z * (-6.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = y * (6.0 * z);
	double t_1 = 6.0 * (z * y);
	double t_2 = -6.0 * (x * z);
	double tmp;
	if (z <= -2.2e+237) {
		tmp = t_0;
	} else if (z <= -1.48e+150) {
		tmp = t_2;
	} else if (z <= -6.6e+109) {
		tmp = t_0;
	} else if (z <= -5.1e+14) {
		tmp = t_2;
	} else if (z <= -2.9e-54) {
		tmp = t_1;
	} else if (z <= 1.32e-39) {
		tmp = x;
	} else if (z <= 2.6e+116) {
		tmp = t_0;
	} else if (z <= 7.2e+149) {
		tmp = t_2;
	} else if (z <= 3e+184) {
		tmp = t_1;
	} else {
		tmp = x * (z * -6.0);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * (6.0 * z)
	t_1 = 6.0 * (z * y)
	t_2 = -6.0 * (x * z)
	tmp = 0
	if z <= -2.2e+237:
		tmp = t_0
	elif z <= -1.48e+150:
		tmp = t_2
	elif z <= -6.6e+109:
		tmp = t_0
	elif z <= -5.1e+14:
		tmp = t_2
	elif z <= -2.9e-54:
		tmp = t_1
	elif z <= 1.32e-39:
		tmp = x
	elif z <= 2.6e+116:
		tmp = t_0
	elif z <= 7.2e+149:
		tmp = t_2
	elif z <= 3e+184:
		tmp = t_1
	else:
		tmp = x * (z * -6.0)
	return tmp
function code(x, y, z)
	t_0 = Float64(y * Float64(6.0 * z))
	t_1 = Float64(6.0 * Float64(z * y))
	t_2 = Float64(-6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -2.2e+237)
		tmp = t_0;
	elseif (z <= -1.48e+150)
		tmp = t_2;
	elseif (z <= -6.6e+109)
		tmp = t_0;
	elseif (z <= -5.1e+14)
		tmp = t_2;
	elseif (z <= -2.9e-54)
		tmp = t_1;
	elseif (z <= 1.32e-39)
		tmp = x;
	elseif (z <= 2.6e+116)
		tmp = t_0;
	elseif (z <= 7.2e+149)
		tmp = t_2;
	elseif (z <= 3e+184)
		tmp = t_1;
	else
		tmp = Float64(x * Float64(z * -6.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * (6.0 * z);
	t_1 = 6.0 * (z * y);
	t_2 = -6.0 * (x * z);
	tmp = 0.0;
	if (z <= -2.2e+237)
		tmp = t_0;
	elseif (z <= -1.48e+150)
		tmp = t_2;
	elseif (z <= -6.6e+109)
		tmp = t_0;
	elseif (z <= -5.1e+14)
		tmp = t_2;
	elseif (z <= -2.9e-54)
		tmp = t_1;
	elseif (z <= 1.32e-39)
		tmp = x;
	elseif (z <= 2.6e+116)
		tmp = t_0;
	elseif (z <= 7.2e+149)
		tmp = t_2;
	elseif (z <= 3e+184)
		tmp = t_1;
	else
		tmp = x * (z * -6.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+237], t$95$0, If[LessEqual[z, -1.48e+150], t$95$2, If[LessEqual[z, -6.6e+109], t$95$0, If[LessEqual[z, -5.1e+14], t$95$2, If[LessEqual[z, -2.9e-54], t$95$1, If[LessEqual[z, 1.32e-39], x, If[LessEqual[z, 2.6e+116], t$95$0, If[LessEqual[z, 7.2e+149], t$95$2, If[LessEqual[z, 3e+184], t$95$1, N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.48 \cdot 10^{+150}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq -5.1 \cdot 10^{+14}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -2.9 \cdot 10^{-54}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.32 \cdot 10^{-39}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 2.6 \cdot 10^{+116}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 7.2 \cdot 10^{+149}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 3 \cdot 10^{+184}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.2e237 or -1.47999999999999991e150 < z < -6.5999999999999998e109 or 1.31999999999999997e-39 < z < 2.59999999999999987e116

    1. Initial program 99.6%

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

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

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

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

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

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

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

    if -2.2e237 < z < -1.47999999999999991e150 or -6.5999999999999998e109 < z < -5.1e14 or 2.59999999999999987e116 < z < 7.1999999999999999e149

    1. Initial program 99.8%

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

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

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

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

    if -5.1e14 < z < -2.90000000000000015e-54 or 7.1999999999999999e149 < z < 2.99999999999999986e184

    1. Initial program 99.7%

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

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

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

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

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

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

    if -2.90000000000000015e-54 < z < 1.31999999999999997e-39

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x} \]

    if 2.99999999999999986e184 < z

    1. Initial program 99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{+237}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq -1.48 \cdot 10^{+150}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{+109}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq -5.1 \cdot 10^{+14}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-54}:\\ \;\;\;\;6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{-39}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+116}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+149}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+184}:\\ \;\;\;\;6 \cdot \left(z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 61.4% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(6 \cdot z\right)\\ t_1 := z \cdot \left(x \cdot -6\right)\\ t_2 := 6 \cdot \left(z \cdot y\right)\\ \mathbf{if}\;z \leq -2.85 \cdot 10^{+237}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -2.95 \cdot 10^{+149}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{+98}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{+14}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-54}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-39}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+114}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+149}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+183}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (* 6.0 z))) (t_1 (* z (* x -6.0))) (t_2 (* 6.0 (* z y))))
   (if (<= z -2.85e+237)
     t_0
     (if (<= z -2.95e+149)
       (* -6.0 (* x z))
       (if (<= z -3.3e+98)
         t_0
         (if (<= z -1.55e+14)
           t_1
           (if (<= z -4e-54)
             t_2
             (if (<= z 1.55e-39)
               x
               (if (<= z 2.3e+114)
                 t_0
                 (if (<= z 2.6e+149)
                   t_1
                   (if (<= z 1.45e+183) t_2 (* x (* z -6.0)))))))))))))
double code(double x, double y, double z) {
	double t_0 = y * (6.0 * z);
	double t_1 = z * (x * -6.0);
	double t_2 = 6.0 * (z * y);
	double tmp;
	if (z <= -2.85e+237) {
		tmp = t_0;
	} else if (z <= -2.95e+149) {
		tmp = -6.0 * (x * z);
	} else if (z <= -3.3e+98) {
		tmp = t_0;
	} else if (z <= -1.55e+14) {
		tmp = t_1;
	} else if (z <= -4e-54) {
		tmp = t_2;
	} else if (z <= 1.55e-39) {
		tmp = x;
	} else if (z <= 2.3e+114) {
		tmp = t_0;
	} else if (z <= 2.6e+149) {
		tmp = t_1;
	} else if (z <= 1.45e+183) {
		tmp = t_2;
	} else {
		tmp = x * (z * -6.0);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = y * (6.0d0 * z)
    t_1 = z * (x * (-6.0d0))
    t_2 = 6.0d0 * (z * y)
    if (z <= (-2.85d+237)) then
        tmp = t_0
    else if (z <= (-2.95d+149)) then
        tmp = (-6.0d0) * (x * z)
    else if (z <= (-3.3d+98)) then
        tmp = t_0
    else if (z <= (-1.55d+14)) then
        tmp = t_1
    else if (z <= (-4d-54)) then
        tmp = t_2
    else if (z <= 1.55d-39) then
        tmp = x
    else if (z <= 2.3d+114) then
        tmp = t_0
    else if (z <= 2.6d+149) then
        tmp = t_1
    else if (z <= 1.45d+183) then
        tmp = t_2
    else
        tmp = x * (z * (-6.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = y * (6.0 * z);
	double t_1 = z * (x * -6.0);
	double t_2 = 6.0 * (z * y);
	double tmp;
	if (z <= -2.85e+237) {
		tmp = t_0;
	} else if (z <= -2.95e+149) {
		tmp = -6.0 * (x * z);
	} else if (z <= -3.3e+98) {
		tmp = t_0;
	} else if (z <= -1.55e+14) {
		tmp = t_1;
	} else if (z <= -4e-54) {
		tmp = t_2;
	} else if (z <= 1.55e-39) {
		tmp = x;
	} else if (z <= 2.3e+114) {
		tmp = t_0;
	} else if (z <= 2.6e+149) {
		tmp = t_1;
	} else if (z <= 1.45e+183) {
		tmp = t_2;
	} else {
		tmp = x * (z * -6.0);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * (6.0 * z)
	t_1 = z * (x * -6.0)
	t_2 = 6.0 * (z * y)
	tmp = 0
	if z <= -2.85e+237:
		tmp = t_0
	elif z <= -2.95e+149:
		tmp = -6.0 * (x * z)
	elif z <= -3.3e+98:
		tmp = t_0
	elif z <= -1.55e+14:
		tmp = t_1
	elif z <= -4e-54:
		tmp = t_2
	elif z <= 1.55e-39:
		tmp = x
	elif z <= 2.3e+114:
		tmp = t_0
	elif z <= 2.6e+149:
		tmp = t_1
	elif z <= 1.45e+183:
		tmp = t_2
	else:
		tmp = x * (z * -6.0)
	return tmp
function code(x, y, z)
	t_0 = Float64(y * Float64(6.0 * z))
	t_1 = Float64(z * Float64(x * -6.0))
	t_2 = Float64(6.0 * Float64(z * y))
	tmp = 0.0
	if (z <= -2.85e+237)
		tmp = t_0;
	elseif (z <= -2.95e+149)
		tmp = Float64(-6.0 * Float64(x * z));
	elseif (z <= -3.3e+98)
		tmp = t_0;
	elseif (z <= -1.55e+14)
		tmp = t_1;
	elseif (z <= -4e-54)
		tmp = t_2;
	elseif (z <= 1.55e-39)
		tmp = x;
	elseif (z <= 2.3e+114)
		tmp = t_0;
	elseif (z <= 2.6e+149)
		tmp = t_1;
	elseif (z <= 1.45e+183)
		tmp = t_2;
	else
		tmp = Float64(x * Float64(z * -6.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * (6.0 * z);
	t_1 = z * (x * -6.0);
	t_2 = 6.0 * (z * y);
	tmp = 0.0;
	if (z <= -2.85e+237)
		tmp = t_0;
	elseif (z <= -2.95e+149)
		tmp = -6.0 * (x * z);
	elseif (z <= -3.3e+98)
		tmp = t_0;
	elseif (z <= -1.55e+14)
		tmp = t_1;
	elseif (z <= -4e-54)
		tmp = t_2;
	elseif (z <= 1.55e-39)
		tmp = x;
	elseif (z <= 2.3e+114)
		tmp = t_0;
	elseif (z <= 2.6e+149)
		tmp = t_1;
	elseif (z <= 1.45e+183)
		tmp = t_2;
	else
		tmp = x * (z * -6.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.85e+237], t$95$0, If[LessEqual[z, -2.95e+149], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.3e+98], t$95$0, If[LessEqual[z, -1.55e+14], t$95$1, If[LessEqual[z, -4e-54], t$95$2, If[LessEqual[z, 1.55e-39], x, If[LessEqual[z, 2.3e+114], t$95$0, If[LessEqual[z, 2.6e+149], t$95$1, If[LessEqual[z, 1.45e+183], t$95$2, N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}

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

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

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

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

\mathbf{elif}\;z \leq -4 \cdot 10^{-54}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq 2.3 \cdot 10^{+114}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;z \leq 1.45 \cdot 10^{+183}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -2.84999999999999997e237 or -2.9500000000000001e149 < z < -3.30000000000000028e98 or 1.54999999999999985e-39 < z < 2.3e114

    1. Initial program 99.6%

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

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

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

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

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

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

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

    if -2.84999999999999997e237 < z < -2.9500000000000001e149

    1. Initial program 99.8%

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

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

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

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

    if -3.30000000000000028e98 < z < -1.55e14 or 2.3e114 < z < 2.59999999999999979e149

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

    if -1.55e14 < z < -4.0000000000000001e-54 or 2.59999999999999979e149 < z < 1.45e183

    1. Initial program 99.7%

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

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

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

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

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

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

    if -4.0000000000000001e-54 < z < 1.54999999999999985e-39

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x} \]

    if 1.45e183 < z

    1. Initial program 99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.85 \cdot 10^{+237}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq -2.95 \cdot 10^{+149}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{+98}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{+14}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-54}:\\ \;\;\;\;6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-39}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+114}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+149}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+183}:\\ \;\;\;\;6 \cdot \left(z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 98.8% accurate, 0.5× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;z \cdot \frac{6}{\frac{1}{y - x}}\\


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

    1. Initial program 99.7%

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

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

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

    if -6.5999999999999996 < z < 0.170000000000000012

    1. Initial program 99.9%

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

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

    if 0.170000000000000012 < z

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto 6 \cdot \left(y \cdot z\right) + \color{blue}{\left(-6\right)} \cdot \left(z \cdot x\right) \]
      4. cancel-sign-sub-inv95.0%

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

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

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

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

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

        \[\leadsto \left(6 \cdot z\right) \cdot y + \color{blue}{\left(6 \cdot z\right) \cdot \left(-x\right)} \]
      10. distribute-lft-out98.1%

        \[\leadsto \color{blue}{\left(6 \cdot z\right) \cdot \left(y + \left(-x\right)\right)} \]
      11. sub-neg98.1%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(z \cdot 6\right) \cdot \left({y}^{2} - \color{blue}{{x}^{2}}\right)}{y + x} \]
    9. Applied egg-rr63.5%

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

        \[\leadsto \color{blue}{\frac{z \cdot 6}{\frac{y + x}{{y}^{2} - {x}^{2}}}} \]
      2. *-commutative73.6%

        \[\leadsto \frac{\color{blue}{6 \cdot z}}{\frac{y + x}{{y}^{2} - {x}^{2}}} \]
      3. associate-/l*73.6%

        \[\leadsto \color{blue}{\frac{6}{\frac{\frac{y + x}{{y}^{2} - {x}^{2}}}{z}}} \]
      4. associate-/r/73.7%

        \[\leadsto \color{blue}{\frac{6}{\frac{y + x}{{y}^{2} - {x}^{2}}} \cdot z} \]
      5. unpow273.7%

        \[\leadsto \frac{6}{\frac{y + x}{\color{blue}{y \cdot y} - {x}^{2}}} \cdot z \]
      6. unpow273.7%

        \[\leadsto \frac{6}{\frac{y + x}{y \cdot y - \color{blue}{x \cdot x}}} \cdot z \]
      7. difference-of-squares76.8%

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

        \[\leadsto \frac{6}{\color{blue}{\frac{\frac{y + x}{y + x}}{y - x}}} \cdot z \]
      9. *-inverses98.2%

        \[\leadsto \frac{6}{\frac{\color{blue}{1}}{y - x}} \cdot z \]
    11. Simplified98.2%

      \[\leadsto \color{blue}{\frac{6}{\frac{1}{y - x}} \cdot z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification98.7%

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

Alternative 8: 85.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{-54} \lor \neg \left(z \leq 1.5 \cdot 10^{-39}\right):\\ \;\;\;\;6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -6.5e-54) (not (<= z 1.5e-39))) (* 6.0 (* z (- y x))) x))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -6.5e-54) || !(z <= 1.5e-39)) {
		tmp = 6.0 * (z * (y - x));
	} else {
		tmp = 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 <= (-6.5d-54)) .or. (.not. (z <= 1.5d-39))) then
        tmp = 6.0d0 * (z * (y - x))
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -6.5e-54) || !(z <= 1.5e-39)) {
		tmp = 6.0 * (z * (y - x));
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -6.5e-54) or not (z <= 1.5e-39):
		tmp = 6.0 * (z * (y - x))
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -6.5e-54) || !(z <= 1.5e-39))
		tmp = Float64(6.0 * Float64(z * Float64(y - x)));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -6.5e-54) || ~((z <= 1.5e-39)))
		tmp = 6.0 * (z * (y - x));
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -6.5e-54], N[Not[LessEqual[z, 1.5e-39]], $MachinePrecision]], N[(6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{-54} \lor \neg \left(z \leq 1.5 \cdot 10^{-39}\right):\\
\;\;\;\;6 \cdot \left(z \cdot \left(y - x\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.49999999999999991e-54 or 1.50000000000000014e-39 < z

    1. Initial program 99.7%

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

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

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

    if -6.49999999999999991e-54 < z < 1.50000000000000014e-39

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{-54} \lor \neg \left(z \leq 1.5 \cdot 10^{-39}\right):\\ \;\;\;\;6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 85.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-54} \lor \neg \left(z \leq 550\right):\\
\;\;\;\;6 \cdot \left(z \cdot \left(y - x\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.59999999999999976e-54 or 550 < z

    1. Initial program 99.7%

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

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

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

    if -3.59999999999999976e-54 < z < 550

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{-54} \lor \neg \left(z \leq 550\right):\\ \;\;\;\;6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 + z \cdot -6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 98.6% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.05e14 or 0.170000000000000012 < z

    1. Initial program 99.7%

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

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

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

    if -1.05e14 < z < 0.170000000000000012

    1. Initial program 99.9%

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

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

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

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

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

Alternative 11: 98.8% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

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

    if -6.5999999999999996 < z < 0.170000000000000012

    1. Initial program 99.9%

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

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

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

Alternative 12: 61.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{-9} \lor \neg \left(z \leq 0.17\right):\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.60000000000000037e-9 or 0.170000000000000012 < z

    1. Initial program 99.7%

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

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

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

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

    if -6.60000000000000037e-9 < z < 0.170000000000000012

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification59.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{-9} \lor \neg \left(z \leq 0.17\right):\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 37.5% accurate, 9.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.8%

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification35.8%

    \[\leadsto x \]
  5. Add Preprocessing

Developer target: 99.8% accurate, 1.0× speedup?

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

\\
x - \left(6 \cdot z\right) \cdot \left(x - y\right)
\end{array}

Reproduce

?
herbie shell --seed 2024031 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, E"
  :precision binary64

  :herbie-target
  (- x (* (* 6.0 z) (- x y)))

  (+ x (* (* (- y x) 6.0) z)))