Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.5% → 94.4%
Time: 32.1s
Alternatives: 12
Speedup: 0.4×

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 12 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.5% accurate, 1.0× speedup?

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

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

Alternative 1: 94.4% accurate, 0.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 5.4e215

    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. +-commutative93.0%

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

        \[\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*95.5%

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + \left(t \cdot a + a \cdot \color{blue}{\left(b \cdot z\right)}\right) \]
      6. *-commutative95.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-out97.2%

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

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \left(-\left(-\color{blue}{z \cdot b}\right)\right)\right) \]
      10. distribute-lft-neg-out97.2%

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

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \color{blue}{\left(t + \left(-\left(-z\right) \cdot b\right)\right)} \]
      13. distribute-lft-neg-in97.2%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{\left(-\left(-z\right)\right) \cdot b}\right) \]
      14. remove-double-neg97.2%

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

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

    if 5.4e215 < b

    1. Initial program 81.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+81.2%

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

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

        \[\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*58.3%

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

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

        \[\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-out64.6%

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

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \left(-\left(-\color{blue}{z \cdot b}\right)\right)\right) \]
      10. distribute-lft-neg-out64.6%

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

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \color{blue}{\left(t + \left(-\left(-z\right) \cdot b\right)\right)} \]
      13. distribute-lft-neg-in64.6%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{\left(-\left(-z\right)\right) \cdot b}\right) \]
      14. remove-double-neg64.6%

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

      \[\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 77.1%

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

      \[\leadsto x + \color{blue}{b \cdot \left(a \cdot z + \frac{a \cdot t}{b}\right)} \]
    7. Step-by-step derivation
      1. associate-/l*94.0%

        \[\leadsto x + b \cdot \left(a \cdot z + \color{blue}{a \cdot \frac{t}{b}}\right) \]
      2. distribute-lft-out94.0%

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

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

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

Alternative 2: 39.3% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \leq -1.7 \cdot 10^{+56}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;a \leq -3.5 \cdot 10^{-59}:\\
\;\;\;\;z \cdot \left(b \cdot a\right)\\

\mathbf{elif}\;a \leq -1.15 \cdot 10^{-211}:\\
\;\;\;\;y \cdot z\\

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

\mathbf{elif}\;a \leq 4.2 \cdot 10^{+248}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -1.05000000000000001e168 or 3.4000000000000001e-34 < a < 4.19999999999999977e248

    1. Initial program 82.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+82.8%

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

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

        \[\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*90.6%

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

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

        \[\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-out96.4%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \color{blue}{\left(t + \left(-\left(-z\right) \cdot b\right)\right)} \]
      13. distribute-lft-neg-in96.4%

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

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

      \[\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.9%

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

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

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

    if -1.05000000000000001e168 < a < -1.7e56 or 4.19999999999999977e248 < a

    1. Initial program 91.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+91.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*94.1%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified94.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 73.9%

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Taylor expanded in x around 0 58.2%

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

    if -1.7e56 < a < -3.5000000000000001e-59

    1. Initial program 96.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube69.5%

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

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

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \sqrt[3]{{\color{blue}{\left(z \cdot a\right)}}^{3}} \cdot b \]
    4. Applied egg-rr69.5%

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\sqrt[3]{{\left(z \cdot a\right)}^{3}}} \cdot b \]
    5. Taylor expanded in z around inf 62.9%

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

        \[\leadsto z \cdot \color{blue}{\left(a \cdot b + y\right)} \]
    7. Simplified62.9%

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

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

    if -3.5000000000000001e-59 < a < -1.14999999999999994e-211

    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. +-commutative100.0%

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

        \[\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*95.1%

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

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

        \[\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-out95.1%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{\left(-\left(-z\right)\right) \cdot b}\right) \]
      14. remove-double-neg95.1%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{z} \cdot b\right) \]
    3. Simplified95.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 inf 79.2%

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

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

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

      \[\leadsto z \cdot y + a \cdot \color{blue}{t} \]
    9. Taylor expanded in z around inf 56.3%

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

        \[\leadsto \color{blue}{z \cdot y} \]
    11. Simplified56.3%

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

    if -1.14999999999999994e-211 < a < 3.4000000000000001e-34

    1. Initial program 98.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+98.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*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 z around 0 53.7%

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Taylor expanded in x around inf 46.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.05 \cdot 10^{+168}:\\ \;\;\;\;a \cdot \left(b \cdot z\right)\\ \mathbf{elif}\;a \leq -1.7 \cdot 10^{+56}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -3.5 \cdot 10^{-59}:\\ \;\;\;\;z \cdot \left(b \cdot a\right)\\ \mathbf{elif}\;a \leq -1.15 \cdot 10^{-211}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{-34}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{+248}:\\ \;\;\;\;a \cdot \left(b \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 95.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot z\\ \mathbf{if}\;\left(t\_1 + a \cdot t\right) + b \cdot \left(z \cdot a\right) \leq \infty:\\ \;\;\;\;t\_1 + \left(a \cdot t + a \cdot \left(b \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + b \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* y z))))
   (if (<= (+ (+ t_1 (* a t)) (* b (* z a))) INFINITY)
     (+ t_1 (+ (* a t) (* a (* b z))))
     (+ x (* a (+ t (* b z)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (y * z);
	double tmp;
	if (((t_1 + (a * t)) + (b * (z * a))) <= ((double) INFINITY)) {
		tmp = t_1 + ((a * t) + (a * (b * z)));
	} else {
		tmp = x + (a * (t + (b * z)));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (y * z);
	double tmp;
	if (((t_1 + (a * t)) + (b * (z * a))) <= Double.POSITIVE_INFINITY) {
		tmp = t_1 + ((a * t) + (a * (b * z)));
	} else {
		tmp = x + (a * (t + (b * z)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (y * z)
	tmp = 0
	if ((t_1 + (a * t)) + (b * (z * a))) <= math.inf:
		tmp = t_1 + ((a * t) + (a * (b * z)))
	else:
		tmp = x + (a * (t + (b * z)))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(y * z))
	tmp = 0.0
	if (Float64(Float64(t_1 + Float64(a * t)) + Float64(b * Float64(z * a))) <= Inf)
		tmp = Float64(t_1 + Float64(Float64(a * t) + Float64(a * Float64(b * z))));
	else
		tmp = Float64(x + Float64(a * Float64(t + Float64(b * z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (y * z);
	tmp = 0.0;
	if (((t_1 + (a * t)) + (b * (z * a))) <= Inf)
		tmp = t_1 + ((a * t) + (a * (b * z)));
	else
		tmp = x + (a * (t + (b * z)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(t$95$1 + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 + N[(N[(a * t), $MachinePrecision] + N[(a * N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0

    1. Initial program 96.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+96.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*97.4%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified97.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

    if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b))

    1. Initial program 0.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+0.0%

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

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

        \[\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*8.3%

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

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

        \[\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-out50.0%

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

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \left(-\left(-\color{blue}{z \cdot b}\right)\right)\right) \]
      10. distribute-lft-neg-out50.0%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \left(-\color{blue}{\left(-z\right) \cdot b}\right)\right) \]
      11. sub-neg50.0%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \color{blue}{\left(t - \left(-z\right) \cdot b\right)} \]
      12. sub-neg50.0%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \color{blue}{\left(t + \left(-\left(-z\right) \cdot b\right)\right)} \]
      13. distribute-lft-neg-in50.0%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{\left(-\left(-z\right)\right) \cdot b}\right) \]
      14. remove-double-neg50.0%

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

      \[\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 83.3%

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

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

Alternative 4: 39.2% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \leq -2.05 \cdot 10^{-210}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 5.1 \cdot 10^{-28}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 2.3 \cdot 10^{+247}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -7.20000000000000001e-59 or 5.10000000000000009e-28 < a < 2.29999999999999991e247

    1. Initial program 86.9%

      \[\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.9%

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

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

        \[\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*91.7%

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

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

        \[\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-out95.1%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{\left(-\left(-z\right)\right) \cdot b}\right) \]
      14. remove-double-neg95.1%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{z} \cdot b\right) \]
    3. Simplified95.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.2%

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

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

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

    if -7.20000000000000001e-59 < a < -2.04999999999999995e-210

    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. +-commutative100.0%

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

        \[\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*95.1%

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

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

        \[\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-out95.1%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{\left(-\left(-z\right)\right) \cdot b}\right) \]
      14. remove-double-neg95.1%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{z} \cdot b\right) \]
    3. Simplified95.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 inf 79.2%

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

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

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

      \[\leadsto z \cdot y + a \cdot \color{blue}{t} \]
    9. Taylor expanded in z around inf 56.3%

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

        \[\leadsto \color{blue}{z \cdot y} \]
    11. Simplified56.3%

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

    if -2.04999999999999995e-210 < a < 5.10000000000000009e-28

    1. Initial program 98.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+98.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*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 z around 0 53.7%

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Taylor expanded in x around inf 46.8%

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

    if 2.29999999999999991e247 < a

    1. Initial program 99.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+99.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*99.8%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified99.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 93.7%

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Taylor expanded in x around 0 79.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7.2 \cdot 10^{-59}:\\ \;\;\;\;a \cdot \left(b \cdot z\right)\\ \mathbf{elif}\;a \leq -2.05 \cdot 10^{-210}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 5.1 \cdot 10^{-28}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 2.3 \cdot 10^{+247}:\\ \;\;\;\;a \cdot \left(b \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 81.4% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.72e-59 or 1.3499999999999999e-35 < a

    1. Initial program 87.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+87.7%

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

        \[\leadsto \color{blue}{\left(y \cdot z + x\right)} + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right) \]
      3. fma-define87.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*91.6%

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

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

        \[\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.9%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{z} \cdot b\right) \]
    3. Simplified94.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 89.1%

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

    if -1.72e-59 < a < -1.25000000000000005e-135

    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. +-commutative100.0%

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

        \[\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*95.9%

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + \left(t \cdot a + a \cdot \color{blue}{\left(b \cdot z\right)}\right) \]
      6. *-commutative95.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-out95.9%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{z} \cdot b\right) \]
    3. Simplified95.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 inf 91.6%

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

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

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

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

    if -1.25000000000000005e-135 < a < 1.3499999999999999e-35

    1. Initial program 98.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube91.4%

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

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

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \sqrt[3]{{\color{blue}{\left(z \cdot a\right)}}^{3}} \cdot b \]
    4. Applied egg-rr91.4%

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\sqrt[3]{{\left(z \cdot a\right)}^{3}}} \cdot b \]
    5. Taylor expanded in a around 0 84.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.72 \cdot 10^{-59}:\\ \;\;\;\;x + a \cdot \left(t + b \cdot z\right)\\ \mathbf{elif}\;a \leq -1.25 \cdot 10^{-135}:\\ \;\;\;\;a \cdot t + y \cdot z\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{-35}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + b \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 72.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(t + b \cdot z\right)\\ \mathbf{if}\;a \leq -3.5 \cdot 10^{-59}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -7.5 \cdot 10^{-138}:\\ \;\;\;\;a \cdot t + y \cdot z\\ \mathbf{elif}\;a \leq 7 \cdot 10^{+69}:\\ \;\;\;\;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 (* b z)))))
   (if (<= a -3.5e-59)
     t_1
     (if (<= a -7.5e-138)
       (+ (* a t) (* y z))
       (if (<= a 7e+69) (+ x (* y z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (t + (b * z));
	double tmp;
	if (a <= -3.5e-59) {
		tmp = t_1;
	} else if (a <= -7.5e-138) {
		tmp = (a * t) + (y * z);
	} else if (a <= 7e+69) {
		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 + (b * z))
    if (a <= (-3.5d-59)) then
        tmp = t_1
    else if (a <= (-7.5d-138)) then
        tmp = (a * t) + (y * z)
    else if (a <= 7d+69) 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 + (b * z));
	double tmp;
	if (a <= -3.5e-59) {
		tmp = t_1;
	} else if (a <= -7.5e-138) {
		tmp = (a * t) + (y * z);
	} else if (a <= 7e+69) {
		tmp = x + (y * z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (t + (b * z))
	tmp = 0
	if a <= -3.5e-59:
		tmp = t_1
	elif a <= -7.5e-138:
		tmp = (a * t) + (y * z)
	elif a <= 7e+69:
		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(b * z)))
	tmp = 0.0
	if (a <= -3.5e-59)
		tmp = t_1;
	elseif (a <= -7.5e-138)
		tmp = Float64(Float64(a * t) + Float64(y * z));
	elseif (a <= 7e+69)
		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 + (b * z));
	tmp = 0.0;
	if (a <= -3.5e-59)
		tmp = t_1;
	elseif (a <= -7.5e-138)
		tmp = (a * t) + (y * z);
	elseif (a <= 7e+69)
		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[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.5e-59], t$95$1, If[LessEqual[a, -7.5e-138], N[(N[(a * t), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7e+69], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -7.5 \cdot 10^{-138}:\\
\;\;\;\;a \cdot t + y \cdot z\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.5000000000000001e-59 or 6.99999999999999974e69 < a

    1. Initial program 86.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+86.1%

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

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

        \[\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*91.1%

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

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

        \[\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.8%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \color{blue}{\left(t + \left(-\left(-z\right) \cdot b\right)\right)} \]
      13. distribute-lft-neg-in94.8%

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

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

      \[\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 92.2%

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

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

    if -3.5000000000000001e-59 < a < -7.4999999999999995e-138

    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. +-commutative100.0%

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

        \[\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*95.9%

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + \left(t \cdot a + a \cdot \color{blue}{\left(b \cdot z\right)}\right) \]
      6. *-commutative95.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-out95.9%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{z} \cdot b\right) \]
    3. Simplified95.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 inf 91.6%

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

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

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

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

    if -7.4999999999999995e-138 < a < 6.99999999999999974e69

    1. Initial program 99.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube90.0%

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

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

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \sqrt[3]{{\color{blue}{\left(z \cdot a\right)}}^{3}} \cdot b \]
    4. Applied egg-rr90.0%

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\sqrt[3]{{\left(z \cdot a\right)}^{3}}} \cdot b \]
    5. Taylor expanded in a around 0 79.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.5 \cdot 10^{-59}:\\ \;\;\;\;a \cdot \left(t + b \cdot z\right)\\ \mathbf{elif}\;a \leq -7.5 \cdot 10^{-138}:\\ \;\;\;\;a \cdot t + y \cdot z\\ \mathbf{elif}\;a \leq 7 \cdot 10^{+69}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + b \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 59.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+125}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;z \leq -5.7 \cdot 10^{+57} \lor \neg \left(z \leq 1.55 \cdot 10^{+79}\right):\\
\;\;\;\;z \cdot \left(b \cdot a\right)\\

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


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

    1. Initial program 83.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+83.1%

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

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

        \[\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*94.1%

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

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

        \[\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-out97.0%

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

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \left(-\left(-\color{blue}{z \cdot b}\right)\right)\right) \]
      10. distribute-lft-neg-out97.0%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \left(-\color{blue}{\left(-z\right) \cdot b}\right)\right) \]
      11. sub-neg97.0%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \color{blue}{\left(t - \left(-z\right) \cdot b\right)} \]
      12. sub-neg97.0%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \color{blue}{\left(t + \left(-\left(-z\right) \cdot b\right)\right)} \]
      13. distribute-lft-neg-in97.0%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{\left(-\left(-z\right)\right) \cdot b}\right) \]
      14. remove-double-neg97.0%

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

      \[\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 inf 91.2%

      \[\leadsto \color{blue}{y \cdot z} + a \cdot \left(t + z \cdot b\right) \]
    6. Step-by-step derivation
      1. *-commutative91.2%

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

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

      \[\leadsto z \cdot y + a \cdot \color{blue}{t} \]
    9. Taylor expanded in z around inf 53.9%

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

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

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

    if -9.50000000000000041e125 < z < -5.6999999999999998e57 or 1.5499999999999999e79 < z

    1. Initial program 85.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube69.6%

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

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

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \sqrt[3]{{\color{blue}{\left(z \cdot a\right)}}^{3}} \cdot b \]
    4. Applied egg-rr69.6%

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\sqrt[3]{{\left(z \cdot a\right)}^{3}}} \cdot b \]
    5. Taylor expanded in z around inf 82.6%

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

        \[\leadsto z \cdot \color{blue}{\left(a \cdot b + y\right)} \]
    7. Simplified82.6%

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

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

    if -5.6999999999999998e57 < z < 1.5499999999999999e79

    1. Initial program 97.9%

      \[\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.9%

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

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified99.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 z around 0 69.7%

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

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

Alternative 8: 61.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot z\\ \mathbf{if}\;y \leq -4.5 \cdot 10^{+76}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.15 \cdot 10^{-58}:\\ \;\;\;\;z \cdot \left(b \cdot a\right)\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+49}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* y z))))
   (if (<= y -4.5e+76)
     t_1
     (if (<= y -2.15e-58)
       (* z (* b a))
       (if (<= y 1.6e+49) (+ x (* a t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (y * z);
	double tmp;
	if (y <= -4.5e+76) {
		tmp = t_1;
	} else if (y <= -2.15e-58) {
		tmp = z * (b * a);
	} else if (y <= 1.6e+49) {
		tmp = x + (a * t);
	} 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 = x + (y * z)
    if (y <= (-4.5d+76)) then
        tmp = t_1
    else if (y <= (-2.15d-58)) then
        tmp = z * (b * a)
    else if (y <= 1.6d+49) then
        tmp = x + (a * t)
    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 = x + (y * z);
	double tmp;
	if (y <= -4.5e+76) {
		tmp = t_1;
	} else if (y <= -2.15e-58) {
		tmp = z * (b * a);
	} else if (y <= 1.6e+49) {
		tmp = x + (a * t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (y * z)
	tmp = 0
	if y <= -4.5e+76:
		tmp = t_1
	elif y <= -2.15e-58:
		tmp = z * (b * a)
	elif y <= 1.6e+49:
		tmp = x + (a * t)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(y * z))
	tmp = 0.0
	if (y <= -4.5e+76)
		tmp = t_1;
	elseif (y <= -2.15e-58)
		tmp = Float64(z * Float64(b * a));
	elseif (y <= 1.6e+49)
		tmp = Float64(x + Float64(a * t));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (y * z);
	tmp = 0.0;
	if (y <= -4.5e+76)
		tmp = t_1;
	elseif (y <= -2.15e-58)
		tmp = z * (b * a);
	elseif (y <= 1.6e+49)
		tmp = x + (a * t);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.5e+76], t$95$1, If[LessEqual[y, -2.15e-58], N[(z * N[(b * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e+49], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 1.6 \cdot 10^{+49}:\\
\;\;\;\;x + a \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.4999999999999997e76 or 1.60000000000000007e49 < y

    1. Initial program 95.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube85.3%

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

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

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \sqrt[3]{{\color{blue}{\left(z \cdot a\right)}}^{3}} \cdot b \]
    4. Applied egg-rr85.3%

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\sqrt[3]{{\left(z \cdot a\right)}^{3}}} \cdot b \]
    5. Taylor expanded in a around 0 71.9%

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

    if -4.4999999999999997e76 < y < -2.15e-58

    1. Initial program 92.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube65.2%

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

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

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \sqrt[3]{{\color{blue}{\left(z \cdot a\right)}}^{3}} \cdot b \]
    4. Applied egg-rr65.2%

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\sqrt[3]{{\left(z \cdot a\right)}^{3}}} \cdot b \]
    5. Taylor expanded in z around inf 76.9%

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

        \[\leadsto z \cdot \color{blue}{\left(a \cdot b + y\right)} \]
    7. Simplified76.9%

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

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

    if -2.15e-58 < y < 1.60000000000000007e49

    1. Initial program 90.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+90.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*93.4%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified93.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 z around 0 62.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{+76}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;y \leq -2.15 \cdot 10^{-58}:\\ \;\;\;\;z \cdot \left(b \cdot a\right)\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+49}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 87.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.3 \cdot 10^{-59} \lor \neg \left(a \leq 1.65 \cdot 10^{-35}\right):\\
\;\;\;\;x + a \cdot \left(t + b \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.3000000000000003e-59 or 1.65e-35 < a

    1. Initial program 87.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+87.7%

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

        \[\leadsto \color{blue}{\left(y \cdot z + x\right)} + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right) \]
      3. fma-define87.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*91.6%

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

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

        \[\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.9%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{z} \cdot b\right) \]
    3. Simplified94.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 89.1%

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

    if -5.3000000000000003e-59 < a < 1.65e-35

    1. Initial program 99.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+99.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*95.6%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified95.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 b around 0 92.6%

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

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

Alternative 10: 72.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.15 \cdot 10^{-106} \lor \neg \left(a \leq 1.55 \cdot 10^{+72}\right):\\
\;\;\;\;a \cdot \left(t + b \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.15000000000000023e-106 or 1.54999999999999994e72 < a

    1. Initial program 87.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+87.2%

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

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

        \[\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*91.2%

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + \left(t \cdot a + a \cdot \color{blue}{\left(b \cdot z\right)}\right) \]
      6. *-commutative91.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.6%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \color{blue}{\left(t + \left(-\left(-z\right) \cdot b\right)\right)} \]
      13. distribute-lft-neg-in94.6%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{\left(-\left(-z\right)\right) \cdot b}\right) \]
      14. remove-double-neg94.6%

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

      \[\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 88.9%

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

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

    if -4.15000000000000023e-106 < a < 1.54999999999999994e72

    1. Initial program 99.1%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube90.0%

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

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

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \sqrt[3]{{\color{blue}{\left(z \cdot a\right)}}^{3}} \cdot b \]
    4. Applied egg-rr90.0%

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\sqrt[3]{{\left(z \cdot a\right)}^{3}}} \cdot b \]
    5. Taylor expanded in a around 0 79.8%

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

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

Alternative 11: 39.2% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;x \leq 2.9 \cdot 10^{+105}:\\
\;\;\;\;a \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.29999999999999992e31 or 2.9000000000000001e105 < x

    1. Initial program 90.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+90.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*94.0%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified94.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 61.8%

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Taylor expanded in x around inf 57.1%

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

    if -3.29999999999999992e31 < x < 2.9000000000000001e105

    1. Initial program 93.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+93.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*92.8%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified92.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 42.3%

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Taylor expanded in x around 0 36.1%

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

Alternative 12: 26.8% 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 92.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+92.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*93.2%

      \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
  3. Simplified93.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 z around 0 48.7%

    \[\leadsto \color{blue}{x + a \cdot t} \]
  6. Taylor expanded in x around inf 24.5%

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

Developer Target 1: 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 2024143 
(FPCore (x y z t a b)
  :name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< z -11820553527347888000) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 47589743188364287/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a))))))

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