Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.8% → 98.8%
Time: 7.2s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 92.8% 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: 98.8% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -5 \cdot 10^{-74} \lor \neg \left(a \leq 2 \cdot 10^{-24}\right):\\ \;\;\;\;\mathsf{fma}\left(y, z, \mathsf{fma}\left(a, \mathsf{fma}\left(z, b, t\right), x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot t + \left(x + y \cdot z\right)\right) + b \cdot \left(a \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= a -5e-74) (not (<= a 2e-24)))
   (fma y z (fma a (fma z b t) x))
   (+ (+ (* a t) (+ x (* y z))) (* b (* a z)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -5e-74) || !(a <= 2e-24)) {
		tmp = fma(y, z, fma(a, fma(z, b, t), x));
	} else {
		tmp = ((a * t) + (x + (y * z))) + (b * (a * z));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((a <= -5e-74) || !(a <= 2e-24))
		tmp = fma(y, z, fma(a, fma(z, b, t), x));
	else
		tmp = Float64(Float64(Float64(a * t) + Float64(x + Float64(y * z))) + Float64(b * Float64(a * z)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -5e-74], N[Not[LessEqual[a, 2e-24]], $MachinePrecision]], N[(y * z + N[(a * N[(z * b + t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * t), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5 \cdot 10^{-74} \lor \neg \left(a \leq 2 \cdot 10^{-24}\right):\\
\;\;\;\;\mathsf{fma}\left(y, z, \mathsf{fma}\left(a, \mathsf{fma}\left(z, b, t\right), x\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.99999999999999998e-74 or 1.99999999999999985e-24 < a

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999998e-74 < a < 1.99999999999999985e-24

    1. Initial program 100.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
  3. Recombined 2 regimes into one program.
  4. Final simplification100.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5 \cdot 10^{-74} \lor \neg \left(a \leq 2 \cdot 10^{-24}\right):\\ \;\;\;\;\mathsf{fma}\left(y, z, \mathsf{fma}\left(a, \mathsf{fma}\left(z, b, t\right), x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot t + \left(x + y \cdot z\right)\right) + b \cdot \left(a \cdot z\right)\\ \end{array} \]

Alternative 2: 97.0% accurate, 0.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.99999999999999999e-73

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999999e-73 < a

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{-73}:\\ \;\;\;\;\mathsf{fma}\left(y, z, \mathsf{fma}\left(a, \mathsf{fma}\left(z, b, t\right), x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\ \end{array} \]

Alternative 3: 61.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + b \cdot \left(a \cdot z\right)\\ t_2 := z \cdot \left(y + a \cdot b\right)\\ t_3 := x + y \cdot z\\ \mathbf{if}\;a \leq -4.2 \cdot 10^{+176}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -1.16 \cdot 10^{+63}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -8.2 \cdot 10^{-74}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{-56}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{-15}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{+44}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{+203}:\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* b (* a z))))
        (t_2 (* z (+ y (* a b))))
        (t_3 (+ x (* y z))))
   (if (<= a -4.2e+176)
     (* a t)
     (if (<= a -1.16e+63)
       t_2
       (if (<= a -8.2e-74)
         t_1
         (if (<= a 7.5e-56)
           t_3
           (if (<= a 1.35e-15)
             t_2
             (if (<= a 6.5e+44) t_3 (if (<= a 4.2e+203) (* a t) t_1)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (b * (a * z));
	double t_2 = z * (y + (a * b));
	double t_3 = x + (y * z);
	double tmp;
	if (a <= -4.2e+176) {
		tmp = a * t;
	} else if (a <= -1.16e+63) {
		tmp = t_2;
	} else if (a <= -8.2e-74) {
		tmp = t_1;
	} else if (a <= 7.5e-56) {
		tmp = t_3;
	} else if (a <= 1.35e-15) {
		tmp = t_2;
	} else if (a <= 6.5e+44) {
		tmp = t_3;
	} else if (a <= 4.2e+203) {
		tmp = a * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = x + (b * (a * z))
    t_2 = z * (y + (a * b))
    t_3 = x + (y * z)
    if (a <= (-4.2d+176)) then
        tmp = a * t
    else if (a <= (-1.16d+63)) then
        tmp = t_2
    else if (a <= (-8.2d-74)) then
        tmp = t_1
    else if (a <= 7.5d-56) then
        tmp = t_3
    else if (a <= 1.35d-15) then
        tmp = t_2
    else if (a <= 6.5d+44) then
        tmp = t_3
    else if (a <= 4.2d+203) then
        tmp = a * t
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (b * (a * z));
	double t_2 = z * (y + (a * b));
	double t_3 = x + (y * z);
	double tmp;
	if (a <= -4.2e+176) {
		tmp = a * t;
	} else if (a <= -1.16e+63) {
		tmp = t_2;
	} else if (a <= -8.2e-74) {
		tmp = t_1;
	} else if (a <= 7.5e-56) {
		tmp = t_3;
	} else if (a <= 1.35e-15) {
		tmp = t_2;
	} else if (a <= 6.5e+44) {
		tmp = t_3;
	} else if (a <= 4.2e+203) {
		tmp = a * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (b * (a * z))
	t_2 = z * (y + (a * b))
	t_3 = x + (y * z)
	tmp = 0
	if a <= -4.2e+176:
		tmp = a * t
	elif a <= -1.16e+63:
		tmp = t_2
	elif a <= -8.2e-74:
		tmp = t_1
	elif a <= 7.5e-56:
		tmp = t_3
	elif a <= 1.35e-15:
		tmp = t_2
	elif a <= 6.5e+44:
		tmp = t_3
	elif a <= 4.2e+203:
		tmp = a * t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(b * Float64(a * z)))
	t_2 = Float64(z * Float64(y + Float64(a * b)))
	t_3 = Float64(x + Float64(y * z))
	tmp = 0.0
	if (a <= -4.2e+176)
		tmp = Float64(a * t);
	elseif (a <= -1.16e+63)
		tmp = t_2;
	elseif (a <= -8.2e-74)
		tmp = t_1;
	elseif (a <= 7.5e-56)
		tmp = t_3;
	elseif (a <= 1.35e-15)
		tmp = t_2;
	elseif (a <= 6.5e+44)
		tmp = t_3;
	elseif (a <= 4.2e+203)
		tmp = Float64(a * t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (b * (a * z));
	t_2 = z * (y + (a * b));
	t_3 = x + (y * z);
	tmp = 0.0;
	if (a <= -4.2e+176)
		tmp = a * t;
	elseif (a <= -1.16e+63)
		tmp = t_2;
	elseif (a <= -8.2e-74)
		tmp = t_1;
	elseif (a <= 7.5e-56)
		tmp = t_3;
	elseif (a <= 1.35e-15)
		tmp = t_2;
	elseif (a <= 6.5e+44)
		tmp = t_3;
	elseif (a <= 4.2e+203)
		tmp = a * t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.2e+176], N[(a * t), $MachinePrecision], If[LessEqual[a, -1.16e+63], t$95$2, If[LessEqual[a, -8.2e-74], t$95$1, If[LessEqual[a, 7.5e-56], t$95$3, If[LessEqual[a, 1.35e-15], t$95$2, If[LessEqual[a, 6.5e+44], t$95$3, If[LessEqual[a, 4.2e+203], N[(a * t), $MachinePrecision], t$95$1]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.16 \cdot 10^{+63}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq -8.2 \cdot 10^{-74}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 7.5 \cdot 10^{-56}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;a \leq 1.35 \cdot 10^{-15}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 6.5 \cdot 10^{+44}:\\
\;\;\;\;t_3\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -4.1999999999999998e176 or 6.50000000000000018e44 < a < 4.19999999999999967e203

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.1999999999999998e176 < a < -1.15999999999999994e63 or 7.50000000000000041e-56 < a < 1.35000000000000005e-15

    1. Initial program 85.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. +-commutative85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.15999999999999994e63 < a < -8.20000000000000063e-74 or 4.19999999999999967e203 < a

    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. +-commutative95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.20000000000000063e-74 < a < 7.50000000000000041e-56 or 1.35000000000000005e-15 < a < 6.50000000000000018e44

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.2 \cdot 10^{+176}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -1.16 \cdot 10^{+63}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;a \leq -8.2 \cdot 10^{-74}:\\ \;\;\;\;x + b \cdot \left(a \cdot z\right)\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{-56}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{-15}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{+44}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{+203}:\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + b \cdot \left(a \cdot z\right)\\ \end{array} \]

Alternative 4: 60.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot z\\ t_2 := z \cdot \left(y + a \cdot b\right)\\ \mathbf{if}\;a \leq -2.45 \cdot 10^{+176}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -3.75 \cdot 10^{+81}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -2.4 \cdot 10^{-10}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -8.8 \cdot 10^{-74}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 1.3 \cdot 10^{-53}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 6.2 \cdot 10^{-15}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 2.9 \cdot 10^{+43}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* y z))) (t_2 (* z (+ y (* a b)))))
   (if (<= a -2.45e+176)
     (* a t)
     (if (<= a -3.75e+81)
       t_2
       (if (<= a -2.4e-10)
         t_1
         (if (<= a -8.8e-74)
           t_2
           (if (<= a 1.3e-53)
             t_1
             (if (<= a 6.2e-15) t_2 (if (<= a 2.9e+43) t_1 (* a t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (y * z);
	double t_2 = z * (y + (a * b));
	double tmp;
	if (a <= -2.45e+176) {
		tmp = a * t;
	} else if (a <= -3.75e+81) {
		tmp = t_2;
	} else if (a <= -2.4e-10) {
		tmp = t_1;
	} else if (a <= -8.8e-74) {
		tmp = t_2;
	} else if (a <= 1.3e-53) {
		tmp = t_1;
	} else if (a <= 6.2e-15) {
		tmp = t_2;
	} else if (a <= 2.9e+43) {
		tmp = t_1;
	} else {
		tmp = a * t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x + (y * z)
    t_2 = z * (y + (a * b))
    if (a <= (-2.45d+176)) then
        tmp = a * t
    else if (a <= (-3.75d+81)) then
        tmp = t_2
    else if (a <= (-2.4d-10)) then
        tmp = t_1
    else if (a <= (-8.8d-74)) then
        tmp = t_2
    else if (a <= 1.3d-53) then
        tmp = t_1
    else if (a <= 6.2d-15) then
        tmp = t_2
    else if (a <= 2.9d+43) then
        tmp = t_1
    else
        tmp = a * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (y * z);
	double t_2 = z * (y + (a * b));
	double tmp;
	if (a <= -2.45e+176) {
		tmp = a * t;
	} else if (a <= -3.75e+81) {
		tmp = t_2;
	} else if (a <= -2.4e-10) {
		tmp = t_1;
	} else if (a <= -8.8e-74) {
		tmp = t_2;
	} else if (a <= 1.3e-53) {
		tmp = t_1;
	} else if (a <= 6.2e-15) {
		tmp = t_2;
	} else if (a <= 2.9e+43) {
		tmp = t_1;
	} else {
		tmp = a * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (y * z)
	t_2 = z * (y + (a * b))
	tmp = 0
	if a <= -2.45e+176:
		tmp = a * t
	elif a <= -3.75e+81:
		tmp = t_2
	elif a <= -2.4e-10:
		tmp = t_1
	elif a <= -8.8e-74:
		tmp = t_2
	elif a <= 1.3e-53:
		tmp = t_1
	elif a <= 6.2e-15:
		tmp = t_2
	elif a <= 2.9e+43:
		tmp = t_1
	else:
		tmp = a * t
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(y * z))
	t_2 = Float64(z * Float64(y + Float64(a * b)))
	tmp = 0.0
	if (a <= -2.45e+176)
		tmp = Float64(a * t);
	elseif (a <= -3.75e+81)
		tmp = t_2;
	elseif (a <= -2.4e-10)
		tmp = t_1;
	elseif (a <= -8.8e-74)
		tmp = t_2;
	elseif (a <= 1.3e-53)
		tmp = t_1;
	elseif (a <= 6.2e-15)
		tmp = t_2;
	elseif (a <= 2.9e+43)
		tmp = t_1;
	else
		tmp = Float64(a * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (y * z);
	t_2 = z * (y + (a * b));
	tmp = 0.0;
	if (a <= -2.45e+176)
		tmp = a * t;
	elseif (a <= -3.75e+81)
		tmp = t_2;
	elseif (a <= -2.4e-10)
		tmp = t_1;
	elseif (a <= -8.8e-74)
		tmp = t_2;
	elseif (a <= 1.3e-53)
		tmp = t_1;
	elseif (a <= 6.2e-15)
		tmp = t_2;
	elseif (a <= 2.9e+43)
		tmp = t_1;
	else
		tmp = a * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.45e+176], N[(a * t), $MachinePrecision], If[LessEqual[a, -3.75e+81], t$95$2, If[LessEqual[a, -2.4e-10], t$95$1, If[LessEqual[a, -8.8e-74], t$95$2, If[LessEqual[a, 1.3e-53], t$95$1, If[LessEqual[a, 6.2e-15], t$95$2, If[LessEqual[a, 2.9e+43], t$95$1, N[(a * t), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -3.75 \cdot 10^{+81}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;a \leq -8.8 \cdot 10^{-74}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 1.3 \cdot 10^{-53}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 6.2 \cdot 10^{-15}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 2.9 \cdot 10^{+43}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.45e176 or 2.9000000000000002e43 < a

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.45e176 < a < -3.74999999999999986e81 or -2.4e-10 < a < -8.80000000000000041e-74 or 1.29999999999999998e-53 < a < 6.1999999999999998e-15

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.74999999999999986e81 < a < -2.4e-10 or -8.80000000000000041e-74 < a < 1.29999999999999998e-53 or 6.1999999999999998e-15 < a < 2.9000000000000002e43

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.45 \cdot 10^{+176}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -3.75 \cdot 10^{+81}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;a \leq -2.4 \cdot 10^{-10}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq -8.8 \cdot 10^{-74}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;a \leq 1.3 \cdot 10^{-53}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 6.2 \cdot 10^{-15}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;a \leq 2.9 \cdot 10^{+43}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]

Alternative 5: 63.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot z + a \cdot t\\ t_2 := x + b \cdot \left(a \cdot z\right)\\ t_3 := x + y \cdot z\\ \mathbf{if}\;x \leq -1.82 \cdot 10^{+90}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -32000000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.1 \cdot 10^{-8}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -6.8 \cdot 10^{-220}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;x \leq 6.4 \cdot 10^{+89}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{+225}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (* y z) (* a t)))
        (t_2 (+ x (* b (* a z))))
        (t_3 (+ x (* y z))))
   (if (<= x -1.82e+90)
     t_3
     (if (<= x -32000000000000.0)
       t_1
       (if (<= x -2.1e-8)
         t_2
         (if (<= x -6.8e-220)
           (* z (+ y (* a b)))
           (if (<= x 6.4e+89) t_1 (if (<= x 1.3e+225) t_3 t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (y * z) + (a * t);
	double t_2 = x + (b * (a * z));
	double t_3 = x + (y * z);
	double tmp;
	if (x <= -1.82e+90) {
		tmp = t_3;
	} else if (x <= -32000000000000.0) {
		tmp = t_1;
	} else if (x <= -2.1e-8) {
		tmp = t_2;
	} else if (x <= -6.8e-220) {
		tmp = z * (y + (a * b));
	} else if (x <= 6.4e+89) {
		tmp = t_1;
	} else if (x <= 1.3e+225) {
		tmp = t_3;
	} 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) :: t_3
    real(8) :: tmp
    t_1 = (y * z) + (a * t)
    t_2 = x + (b * (a * z))
    t_3 = x + (y * z)
    if (x <= (-1.82d+90)) then
        tmp = t_3
    else if (x <= (-32000000000000.0d0)) then
        tmp = t_1
    else if (x <= (-2.1d-8)) then
        tmp = t_2
    else if (x <= (-6.8d-220)) then
        tmp = z * (y + (a * b))
    else if (x <= 6.4d+89) then
        tmp = t_1
    else if (x <= 1.3d+225) then
        tmp = t_3
    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 = (y * z) + (a * t);
	double t_2 = x + (b * (a * z));
	double t_3 = x + (y * z);
	double tmp;
	if (x <= -1.82e+90) {
		tmp = t_3;
	} else if (x <= -32000000000000.0) {
		tmp = t_1;
	} else if (x <= -2.1e-8) {
		tmp = t_2;
	} else if (x <= -6.8e-220) {
		tmp = z * (y + (a * b));
	} else if (x <= 6.4e+89) {
		tmp = t_1;
	} else if (x <= 1.3e+225) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (y * z) + (a * t)
	t_2 = x + (b * (a * z))
	t_3 = x + (y * z)
	tmp = 0
	if x <= -1.82e+90:
		tmp = t_3
	elif x <= -32000000000000.0:
		tmp = t_1
	elif x <= -2.1e-8:
		tmp = t_2
	elif x <= -6.8e-220:
		tmp = z * (y + (a * b))
	elif x <= 6.4e+89:
		tmp = t_1
	elif x <= 1.3e+225:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(y * z) + Float64(a * t))
	t_2 = Float64(x + Float64(b * Float64(a * z)))
	t_3 = Float64(x + Float64(y * z))
	tmp = 0.0
	if (x <= -1.82e+90)
		tmp = t_3;
	elseif (x <= -32000000000000.0)
		tmp = t_1;
	elseif (x <= -2.1e-8)
		tmp = t_2;
	elseif (x <= -6.8e-220)
		tmp = Float64(z * Float64(y + Float64(a * b)));
	elseif (x <= 6.4e+89)
		tmp = t_1;
	elseif (x <= 1.3e+225)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (y * z) + (a * t);
	t_2 = x + (b * (a * z));
	t_3 = x + (y * z);
	tmp = 0.0;
	if (x <= -1.82e+90)
		tmp = t_3;
	elseif (x <= -32000000000000.0)
		tmp = t_1;
	elseif (x <= -2.1e-8)
		tmp = t_2;
	elseif (x <= -6.8e-220)
		tmp = z * (y + (a * b));
	elseif (x <= 6.4e+89)
		tmp = t_1;
	elseif (x <= 1.3e+225)
		tmp = t_3;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * z), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.82e+90], t$95$3, If[LessEqual[x, -32000000000000.0], t$95$1, If[LessEqual[x, -2.1e-8], t$95$2, If[LessEqual[x, -6.8e-220], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.4e+89], t$95$1, If[LessEqual[x, 1.3e+225], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -32000000000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -2.1 \cdot 10^{-8}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;x \leq 6.4 \cdot 10^{+89}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 1.3 \cdot 10^{+225}:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.81999999999999994e90 or 6.39999999999999974e89 < x < 1.30000000000000002e225

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.81999999999999994e90 < x < -3.2e13 or -6.79999999999999987e-220 < x < 6.39999999999999974e89

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.2e13 < x < -2.09999999999999994e-8 or 1.30000000000000002e225 < x

    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. +-commutative95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.09999999999999994e-8 < x < -6.79999999999999987e-220

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.82 \cdot 10^{+90}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;x \leq -32000000000000:\\ \;\;\;\;y \cdot z + a \cdot t\\ \mathbf{elif}\;x \leq -2.1 \cdot 10^{-8}:\\ \;\;\;\;x + b \cdot \left(a \cdot z\right)\\ \mathbf{elif}\;x \leq -6.8 \cdot 10^{-220}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;x \leq 6.4 \cdot 10^{+89}:\\ \;\;\;\;y \cdot z + a \cdot t\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{+225}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + b \cdot \left(a \cdot z\right)\\ \end{array} \]

Alternative 6: 94.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+192} \lor \neg \left(z \leq 5.2 \cdot 10^{+215}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.5e192 or 5.2000000000000001e215 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5e192 < z < 5.2000000000000001e215

    1. Initial program 99.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.4%

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

Alternative 7: 94.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 5 \cdot 10^{+130}:\\
\;\;\;\;\left(a \cdot \left(z \cdot b\right) + a \cdot t\right) + \left(x + y \cdot z\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 z < 4.9999999999999996e130

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

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

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

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

    if 4.9999999999999996e130 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 59.6% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot z\\ \mathbf{if}\;a \leq -3.1 \cdot 10^{+77}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{-28}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 3.6 \cdot 10^{-16}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{+50}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* y z))))
   (if (<= a -3.1e+77)
     (* a t)
     (if (<= a 7.5e-28)
       t_1
       (if (<= a 3.6e-16) (* a (* z b)) (if (<= a 1.5e+50) t_1 (* a t)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (y * z);
	double tmp;
	if (a <= -3.1e+77) {
		tmp = a * t;
	} else if (a <= 7.5e-28) {
		tmp = t_1;
	} else if (a <= 3.6e-16) {
		tmp = a * (z * b);
	} else if (a <= 1.5e+50) {
		tmp = t_1;
	} else {
		tmp = a * t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + (y * z)
    if (a <= (-3.1d+77)) then
        tmp = a * t
    else if (a <= 7.5d-28) then
        tmp = t_1
    else if (a <= 3.6d-16) then
        tmp = a * (z * b)
    else if (a <= 1.5d+50) then
        tmp = t_1
    else
        tmp = a * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (y * z);
	double tmp;
	if (a <= -3.1e+77) {
		tmp = a * t;
	} else if (a <= 7.5e-28) {
		tmp = t_1;
	} else if (a <= 3.6e-16) {
		tmp = a * (z * b);
	} else if (a <= 1.5e+50) {
		tmp = t_1;
	} else {
		tmp = a * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (y * z)
	tmp = 0
	if a <= -3.1e+77:
		tmp = a * t
	elif a <= 7.5e-28:
		tmp = t_1
	elif a <= 3.6e-16:
		tmp = a * (z * b)
	elif a <= 1.5e+50:
		tmp = t_1
	else:
		tmp = a * t
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(y * z))
	tmp = 0.0
	if (a <= -3.1e+77)
		tmp = Float64(a * t);
	elseif (a <= 7.5e-28)
		tmp = t_1;
	elseif (a <= 3.6e-16)
		tmp = Float64(a * Float64(z * b));
	elseif (a <= 1.5e+50)
		tmp = t_1;
	else
		tmp = Float64(a * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (y * z);
	tmp = 0.0;
	if (a <= -3.1e+77)
		tmp = a * t;
	elseif (a <= 7.5e-28)
		tmp = t_1;
	elseif (a <= 3.6e-16)
		tmp = a * (z * b);
	elseif (a <= 1.5e+50)
		tmp = t_1;
	else
		tmp = a * t;
	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[a, -3.1e+77], N[(a * t), $MachinePrecision], If[LessEqual[a, 7.5e-28], t$95$1, If[LessEqual[a, 3.6e-16], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.5e+50], t$95$1, N[(a * t), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;a \leq -3.1 \cdot 10^{+77}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;a \leq 7.5 \cdot 10^{-28}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \leq 1.5 \cdot 10^{+50}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.09999999999999999e77 or 1.4999999999999999e50 < a

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.09999999999999999e77 < a < 7.5000000000000003e-28 or 3.59999999999999983e-16 < a < 1.4999999999999999e50

    1. Initial program 99.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. +-commutative99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.5000000000000003e-28 < a < 3.59999999999999983e-16

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.1 \cdot 10^{+77}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{-28}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 3.6 \cdot 10^{-16}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{+50}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]

Alternative 9: 85.7% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.2 \cdot 10^{-124} \lor \neg \left(t \leq 6.5 \cdot 10^{-33}\right):\\
\;\;\;\;y \cdot z + \left(x + a \cdot t\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 t < -9.20000000000000048e-124 or 6.4999999999999993e-33 < t

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.20000000000000048e-124 < t < 6.4999999999999993e-33

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 40.1% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;y \leq -6.2 \cdot 10^{-298}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;y \leq 2.75 \cdot 10^{-92}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.85 \cdot 10^{+83}:\\
\;\;\;\;a \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.3799999999999999e45 or 1.8500000000000001e83 < y

    1. Initial program 93.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3799999999999999e45 < y < -6.2000000000000003e-298 or 2.7500000000000001e-92 < y < 1.8500000000000001e83

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.2000000000000003e-298 < y < 2.7500000000000001e-92

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.38 \cdot 10^{+45}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq -6.2 \cdot 10^{-298}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;y \leq 2.75 \cdot 10^{-92}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+83}:\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]

Alternative 11: 79.6% accurate, 1.4× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.6000000000000003e122 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 40.3% accurate, 2.1× speedup?

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

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

\mathbf{elif}\;t \leq 3.1 \cdot 10^{-10}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.5e62 or 3.10000000000000015e-10 < t

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5e62 < t < 3.10000000000000015e-10

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 27.3% accurate, 15.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 93.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. +-commutative93.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto x \]

Developer target: 97.4% 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 2023213 
(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)))