Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.7% → 94.4%
Time: 11.1s
Alternatives: 15
Speedup: 0.8×

Specification

?
\[\begin{array}{l} \\ \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b):
	return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\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 15 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: 92.7% accurate, 1.0× speedup?

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

\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}

Alternative 1: 94.4% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 4.8 \cdot 10^{+37}:\\ \;\;\;\;\mathsf{fma}\left(z, a \cdot b, \mathsf{fma}\left(t, a, \mathsf{fma}\left(y, z, x\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a 4.8e+37)
   (fma z (* a b) (fma t a (fma y z x)))
   (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= 4.8e+37) {
		tmp = fma(z, (a * b), fma(t, a, fma(y, z, x)));
	} else {
		tmp = x + (a * (t + (z * b)));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= 4.8e+37)
		tmp = fma(z, Float64(a * b), fma(t, a, fma(y, z, x)));
	else
		tmp = Float64(x + Float64(a * Float64(t + Float64(z * b))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, 4.8e+37], N[(z * N[(a * b), $MachinePrecision] + N[(t * a + N[(y * z + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.8 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(z, a \cdot b, \mathsf{fma}\left(t, a, \mathsf{fma}\left(y, z, x\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 4.8e37

    1. Initial program 93.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative93.6%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. *-commutative93.6%

        \[\leadsto \color{blue}{\left(z \cdot a\right)} \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right) \]
      3. associate-*l*95.9%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b\right)} + \left(\left(x + y \cdot z\right) + t \cdot a\right) \]
      4. *-commutative95.9%

        \[\leadsto z \cdot \color{blue}{\left(b \cdot a\right)} + \left(\left(x + y \cdot z\right) + t \cdot a\right) \]
      5. fma-define96.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, b \cdot a, \left(x + y \cdot z\right) + t \cdot a\right)} \]
      6. *-commutative96.9%

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{a \cdot b}, \left(x + y \cdot z\right) + t \cdot a\right) \]
      7. +-commutative96.9%

        \[\leadsto \mathsf{fma}\left(z, a \cdot b, \color{blue}{t \cdot a + \left(x + y \cdot z\right)}\right) \]
      8. fma-define97.4%

        \[\leadsto \mathsf{fma}\left(z, a \cdot b, \color{blue}{\mathsf{fma}\left(t, a, x + y \cdot z\right)}\right) \]
      9. +-commutative97.4%

        \[\leadsto \mathsf{fma}\left(z, a \cdot b, \mathsf{fma}\left(t, a, \color{blue}{y \cdot z + x}\right)\right) \]
      10. fma-define97.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, a \cdot b, \mathsf{fma}\left(t, a, \mathsf{fma}\left(y, z, x\right)\right)\right)} \]
    4. Add Preprocessing

    if 4.8e37 < a

    1. Initial program 83.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 85.3%

      \[\leadsto \color{blue}{x + \left(a \cdot t + z \cdot \left(y + a \cdot b\right)\right)} \]
    4. Taylor expanded in a around inf 96.8%

      \[\leadsto x + \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
    5. Step-by-step derivation
      1. +-commutative96.8%

        \[\leadsto x + a \cdot \color{blue}{\left(b \cdot z + t\right)} \]
    6. Simplified96.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 4.8 \cdot 10^{+37}:\\ \;\;\;\;\mathsf{fma}\left(z, a \cdot b, \mathsf{fma}\left(t, a, \mathsf{fma}\left(y, z, x\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 38.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;a \leq -1.65 \cdot 10^{+131}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -5.5 \cdot 10^{+73}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;a \leq -6 \cdot 10^{-7}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -2 \cdot 10^{-71}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;a \leq -1.45 \cdot 10^{-157}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-171}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;a \leq 8.2 \cdot 10^{+96}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.6 \cdot 10^{+215}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* z b))))
   (if (<= a -1.65e+131)
     t_1
     (if (<= a -5.5e+73)
       (* z y)
       (if (<= a -6e-7)
         t_1
         (if (<= a -2e-71)
           (* z y)
           (if (<= a -1.45e-157)
             x
             (if (<= a 5e-171)
               (* z y)
               (if (<= a 8.2e+96) x (if (<= a 1.6e+215) t_1 (* a t)))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (a <= -1.65e+131) {
		tmp = t_1;
	} else if (a <= -5.5e+73) {
		tmp = z * y;
	} else if (a <= -6e-7) {
		tmp = t_1;
	} else if (a <= -2e-71) {
		tmp = z * y;
	} else if (a <= -1.45e-157) {
		tmp = x;
	} else if (a <= 5e-171) {
		tmp = z * y;
	} else if (a <= 8.2e+96) {
		tmp = x;
	} else if (a <= 1.6e+215) {
		tmp = t_1;
	} else {
		tmp = a * t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = a * (z * b)
    if (a <= (-1.65d+131)) then
        tmp = t_1
    else if (a <= (-5.5d+73)) then
        tmp = z * y
    else if (a <= (-6d-7)) then
        tmp = t_1
    else if (a <= (-2d-71)) then
        tmp = z * y
    else if (a <= (-1.45d-157)) then
        tmp = x
    else if (a <= 5d-171) then
        tmp = z * y
    else if (a <= 8.2d+96) then
        tmp = x
    else if (a <= 1.6d+215) then
        tmp = t_1
    else
        tmp = a * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (a <= -1.65e+131) {
		tmp = t_1;
	} else if (a <= -5.5e+73) {
		tmp = z * y;
	} else if (a <= -6e-7) {
		tmp = t_1;
	} else if (a <= -2e-71) {
		tmp = z * y;
	} else if (a <= -1.45e-157) {
		tmp = x;
	} else if (a <= 5e-171) {
		tmp = z * y;
	} else if (a <= 8.2e+96) {
		tmp = x;
	} else if (a <= 1.6e+215) {
		tmp = t_1;
	} else {
		tmp = a * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (z * b)
	tmp = 0
	if a <= -1.65e+131:
		tmp = t_1
	elif a <= -5.5e+73:
		tmp = z * y
	elif a <= -6e-7:
		tmp = t_1
	elif a <= -2e-71:
		tmp = z * y
	elif a <= -1.45e-157:
		tmp = x
	elif a <= 5e-171:
		tmp = z * y
	elif a <= 8.2e+96:
		tmp = x
	elif a <= 1.6e+215:
		tmp = t_1
	else:
		tmp = a * t
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(z * b))
	tmp = 0.0
	if (a <= -1.65e+131)
		tmp = t_1;
	elseif (a <= -5.5e+73)
		tmp = Float64(z * y);
	elseif (a <= -6e-7)
		tmp = t_1;
	elseif (a <= -2e-71)
		tmp = Float64(z * y);
	elseif (a <= -1.45e-157)
		tmp = x;
	elseif (a <= 5e-171)
		tmp = Float64(z * y);
	elseif (a <= 8.2e+96)
		tmp = x;
	elseif (a <= 1.6e+215)
		tmp = t_1;
	else
		tmp = Float64(a * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (z * b);
	tmp = 0.0;
	if (a <= -1.65e+131)
		tmp = t_1;
	elseif (a <= -5.5e+73)
		tmp = z * y;
	elseif (a <= -6e-7)
		tmp = t_1;
	elseif (a <= -2e-71)
		tmp = z * y;
	elseif (a <= -1.45e-157)
		tmp = x;
	elseif (a <= 5e-171)
		tmp = z * y;
	elseif (a <= 8.2e+96)
		tmp = x;
	elseif (a <= 1.6e+215)
		tmp = t_1;
	else
		tmp = a * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.65e+131], t$95$1, If[LessEqual[a, -5.5e+73], N[(z * y), $MachinePrecision], If[LessEqual[a, -6e-7], t$95$1, If[LessEqual[a, -2e-71], N[(z * y), $MachinePrecision], If[LessEqual[a, -1.45e-157], x, If[LessEqual[a, 5e-171], N[(z * y), $MachinePrecision], If[LessEqual[a, 8.2e+96], x, If[LessEqual[a, 1.6e+215], t$95$1, N[(a * t), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;a \leq -1.65 \cdot 10^{+131}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -5.5 \cdot 10^{+73}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;a \leq -6 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -2 \cdot 10^{-71}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;a \leq -1.45 \cdot 10^{-157}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 5 \cdot 10^{-171}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;a \leq 8.2 \cdot 10^{+96}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1.6 \cdot 10^{+215}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;a \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.6499999999999999e131 or -5.5000000000000003e73 < a < -5.9999999999999997e-7 or 8.19999999999999996e96 < a < 1.5999999999999999e215

    1. Initial program 84.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf 57.3%

      \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]

    if -1.6499999999999999e131 < a < -5.5000000000000003e73 or -5.9999999999999997e-7 < a < -1.9999999999999998e-71 or -1.44999999999999994e-157 < a < 4.99999999999999992e-171

    1. Initial program 95.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 53.9%

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

        \[\leadsto \color{blue}{z \cdot y} \]
    5. Simplified53.9%

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

    if -1.9999999999999998e-71 < a < -1.44999999999999994e-157 or 4.99999999999999992e-171 < a < 8.19999999999999996e96

    1. Initial program 99.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 58.9%

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

    if 1.5999999999999999e215 < a

    1. Initial program 77.3%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 69.5%

      \[\leadsto \color{blue}{a \cdot t} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification57.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.65 \cdot 10^{+131}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -5.5 \cdot 10^{+73}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;a \leq -6 \cdot 10^{-7}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -2 \cdot 10^{-71}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;a \leq -1.45 \cdot 10^{-157}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-171}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;a \leq 8.2 \cdot 10^{+96}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.6 \cdot 10^{+215}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 38.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -5.2 \cdot 10^{-9}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq -1.25 \cdot 10^{-71}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;a \leq -1.55 \cdot 10^{-157}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.95 \cdot 10^{-171}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;a \leq 8.4 \cdot 10^{+96}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{+214}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -5.2e-9)
   (* z (* a b))
   (if (<= a -1.25e-71)
     (* z y)
     (if (<= a -1.55e-157)
       x
       (if (<= a 1.95e-171)
         (* z y)
         (if (<= a 8.4e+96) x (if (<= a 5.8e+214) (* a (* z b)) (* a t))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -5.2e-9) {
		tmp = z * (a * b);
	} else if (a <= -1.25e-71) {
		tmp = z * y;
	} else if (a <= -1.55e-157) {
		tmp = x;
	} else if (a <= 1.95e-171) {
		tmp = z * y;
	} else if (a <= 8.4e+96) {
		tmp = x;
	} else if (a <= 5.8e+214) {
		tmp = a * (z * b);
	} else {
		tmp = a * t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (a <= (-5.2d-9)) then
        tmp = z * (a * b)
    else if (a <= (-1.25d-71)) then
        tmp = z * y
    else if (a <= (-1.55d-157)) then
        tmp = x
    else if (a <= 1.95d-171) then
        tmp = z * y
    else if (a <= 8.4d+96) then
        tmp = x
    else if (a <= 5.8d+214) then
        tmp = a * (z * b)
    else
        tmp = a * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -5.2e-9) {
		tmp = z * (a * b);
	} else if (a <= -1.25e-71) {
		tmp = z * y;
	} else if (a <= -1.55e-157) {
		tmp = x;
	} else if (a <= 1.95e-171) {
		tmp = z * y;
	} else if (a <= 8.4e+96) {
		tmp = x;
	} else if (a <= 5.8e+214) {
		tmp = a * (z * b);
	} else {
		tmp = a * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -5.2e-9:
		tmp = z * (a * b)
	elif a <= -1.25e-71:
		tmp = z * y
	elif a <= -1.55e-157:
		tmp = x
	elif a <= 1.95e-171:
		tmp = z * y
	elif a <= 8.4e+96:
		tmp = x
	elif a <= 5.8e+214:
		tmp = a * (z * b)
	else:
		tmp = a * t
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -5.2e-9)
		tmp = Float64(z * Float64(a * b));
	elseif (a <= -1.25e-71)
		tmp = Float64(z * y);
	elseif (a <= -1.55e-157)
		tmp = x;
	elseif (a <= 1.95e-171)
		tmp = Float64(z * y);
	elseif (a <= 8.4e+96)
		tmp = x;
	elseif (a <= 5.8e+214)
		tmp = Float64(a * Float64(z * b));
	else
		tmp = Float64(a * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (a <= -5.2e-9)
		tmp = z * (a * b);
	elseif (a <= -1.25e-71)
		tmp = z * y;
	elseif (a <= -1.55e-157)
		tmp = x;
	elseif (a <= 1.95e-171)
		tmp = z * y;
	elseif (a <= 8.4e+96)
		tmp = x;
	elseif (a <= 5.8e+214)
		tmp = a * (z * b);
	else
		tmp = a * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -5.2e-9], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.25e-71], N[(z * y), $MachinePrecision], If[LessEqual[a, -1.55e-157], x, If[LessEqual[a, 1.95e-171], N[(z * y), $MachinePrecision], If[LessEqual[a, 8.4e+96], x, If[LessEqual[a, 5.8e+214], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], N[(a * t), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.2 \cdot 10^{-9}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\

\mathbf{elif}\;a \leq -1.25 \cdot 10^{-71}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;a \leq -1.55 \cdot 10^{-157}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1.95 \cdot 10^{-171}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;a \leq 8.4 \cdot 10^{+96}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 5.8 \cdot 10^{+214}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\

\mathbf{else}:\\
\;\;\;\;a \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -5.2000000000000002e-9

    1. Initial program 84.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 70.2%

      \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
    4. Taylor expanded in t around 0 48.1%

      \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]
    5. Step-by-step derivation
      1. associate-*r*50.5%

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot z} \]
      2. *-commutative50.5%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b\right)} \]
    6. Simplified50.5%

      \[\leadsto \color{blue}{z \cdot \left(a \cdot b\right)} \]

    if -5.2000000000000002e-9 < a < -1.24999999999999999e-71 or -1.5499999999999999e-157 < a < 1.9499999999999999e-171

    1. Initial program 99.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 55.3%

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

        \[\leadsto \color{blue}{z \cdot y} \]
    5. Simplified55.3%

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

    if -1.24999999999999999e-71 < a < -1.5499999999999999e-157 or 1.9499999999999999e-171 < a < 8.4000000000000005e96

    1. Initial program 99.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 58.9%

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

    if 8.4000000000000005e96 < a < 5.7999999999999999e214

    1. Initial program 81.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf 60.8%

      \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]

    if 5.7999999999999999e214 < a

    1. Initial program 77.3%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 69.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.2 \cdot 10^{-9}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq -1.25 \cdot 10^{-71}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;a \leq -1.55 \cdot 10^{-157}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.95 \cdot 10^{-171}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;a \leq 8.4 \cdot 10^{+96}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{+214}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 86.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.55 \cdot 10^{+140} \lor \neg \left(a \leq -5.2 \cdot 10^{+88} \lor \neg \left(a \leq -1.05 \cdot 10^{-5}\right) \land a \leq 1.15 \cdot 10^{-14}\right):\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= a -1.55e+140)
         (not
          (or (<= a -5.2e+88) (and (not (<= a -1.05e-5)) (<= a 1.15e-14)))))
   (+ x (* a (+ t (* z b))))
   (+ x (+ (* a t) (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -1.55e+140) || !((a <= -5.2e+88) || (!(a <= -1.05e-5) && (a <= 1.15e-14)))) {
		tmp = x + (a * (t + (z * b)));
	} else {
		tmp = x + ((a * t) + (z * y));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((a <= (-1.55d+140)) .or. (.not. (a <= (-5.2d+88)) .or. (.not. (a <= (-1.05d-5))) .and. (a <= 1.15d-14))) then
        tmp = x + (a * (t + (z * b)))
    else
        tmp = x + ((a * t) + (z * y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -1.55e+140) || !((a <= -5.2e+88) || (!(a <= -1.05e-5) && (a <= 1.15e-14)))) {
		tmp = x + (a * (t + (z * b)));
	} else {
		tmp = x + ((a * t) + (z * y));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (a <= -1.55e+140) or not ((a <= -5.2e+88) or (not (a <= -1.05e-5) and (a <= 1.15e-14))):
		tmp = x + (a * (t + (z * b)))
	else:
		tmp = x + ((a * t) + (z * y))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((a <= -1.55e+140) || !((a <= -5.2e+88) || (!(a <= -1.05e-5) && (a <= 1.15e-14))))
		tmp = Float64(x + Float64(a * Float64(t + Float64(z * b))));
	else
		tmp = Float64(x + Float64(Float64(a * t) + Float64(z * y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((a <= -1.55e+140) || ~(((a <= -5.2e+88) || (~((a <= -1.05e-5)) && (a <= 1.15e-14)))))
		tmp = x + (a * (t + (z * b)));
	else
		tmp = x + ((a * t) + (z * y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.55e+140], N[Not[Or[LessEqual[a, -5.2e+88], And[N[Not[LessEqual[a, -1.05e-5]], $MachinePrecision], LessEqual[a, 1.15e-14]]]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.55 \cdot 10^{+140} \lor \neg \left(a \leq -5.2 \cdot 10^{+88} \lor \neg \left(a \leq -1.05 \cdot 10^{-5}\right) \land a \leq 1.15 \cdot 10^{-14}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.55e140 or -5.2000000000000001e88 < a < -1.04999999999999994e-5 or 1.14999999999999999e-14 < a

    1. Initial program 86.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 89.0%

      \[\leadsto \color{blue}{x + \left(a \cdot t + z \cdot \left(y + a \cdot b\right)\right)} \]
    4. Taylor expanded in a around inf 90.6%

      \[\leadsto x + \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
    5. Step-by-step derivation
      1. +-commutative90.6%

        \[\leadsto x + a \cdot \color{blue}{\left(b \cdot z + t\right)} \]
    6. Simplified90.6%

      \[\leadsto x + \color{blue}{a \cdot \left(b \cdot z + t\right)} \]

    if -1.55e140 < a < -5.2000000000000001e88 or -1.04999999999999994e-5 < a < 1.14999999999999999e-14

    1. Initial program 96.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0 94.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.55 \cdot 10^{+140} \lor \neg \left(a \leq -5.2 \cdot 10^{+88} \lor \neg \left(a \leq -1.05 \cdot 10^{-5}\right) \land a \leq 1.15 \cdot 10^{-14}\right):\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 86.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(a \cdot t + z \cdot y\right)\\ t_2 := x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{if}\;a \leq -1.55 \cdot 10^{+140}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -1.35 \cdot 10^{+86}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -1.08 \cdot 10^{-23}:\\ \;\;\;\;a \cdot t + z \cdot \left(a \cdot b + y\right)\\ \mathbf{elif}\;a \leq 2.4 \cdot 10^{-14}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (+ (* a t) (* z y)))) (t_2 (+ x (* a (+ t (* z b))))))
   (if (<= a -1.55e+140)
     t_2
     (if (<= a -1.35e+86)
       t_1
       (if (<= a -1.08e-23)
         (+ (* a t) (* z (+ (* a b) y)))
         (if (<= a 2.4e-14) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + ((a * t) + (z * y));
	double t_2 = x + (a * (t + (z * b)));
	double tmp;
	if (a <= -1.55e+140) {
		tmp = t_2;
	} else if (a <= -1.35e+86) {
		tmp = t_1;
	} else if (a <= -1.08e-23) {
		tmp = (a * t) + (z * ((a * b) + y));
	} else if (a <= 2.4e-14) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x + ((a * t) + (z * y))
    t_2 = x + (a * (t + (z * b)))
    if (a <= (-1.55d+140)) then
        tmp = t_2
    else if (a <= (-1.35d+86)) then
        tmp = t_1
    else if (a <= (-1.08d-23)) then
        tmp = (a * t) + (z * ((a * b) + y))
    else if (a <= 2.4d-14) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + ((a * t) + (z * y));
	double t_2 = x + (a * (t + (z * b)));
	double tmp;
	if (a <= -1.55e+140) {
		tmp = t_2;
	} else if (a <= -1.35e+86) {
		tmp = t_1;
	} else if (a <= -1.08e-23) {
		tmp = (a * t) + (z * ((a * b) + y));
	} else if (a <= 2.4e-14) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + ((a * t) + (z * y))
	t_2 = x + (a * (t + (z * b)))
	tmp = 0
	if a <= -1.55e+140:
		tmp = t_2
	elif a <= -1.35e+86:
		tmp = t_1
	elif a <= -1.08e-23:
		tmp = (a * t) + (z * ((a * b) + y))
	elif a <= 2.4e-14:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(Float64(a * t) + Float64(z * y)))
	t_2 = Float64(x + Float64(a * Float64(t + Float64(z * b))))
	tmp = 0.0
	if (a <= -1.55e+140)
		tmp = t_2;
	elseif (a <= -1.35e+86)
		tmp = t_1;
	elseif (a <= -1.08e-23)
		tmp = Float64(Float64(a * t) + Float64(z * Float64(Float64(a * b) + y)));
	elseif (a <= 2.4e-14)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + ((a * t) + (z * y));
	t_2 = x + (a * (t + (z * b)));
	tmp = 0.0;
	if (a <= -1.55e+140)
		tmp = t_2;
	elseif (a <= -1.35e+86)
		tmp = t_1;
	elseif (a <= -1.08e-23)
		tmp = (a * t) + (z * ((a * b) + y));
	elseif (a <= 2.4e-14)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.55e+140], t$95$2, If[LessEqual[a, -1.35e+86], t$95$1, If[LessEqual[a, -1.08e-23], N[(N[(a * t), $MachinePrecision] + N[(z * N[(N[(a * b), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.4e-14], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \left(a \cdot t + z \cdot y\right)\\
t_2 := x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -1.55 \cdot 10^{+140}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq -1.35 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -1.08 \cdot 10^{-23}:\\
\;\;\;\;a \cdot t + z \cdot \left(a \cdot b + y\right)\\

\mathbf{elif}\;a \leq 2.4 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.55e140 or 2.4e-14 < a

    1. Initial program 83.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 87.1%

      \[\leadsto \color{blue}{x + \left(a \cdot t + z \cdot \left(y + a \cdot b\right)\right)} \]
    4. Taylor expanded in a around inf 92.3%

      \[\leadsto x + \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
    5. Step-by-step derivation
      1. +-commutative92.3%

        \[\leadsto x + a \cdot \color{blue}{\left(b \cdot z + t\right)} \]
    6. Simplified92.3%

      \[\leadsto x + \color{blue}{a \cdot \left(b \cdot z + t\right)} \]

    if -1.55e140 < a < -1.35000000000000009e86 or -1.08000000000000003e-23 < a < 2.4e-14

    1. Initial program 96.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0 94.7%

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

    if -1.35000000000000009e86 < a < -1.08000000000000003e-23

    1. Initial program 99.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 99.9%

      \[\leadsto \color{blue}{x + \left(a \cdot t + z \cdot \left(y + a \cdot b\right)\right)} \]
    4. Taylor expanded in x around 0 86.1%

      \[\leadsto \color{blue}{a \cdot t + z \cdot \left(y + a \cdot b\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.55 \cdot 10^{+140}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq -1.35 \cdot 10^{+86}:\\ \;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\ \mathbf{elif}\;a \leq -1.08 \cdot 10^{-23}:\\ \;\;\;\;a \cdot t + z \cdot \left(a \cdot b + y\right)\\ \mathbf{elif}\;a \leq 2.4 \cdot 10^{-14}:\\ \;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 86.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(a \cdot t + z \cdot y\right)\\ t_2 := x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{if}\;a \leq -1.56 \cdot 10^{+140}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -4.1 \cdot 10^{+86}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -1.6 \cdot 10^{-8}:\\ \;\;\;\;x + \left(a \cdot t + a \cdot \left(z \cdot b\right)\right)\\ \mathbf{elif}\;a \leq 3.3 \cdot 10^{-15}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (+ (* a t) (* z y)))) (t_2 (+ x (* a (+ t (* z b))))))
   (if (<= a -1.56e+140)
     t_2
     (if (<= a -4.1e+86)
       t_1
       (if (<= a -1.6e-8)
         (+ x (+ (* a t) (* a (* z b))))
         (if (<= a 3.3e-15) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + ((a * t) + (z * y));
	double t_2 = x + (a * (t + (z * b)));
	double tmp;
	if (a <= -1.56e+140) {
		tmp = t_2;
	} else if (a <= -4.1e+86) {
		tmp = t_1;
	} else if (a <= -1.6e-8) {
		tmp = x + ((a * t) + (a * (z * b)));
	} else if (a <= 3.3e-15) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x + ((a * t) + (z * y))
    t_2 = x + (a * (t + (z * b)))
    if (a <= (-1.56d+140)) then
        tmp = t_2
    else if (a <= (-4.1d+86)) then
        tmp = t_1
    else if (a <= (-1.6d-8)) then
        tmp = x + ((a * t) + (a * (z * b)))
    else if (a <= 3.3d-15) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + ((a * t) + (z * y));
	double t_2 = x + (a * (t + (z * b)));
	double tmp;
	if (a <= -1.56e+140) {
		tmp = t_2;
	} else if (a <= -4.1e+86) {
		tmp = t_1;
	} else if (a <= -1.6e-8) {
		tmp = x + ((a * t) + (a * (z * b)));
	} else if (a <= 3.3e-15) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + ((a * t) + (z * y))
	t_2 = x + (a * (t + (z * b)))
	tmp = 0
	if a <= -1.56e+140:
		tmp = t_2
	elif a <= -4.1e+86:
		tmp = t_1
	elif a <= -1.6e-8:
		tmp = x + ((a * t) + (a * (z * b)))
	elif a <= 3.3e-15:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(Float64(a * t) + Float64(z * y)))
	t_2 = Float64(x + Float64(a * Float64(t + Float64(z * b))))
	tmp = 0.0
	if (a <= -1.56e+140)
		tmp = t_2;
	elseif (a <= -4.1e+86)
		tmp = t_1;
	elseif (a <= -1.6e-8)
		tmp = Float64(x + Float64(Float64(a * t) + Float64(a * Float64(z * b))));
	elseif (a <= 3.3e-15)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + ((a * t) + (z * y));
	t_2 = x + (a * (t + (z * b)));
	tmp = 0.0;
	if (a <= -1.56e+140)
		tmp = t_2;
	elseif (a <= -4.1e+86)
		tmp = t_1;
	elseif (a <= -1.6e-8)
		tmp = x + ((a * t) + (a * (z * b)));
	elseif (a <= 3.3e-15)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.56e+140], t$95$2, If[LessEqual[a, -4.1e+86], t$95$1, If[LessEqual[a, -1.6e-8], N[(x + N[(N[(a * t), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.3e-15], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \left(a \cdot t + z \cdot y\right)\\
t_2 := x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -1.56 \cdot 10^{+140}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq -4.1 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -1.6 \cdot 10^{-8}:\\
\;\;\;\;x + \left(a \cdot t + a \cdot \left(z \cdot b\right)\right)\\

\mathbf{elif}\;a \leq 3.3 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.56000000000000002e140 or 3.3e-15 < a

    1. Initial program 83.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 87.1%

      \[\leadsto \color{blue}{x + \left(a \cdot t + z \cdot \left(y + a \cdot b\right)\right)} \]
    4. Taylor expanded in a around inf 92.3%

      \[\leadsto x + \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
    5. Step-by-step derivation
      1. +-commutative92.3%

        \[\leadsto x + a \cdot \color{blue}{\left(b \cdot z + t\right)} \]
    6. Simplified92.3%

      \[\leadsto x + \color{blue}{a \cdot \left(b \cdot z + t\right)} \]

    if -1.56000000000000002e140 < a < -4.0999999999999999e86 or -1.6000000000000001e-8 < a < 3.3e-15

    1. Initial program 96.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0 94.1%

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

    if -4.0999999999999999e86 < a < -1.6000000000000001e-8

    1. Initial program 100.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 80.5%

      \[\leadsto \color{blue}{x + \left(a \cdot t + a \cdot \left(b \cdot z\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.56 \cdot 10^{+140}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq -4.1 \cdot 10^{+86}:\\ \;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\ \mathbf{elif}\;a \leq -1.6 \cdot 10^{-8}:\\ \;\;\;\;x + \left(a \cdot t + a \cdot \left(z \cdot b\right)\right)\\ \mathbf{elif}\;a \leq 3.3 \cdot 10^{-15}:\\ \;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 71.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.65 \cdot 10^{+131} \lor \neg \left(a \leq -7.6 \cdot 10^{+88} \lor \neg \left(a \leq -1.12 \cdot 10^{-23}\right) \land a \leq 8.4 \cdot 10^{+96}\right):\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= a -1.65e+131)
         (not
          (or (<= a -7.6e+88) (and (not (<= a -1.12e-23)) (<= a 8.4e+96)))))
   (* a (+ t (* z b)))
   (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -1.65e+131) || !((a <= -7.6e+88) || (!(a <= -1.12e-23) && (a <= 8.4e+96)))) {
		tmp = a * (t + (z * b));
	} else {
		tmp = x + (z * y);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((a <= (-1.65d+131)) .or. (.not. (a <= (-7.6d+88)) .or. (.not. (a <= (-1.12d-23))) .and. (a <= 8.4d+96))) then
        tmp = a * (t + (z * b))
    else
        tmp = x + (z * y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -1.65e+131) || !((a <= -7.6e+88) || (!(a <= -1.12e-23) && (a <= 8.4e+96)))) {
		tmp = a * (t + (z * b));
	} else {
		tmp = x + (z * y);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (a <= -1.65e+131) or not ((a <= -7.6e+88) or (not (a <= -1.12e-23) and (a <= 8.4e+96))):
		tmp = a * (t + (z * b))
	else:
		tmp = x + (z * y)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((a <= -1.65e+131) || !((a <= -7.6e+88) || (!(a <= -1.12e-23) && (a <= 8.4e+96))))
		tmp = Float64(a * Float64(t + Float64(z * b)));
	else
		tmp = Float64(x + Float64(z * y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((a <= -1.65e+131) || ~(((a <= -7.6e+88) || (~((a <= -1.12e-23)) && (a <= 8.4e+96)))))
		tmp = a * (t + (z * b));
	else
		tmp = x + (z * y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.65e+131], N[Not[Or[LessEqual[a, -7.6e+88], And[N[Not[LessEqual[a, -1.12e-23]], $MachinePrecision], LessEqual[a, 8.4e+96]]]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.65 \cdot 10^{+131} \lor \neg \left(a \leq -7.6 \cdot 10^{+88} \lor \neg \left(a \leq -1.12 \cdot 10^{-23}\right) \land a \leq 8.4 \cdot 10^{+96}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\

\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.6499999999999999e131 or -7.5999999999999993e88 < a < -1.1200000000000001e-23 or 8.4000000000000005e96 < a

    1. Initial program 84.2%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 82.2%

      \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} \]

    if -1.6499999999999999e131 < a < -7.5999999999999993e88 or -1.1200000000000001e-23 < a < 8.4000000000000005e96

    1. Initial program 97.3%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 81.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.65 \cdot 10^{+131} \lor \neg \left(a \leq -7.6 \cdot 10^{+88} \lor \neg \left(a \leq -1.12 \cdot 10^{-23}\right) \land a \leq 8.4 \cdot 10^{+96}\right):\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 71.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(t + z \cdot b\right)\\ \mathbf{if}\;a \leq -1.75 \cdot 10^{+131}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -6.1 \cdot 10^{-24}:\\ \;\;\;\;z \cdot \left(a \cdot b + y\right)\\ \mathbf{elif}\;a \leq 2.05 \cdot 10^{+97}:\\ \;\;\;\;x + z \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (+ t (* z b)))))
   (if (<= a -1.75e+131)
     t_1
     (if (<= a -6.1e-24)
       (* z (+ (* a b) y))
       (if (<= a 2.05e+97) (+ x (* z y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (t + (z * b));
	double tmp;
	if (a <= -1.75e+131) {
		tmp = t_1;
	} else if (a <= -6.1e-24) {
		tmp = z * ((a * b) + y);
	} else if (a <= 2.05e+97) {
		tmp = x + (z * y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = a * (t + (z * b))
    if (a <= (-1.75d+131)) then
        tmp = t_1
    else if (a <= (-6.1d-24)) then
        tmp = z * ((a * b) + y)
    else if (a <= 2.05d+97) then
        tmp = x + (z * y)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (t + (z * b));
	double tmp;
	if (a <= -1.75e+131) {
		tmp = t_1;
	} else if (a <= -6.1e-24) {
		tmp = z * ((a * b) + y);
	} else if (a <= 2.05e+97) {
		tmp = x + (z * y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (t + (z * b))
	tmp = 0
	if a <= -1.75e+131:
		tmp = t_1
	elif a <= -6.1e-24:
		tmp = z * ((a * b) + y)
	elif a <= 2.05e+97:
		tmp = x + (z * y)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(t + Float64(z * b)))
	tmp = 0.0
	if (a <= -1.75e+131)
		tmp = t_1;
	elseif (a <= -6.1e-24)
		tmp = Float64(z * Float64(Float64(a * b) + y));
	elseif (a <= 2.05e+97)
		tmp = Float64(x + Float64(z * y));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (t + (z * b));
	tmp = 0.0;
	if (a <= -1.75e+131)
		tmp = t_1;
	elseif (a <= -6.1e-24)
		tmp = z * ((a * b) + y);
	elseif (a <= 2.05e+97)
		tmp = x + (z * y);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.75e+131], t$95$1, If[LessEqual[a, -6.1e-24], N[(z * N[(N[(a * b), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.05e+97], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -1.75 \cdot 10^{+131}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -6.1 \cdot 10^{-24}:\\
\;\;\;\;z \cdot \left(a \cdot b + y\right)\\

\mathbf{elif}\;a \leq 2.05 \cdot 10^{+97}:\\
\;\;\;\;x + z \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.7499999999999999e131 or 2.04999999999999994e97 < a

    1. Initial program 80.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 86.4%

      \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} \]

    if -1.7499999999999999e131 < a < -6.10000000000000036e-24

    1. Initial program 91.3%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 65.7%

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

    if -6.10000000000000036e-24 < a < 2.04999999999999994e97

    1. Initial program 99.4%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 82.5%

      \[\leadsto \color{blue}{x + y \cdot z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification81.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.75 \cdot 10^{+131}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq -6.1 \cdot 10^{-24}:\\ \;\;\;\;z \cdot \left(a \cdot b + y\right)\\ \mathbf{elif}\;a \leq 2.05 \cdot 10^{+97}:\\ \;\;\;\;x + z \cdot y\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 59.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.75 \cdot 10^{+131}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq 3 \cdot 10^{+98}:\\ \;\;\;\;x + z \cdot y\\ \mathbf{elif}\;a \leq 1.92 \cdot 10^{+214}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -1.75e+131)
   (* z (* a b))
   (if (<= a 3e+98)
     (+ x (* z y))
     (if (<= a 1.92e+214) (* a (* z b)) (+ x (* a t))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -1.75e+131) {
		tmp = z * (a * b);
	} else if (a <= 3e+98) {
		tmp = x + (z * y);
	} else if (a <= 1.92e+214) {
		tmp = a * (z * b);
	} else {
		tmp = x + (a * t);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (a <= (-1.75d+131)) then
        tmp = z * (a * b)
    else if (a <= 3d+98) then
        tmp = x + (z * y)
    else if (a <= 1.92d+214) then
        tmp = a * (z * b)
    else
        tmp = x + (a * t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -1.75e+131) {
		tmp = z * (a * b);
	} else if (a <= 3e+98) {
		tmp = x + (z * y);
	} else if (a <= 1.92e+214) {
		tmp = a * (z * b);
	} else {
		tmp = x + (a * t);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -1.75e+131:
		tmp = z * (a * b)
	elif a <= 3e+98:
		tmp = x + (z * y)
	elif a <= 1.92e+214:
		tmp = a * (z * b)
	else:
		tmp = x + (a * t)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -1.75e+131)
		tmp = Float64(z * Float64(a * b));
	elseif (a <= 3e+98)
		tmp = Float64(x + Float64(z * y));
	elseif (a <= 1.92e+214)
		tmp = Float64(a * Float64(z * b));
	else
		tmp = Float64(x + Float64(a * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (a <= -1.75e+131)
		tmp = z * (a * b);
	elseif (a <= 3e+98)
		tmp = x + (z * y);
	elseif (a <= 1.92e+214)
		tmp = a * (z * b);
	else
		tmp = x + (a * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.75e+131], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3e+98], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.92e+214], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.75 \cdot 10^{+131}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\

\mathbf{elif}\;a \leq 3 \cdot 10^{+98}:\\
\;\;\;\;x + z \cdot y\\

\mathbf{elif}\;a \leq 1.92 \cdot 10^{+214}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\

\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.7499999999999999e131

    1. Initial program 81.1%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 84.5%

      \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
    4. Taylor expanded in t around 0 58.5%

      \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]
    5. Step-by-step derivation
      1. associate-*r*60.5%

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

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b\right)} \]
    6. Simplified60.5%

      \[\leadsto \color{blue}{z \cdot \left(a \cdot b\right)} \]

    if -1.7499999999999999e131 < a < 3.0000000000000001e98

    1. Initial program 97.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 75.3%

      \[\leadsto \color{blue}{x + y \cdot z} \]

    if 3.0000000000000001e98 < a < 1.92e214

    1. Initial program 81.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf 60.8%

      \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]

    if 1.92e214 < a

    1. Initial program 77.3%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 78.1%

      \[\leadsto \color{blue}{x + a \cdot t} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification71.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.75 \cdot 10^{+131}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq 3 \cdot 10^{+98}:\\ \;\;\;\;x + z \cdot y\\ \mathbf{elif}\;a \leq 1.92 \cdot 10^{+214}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 81.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{-24} \lor \neg \left(a \leq 1.15 \cdot 10^{-15}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -9.50000000000000029e-24 or 1.14999999999999995e-15 < a

    1. Initial program 85.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 90.2%

      \[\leadsto \color{blue}{x + \left(a \cdot t + z \cdot \left(y + a \cdot b\right)\right)} \]
    4. Taylor expanded in a around inf 87.1%

      \[\leadsto x + \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
    5. Step-by-step derivation
      1. +-commutative87.1%

        \[\leadsto x + a \cdot \color{blue}{\left(b \cdot z + t\right)} \]
    6. Simplified87.1%

      \[\leadsto x + \color{blue}{a \cdot \left(b \cdot z + t\right)} \]

    if -9.50000000000000029e-24 < a < 1.14999999999999995e-15

    1. Initial program 99.3%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 85.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9.5 \cdot 10^{-24} \lor \neg \left(a \leq 1.15 \cdot 10^{-15}\right):\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 94.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 4.8 \cdot 10^{+37}:\\ \;\;\;\;x + \left(a \cdot t + z \cdot \left(a \cdot b + y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a 4.8e+37)
   (+ x (+ (* a t) (* z (+ (* a b) y))))
   (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= 4.8e+37) {
		tmp = x + ((a * t) + (z * ((a * b) + y)));
	} else {
		tmp = x + (a * (t + (z * b)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (a <= 4.8d+37) then
        tmp = x + ((a * t) + (z * ((a * b) + y)))
    else
        tmp = x + (a * (t + (z * b)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= 4.8e+37) {
		tmp = x + ((a * t) + (z * ((a * b) + y)));
	} else {
		tmp = x + (a * (t + (z * b)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= 4.8e+37:
		tmp = x + ((a * t) + (z * ((a * b) + y)))
	else:
		tmp = x + (a * (t + (z * b)))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= 4.8e+37)
		tmp = Float64(x + Float64(Float64(a * t) + Float64(z * Float64(Float64(a * b) + y))));
	else
		tmp = Float64(x + Float64(a * Float64(t + Float64(z * b))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (a <= 4.8e+37)
		tmp = x + ((a * t) + (z * ((a * b) + y)));
	else
		tmp = x + (a * (t + (z * b)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, 4.8e+37], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * N[(N[(a * b), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.8 \cdot 10^{+37}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot \left(a \cdot b + y\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 4.8e37

    1. Initial program 93.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 96.9%

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

    if 4.8e37 < a

    1. Initial program 83.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 85.3%

      \[\leadsto \color{blue}{x + \left(a \cdot t + z \cdot \left(y + a \cdot b\right)\right)} \]
    4. Taylor expanded in a around inf 96.8%

      \[\leadsto x + \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
    5. Step-by-step derivation
      1. +-commutative96.8%

        \[\leadsto x + a \cdot \color{blue}{\left(b \cdot z + t\right)} \]
    6. Simplified96.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 4.8 \cdot 10^{+37}:\\ \;\;\;\;x + \left(a \cdot t + z \cdot \left(a \cdot b + y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 59.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{+103}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq 1.16 \cdot 10^{+70}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -4.1e+103)
   (* a (* z b))
   (if (<= z 1.16e+70) (+ x (* a t)) (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -4.1e+103) {
		tmp = a * (z * b);
	} else if (z <= 1.16e+70) {
		tmp = x + (a * t);
	} else {
		tmp = z * y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (z <= (-4.1d+103)) then
        tmp = a * (z * b)
    else if (z <= 1.16d+70) then
        tmp = x + (a * t)
    else
        tmp = z * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -4.1e+103) {
		tmp = a * (z * b);
	} else if (z <= 1.16e+70) {
		tmp = x + (a * t);
	} else {
		tmp = z * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -4.1e+103:
		tmp = a * (z * b)
	elif z <= 1.16e+70:
		tmp = x + (a * t)
	else:
		tmp = z * y
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -4.1e+103)
		tmp = Float64(a * Float64(z * b));
	elseif (z <= 1.16e+70)
		tmp = Float64(x + Float64(a * t));
	else
		tmp = Float64(z * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (z <= -4.1e+103)
		tmp = a * (z * b);
	elseif (z <= 1.16e+70)
		tmp = x + (a * t);
	else
		tmp = z * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.1e+103], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.16e+70], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], N[(z * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+103}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\

\mathbf{elif}\;z \leq 1.16 \cdot 10^{+70}:\\
\;\;\;\;x + a \cdot t\\

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


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

    1. Initial program 76.1%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf 54.6%

      \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]

    if -4.1000000000000002e103 < z < 1.1599999999999999e70

    1. Initial program 96.4%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 66.5%

      \[\leadsto \color{blue}{x + a \cdot t} \]

    if 1.1599999999999999e70 < z

    1. Initial program 87.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 47.5%

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

        \[\leadsto \color{blue}{z \cdot y} \]
    5. Simplified47.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{+103}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq 1.16 \cdot 10^{+70}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 37.4% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.4 \cdot 10^{+94}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 6 \cdot 10^{-44}:\\ \;\;\;\;z \cdot y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x -2.4e+94) x (if (<= x 6e-44) (* z y) x)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -2.4e+94) {
		tmp = x;
	} else if (x <= 6e-44) {
		tmp = z * y;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (x <= (-2.4d+94)) then
        tmp = x
    else if (x <= 6d-44) then
        tmp = z * y
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -2.4e+94) {
		tmp = x;
	} else if (x <= 6e-44) {
		tmp = z * y;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -2.4e+94:
		tmp = x
	elif x <= 6e-44:
		tmp = z * y
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -2.4e+94)
		tmp = x;
	elseif (x <= 6e-44)
		tmp = Float64(z * y);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (x <= -2.4e+94)
		tmp = x;
	elseif (x <= 6e-44)
		tmp = z * y;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.4e+94], x, If[LessEqual[x, 6e-44], N[(z * y), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+94}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 6 \cdot 10^{-44}:\\
\;\;\;\;z \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.39999999999999983e94 or 6.0000000000000005e-44 < x

    1. Initial program 90.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 49.0%

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

    if -2.39999999999999983e94 < x < 6.0000000000000005e-44

    1. Initial program 91.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 41.8%

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

        \[\leadsto \color{blue}{z \cdot y} \]
    5. Simplified41.8%

      \[\leadsto \color{blue}{z \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 14: 37.7% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -9.4 \cdot 10^{-24}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-42}:\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x -9.4e-24) x (if (<= x 3.5e-42) (* a t) x)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -9.4e-24) {
		tmp = x;
	} else if (x <= 3.5e-42) {
		tmp = a * t;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (x <= (-9.4d-24)) then
        tmp = x
    else if (x <= 3.5d-42) then
        tmp = a * t
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -9.4e-24) {
		tmp = x;
	} else if (x <= 3.5e-42) {
		tmp = a * t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -9.4e-24:
		tmp = x
	elif x <= 3.5e-42:
		tmp = a * t
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -9.4e-24)
		tmp = x;
	elseif (x <= 3.5e-42)
		tmp = Float64(a * t);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (x <= -9.4e-24)
		tmp = x;
	elseif (x <= 3.5e-42)
		tmp = a * t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -9.4e-24], x, If[LessEqual[x, 3.5e-42], N[(a * t), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.4 \cdot 10^{-24}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 3.5 \cdot 10^{-42}:\\
\;\;\;\;a \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.39999999999999983e-24 or 3.5000000000000002e-42 < x

    1. Initial program 90.2%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 46.6%

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

    if -9.39999999999999983e-24 < x < 3.5000000000000002e-42

    1. Initial program 92.4%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 31.4%

      \[\leadsto \color{blue}{a \cdot t} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 26.0% accurate, 15.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 91.2%

    \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
  2. Add Preprocessing
  3. Taylor expanded in x around inf 27.6%

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

Developer target: 97.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\ \mathbf{if}\;z < -11820553527347888000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\ \;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (* z (+ (* b a) y)) (+ x (* t a)))))
   (if (< z -11820553527347888000.0)
     t_1
     (if (< z 4.7589743188364287e-122)
       (+ (* (+ (* b z) t) a) (+ (* z y) x))
       t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z * ((b * a) + y)) + (x + (t * a));
	double tmp;
	if (z < -11820553527347888000.0) {
		tmp = t_1;
	} else if (z < 4.7589743188364287e-122) {
		tmp = (((b * z) + t) * a) + ((z * y) + x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (z * ((b * a) + y)) + (x + (t * a))
    if (z < (-11820553527347888000.0d0)) then
        tmp = t_1
    else if (z < 4.7589743188364287d-122) then
        tmp = (((b * z) + t) * a) + ((z * y) + x)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z * ((b * a) + y)) + (x + (t * a));
	double tmp;
	if (z < -11820553527347888000.0) {
		tmp = t_1;
	} else if (z < 4.7589743188364287e-122) {
		tmp = (((b * z) + t) * a) + ((z * y) + x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (z * ((b * a) + y)) + (x + (t * a))
	tmp = 0
	if z < -11820553527347888000.0:
		tmp = t_1
	elif z < 4.7589743188364287e-122:
		tmp = (((b * z) + t) * a) + ((z * y) + x)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(z * Float64(Float64(b * a) + y)) + Float64(x + Float64(t * a)))
	tmp = 0.0
	if (z < -11820553527347888000.0)
		tmp = t_1;
	elseif (z < 4.7589743188364287e-122)
		tmp = Float64(Float64(Float64(Float64(b * z) + t) * a) + Float64(Float64(z * y) + x));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (z * ((b * a) + y)) + (x + (t * a));
	tmp = 0.0;
	if (z < -11820553527347888000.0)
		tmp = t_1;
	elseif (z < 4.7589743188364287e-122)
		tmp = (((b * z) + t) * a) + ((z * y) + x);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(N[(b * a), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -11820553527347888000.0], t$95$1, If[Less[z, 4.7589743188364287e-122], N[(N[(N[(N[(b * z), $MachinePrecision] + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\
\mathbf{if}\;z < -11820553527347888000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
\;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024097 
(FPCore (x y z t a b)
  :name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
  :precision binary64

  :alt
  (if (< z -11820553527347888000.0) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))

  (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))