Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.4% → 96.4%
Time: 7.0s
Alternatives: 13
Speedup: 0.5×

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

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

Initial Program: 92.4% 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.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z \cdot a\right) \cdot b + \left(t \cdot a + \left(x + y \cdot z\right)\right)\\ \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 (+ (* (* z a) b) (+ (* t a) (+ x (* y z))))))
   (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 = ((z * a) * b) + ((t * a) + (x + (y * z)));
	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 = ((z * a) * b) + ((t * a) + (x + (y * z)));
	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 = ((z * a) * b) + ((t * a) + (x + (y * z)))
	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(z * a) * b) + Float64(Float64(t * a) + Float64(x + Float64(y * z))))
	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 = ((z * a) * b) + ((t * a) + (x + (y * z)));
	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[(z * a), $MachinePrecision] * b), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $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(z \cdot a\right) \cdot b + \left(t \cdot a + \left(x + y \cdot z\right)\right)\\
\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 99.2%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]

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

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

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

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

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

Alternative 2: 37.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;z \leq -8.5 \cdot 10^{+68}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-222}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-206}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;z \leq 2.65 \cdot 10^{-98}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 0.32:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;z \leq 4 \cdot 10^{+37}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{+47}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* z b))))
   (if (<= z -8.5e+68)
     t_1
     (if (<= z -4.2e-222)
       x
       (if (<= z 1.95e-206)
         (* t a)
         (if (<= z 2.65e-98)
           x
           (if (<= z 0.32)
             (* t a)
             (if (<= z 4e+37) x (if (<= z 3.1e+47) (* t a) t_1)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (z <= -8.5e+68) {
		tmp = t_1;
	} else if (z <= -4.2e-222) {
		tmp = x;
	} else if (z <= 1.95e-206) {
		tmp = t * a;
	} else if (z <= 2.65e-98) {
		tmp = x;
	} else if (z <= 0.32) {
		tmp = t * a;
	} else if (z <= 4e+37) {
		tmp = x;
	} else if (z <= 3.1e+47) {
		tmp = t * a;
	} 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 * (z * b)
    if (z <= (-8.5d+68)) then
        tmp = t_1
    else if (z <= (-4.2d-222)) then
        tmp = x
    else if (z <= 1.95d-206) then
        tmp = t * a
    else if (z <= 2.65d-98) then
        tmp = x
    else if (z <= 0.32d0) then
        tmp = t * a
    else if (z <= 4d+37) then
        tmp = x
    else if (z <= 3.1d+47) then
        tmp = t * a
    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 * (z * b);
	double tmp;
	if (z <= -8.5e+68) {
		tmp = t_1;
	} else if (z <= -4.2e-222) {
		tmp = x;
	} else if (z <= 1.95e-206) {
		tmp = t * a;
	} else if (z <= 2.65e-98) {
		tmp = x;
	} else if (z <= 0.32) {
		tmp = t * a;
	} else if (z <= 4e+37) {
		tmp = x;
	} else if (z <= 3.1e+47) {
		tmp = t * a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (z * b)
	tmp = 0
	if z <= -8.5e+68:
		tmp = t_1
	elif z <= -4.2e-222:
		tmp = x
	elif z <= 1.95e-206:
		tmp = t * a
	elif z <= 2.65e-98:
		tmp = x
	elif z <= 0.32:
		tmp = t * a
	elif z <= 4e+37:
		tmp = x
	elif z <= 3.1e+47:
		tmp = t * a
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(z * b))
	tmp = 0.0
	if (z <= -8.5e+68)
		tmp = t_1;
	elseif (z <= -4.2e-222)
		tmp = x;
	elseif (z <= 1.95e-206)
		tmp = Float64(t * a);
	elseif (z <= 2.65e-98)
		tmp = x;
	elseif (z <= 0.32)
		tmp = Float64(t * a);
	elseif (z <= 4e+37)
		tmp = x;
	elseif (z <= 3.1e+47)
		tmp = Float64(t * a);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (z * b);
	tmp = 0.0;
	if (z <= -8.5e+68)
		tmp = t_1;
	elseif (z <= -4.2e-222)
		tmp = x;
	elseif (z <= 1.95e-206)
		tmp = t * a;
	elseif (z <= 2.65e-98)
		tmp = x;
	elseif (z <= 0.32)
		tmp = t * a;
	elseif (z <= 4e+37)
		tmp = x;
	elseif (z <= 3.1e+47)
		tmp = t * a;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e+68], t$95$1, If[LessEqual[z, -4.2e-222], x, If[LessEqual[z, 1.95e-206], N[(t * a), $MachinePrecision], If[LessEqual[z, 2.65e-98], x, If[LessEqual[z, 0.32], N[(t * a), $MachinePrecision], If[LessEqual[z, 4e+37], x, If[LessEqual[z, 3.1e+47], N[(t * a), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -4.2 \cdot 10^{-222}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.95 \cdot 10^{-206}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;z \leq 2.65 \cdot 10^{-98}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 0.32:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;z \leq 4 \cdot 10^{+37}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 3.1 \cdot 10^{+47}:\\
\;\;\;\;t \cdot a\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.49999999999999966e68 or 3.1000000000000001e47 < z

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

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

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

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

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

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

    if -8.49999999999999966e68 < z < -4.1999999999999998e-222 or 1.95000000000000004e-206 < z < 2.65000000000000015e-98 or 0.320000000000000007 < z < 3.99999999999999982e37

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

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

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

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

    if -4.1999999999999998e-222 < z < 1.95000000000000004e-206 or 2.65000000000000015e-98 < z < 0.320000000000000007 or 3.99999999999999982e37 < z < 3.1000000000000001e47

    1. Initial program 100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+68}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-222}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-206}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;z \leq 2.65 \cdot 10^{-98}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 0.32:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;z \leq 4 \cdot 10^{+37}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{+47}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \end{array} \]

Alternative 3: 38.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(a \cdot b\right)\\ \mathbf{if}\;z \leq -8.5 \cdot 10^{+68}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-221}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-209}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-98}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{-10}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;z \leq 3.95 \cdot 10^{+37}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7.1 \cdot 10^{+47}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* z (* a b))))
   (if (<= z -8.5e+68)
     t_1
     (if (<= z -6e-221)
       x
       (if (<= z 1.7e-209)
         (* t a)
         (if (<= z 5.5e-98)
           x
           (if (<= z 4.7e-10)
             (* t a)
             (if (<= z 3.95e+37) x (if (<= z 7.1e+47) (* t a) t_1)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = z * (a * b);
	double tmp;
	if (z <= -8.5e+68) {
		tmp = t_1;
	} else if (z <= -6e-221) {
		tmp = x;
	} else if (z <= 1.7e-209) {
		tmp = t * a;
	} else if (z <= 5.5e-98) {
		tmp = x;
	} else if (z <= 4.7e-10) {
		tmp = t * a;
	} else if (z <= 3.95e+37) {
		tmp = x;
	} else if (z <= 7.1e+47) {
		tmp = t * a;
	} 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 * (a * b)
    if (z <= (-8.5d+68)) then
        tmp = t_1
    else if (z <= (-6d-221)) then
        tmp = x
    else if (z <= 1.7d-209) then
        tmp = t * a
    else if (z <= 5.5d-98) then
        tmp = x
    else if (z <= 4.7d-10) then
        tmp = t * a
    else if (z <= 3.95d+37) then
        tmp = x
    else if (z <= 7.1d+47) then
        tmp = t * a
    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 * (a * b);
	double tmp;
	if (z <= -8.5e+68) {
		tmp = t_1;
	} else if (z <= -6e-221) {
		tmp = x;
	} else if (z <= 1.7e-209) {
		tmp = t * a;
	} else if (z <= 5.5e-98) {
		tmp = x;
	} else if (z <= 4.7e-10) {
		tmp = t * a;
	} else if (z <= 3.95e+37) {
		tmp = x;
	} else if (z <= 7.1e+47) {
		tmp = t * a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = z * (a * b)
	tmp = 0
	if z <= -8.5e+68:
		tmp = t_1
	elif z <= -6e-221:
		tmp = x
	elif z <= 1.7e-209:
		tmp = t * a
	elif z <= 5.5e-98:
		tmp = x
	elif z <= 4.7e-10:
		tmp = t * a
	elif z <= 3.95e+37:
		tmp = x
	elif z <= 7.1e+47:
		tmp = t * a
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(z * Float64(a * b))
	tmp = 0.0
	if (z <= -8.5e+68)
		tmp = t_1;
	elseif (z <= -6e-221)
		tmp = x;
	elseif (z <= 1.7e-209)
		tmp = Float64(t * a);
	elseif (z <= 5.5e-98)
		tmp = x;
	elseif (z <= 4.7e-10)
		tmp = Float64(t * a);
	elseif (z <= 3.95e+37)
		tmp = x;
	elseif (z <= 7.1e+47)
		tmp = Float64(t * a);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = z * (a * b);
	tmp = 0.0;
	if (z <= -8.5e+68)
		tmp = t_1;
	elseif (z <= -6e-221)
		tmp = x;
	elseif (z <= 1.7e-209)
		tmp = t * a;
	elseif (z <= 5.5e-98)
		tmp = x;
	elseif (z <= 4.7e-10)
		tmp = t * a;
	elseif (z <= 3.95e+37)
		tmp = x;
	elseif (z <= 7.1e+47)
		tmp = t * a;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e+68], t$95$1, If[LessEqual[z, -6e-221], x, If[LessEqual[z, 1.7e-209], N[(t * a), $MachinePrecision], If[LessEqual[z, 5.5e-98], x, If[LessEqual[z, 4.7e-10], N[(t * a), $MachinePrecision], If[LessEqual[z, 3.95e+37], x, If[LessEqual[z, 7.1e+47], N[(t * a), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq 1.7 \cdot 10^{-209}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;z \leq 5.5 \cdot 10^{-98}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 4.7 \cdot 10^{-10}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;z \leq 3.95 \cdot 10^{+37}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 7.1 \cdot 10^{+47}:\\
\;\;\;\;t \cdot a\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.49999999999999966e68 or 7.1000000000000002e47 < z

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

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

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

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

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

    if -8.49999999999999966e68 < z < -6.0000000000000003e-221 or 1.69999999999999994e-209 < z < 5.4999999999999997e-98 or 4.7000000000000003e-10 < z < 3.9500000000000001e37

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

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

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

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

    if -6.0000000000000003e-221 < z < 1.69999999999999994e-209 or 5.4999999999999997e-98 < z < 4.7000000000000003e-10 or 3.9500000000000001e37 < z < 7.1000000000000002e47

    1. Initial program 100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+68}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-221}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-209}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-98}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{-10}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;z \leq 3.95 \cdot 10^{+37}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7.1 \cdot 10^{+47}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \end{array} \]

Alternative 4: 92.2% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -7.5000000000000004e174

    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. +-commutative97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.5000000000000004e174 < b < 8.0000000000000004e238

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

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

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

    if 8.0000000000000004e238 < b

    1. Initial program 66.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+66.7%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7.5 \cdot 10^{+174}:\\ \;\;\;\;x + \left(\left(z \cdot a\right) \cdot b + t \cdot a\right)\\ \mathbf{elif}\;b \leq 8 \cdot 10^{+238}:\\ \;\;\;\;\left(t \cdot a + a \cdot \left(z \cdot b\right)\right) + \left(x + y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]

Alternative 5: 72.6% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;z \leq -4.7 \cdot 10^{-66}:\\
\;\;\;\;x + y \cdot z\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.49999999999999966e68 or 1.7e54 < z

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

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

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

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

    if -8.49999999999999966e68 < z < -4.6999999999999999e-66

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

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

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

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

    if -4.6999999999999999e-66 < z < 1.7e54

    1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*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. Taylor expanded in z around 0 78.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+68}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;z \leq -4.7 \cdot 10^{-66}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+54}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \end{array} \]

Alternative 6: 82.3% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+97} \lor \neg \left(z \leq 2.85 \cdot 10^{+107}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.0000000000000001e97 or 2.84999999999999986e107 < z

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

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

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

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

    if -7.0000000000000001e97 < z < 2.84999999999999986e107

    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. +-commutative99.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+97} \lor \neg \left(z \leq 2.85 \cdot 10^{+107}\right):\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]

Alternative 7: 87.6% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.5e21 or 1.15e-104 < a

    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. +-commutative90.2%

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

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

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

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

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

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

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

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

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

    if -4.5e21 < a < 1.15e-104

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.5 \cdot 10^{+21} \lor \neg \left(a \leq 1.15 \cdot 10^{-104}\right):\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot a + \left(x + y \cdot z\right)\\ \end{array} \]

Alternative 8: 83.7% accurate, 1.1× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -3.6500000000000002e174

    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. +-commutative97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.6500000000000002e174 < b < 6e-98

    1. Initial program 95.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+95.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*96.5%

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

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

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

    if 6e-98 < b

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.65 \cdot 10^{+174}:\\ \;\;\;\;x + \left(\left(z \cdot a\right) \cdot b + t \cdot a\right)\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-98}:\\ \;\;\;\;t \cdot a + \left(x + y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]

Alternative 9: 39.7% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5200000:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -1.95 \cdot 10^{-306}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{+35}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x -5200000.0)
   x
   (if (<= x -1.95e-306) (* t a) (if (<= x 5.2e+35) (* y z) x))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -5200000.0) {
		tmp = x;
	} else if (x <= -1.95e-306) {
		tmp = t * a;
	} else if (x <= 5.2e+35) {
		tmp = y * z;
	} 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 <= (-5200000.0d0)) then
        tmp = x
    else if (x <= (-1.95d-306)) then
        tmp = t * a
    else if (x <= 5.2d+35) then
        tmp = y * z
    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 <= -5200000.0) {
		tmp = x;
	} else if (x <= -1.95e-306) {
		tmp = t * a;
	} else if (x <= 5.2e+35) {
		tmp = y * z;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -5200000.0:
		tmp = x
	elif x <= -1.95e-306:
		tmp = t * a
	elif x <= 5.2e+35:
		tmp = y * z
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -5200000.0)
		tmp = x;
	elseif (x <= -1.95e-306)
		tmp = Float64(t * a);
	elseif (x <= 5.2e+35)
		tmp = Float64(y * z);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (x <= -5200000.0)
		tmp = x;
	elseif (x <= -1.95e-306)
		tmp = t * a;
	elseif (x <= 5.2e+35)
		tmp = y * z;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -5200000.0], x, If[LessEqual[x, -1.95e-306], N[(t * a), $MachinePrecision], If[LessEqual[x, 5.2e+35], N[(y * z), $MachinePrecision], x]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5200000:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq -1.95 \cdot 10^{-306}:\\
\;\;\;\;t \cdot a\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.2e6 or 5.20000000000000013e35 < x

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

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

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

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

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

    if -5.2e6 < x < -1.95e-306

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

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

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

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

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

    if -1.95e-306 < x < 5.20000000000000013e35

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5200000:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -1.95 \cdot 10^{-306}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{+35}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 10: 59.3% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+97} \lor \neg \left(z \leq 8.2 \cdot 10^{+80}\right):\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.0000000000000001e97 or 8.20000000000000003e80 < z

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

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

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

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

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

    if -7.0000000000000001e97 < z < 8.20000000000000003e80

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+97} \lor \neg \left(z \leq 8.2 \cdot 10^{+80}\right):\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot a\\ \end{array} \]

Alternative 11: 63.4% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.2 \cdot 10^{+42} \lor \neg \left(y \leq 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 -5.2e+42) (not (<= y 98.0))) (+ x (* y z)) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -5.2e+42) || !(y <= 98.0)) {
		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 <= (-5.2d+42)) .or. (.not. (y <= 98.0d0))) 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 <= -5.2e+42) || !(y <= 98.0)) {
		tmp = x + (y * z);
	} else {
		tmp = x + (t * a);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (y <= -5.2e+42) or not (y <= 98.0):
		tmp = x + (y * z)
	else:
		tmp = x + (t * a)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((y <= -5.2e+42) || !(y <= 98.0))
		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 <= -5.2e+42) || ~((y <= 98.0)))
		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, -5.2e+42], N[Not[LessEqual[y, 98.0]], $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 -5.2 \cdot 10^{+42} \lor \neg \left(y \leq 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 < -5.1999999999999998e42 or 98 < y

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

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

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

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

    if -5.1999999999999998e42 < y < 98

    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. 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. Taylor expanded in z around 0 64.0%

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

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

Alternative 12: 39.8% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -122000000:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{+39}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x -122000000.0) x (if (<= x 1.4e+39) (* t a) x)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -122000000.0) {
		tmp = x;
	} else if (x <= 1.4e+39) {
		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 (x <= (-122000000.0d0)) then
        tmp = x
    else if (x <= 1.4d+39) 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 (x <= -122000000.0) {
		tmp = x;
	} else if (x <= 1.4e+39) {
		tmp = t * a;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -122000000.0:
		tmp = x
	elif x <= 1.4e+39:
		tmp = t * a
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -122000000.0)
		tmp = x;
	elseif (x <= 1.4e+39)
		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 (x <= -122000000.0)
		tmp = x;
	elseif (x <= 1.4e+39)
		tmp = t * a;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -122000000.0], x, If[LessEqual[x, 1.4e+39], N[(t * a), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -122000000:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.4 \cdot 10^{+39}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.22e8 or 1.40000000000000001e39 < x

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

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

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

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

    if -1.22e8 < x < 1.40000000000000001e39

    1. Initial program 94.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+94.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*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. Taylor expanded in t around inf 71.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -122000000:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{+39}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 13: 26.4% 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 94.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+94.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*91.1%

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification31.2%

    \[\leadsto x \]

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

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

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