Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.2% → 96.6%
Time: 10.1s
Alternatives: 14
Speedup: 0.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 92.2% accurate, 1.0× speedup?

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

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

Alternative 1: 96.6% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\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 98.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. 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. associate-*l*14.3%

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

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

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

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

Alternative 2: 39.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z \cdot a\right) \cdot b\\ \mathbf{if}\;y \leq -2.6 \cdot 10^{+48}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-109}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.45 \cdot 10^{-179}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -7 \cdot 10^{-222}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -9 \cdot 10^{-282}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{-213}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-171}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{+99}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* (* z a) b)))
   (if (<= y -2.6e+48)
     (* y z)
     (if (<= y -1.1e-109)
       t_1
       (if (<= y -2.45e-179)
         x
         (if (<= y -7e-222)
           t_1
           (if (<= y -9e-282)
             x
             (if (<= y 1.8e-213)
               (* t a)
               (if (<= y 2.1e-171)
                 x
                 (if (<= y 2.05e+99) (* t a) (* y z)))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z * a) * b;
	double tmp;
	if (y <= -2.6e+48) {
		tmp = y * z;
	} else if (y <= -1.1e-109) {
		tmp = t_1;
	} else if (y <= -2.45e-179) {
		tmp = x;
	} else if (y <= -7e-222) {
		tmp = t_1;
	} else if (y <= -9e-282) {
		tmp = x;
	} else if (y <= 1.8e-213) {
		tmp = t * a;
	} else if (y <= 2.1e-171) {
		tmp = x;
	} else if (y <= 2.05e+99) {
		tmp = t * a;
	} else {
		tmp = 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) :: t_1
    real(8) :: tmp
    t_1 = (z * a) * b
    if (y <= (-2.6d+48)) then
        tmp = y * z
    else if (y <= (-1.1d-109)) then
        tmp = t_1
    else if (y <= (-2.45d-179)) then
        tmp = x
    else if (y <= (-7d-222)) then
        tmp = t_1
    else if (y <= (-9d-282)) then
        tmp = x
    else if (y <= 1.8d-213) then
        tmp = t * a
    else if (y <= 2.1d-171) then
        tmp = x
    else if (y <= 2.05d+99) then
        tmp = t * a
    else
        tmp = 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 t_1 = (z * a) * b;
	double tmp;
	if (y <= -2.6e+48) {
		tmp = y * z;
	} else if (y <= -1.1e-109) {
		tmp = t_1;
	} else if (y <= -2.45e-179) {
		tmp = x;
	} else if (y <= -7e-222) {
		tmp = t_1;
	} else if (y <= -9e-282) {
		tmp = x;
	} else if (y <= 1.8e-213) {
		tmp = t * a;
	} else if (y <= 2.1e-171) {
		tmp = x;
	} else if (y <= 2.05e+99) {
		tmp = t * a;
	} else {
		tmp = y * z;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (z * a) * b
	tmp = 0
	if y <= -2.6e+48:
		tmp = y * z
	elif y <= -1.1e-109:
		tmp = t_1
	elif y <= -2.45e-179:
		tmp = x
	elif y <= -7e-222:
		tmp = t_1
	elif y <= -9e-282:
		tmp = x
	elif y <= 1.8e-213:
		tmp = t * a
	elif y <= 2.1e-171:
		tmp = x
	elif y <= 2.05e+99:
		tmp = t * a
	else:
		tmp = y * z
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(z * a) * b)
	tmp = 0.0
	if (y <= -2.6e+48)
		tmp = Float64(y * z);
	elseif (y <= -1.1e-109)
		tmp = t_1;
	elseif (y <= -2.45e-179)
		tmp = x;
	elseif (y <= -7e-222)
		tmp = t_1;
	elseif (y <= -9e-282)
		tmp = x;
	elseif (y <= 1.8e-213)
		tmp = Float64(t * a);
	elseif (y <= 2.1e-171)
		tmp = x;
	elseif (y <= 2.05e+99)
		tmp = Float64(t * a);
	else
		tmp = Float64(y * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (z * a) * b;
	tmp = 0.0;
	if (y <= -2.6e+48)
		tmp = y * z;
	elseif (y <= -1.1e-109)
		tmp = t_1;
	elseif (y <= -2.45e-179)
		tmp = x;
	elseif (y <= -7e-222)
		tmp = t_1;
	elseif (y <= -9e-282)
		tmp = x;
	elseif (y <= 1.8e-213)
		tmp = t * a;
	elseif (y <= 2.1e-171)
		tmp = x;
	elseif (y <= 2.05e+99)
		tmp = t * a;
	else
		tmp = y * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[y, -2.6e+48], N[(y * z), $MachinePrecision], If[LessEqual[y, -1.1e-109], t$95$1, If[LessEqual[y, -2.45e-179], x, If[LessEqual[y, -7e-222], t$95$1, If[LessEqual[y, -9e-282], x, If[LessEqual[y, 1.8e-213], N[(t * a), $MachinePrecision], If[LessEqual[y, 2.1e-171], x, If[LessEqual[y, 2.05e+99], N[(t * a), $MachinePrecision], N[(y * z), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;y \leq -2.6 \cdot 10^{+48}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;y \leq -1.1 \cdot 10^{-109}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -2.45 \cdot 10^{-179}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -7 \cdot 10^{-222}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -9 \cdot 10^{-282}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.8 \cdot 10^{-213}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;y \leq 2.1 \cdot 10^{-171}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 2.05 \cdot 10^{+99}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.59999999999999995e48 or 2.0499999999999999e99 < y

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

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

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

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

        \[\leadsto \color{blue}{z \cdot y} \]
    7. Simplified63.3%

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

    if -2.59999999999999995e48 < y < -1.1e-109 or -2.45e-179 < y < -7.00000000000000049e-222

    1. Initial program 97.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+97.3%

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

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

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

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

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

    if -1.1e-109 < y < -2.45e-179 or -7.00000000000000049e-222 < y < -9.00000000000000017e-282 or 1.8e-213 < y < 2.1e-171

    1. Initial program 97.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+97.7%

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

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

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

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

    if -9.00000000000000017e-282 < y < 1.8e-213 or 2.1e-171 < y < 2.0499999999999999e99

    1. Initial program 97.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+97.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*98.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{+48}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-109}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{elif}\;y \leq -2.45 \cdot 10^{-179}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -7 \cdot 10^{-222}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{elif}\;y \leq -9 \cdot 10^{-282}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{-213}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-171}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{+99}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 40.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -33000000000000:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{-85}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;y \leq -1.05 \cdot 10^{-282}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-212}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-170}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{+100}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -33000000000000.0)
   (* y z)
   (if (<= y -2.5e-85)
     (* t a)
     (if (<= y -1.05e-282)
       x
       (if (<= y 5.5e-212)
         (* t a)
         (if (<= y 6e-170) x (if (<= y 3.3e+100) (* t a) (* y z))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -33000000000000.0) {
		tmp = y * z;
	} else if (y <= -2.5e-85) {
		tmp = t * a;
	} else if (y <= -1.05e-282) {
		tmp = x;
	} else if (y <= 5.5e-212) {
		tmp = t * a;
	} else if (y <= 6e-170) {
		tmp = x;
	} else if (y <= 3.3e+100) {
		tmp = t * a;
	} else {
		tmp = 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 (y <= (-33000000000000.0d0)) then
        tmp = y * z
    else if (y <= (-2.5d-85)) then
        tmp = t * a
    else if (y <= (-1.05d-282)) then
        tmp = x
    else if (y <= 5.5d-212) then
        tmp = t * a
    else if (y <= 6d-170) then
        tmp = x
    else if (y <= 3.3d+100) then
        tmp = t * a
    else
        tmp = 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 (y <= -33000000000000.0) {
		tmp = y * z;
	} else if (y <= -2.5e-85) {
		tmp = t * a;
	} else if (y <= -1.05e-282) {
		tmp = x;
	} else if (y <= 5.5e-212) {
		tmp = t * a;
	} else if (y <= 6e-170) {
		tmp = x;
	} else if (y <= 3.3e+100) {
		tmp = t * a;
	} else {
		tmp = y * z;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -33000000000000.0:
		tmp = y * z
	elif y <= -2.5e-85:
		tmp = t * a
	elif y <= -1.05e-282:
		tmp = x
	elif y <= 5.5e-212:
		tmp = t * a
	elif y <= 6e-170:
		tmp = x
	elif y <= 3.3e+100:
		tmp = t * a
	else:
		tmp = y * z
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -33000000000000.0)
		tmp = Float64(y * z);
	elseif (y <= -2.5e-85)
		tmp = Float64(t * a);
	elseif (y <= -1.05e-282)
		tmp = x;
	elseif (y <= 5.5e-212)
		tmp = Float64(t * a);
	elseif (y <= 6e-170)
		tmp = x;
	elseif (y <= 3.3e+100)
		tmp = Float64(t * a);
	else
		tmp = Float64(y * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -33000000000000.0)
		tmp = y * z;
	elseif (y <= -2.5e-85)
		tmp = t * a;
	elseif (y <= -1.05e-282)
		tmp = x;
	elseif (y <= 5.5e-212)
		tmp = t * a;
	elseif (y <= 6e-170)
		tmp = x;
	elseif (y <= 3.3e+100)
		tmp = t * a;
	else
		tmp = y * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -33000000000000.0], N[(y * z), $MachinePrecision], If[LessEqual[y, -2.5e-85], N[(t * a), $MachinePrecision], If[LessEqual[y, -1.05e-282], x, If[LessEqual[y, 5.5e-212], N[(t * a), $MachinePrecision], If[LessEqual[y, 6e-170], x, If[LessEqual[y, 3.3e+100], N[(t * a), $MachinePrecision], N[(y * z), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -33000000000000:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;y \leq -2.5 \cdot 10^{-85}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;y \leq -1.05 \cdot 10^{-282}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 5.5 \cdot 10^{-212}:\\
\;\;\;\;t \cdot a\\

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

\mathbf{elif}\;y \leq 3.3 \cdot 10^{+100}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.3e13 or 3.3000000000000001e100 < y

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

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

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

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

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

    if -3.3e13 < y < -2.5000000000000001e-85 or -1.05000000000000006e-282 < y < 5.49999999999999995e-212 or 6.00000000000000027e-170 < y < 3.3000000000000001e100

    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*98.0%

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

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

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

    if -2.5000000000000001e-85 < y < -1.05000000000000006e-282 or 5.49999999999999995e-212 < y < 6.00000000000000027e-170

    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*92.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -33000000000000:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{-85}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;y \leq -1.05 \cdot 10^{-282}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-212}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-170}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{+100}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 39.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{+48}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq -1.05 \cdot 10^{-108}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;y \leq -5 \cdot 10^{-282}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{-214}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{-170}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{+98}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -9.5e+48)
   (* y z)
   (if (<= y -1.05e-108)
     (* a (* z b))
     (if (<= y -5e-282)
       x
       (if (<= y 6.5e-214)
         (* t a)
         (if (<= y 5.6e-170) x (if (<= y 1.7e+98) (* t a) (* y z))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -9.5e+48) {
		tmp = y * z;
	} else if (y <= -1.05e-108) {
		tmp = a * (z * b);
	} else if (y <= -5e-282) {
		tmp = x;
	} else if (y <= 6.5e-214) {
		tmp = t * a;
	} else if (y <= 5.6e-170) {
		tmp = x;
	} else if (y <= 1.7e+98) {
		tmp = t * a;
	} else {
		tmp = 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 (y <= (-9.5d+48)) then
        tmp = y * z
    else if (y <= (-1.05d-108)) then
        tmp = a * (z * b)
    else if (y <= (-5d-282)) then
        tmp = x
    else if (y <= 6.5d-214) then
        tmp = t * a
    else if (y <= 5.6d-170) then
        tmp = x
    else if (y <= 1.7d+98) then
        tmp = t * a
    else
        tmp = 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 (y <= -9.5e+48) {
		tmp = y * z;
	} else if (y <= -1.05e-108) {
		tmp = a * (z * b);
	} else if (y <= -5e-282) {
		tmp = x;
	} else if (y <= 6.5e-214) {
		tmp = t * a;
	} else if (y <= 5.6e-170) {
		tmp = x;
	} else if (y <= 1.7e+98) {
		tmp = t * a;
	} else {
		tmp = y * z;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -9.5e+48:
		tmp = y * z
	elif y <= -1.05e-108:
		tmp = a * (z * b)
	elif y <= -5e-282:
		tmp = x
	elif y <= 6.5e-214:
		tmp = t * a
	elif y <= 5.6e-170:
		tmp = x
	elif y <= 1.7e+98:
		tmp = t * a
	else:
		tmp = y * z
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -9.5e+48)
		tmp = Float64(y * z);
	elseif (y <= -1.05e-108)
		tmp = Float64(a * Float64(z * b));
	elseif (y <= -5e-282)
		tmp = x;
	elseif (y <= 6.5e-214)
		tmp = Float64(t * a);
	elseif (y <= 5.6e-170)
		tmp = x;
	elseif (y <= 1.7e+98)
		tmp = Float64(t * a);
	else
		tmp = Float64(y * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -9.5e+48)
		tmp = y * z;
	elseif (y <= -1.05e-108)
		tmp = a * (z * b);
	elseif (y <= -5e-282)
		tmp = x;
	elseif (y <= 6.5e-214)
		tmp = t * a;
	elseif (y <= 5.6e-170)
		tmp = x;
	elseif (y <= 1.7e+98)
		tmp = t * a;
	else
		tmp = y * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -9.5e+48], N[(y * z), $MachinePrecision], If[LessEqual[y, -1.05e-108], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5e-282], x, If[LessEqual[y, 6.5e-214], N[(t * a), $MachinePrecision], If[LessEqual[y, 5.6e-170], x, If[LessEqual[y, 1.7e+98], N[(t * a), $MachinePrecision], N[(y * z), $MachinePrecision]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq -5 \cdot 10^{-282}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;y \leq 5.6 \cdot 10^{-170}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.7 \cdot 10^{+98}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -9.4999999999999997e48 or 1.69999999999999986e98 < y

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

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

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

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

        \[\leadsto \color{blue}{z \cdot y} \]
    7. Simplified63.3%

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

    if -9.4999999999999997e48 < y < -1.05e-108

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

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

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

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

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

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

    if -1.05e-108 < y < -5.0000000000000001e-282 or 6.5000000000000004e-214 < y < 5.59999999999999991e-170

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

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

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

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

    if -5.0000000000000001e-282 < y < 6.5000000000000004e-214 or 5.59999999999999991e-170 < y < 1.69999999999999986e98

    1. Initial program 97.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+97.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*98.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{+48}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq -1.05 \cdot 10^{-108}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;y \leq -5 \cdot 10^{-282}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{-214}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{-170}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{+98}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 81.7% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;x \leq 3350000:\\
\;\;\;\;\left(z \cdot a\right) \cdot b + t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -9.49999999999999939e110

    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*92.1%

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

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

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

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

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

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

    if -9.49999999999999939e110 < x < 3.35e6

    1. Initial program 95.4%

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

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

    if 3.35e6 < x

    1. Initial program 92.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+92.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.3%

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

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

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

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

Alternative 6: 84.5% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \leq 1.52 \cdot 10^{-120}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 + y \cdot z\\


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

    1. Initial program 88.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+88.2%

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

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

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

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

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

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

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

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

    if -8.1999999999999999e82 < a < 1.52e-120

    1. Initial program 97.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+97.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*92.3%

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

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

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

    if 1.52e-120 < a

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 92.8% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 3.7000000000000002e180

    1. Initial program 94.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+94.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*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

    if 3.7000000000000002e180 < z

    1. Initial program 78.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+78.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*70.1%

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

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

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

Alternative 8: 79.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+50} \lor \neg \left(y \leq 1.85 \cdot 10^{+129}\right):\\
\;\;\;\;x + y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.0000000000000003e50 or 1.84999999999999989e129 < y

    1. Initial program 88.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+88.2%

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

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

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

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

    if -4.0000000000000003e50 < y < 1.84999999999999989e129

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

Alternative 9: 86.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \cdot 10^{+82} \lor \neg \left(a \leq 1.35 \cdot 10^{+75}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.1000000000000001e82 or 1.34999999999999999e75 < a

    1. Initial program 84.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+84.9%

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

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

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

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

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

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

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

    if -1.1000000000000001e82 < a < 1.34999999999999999e75

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

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

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

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

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

Alternative 10: 74.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.2 \cdot 10^{-25} \lor \neg \left(a \leq 5 \cdot 10^{-33}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -7.1999999999999998e-25 or 5.00000000000000028e-33 < a

    1. Initial program 88.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+88.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*92.2%

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

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

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

    if -7.1999999999999998e-25 < a < 5.00000000000000028e-33

    1. Initial program 98.4%

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

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

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

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

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

Alternative 11: 59.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{+65} \lor \neg \left(a \leq 5.5 \cdot 10^{+140}\right):\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.35000000000000009e65 or 5.5e140 < a

    1. Initial program 85.7%

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

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

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

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

    if -1.35000000000000009e65 < a < 5.5e140

    1. Initial program 97.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+97.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*93.3%

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

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

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

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

Alternative 12: 64.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -850000000000 \lor \neg \left(y \leq 1.5 \cdot 10^{+98}\right):\\
\;\;\;\;x + y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.5e11 or 1.5000000000000001e98 < y

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

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

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

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

    if -8.5e11 < y < 1.5000000000000001e98

    1. Initial program 97.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+97.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*95.7%

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

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

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

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

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

Alternative 13: 38.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.3 \cdot 10^{-25} \lor \neg \left(a \leq 4.6 \cdot 10^{-54}\right):\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.3e-25 or 4.5999999999999998e-54 < a

    1. Initial program 88.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+88.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*92.4%

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

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

    if -1.3e-25 < a < 4.5999999999999998e-54

    1. Initial program 98.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+98.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*91.4%

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

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

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

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

Alternative 14: 26.1% accurate, 15.0× speedup?

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification25.3%

    \[\leadsto x \]
  7. Add Preprocessing

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

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

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