Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 91.9% → 94.2%
Time: 11.1s
Alternatives: 15
Speedup: 0.9×

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 15 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: 91.9% accurate, 1.0× speedup?

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

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

Alternative 1: 94.2% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\right)
\end{array}
Derivation
  1. Initial program 94.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+94.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 93.6% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)
\end{array}
Derivation
  1. Initial program 94.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+94.3%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 95.0% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 69.6% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;a \leq -9.8 \cdot 10^{-164}:\\
\;\;\;\;t_1\\

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

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

\mathbf{elif}\;a \leq 250:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -6e-52 or 250 < a

    1. Initial program 89.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+89.3%

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

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

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

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

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

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

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

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

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

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

    if -6e-52 < a < -9.7999999999999993e-164 or 1.20000000000000005e-134 < a < 250

    1. Initial program 100.0%

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

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

        \[\leadsto \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 t around inf 87.5%

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

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

    if -9.7999999999999993e-164 < a < -2.3999999999999999e-233

    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(y \cdot z + x\right)} + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right) \]
      3. fma-def99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3999999999999999e-233 < a < 1.20000000000000005e-134

    1. Initial program 100.0%

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

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

        \[\leadsto \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 a around 0 95.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6 \cdot 10^{-52}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq -9.8 \cdot 10^{-164}:\\ \;\;\;\;z \cdot y + a \cdot t\\ \mathbf{elif}\;a \leq -2.4 \cdot 10^{-233}:\\ \;\;\;\;x + b \cdot \left(a \cdot z\right)\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{-134}:\\ \;\;\;\;x + z \cdot y\\ \mathbf{elif}\;a \leq 250:\\ \;\;\;\;z \cdot y + a \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \]

Alternative 5: 80.0% accurate, 0.9× speedup?

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

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

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

\mathbf{elif}\;a \leq -3.1 \cdot 10^{-201} \lor \neg \left(a \leq 1.75 \cdot 10^{-126}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.99999999999999998e-65 or -4.5999999999999999e-163 < a < -3.0999999999999999e-201 or 1.75e-126 < a

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

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

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

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

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

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

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

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

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

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

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

    if -2.99999999999999998e-65 < a < -4.5999999999999999e-163

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

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

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

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

    if -3.0999999999999999e-201 < a < 1.75e-126

    1. Initial program 100.0%

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

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

        \[\leadsto \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 a around 0 94.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3 \cdot 10^{-65}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq -4.6 \cdot 10^{-163}:\\ \;\;\;\;z \cdot y + a \cdot t\\ \mathbf{elif}\;a \leq -3.1 \cdot 10^{-201} \lor \neg \left(a \leq 1.75 \cdot 10^{-126}\right):\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot y\\ \end{array} \]

Alternative 6: 92.7% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.00000000000000048e220

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

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

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

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

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

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

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

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

    if -6.00000000000000048e220 < a

    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. *-commutative95.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*96.3%

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

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

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

Alternative 7: 82.5% accurate, 1.0× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

    if -1.45000000000000008e78 < x < 2.2999999999999999e89

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

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

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

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

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

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

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

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

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

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

    if 2.2999999999999999e89 < x

    1. Initial program 90.5%

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

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

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

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

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

Alternative 8: 39.1% accurate, 1.1× speedup?

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

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

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

\mathbf{elif}\;x \leq -6 \cdot 10^{-98}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;x \leq -2.4 \cdot 10^{-293}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;x \leq 4.6 \cdot 10^{+91}:\\
\;\;\;\;a \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.0999999999999999e109 or 4.59999999999999982e91 < x

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

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

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

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

    if -5.0999999999999999e109 < x < -6.4999999999999998e37 or -6e-98 < x < -2.3999999999999999e-293

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

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

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

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

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

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

    if -6.4999999999999998e37 < x < -6e-98 or -2.3999999999999999e-293 < x < 4.59999999999999982e91

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.1 \cdot 10^{+109}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -6.5 \cdot 10^{+37}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;x \leq -6 \cdot 10^{-98}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;x \leq -2.4 \cdot 10^{-293}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{+91}:\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 9: 86.6% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.6000000000000002e-37 or 4.80000000000000004e-27 < a

    1. Initial program 89.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+89.8%

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

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

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

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

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

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

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

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

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

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

    if -5.6000000000000002e-37 < a < 4.80000000000000004e-27

    1. Initial program 100.0%

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

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

        \[\leadsto \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 t around 0 85.6%

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

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

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

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

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

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

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

Alternative 10: 86.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.5 \cdot 10^{-53} \lor \neg \left(a \leq 400000\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.49999999999999993e-53 or 4e5 < a

    1. Initial program 89.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+89.3%

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

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

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

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

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

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

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

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

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

    if -3.49999999999999993e-53 < a < 4e5

    1. Initial program 100.0%

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

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

        \[\leadsto \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 t around inf 90.5%

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

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

Alternative 11: 57.1% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;a \leq -2.55 \cdot 10^{+38} \lor \neg \left(a \leq 9.5 \cdot 10^{-27}\right):\\
\;\;\;\;a \cdot t\\

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


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

    1. Initial program 77.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+77.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.7999999999999999e243 < a < -2.5500000000000001e38 or 9.50000000000000037e-27 < a

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

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

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

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

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

    if -2.5500000000000001e38 < a < 9.50000000000000037e-27

    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 \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 a around 0 75.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.8 \cdot 10^{+243}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -2.55 \cdot 10^{+38} \lor \neg \left(a \leq 9.5 \cdot 10^{-27}\right):\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot y\\ \end{array} \]

Alternative 12: 71.3% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.75 \cdot 10^{-51} \lor \neg \left(a \leq 1.85 \cdot 10^{-126}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.7499999999999999e-51 or 1.85e-126 < a

    1. Initial program 90.7%

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

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

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

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

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

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

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

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

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

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

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

    if -1.7499999999999999e-51 < a < 1.85e-126

    1. Initial program 100.0%

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

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

        \[\leadsto \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 a around 0 84.8%

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

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

Alternative 13: 62.0% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.5 \cdot 10^{-47} \lor \neg \left(a \leq 1.85 \cdot 10^{-126}\right):\\
\;\;\;\;x + a \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.50000000000000008e-47 or 1.85e-126 < a

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

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

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

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

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

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

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

    if -1.50000000000000008e-47 < a < 1.85e-126

    1. Initial program 100.0%

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

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

        \[\leadsto \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 a around 0 84.0%

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

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

Alternative 14: 38.6% accurate, 2.1× speedup?

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

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

\mathbf{elif}\;x \leq 4.2 \cdot 10^{+91}:\\
\;\;\;\;a \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.49999999999999955e77 or 4.20000000000000015e91 < x

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

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

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

    if -7.49999999999999955e77 < x < 4.20000000000000015e91

    1. Initial program 96.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.5 \cdot 10^{+77}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{+91}:\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 15: 25.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.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+94.3%

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification25.7%

    \[\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 2023310 
(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)))