Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.2% → 96.2%
Time: 12.4s
Alternatives: 14
Speedup: 0.7×

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 14 alternatives:

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

Initial Program: 92.2% 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: 96.2% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.45 \cdot 10^{+243} \lor \neg \left(a \leq 10^{+130}\right):\\ \;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(a \cdot t + z \cdot \left(y + a \cdot b\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= a -2.45e+243) (not (<= a 1e+130)))
   (+ (fma y z x) (* a (+ t (* z b))))
   (+ x (+ (* a t) (* z (+ y (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -2.45e+243) || !(a <= 1e+130)) {
		tmp = fma(y, z, x) + (a * (t + (z * b)));
	} else {
		tmp = x + ((a * t) + (z * (y + (a * b))));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((a <= -2.45e+243) || !(a <= 1e+130))
		tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b))));
	else
		tmp = Float64(x + Float64(Float64(a * t) + Float64(z * Float64(y + Float64(a * b)))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.45e+243], N[Not[LessEqual[a, 1e+130]], $MachinePrecision]], N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.45 \cdot 10^{+243} \lor \neg \left(a \leq 10^{+130}\right):\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.44999999999999992e243 or 1.0000000000000001e130 < a

    1. Initial program 75.7%

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

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

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

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

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

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

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

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

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

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

    if -2.44999999999999992e243 < a < 1.0000000000000001e130

    1. Initial program 92.7%

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

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

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

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

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

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

Alternative 2: 38.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a \cdot z\right)\\ \mathbf{if}\;a \leq -7.5 \cdot 10^{+242}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -4.4 \cdot 10^{-296}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 9.2 \cdot 10^{-235}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 1.08 \cdot 10^{-220}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{-125}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-9}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (* a z))))
   (if (<= a -7.5e+242)
     t_1
     (if (<= a -6.5e-9)
       (* a t)
       (if (<= a -4.4e-296)
         x
         (if (<= a 9.2e-235)
           (* y z)
           (if (<= a 1.08e-220)
             x
             (if (<= a 5.8e-125) (* y z) (if (<= a 9.5e-9) t_1 (* a t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (a * z);
	double tmp;
	if (a <= -7.5e+242) {
		tmp = t_1;
	} else if (a <= -6.5e-9) {
		tmp = a * t;
	} else if (a <= -4.4e-296) {
		tmp = x;
	} else if (a <= 9.2e-235) {
		tmp = y * z;
	} else if (a <= 1.08e-220) {
		tmp = x;
	} else if (a <= 5.8e-125) {
		tmp = y * z;
	} else if (a <= 9.5e-9) {
		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 = b * (a * z)
    if (a <= (-7.5d+242)) then
        tmp = t_1
    else if (a <= (-6.5d-9)) then
        tmp = a * t
    else if (a <= (-4.4d-296)) then
        tmp = x
    else if (a <= 9.2d-235) then
        tmp = y * z
    else if (a <= 1.08d-220) then
        tmp = x
    else if (a <= 5.8d-125) then
        tmp = y * z
    else if (a <= 9.5d-9) 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 = b * (a * z);
	double tmp;
	if (a <= -7.5e+242) {
		tmp = t_1;
	} else if (a <= -6.5e-9) {
		tmp = a * t;
	} else if (a <= -4.4e-296) {
		tmp = x;
	} else if (a <= 9.2e-235) {
		tmp = y * z;
	} else if (a <= 1.08e-220) {
		tmp = x;
	} else if (a <= 5.8e-125) {
		tmp = y * z;
	} else if (a <= 9.5e-9) {
		tmp = t_1;
	} else {
		tmp = a * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (a * z)
	tmp = 0
	if a <= -7.5e+242:
		tmp = t_1
	elif a <= -6.5e-9:
		tmp = a * t
	elif a <= -4.4e-296:
		tmp = x
	elif a <= 9.2e-235:
		tmp = y * z
	elif a <= 1.08e-220:
		tmp = x
	elif a <= 5.8e-125:
		tmp = y * z
	elif a <= 9.5e-9:
		tmp = t_1
	else:
		tmp = a * t
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(b * Float64(a * z))
	tmp = 0.0
	if (a <= -7.5e+242)
		tmp = t_1;
	elseif (a <= -6.5e-9)
		tmp = Float64(a * t);
	elseif (a <= -4.4e-296)
		tmp = x;
	elseif (a <= 9.2e-235)
		tmp = Float64(y * z);
	elseif (a <= 1.08e-220)
		tmp = x;
	elseif (a <= 5.8e-125)
		tmp = Float64(y * z);
	elseif (a <= 9.5e-9)
		tmp = t_1;
	else
		tmp = Float64(a * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = b * (a * z);
	tmp = 0.0;
	if (a <= -7.5e+242)
		tmp = t_1;
	elseif (a <= -6.5e-9)
		tmp = a * t;
	elseif (a <= -4.4e-296)
		tmp = x;
	elseif (a <= 9.2e-235)
		tmp = y * z;
	elseif (a <= 1.08e-220)
		tmp = x;
	elseif (a <= 5.8e-125)
		tmp = y * z;
	elseif (a <= 9.5e-9)
		tmp = t_1;
	else
		tmp = a * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.5e+242], t$95$1, If[LessEqual[a, -6.5e-9], N[(a * t), $MachinePrecision], If[LessEqual[a, -4.4e-296], x, If[LessEqual[a, 9.2e-235], N[(y * z), $MachinePrecision], If[LessEqual[a, 1.08e-220], x, If[LessEqual[a, 5.8e-125], N[(y * z), $MachinePrecision], If[LessEqual[a, 9.5e-9], t$95$1, N[(a * t), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -6.5 \cdot 10^{-9}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;a \leq -4.4 \cdot 10^{-296}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 9.2 \cdot 10^{-235}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 1.08 \cdot 10^{-220}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 5.8 \cdot 10^{-125}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 9.5 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -7.49999999999999961e242 or 5.8000000000000004e-125 < a < 9.5000000000000007e-9

    1. Initial program 84.5%

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

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

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

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(b \cdot z + t\right)} \]
    9. Simplified68.5%

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

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

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

        \[\leadsto \color{blue}{\left(b \cdot a\right)} \cdot z \]
      3. associate-*r*57.7%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot z\right)} \]
    12. Simplified57.7%

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

    if -7.49999999999999961e242 < a < -6.5000000000000003e-9 or 9.5000000000000007e-9 < a

    1. Initial program 84.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. associate-+l+84.6%

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

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

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

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

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

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

    if -6.5000000000000003e-9 < a < -4.40000000000000024e-296 or 9.19999999999999989e-235 < a < 1.08e-220

    1. Initial program 100.0%

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

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

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

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

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

    if -4.40000000000000024e-296 < a < 9.19999999999999989e-235 or 1.08e-220 < a < 5.8000000000000004e-125

    1. Initial program 93.0%

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot y} \]
    7. Simplified60.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7.5 \cdot 10^{+242}:\\ \;\;\;\;b \cdot \left(a \cdot z\right)\\ \mathbf{elif}\;a \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -4.4 \cdot 10^{-296}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 9.2 \cdot 10^{-235}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 1.08 \cdot 10^{-220}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{-125}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-9}:\\ \;\;\;\;b \cdot \left(a \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 38.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -3.8 \cdot 10^{+244}:\\ \;\;\;\;b \cdot \left(a \cdot z\right)\\ \mathbf{elif}\;a \leq -7.5 \cdot 10^{-8}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -5.8 \cdot 10^{-296}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 6.2 \cdot 10^{-235}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{-220}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5.7 \cdot 10^{-117}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 0.0038:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -3.8e+244)
   (* b (* a z))
   (if (<= a -7.5e-8)
     (* a t)
     (if (<= a -5.8e-296)
       x
       (if (<= a 6.2e-235)
         (* y z)
         (if (<= a 3.4e-220)
           x
           (if (<= a 5.7e-117)
             (* y z)
             (if (<= a 0.0038) (* z (* a b)) (* a t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -3.8e+244) {
		tmp = b * (a * z);
	} else if (a <= -7.5e-8) {
		tmp = a * t;
	} else if (a <= -5.8e-296) {
		tmp = x;
	} else if (a <= 6.2e-235) {
		tmp = y * z;
	} else if (a <= 3.4e-220) {
		tmp = x;
	} else if (a <= 5.7e-117) {
		tmp = y * z;
	} else if (a <= 0.0038) {
		tmp = z * (a * 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 <= (-3.8d+244)) then
        tmp = b * (a * z)
    else if (a <= (-7.5d-8)) then
        tmp = a * t
    else if (a <= (-5.8d-296)) then
        tmp = x
    else if (a <= 6.2d-235) then
        tmp = y * z
    else if (a <= 3.4d-220) then
        tmp = x
    else if (a <= 5.7d-117) then
        tmp = y * z
    else if (a <= 0.0038d0) then
        tmp = z * (a * 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 <= -3.8e+244) {
		tmp = b * (a * z);
	} else if (a <= -7.5e-8) {
		tmp = a * t;
	} else if (a <= -5.8e-296) {
		tmp = x;
	} else if (a <= 6.2e-235) {
		tmp = y * z;
	} else if (a <= 3.4e-220) {
		tmp = x;
	} else if (a <= 5.7e-117) {
		tmp = y * z;
	} else if (a <= 0.0038) {
		tmp = z * (a * b);
	} else {
		tmp = a * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -3.8e+244:
		tmp = b * (a * z)
	elif a <= -7.5e-8:
		tmp = a * t
	elif a <= -5.8e-296:
		tmp = x
	elif a <= 6.2e-235:
		tmp = y * z
	elif a <= 3.4e-220:
		tmp = x
	elif a <= 5.7e-117:
		tmp = y * z
	elif a <= 0.0038:
		tmp = z * (a * b)
	else:
		tmp = a * t
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -3.8e+244)
		tmp = Float64(b * Float64(a * z));
	elseif (a <= -7.5e-8)
		tmp = Float64(a * t);
	elseif (a <= -5.8e-296)
		tmp = x;
	elseif (a <= 6.2e-235)
		tmp = Float64(y * z);
	elseif (a <= 3.4e-220)
		tmp = x;
	elseif (a <= 5.7e-117)
		tmp = Float64(y * z);
	elseif (a <= 0.0038)
		tmp = Float64(z * Float64(a * 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 <= -3.8e+244)
		tmp = b * (a * z);
	elseif (a <= -7.5e-8)
		tmp = a * t;
	elseif (a <= -5.8e-296)
		tmp = x;
	elseif (a <= 6.2e-235)
		tmp = y * z;
	elseif (a <= 3.4e-220)
		tmp = x;
	elseif (a <= 5.7e-117)
		tmp = y * z;
	elseif (a <= 0.0038)
		tmp = z * (a * b);
	else
		tmp = a * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -3.8e+244], N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -7.5e-8], N[(a * t), $MachinePrecision], If[LessEqual[a, -5.8e-296], x, If[LessEqual[a, 6.2e-235], N[(y * z), $MachinePrecision], If[LessEqual[a, 3.4e-220], x, If[LessEqual[a, 5.7e-117], N[(y * z), $MachinePrecision], If[LessEqual[a, 0.0038], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(a * t), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -7.5 \cdot 10^{-8}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;a \leq -5.8 \cdot 10^{-296}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 6.2 \cdot 10^{-235}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 3.4 \cdot 10^{-220}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 5.7 \cdot 10^{-117}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 0.0038:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -3.79999999999999983e244

    1. Initial program 72.2%

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

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

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

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(b \cdot z + t\right)} \]
    9. Simplified94.4%

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

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

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

        \[\leadsto \color{blue}{\left(b \cdot a\right)} \cdot z \]
      3. associate-*r*72.4%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot z\right)} \]
    12. Simplified72.4%

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

    if -3.79999999999999983e244 < a < -7.4999999999999997e-8 or 0.00379999999999999999 < a

    1. Initial program 84.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. associate-+l+84.6%

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

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

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

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

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

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

    if -7.4999999999999997e-8 < a < -5.79999999999999965e-296 or 6.2e-235 < a < 3.39999999999999993e-220

    1. Initial program 100.0%

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

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

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

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

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

    if -5.79999999999999965e-296 < a < 6.2e-235 or 3.39999999999999993e-220 < a < 5.6999999999999999e-117

    1. Initial program 93.0%

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot y} \]
    7. Simplified60.4%

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

    if 5.6999999999999999e-117 < a < 0.00379999999999999999

    1. Initial program 95.0%

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

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

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

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

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

      \[\leadsto z \cdot \color{blue}{\left(a \cdot b\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification54.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.8 \cdot 10^{+244}:\\ \;\;\;\;b \cdot \left(a \cdot z\right)\\ \mathbf{elif}\;a \leq -7.5 \cdot 10^{-8}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -5.8 \cdot 10^{-296}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 6.2 \cdot 10^{-235}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{-220}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5.7 \cdot 10^{-117}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 0.0038:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 39.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.65 \cdot 10^{+243}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -4.2 \cdot 10^{-7}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -6.2 \cdot 10^{-296}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 2.4 \cdot 10^{-235}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 5.5 \cdot 10^{-221}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-125}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-63}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -2.65e+243)
   (* a (* z b))
   (if (<= a -4.2e-7)
     (* a t)
     (if (<= a -6.2e-296)
       x
       (if (<= a 2.4e-235)
         (* y z)
         (if (<= a 5.5e-221)
           x
           (if (<= a 1.7e-125) (* y z) (if (<= a 6.5e-63) x (* a t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -2.65e+243) {
		tmp = a * (z * b);
	} else if (a <= -4.2e-7) {
		tmp = a * t;
	} else if (a <= -6.2e-296) {
		tmp = x;
	} else if (a <= 2.4e-235) {
		tmp = y * z;
	} else if (a <= 5.5e-221) {
		tmp = x;
	} else if (a <= 1.7e-125) {
		tmp = y * z;
	} else if (a <= 6.5e-63) {
		tmp = x;
	} 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 <= (-2.65d+243)) then
        tmp = a * (z * b)
    else if (a <= (-4.2d-7)) then
        tmp = a * t
    else if (a <= (-6.2d-296)) then
        tmp = x
    else if (a <= 2.4d-235) then
        tmp = y * z
    else if (a <= 5.5d-221) then
        tmp = x
    else if (a <= 1.7d-125) then
        tmp = y * z
    else if (a <= 6.5d-63) then
        tmp = x
    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 <= -2.65e+243) {
		tmp = a * (z * b);
	} else if (a <= -4.2e-7) {
		tmp = a * t;
	} else if (a <= -6.2e-296) {
		tmp = x;
	} else if (a <= 2.4e-235) {
		tmp = y * z;
	} else if (a <= 5.5e-221) {
		tmp = x;
	} else if (a <= 1.7e-125) {
		tmp = y * z;
	} else if (a <= 6.5e-63) {
		tmp = x;
	} else {
		tmp = a * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -2.65e+243:
		tmp = a * (z * b)
	elif a <= -4.2e-7:
		tmp = a * t
	elif a <= -6.2e-296:
		tmp = x
	elif a <= 2.4e-235:
		tmp = y * z
	elif a <= 5.5e-221:
		tmp = x
	elif a <= 1.7e-125:
		tmp = y * z
	elif a <= 6.5e-63:
		tmp = x
	else:
		tmp = a * t
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -2.65e+243)
		tmp = Float64(a * Float64(z * b));
	elseif (a <= -4.2e-7)
		tmp = Float64(a * t);
	elseif (a <= -6.2e-296)
		tmp = x;
	elseif (a <= 2.4e-235)
		tmp = Float64(y * z);
	elseif (a <= 5.5e-221)
		tmp = x;
	elseif (a <= 1.7e-125)
		tmp = Float64(y * z);
	elseif (a <= 6.5e-63)
		tmp = x;
	else
		tmp = Float64(a * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (a <= -2.65e+243)
		tmp = a * (z * b);
	elseif (a <= -4.2e-7)
		tmp = a * t;
	elseif (a <= -6.2e-296)
		tmp = x;
	elseif (a <= 2.4e-235)
		tmp = y * z;
	elseif (a <= 5.5e-221)
		tmp = x;
	elseif (a <= 1.7e-125)
		tmp = y * z;
	elseif (a <= 6.5e-63)
		tmp = x;
	else
		tmp = a * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.65e+243], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -4.2e-7], N[(a * t), $MachinePrecision], If[LessEqual[a, -6.2e-296], x, If[LessEqual[a, 2.4e-235], N[(y * z), $MachinePrecision], If[LessEqual[a, 5.5e-221], x, If[LessEqual[a, 1.7e-125], N[(y * z), $MachinePrecision], If[LessEqual[a, 6.5e-63], x, N[(a * t), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;a \leq -6.2 \cdot 10^{-296}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 2.4 \cdot 10^{-235}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 5.5 \cdot 10^{-221}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1.7 \cdot 10^{-125}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 6.5 \cdot 10^{-63}:\\
\;\;\;\;x\\

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


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

    1. Initial program 72.2%

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

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

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

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

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

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

    if -2.6499999999999999e243 < a < -4.2e-7 or 6.4999999999999998e-63 < a

    1. Initial program 85.7%

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

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

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

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

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

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

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

    if -4.2e-7 < a < -6.2000000000000004e-296 or 2.40000000000000011e-235 < a < 5.49999999999999966e-221 or 1.69999999999999988e-125 < a < 6.4999999999999998e-63

    1. Initial program 98.4%

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

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

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

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

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

    if -6.2000000000000004e-296 < a < 2.40000000000000011e-235 or 5.49999999999999966e-221 < a < 1.69999999999999988e-125

    1. Initial program 93.0%

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot y} \]
    7. Simplified60.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.65 \cdot 10^{+243}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -4.2 \cdot 10^{-7}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -6.2 \cdot 10^{-296}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 2.4 \cdot 10^{-235}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 5.5 \cdot 10^{-221}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-125}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-63}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 39.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -4.5 \cdot 10^{-8}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -8.1 \cdot 10^{-296}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-234}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 8.2 \cdot 10^{-219}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.1 \cdot 10^{-117}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{-58}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -4.5e-8)
   (* a t)
   (if (<= a -8.1e-296)
     x
     (if (<= a 1.7e-234)
       (* y z)
       (if (<= a 8.2e-219)
         x
         (if (<= a 1.1e-117) (* y z) (if (<= a 1.15e-58) x (* a t))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -4.5e-8) {
		tmp = a * t;
	} else if (a <= -8.1e-296) {
		tmp = x;
	} else if (a <= 1.7e-234) {
		tmp = y * z;
	} else if (a <= 8.2e-219) {
		tmp = x;
	} else if (a <= 1.1e-117) {
		tmp = y * z;
	} else if (a <= 1.15e-58) {
		tmp = x;
	} 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 <= (-4.5d-8)) then
        tmp = a * t
    else if (a <= (-8.1d-296)) then
        tmp = x
    else if (a <= 1.7d-234) then
        tmp = y * z
    else if (a <= 8.2d-219) then
        tmp = x
    else if (a <= 1.1d-117) then
        tmp = y * z
    else if (a <= 1.15d-58) then
        tmp = x
    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 <= -4.5e-8) {
		tmp = a * t;
	} else if (a <= -8.1e-296) {
		tmp = x;
	} else if (a <= 1.7e-234) {
		tmp = y * z;
	} else if (a <= 8.2e-219) {
		tmp = x;
	} else if (a <= 1.1e-117) {
		tmp = y * z;
	} else if (a <= 1.15e-58) {
		tmp = x;
	} else {
		tmp = a * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -4.5e-8:
		tmp = a * t
	elif a <= -8.1e-296:
		tmp = x
	elif a <= 1.7e-234:
		tmp = y * z
	elif a <= 8.2e-219:
		tmp = x
	elif a <= 1.1e-117:
		tmp = y * z
	elif a <= 1.15e-58:
		tmp = x
	else:
		tmp = a * t
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -4.5e-8)
		tmp = Float64(a * t);
	elseif (a <= -8.1e-296)
		tmp = x;
	elseif (a <= 1.7e-234)
		tmp = Float64(y * z);
	elseif (a <= 8.2e-219)
		tmp = x;
	elseif (a <= 1.1e-117)
		tmp = Float64(y * z);
	elseif (a <= 1.15e-58)
		tmp = x;
	else
		tmp = Float64(a * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (a <= -4.5e-8)
		tmp = a * t;
	elseif (a <= -8.1e-296)
		tmp = x;
	elseif (a <= 1.7e-234)
		tmp = y * z;
	elseif (a <= 8.2e-219)
		tmp = x;
	elseif (a <= 1.1e-117)
		tmp = y * z;
	elseif (a <= 1.15e-58)
		tmp = x;
	else
		tmp = a * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4.5e-8], N[(a * t), $MachinePrecision], If[LessEqual[a, -8.1e-296], x, If[LessEqual[a, 1.7e-234], N[(y * z), $MachinePrecision], If[LessEqual[a, 8.2e-219], x, If[LessEqual[a, 1.1e-117], N[(y * z), $MachinePrecision], If[LessEqual[a, 1.15e-58], x, N[(a * t), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.5 \cdot 10^{-8}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;a \leq -8.1 \cdot 10^{-296}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1.7 \cdot 10^{-234}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 8.2 \cdot 10^{-219}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1.1 \cdot 10^{-117}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 1.15 \cdot 10^{-58}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.49999999999999993e-8 or 1.1499999999999999e-58 < a

    1. Initial program 84.0%

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

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

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

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

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

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

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

    if -4.49999999999999993e-8 < a < -8.10000000000000051e-296 or 1.69999999999999993e-234 < a < 8.2e-219 or 1.1000000000000001e-117 < a < 1.1499999999999999e-58

    1. Initial program 98.4%

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

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

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

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

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

    if -8.10000000000000051e-296 < a < 1.69999999999999993e-234 or 8.2e-219 < a < 1.1000000000000001e-117

    1. Initial program 93.0%

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot y} \]
    7. Simplified60.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.5 \cdot 10^{-8}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -8.1 \cdot 10^{-296}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-234}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 8.2 \cdot 10^{-219}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.1 \cdot 10^{-117}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{-58}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 70.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(t + z \cdot b\right)\\ \mathbf{if}\;a \leq -1.32 \cdot 10^{+160}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -2.4 \cdot 10^{-88}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{-116}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 2.45 \cdot 10^{-64}:\\ \;\;\;\;x + b \cdot \left(a \cdot z\right)\\ \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.32e+160)
     t_1
     (if (<= a -2.4e-88)
       (+ x (* a t))
       (if (<= a 1.5e-116)
         (+ x (* y z))
         (if (<= a 2.45e-64) (+ x (* b (* a z))) 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.32e+160) {
		tmp = t_1;
	} else if (a <= -2.4e-88) {
		tmp = x + (a * t);
	} else if (a <= 1.5e-116) {
		tmp = x + (y * z);
	} else if (a <= 2.45e-64) {
		tmp = x + (b * (a * z));
	} 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.32d+160)) then
        tmp = t_1
    else if (a <= (-2.4d-88)) then
        tmp = x + (a * t)
    else if (a <= 1.5d-116) then
        tmp = x + (y * z)
    else if (a <= 2.45d-64) then
        tmp = x + (b * (a * z))
    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.32e+160) {
		tmp = t_1;
	} else if (a <= -2.4e-88) {
		tmp = x + (a * t);
	} else if (a <= 1.5e-116) {
		tmp = x + (y * z);
	} else if (a <= 2.45e-64) {
		tmp = x + (b * (a * z));
	} 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.32e+160:
		tmp = t_1
	elif a <= -2.4e-88:
		tmp = x + (a * t)
	elif a <= 1.5e-116:
		tmp = x + (y * z)
	elif a <= 2.45e-64:
		tmp = x + (b * (a * z))
	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.32e+160)
		tmp = t_1;
	elseif (a <= -2.4e-88)
		tmp = Float64(x + Float64(a * t));
	elseif (a <= 1.5e-116)
		tmp = Float64(x + Float64(y * z));
	elseif (a <= 2.45e-64)
		tmp = Float64(x + Float64(b * Float64(a * z)));
	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.32e+160)
		tmp = t_1;
	elseif (a <= -2.4e-88)
		tmp = x + (a * t);
	elseif (a <= 1.5e-116)
		tmp = x + (y * z);
	elseif (a <= 2.45e-64)
		tmp = x + (b * (a * z));
	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.32e+160], t$95$1, If[LessEqual[a, -2.4e-88], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.5e-116], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.45e-64], N[(x + N[(b * N[(a * z), $MachinePrecision]), $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.32 \cdot 10^{+160}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -2.4 \cdot 10^{-88}:\\
\;\;\;\;x + a \cdot t\\

\mathbf{elif}\;a \leq 1.5 \cdot 10^{-116}:\\
\;\;\;\;x + y \cdot z\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.32e160 or 2.4500000000000001e-64 < a

    1. Initial program 82.1%

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

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

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

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

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

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

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

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

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

    if -1.32e160 < a < -2.4e-88

    1. Initial program 90.7%

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

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

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

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

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Step-by-step derivation
      1. +-commutative73.6%

        \[\leadsto \color{blue}{a \cdot t + x} \]
    7. Simplified73.6%

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

    if -2.4e-88 < a < 1.50000000000000013e-116

    1. Initial program 96.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. associate-+l+96.6%

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

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

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

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

    if 1.50000000000000013e-116 < a < 2.4500000000000001e-64

    1. Initial program 99.7%

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(a \cdot t + a \cdot \left(b \cdot z\right)\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-in82.9%

        \[\leadsto x + \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
      2. +-commutative82.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(b \cdot a\right)} \cdot z \]
      3. associate-*r*47.4%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot z\right)} \]
    11. Simplified97.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.32 \cdot 10^{+160}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq -2.4 \cdot 10^{-88}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{-116}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 2.45 \cdot 10^{-64}:\\ \;\;\;\;x + b \cdot \left(a \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 95.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 -5.3 \cdot 10^{+243}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 3.6 \cdot 10^{+151}:\\ \;\;\;\;x + \left(a \cdot t + z \cdot \left(y + a \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (+ t (* z b)))))
   (if (<= a -5.3e+243)
     t_1
     (if (<= a 3.6e+151) (+ x (+ (* a t) (* z (+ y (* a b))))) (+ x 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 <= -5.3e+243) {
		tmp = t_1;
	} else if (a <= 3.6e+151) {
		tmp = x + ((a * t) + (z * (y + (a * b))));
	} else {
		tmp = x + 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 <= (-5.3d+243)) then
        tmp = t_1
    else if (a <= 3.6d+151) then
        tmp = x + ((a * t) + (z * (y + (a * b))))
    else
        tmp = x + 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 <= -5.3e+243) {
		tmp = t_1;
	} else if (a <= 3.6e+151) {
		tmp = x + ((a * t) + (z * (y + (a * b))));
	} else {
		tmp = x + t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (t + (z * b))
	tmp = 0
	if a <= -5.3e+243:
		tmp = t_1
	elif a <= 3.6e+151:
		tmp = x + ((a * t) + (z * (y + (a * b))))
	else:
		tmp = x + 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 <= -5.3e+243)
		tmp = t_1;
	elseif (a <= 3.6e+151)
		tmp = Float64(x + Float64(Float64(a * t) + Float64(z * Float64(y + Float64(a * b)))));
	else
		tmp = Float64(x + 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 <= -5.3e+243)
		tmp = t_1;
	elseif (a <= 3.6e+151)
		tmp = x + ((a * t) + (z * (y + (a * b))));
	else
		tmp = x + 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, -5.3e+243], t$95$1, If[LessEqual[a, 3.6e+151], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq 3.6 \cdot 10^{+151}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot \left(y + a \cdot b\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.2999999999999997e243

    1. Initial program 72.2%

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

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

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

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(b \cdot z + t\right)} \]
    9. Simplified94.4%

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

    if -5.2999999999999997e243 < a < 3.6e151

    1. Initial program 92.8%

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

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

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

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

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

    if 3.6e151 < a

    1. Initial program 74.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. associate-+l+74.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 99.9%

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

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

Alternative 8: 71.1% 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.7 \cdot 10^{+159}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -7.2 \cdot 10^{-90}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-64}:\\ \;\;\;\;x + y \cdot z\\ \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.7e+159)
     t_1
     (if (<= a -7.2e-90)
       (+ x (* a t))
       (if (<= a 9.5e-64) (+ x (* y z)) 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.7e+159) {
		tmp = t_1;
	} else if (a <= -7.2e-90) {
		tmp = x + (a * t);
	} else if (a <= 9.5e-64) {
		tmp = x + (y * z);
	} 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.7d+159)) then
        tmp = t_1
    else if (a <= (-7.2d-90)) then
        tmp = x + (a * t)
    else if (a <= 9.5d-64) then
        tmp = x + (y * z)
    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.7e+159) {
		tmp = t_1;
	} else if (a <= -7.2e-90) {
		tmp = x + (a * t);
	} else if (a <= 9.5e-64) {
		tmp = x + (y * z);
	} 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.7e+159:
		tmp = t_1
	elif a <= -7.2e-90:
		tmp = x + (a * t)
	elif a <= 9.5e-64:
		tmp = x + (y * z)
	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.7e+159)
		tmp = t_1;
	elseif (a <= -7.2e-90)
		tmp = Float64(x + Float64(a * t));
	elseif (a <= 9.5e-64)
		tmp = Float64(x + Float64(y * z));
	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.7e+159)
		tmp = t_1;
	elseif (a <= -7.2e-90)
		tmp = x + (a * t);
	elseif (a <= 9.5e-64)
		tmp = x + (y * z);
	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.7e+159], t$95$1, If[LessEqual[a, -7.2e-90], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.5e-64], N[(x + N[(y * z), $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.7 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -7.2 \cdot 10^{-90}:\\
\;\;\;\;x + a \cdot t\\

\mathbf{elif}\;a \leq 9.5 \cdot 10^{-64}:\\
\;\;\;\;x + y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.69999999999999996e159 or 9.50000000000000043e-64 < a

    1. Initial program 82.1%

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

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

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

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

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

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

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

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

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

    if -1.69999999999999996e159 < a < -7.19999999999999961e-90

    1. Initial program 90.7%

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

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

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

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

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Step-by-step derivation
      1. +-commutative73.6%

        \[\leadsto \color{blue}{a \cdot t + x} \]
    7. Simplified73.6%

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

    if -7.19999999999999961e-90 < a < 9.50000000000000043e-64

    1. Initial program 97.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.7 \cdot 10^{+159}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq -7.2 \cdot 10^{-90}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-64}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 62.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -4.5 \cdot 10^{+244}:\\ \;\;\;\;b \cdot \left(a \cdot z\right)\\ \mathbf{elif}\;a \leq -1.05 \cdot 10^{-90} \lor \neg \left(a \leq 1.05 \cdot 10^{-33}\right):\\ \;\;\;\;x + a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -4.5e+244)
   (* b (* a z))
   (if (or (<= a -1.05e-90) (not (<= a 1.05e-33)))
     (+ x (* a t))
     (+ x (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -4.5e+244) {
		tmp = b * (a * z);
	} else if ((a <= -1.05e-90) || !(a <= 1.05e-33)) {
		tmp = x + (a * t);
	} else {
		tmp = x + (y * z);
	}
	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.5d+244)) then
        tmp = b * (a * z)
    else if ((a <= (-1.05d-90)) .or. (.not. (a <= 1.05d-33))) then
        tmp = x + (a * t)
    else
        tmp = x + (y * z)
    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.5e+244) {
		tmp = b * (a * z);
	} else if ((a <= -1.05e-90) || !(a <= 1.05e-33)) {
		tmp = x + (a * t);
	} else {
		tmp = x + (y * z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -4.5e+244:
		tmp = b * (a * z)
	elif (a <= -1.05e-90) or not (a <= 1.05e-33):
		tmp = x + (a * t)
	else:
		tmp = x + (y * z)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -4.5e+244)
		tmp = Float64(b * Float64(a * z));
	elseif ((a <= -1.05e-90) || !(a <= 1.05e-33))
		tmp = Float64(x + Float64(a * t));
	else
		tmp = Float64(x + Float64(y * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (a <= -4.5e+244)
		tmp = b * (a * z);
	elseif ((a <= -1.05e-90) || ~((a <= 1.05e-33)))
		tmp = x + (a * t);
	else
		tmp = x + (y * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4.5e+244], N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -1.05e-90], N[Not[LessEqual[a, 1.05e-33]], $MachinePrecision]], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.05 \cdot 10^{-90} \lor \neg \left(a \leq 1.05 \cdot 10^{-33}\right):\\
\;\;\;\;x + a \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.5000000000000003e244

    1. Initial program 72.2%

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

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

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

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(b \cdot z + t\right)} \]
    9. Simplified94.4%

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

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

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

        \[\leadsto \color{blue}{\left(b \cdot a\right)} \cdot z \]
      3. associate-*r*72.4%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot z\right)} \]
    12. Simplified72.4%

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

    if -4.5000000000000003e244 < a < -1.05e-90 or 1.05e-33 < 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. Step-by-step derivation
      1. associate-+l+86.0%

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

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

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

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Step-by-step derivation
      1. +-commutative64.6%

        \[\leadsto \color{blue}{a \cdot t + x} \]
    7. Simplified64.6%

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

    if -1.05e-90 < a < 1.05e-33

    1. Initial program 96.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.5 \cdot 10^{+244}:\\ \;\;\;\;b \cdot \left(a \cdot z\right)\\ \mathbf{elif}\;a \leq -1.05 \cdot 10^{-90} \lor \neg \left(a \leq 1.05 \cdot 10^{-33}\right):\\ \;\;\;\;x + a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 82.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{-88} \lor \neg \left(a \leq 2.5 \cdot 10^{-120}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.8e-88 or 2.50000000000000003e-120 < a

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 86.3%

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

    if -1.8e-88 < a < 2.50000000000000003e-120

    1. Initial program 96.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. associate-+l+96.6%

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

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

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

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

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

Alternative 11: 84.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5.6 \cdot 10^{+188} \lor \neg \left(b \leq 2.8 \cdot 10^{+60}\right):\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot t + \left(x + y \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= b -5.6e+188) (not (<= b 2.8e+60)))
   (+ x (* a (+ t (* z b))))
   (+ (* a t) (+ x (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((b <= -5.6e+188) || !(b <= 2.8e+60)) {
		tmp = x + (a * (t + (z * b)));
	} else {
		tmp = (a * t) + (x + (y * z));
	}
	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 ((b <= (-5.6d+188)) .or. (.not. (b <= 2.8d+60))) then
        tmp = x + (a * (t + (z * b)))
    else
        tmp = (a * t) + (x + (y * z))
    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 ((b <= -5.6e+188) || !(b <= 2.8e+60)) {
		tmp = x + (a * (t + (z * b)));
	} else {
		tmp = (a * t) + (x + (y * z));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (b <= -5.6e+188) or not (b <= 2.8e+60):
		tmp = x + (a * (t + (z * b)))
	else:
		tmp = (a * t) + (x + (y * z))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((b <= -5.6e+188) || !(b <= 2.8e+60))
		tmp = Float64(x + Float64(a * Float64(t + Float64(z * b))));
	else
		tmp = Float64(Float64(a * t) + Float64(x + Float64(y * z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((b <= -5.6e+188) || ~((b <= 2.8e+60)))
		tmp = x + (a * (t + (z * b)));
	else
		tmp = (a * t) + (x + (y * z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5.6e+188], N[Not[LessEqual[b, 2.8e+60]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * t), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.6 \cdot 10^{+188} \lor \neg \left(b \leq 2.8 \cdot 10^{+60}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -5.5999999999999996e188 or 2.8e60 < b

    1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 89.3%

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

    if -5.5999999999999996e188 < b < 2.8e60

    1. Initial program 91.4%

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

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

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

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

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

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

Alternative 12: 58.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.9 \cdot 10^{+137} \lor \neg \left(t \leq 2.2 \cdot 10^{+167}\right):\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= t -2.9e+137) (not (<= t 2.2e+167))) (* a t) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((t <= -2.9e+137) || !(t <= 2.2e+167)) {
		tmp = a * t;
	} else {
		tmp = x + (y * z);
	}
	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 ((t <= (-2.9d+137)) .or. (.not. (t <= 2.2d+167))) then
        tmp = a * t
    else
        tmp = x + (y * z)
    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 ((t <= -2.9e+137) || !(t <= 2.2e+167)) {
		tmp = a * t;
	} else {
		tmp = x + (y * z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (t <= -2.9e+137) or not (t <= 2.2e+167):
		tmp = a * t
	else:
		tmp = x + (y * z)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((t <= -2.9e+137) || !(t <= 2.2e+167))
		tmp = Float64(a * t);
	else
		tmp = Float64(x + Float64(y * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((t <= -2.9e+137) || ~((t <= 2.2e+167)))
		tmp = a * t;
	else
		tmp = x + (y * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.9e+137], N[Not[LessEqual[t, 2.2e+167]], $MachinePrecision]], N[(a * t), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+137} \lor \neg \left(t \leq 2.2 \cdot 10^{+167}\right):\\
\;\;\;\;a \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.89999999999999985e137 or 2.20000000000000003e167 < t

    1. Initial program 82.5%

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

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

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

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

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

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

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

    if -2.89999999999999985e137 < t < 2.20000000000000003e167

    1. Initial program 91.4%

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

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

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

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

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

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

Alternative 13: 39.1% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -5.2 \cdot 10^{-8} \lor \neg \left(a \leq 7 \cdot 10^{-59}\right):\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= a -5.2e-8) (not (<= a 7e-59))) (* a t) x))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -5.2e-8) || !(a <= 7e-59)) {
		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 ((a <= (-5.2d-8)) .or. (.not. (a <= 7d-59))) 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 ((a <= -5.2e-8) || !(a <= 7e-59)) {
		tmp = a * t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (a <= -5.2e-8) or not (a <= 7e-59):
		tmp = a * t
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((a <= -5.2e-8) || !(a <= 7e-59))
		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 ((a <= -5.2e-8) || ~((a <= 7e-59)))
		tmp = a * t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -5.2e-8], N[Not[LessEqual[a, 7e-59]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.2 \cdot 10^{-8} \lor \neg \left(a \leq 7 \cdot 10^{-59}\right):\\
\;\;\;\;a \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.2000000000000002e-8 or 7.0000000000000002e-59 < a

    1. Initial program 84.0%

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

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

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

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

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

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

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

    if -5.2000000000000002e-8 < a < 7.0000000000000002e-59

    1. Initial program 96.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.2 \cdot 10^{-8} \lor \neg \left(a \leq 7 \cdot 10^{-59}\right):\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 26.1% 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 89.2%

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification26.9%

    \[\leadsto x \]
  7. 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 2024029 
(FPCore (x y z t a b)
  :name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
  :precision binary64

  :herbie-target
  (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)))