Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.3% → 95.4%
Time: 10.4s
Alternatives: 11
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 11 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.3% 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: 95.4% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot z\\ \mathbf{if}\;\left(t_1 + t \cdot a\right) + \left(z \cdot a\right) \cdot b \leq \infty:\\ \;\;\;\;t_1 + \mathsf{fma}\left(t, a, z \cdot \left(a \cdot b\right)\right)\\ \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))))
   (if (<= (+ (+ t_1 (* t a)) (* (* z a) b)) INFINITY)
     (+ t_1 (fma t a (* z (* a b))))
     (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (y * z);
	double tmp;
	if (((t_1 + (t * a)) + ((z * a) * b)) <= ((double) INFINITY)) {
		tmp = t_1 + fma(t, a, (z * (a * b)));
	} else {
		tmp = z * (y + (a * b));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(y * z))
	tmp = 0.0
	if (Float64(Float64(t_1 + Float64(t * a)) + Float64(Float64(z * a) * b)) <= Inf)
		tmp = Float64(t_1 + fma(t, a, Float64(z * Float64(a * b))));
	else
		tmp = Float64(z * Float64(y + Float64(a * b)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(t$95$1 + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 + N[(t * a + N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\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 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. *-commutative97.1%

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

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

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + z \cdot \left(a \cdot b\right)\right)} \]
    4. Step-by-step derivation
      1. fma-def98.0%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

      \[\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(x + y \cdot z\right) + \mathsf{fma}\left(t, a, z \cdot \left(a \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \end{array} \]

Alternative 2: 95.4% accurate, 0.5× speedup?

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

    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. *-commutative97.1%

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

      \[\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(x + y \cdot z\right) + \left(z \cdot \left(a \cdot b\right) + t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \end{array} \]

Alternative 3: 38.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -3.8 \cdot 10^{+52}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;a \leq -1.25 \cdot 10^{-162}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{-15}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 9.2 \cdot 10^{+52}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 7.2 \cdot 10^{+79} \lor \neg \left(a \leq 2.75 \cdot 10^{+156}\right) \land a \leq 1.08 \cdot 10^{+250}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -3.8e+52)
   (* t a)
   (if (<= a -1.25e-162)
     x
     (if (<= a 3.4e-15)
       (* y z)
       (if (<= a 9.2e+52)
         x
         (if (or (<= a 7.2e+79) (and (not (<= a 2.75e+156)) (<= a 1.08e+250)))
           (* t a)
           (* a (* z b))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -3.8e+52) {
		tmp = t * a;
	} else if (a <= -1.25e-162) {
		tmp = x;
	} else if (a <= 3.4e-15) {
		tmp = y * z;
	} else if (a <= 9.2e+52) {
		tmp = x;
	} else if ((a <= 7.2e+79) || (!(a <= 2.75e+156) && (a <= 1.08e+250))) {
		tmp = t * a;
	} else {
		tmp = a * (z * b);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (a <= (-3.8d+52)) then
        tmp = t * a
    else if (a <= (-1.25d-162)) then
        tmp = x
    else if (a <= 3.4d-15) then
        tmp = y * z
    else if (a <= 9.2d+52) then
        tmp = x
    else if ((a <= 7.2d+79) .or. (.not. (a <= 2.75d+156)) .and. (a <= 1.08d+250)) then
        tmp = t * a
    else
        tmp = a * (z * b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -3.8e+52) {
		tmp = t * a;
	} else if (a <= -1.25e-162) {
		tmp = x;
	} else if (a <= 3.4e-15) {
		tmp = y * z;
	} else if (a <= 9.2e+52) {
		tmp = x;
	} else if ((a <= 7.2e+79) || (!(a <= 2.75e+156) && (a <= 1.08e+250))) {
		tmp = t * a;
	} else {
		tmp = a * (z * b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -3.8e+52:
		tmp = t * a
	elif a <= -1.25e-162:
		tmp = x
	elif a <= 3.4e-15:
		tmp = y * z
	elif a <= 9.2e+52:
		tmp = x
	elif (a <= 7.2e+79) or (not (a <= 2.75e+156) and (a <= 1.08e+250)):
		tmp = t * a
	else:
		tmp = a * (z * b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -3.8e+52)
		tmp = Float64(t * a);
	elseif (a <= -1.25e-162)
		tmp = x;
	elseif (a <= 3.4e-15)
		tmp = Float64(y * z);
	elseif (a <= 9.2e+52)
		tmp = x;
	elseif ((a <= 7.2e+79) || (!(a <= 2.75e+156) && (a <= 1.08e+250)))
		tmp = Float64(t * a);
	else
		tmp = Float64(a * Float64(z * b));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (a <= -3.8e+52)
		tmp = t * a;
	elseif (a <= -1.25e-162)
		tmp = x;
	elseif (a <= 3.4e-15)
		tmp = y * z;
	elseif (a <= 9.2e+52)
		tmp = x;
	elseif ((a <= 7.2e+79) || (~((a <= 2.75e+156)) && (a <= 1.08e+250)))
		tmp = t * a;
	else
		tmp = a * (z * b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -3.8e+52], N[(t * a), $MachinePrecision], If[LessEqual[a, -1.25e-162], x, If[LessEqual[a, 3.4e-15], N[(y * z), $MachinePrecision], If[LessEqual[a, 9.2e+52], x, If[Or[LessEqual[a, 7.2e+79], And[N[Not[LessEqual[a, 2.75e+156]], $MachinePrecision], LessEqual[a, 1.08e+250]]], N[(t * a), $MachinePrecision], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{+52}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;a \leq -1.25 \cdot 10^{-162}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 3.4 \cdot 10^{-15}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 9.2 \cdot 10^{+52}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 7.2 \cdot 10^{+79} \lor \neg \left(a \leq 2.75 \cdot 10^{+156}\right) \land a \leq 1.08 \cdot 10^{+250}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -3.8e52 or 9.1999999999999999e52 < a < 7.1999999999999999e79 or 2.7500000000000001e156 < a < 1.08000000000000007e250

    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. *-commutative83.8%

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

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

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

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

    if -3.8e52 < a < -1.25000000000000004e-162 or 3.4e-15 < a < 9.1999999999999999e52

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

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

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

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

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

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

    if -1.25000000000000004e-162 < a < 3.4e-15

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

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

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

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

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

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

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

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

    if 7.1999999999999999e79 < a < 2.7500000000000001e156 or 1.08000000000000007e250 < a

    1. Initial program 80.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+80.7%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.8 \cdot 10^{+52}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;a \leq -1.25 \cdot 10^{-162}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{-15}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 9.2 \cdot 10^{+52}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 7.2 \cdot 10^{+79} \lor \neg \left(a \leq 2.75 \cdot 10^{+156}\right) \land a \leq 1.08 \cdot 10^{+250}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \end{array} \]

Alternative 4: 82.0% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -7.5000000000000002e-112 or 3.1999999999999999e-15 < a

    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. +-commutative86.7%

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

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

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

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

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

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

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

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

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

    if -7.5000000000000002e-112 < a < 3.1999999999999999e-15

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

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

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

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

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

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

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

Alternative 5: 87.6% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.4 \cdot 10^{+31} \lor \neg \left(a \leq 1.26 \cdot 10^{-14}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.4000000000000002e31 or 1.25999999999999996e-14 < a

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

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

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

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

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

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

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

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

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

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

    if -4.4000000000000002e31 < a < 1.25999999999999996e-14

    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. *-commutative97.7%

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

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

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

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

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

Alternative 6: 38.6% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;a \leq -9.2 \cdot 10^{-163}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 6.6 \cdot 10^{-15}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 6.5 \cdot 10^{+57}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.5e52 or 6.4999999999999997e57 < a

    1. Initial program 82.8%

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

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

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

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

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

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

    if -4.5e52 < a < -9.1999999999999997e-163 or 6.6e-15 < a < 6.4999999999999997e57

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

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

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

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

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

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

    if -9.1999999999999997e-163 < a < 6.6e-15

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.5 \cdot 10^{+52}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;a \leq -9.2 \cdot 10^{-163}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 6.6 \cdot 10^{-15}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{+57}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \]

Alternative 7: 58.5% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.32 \cdot 10^{+54}:\\
\;\;\;\;t \cdot a\\

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

\mathbf{elif}\;a \leq 2.4 \cdot 10^{+250}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.3200000000000001e54 or 1.59999999999999987e135 < a < 2.40000000000000013e250

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

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

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

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

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

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

    if -1.3200000000000001e54 < a < 1.59999999999999987e135

    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 \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{\left(z \cdot a\right)} \cdot b\right) \]
      3. associate-*l*96.9%

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

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

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

    if 2.40000000000000013e250 < a

    1. Initial program 69.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+69.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.32 \cdot 10^{+54}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;a \leq 1.6 \cdot 10^{+135}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 2.4 \cdot 10^{+250}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \end{array} \]

Alternative 8: 62.0% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_1 := x + t \cdot a\\
\mathbf{if}\;a \leq -5.2 \cdot 10^{-111}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \leq 1.1 \cdot 10^{+261}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.19999999999999965e-111 or 4.3000000000000001e67 < a < 1.09999999999999992e261

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

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

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

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

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

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

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

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

    if -5.19999999999999965e-111 < a < 4.3000000000000001e67

    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. *-commutative98.3%

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

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

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

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

    if 1.09999999999999992e261 < a

    1. Initial program 69.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+69.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.2 \cdot 10^{-111}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{elif}\;a \leq 4.3 \cdot 10^{+67}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 1.1 \cdot 10^{+261}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \end{array} \]

Alternative 9: 74.3% accurate, 1.3× speedup?

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

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

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

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

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

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

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

    if -4.2e30 < a < 5.2e52

    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. *-commutative97.9%

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

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

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

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

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

Alternative 10: 38.0% accurate, 2.1× speedup?

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

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

\mathbf{elif}\;x \leq 3.8 \cdot 10^{-69}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.05e133 or 3.7999999999999998e-69 < x

    1. Initial program 91.1%

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

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

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

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

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

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

    if -1.05e133 < x < 3.7999999999999998e-69

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.05 \cdot 10^{+133}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{-69}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 11: 26.2% accurate, 15.0× speedup?

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification24.1%

    \[\leadsto x \]

Developer target: 97.3% 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 2023308 
(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)))