Linear.V4:$cdot from linear-1.19.1.3, C

Percentage Accurate: 96.0% → 97.6%
Time: 8.4s
Alternatives: 12
Speedup: 0.5×

Specification

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

\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\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 12 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: 96.0% accurate, 1.0× speedup?

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

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

Alternative 1: 97.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := i \cdot c + \left(b \cdot a + \left(t \cdot z + y \cdot x\right)\right)\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, b \cdot a\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* i c) (+ (* b a) (+ (* t z) (* y x))))))
   (if (<= t_1 INFINITY) t_1 (fma y x (* b a)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (i * c) + ((b * a) + ((t * z) + (y * x)));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = fma(y, x, (b * a));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(i * c) + Float64(Float64(b * a) + Float64(Float64(t * z) + Float64(y * x))))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = fma(y, x, Float64(b * a));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(i * c), $MachinePrecision] + N[(N[(b * a), $MachinePrecision] + N[(N[(t * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(y * x + N[(b * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
    2. Add Preprocessing

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

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + x \cdot y\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
      6. lower-*.f6450.0

        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
    5. Applied rewrites50.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
    6. Taylor expanded in c around 0

      \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
    7. Step-by-step derivation
      1. Applied rewrites75.2%

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

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

    Alternative 2: 43.3% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \cdot z \leq -3.8 \cdot 10^{+93}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;t \cdot z \leq -2.16 \cdot 10^{-113}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;t \cdot z \leq -4 \cdot 10^{-318}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;t \cdot z \leq 2.15 \cdot 10^{-164}:\\ \;\;\;\;i \cdot c\\ \mathbf{elif}\;t \cdot z \leq 1.6 \cdot 10^{+124}:\\ \;\;\;\;b \cdot a\\ \mathbf{else}:\\ \;\;\;\;t \cdot z\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i)
     :precision binary64
     (if (<= (* t z) -3.8e+93)
       (* t z)
       (if (<= (* t z) -2.16e-113)
         (* b a)
         (if (<= (* t z) -4e-318)
           (* y x)
           (if (<= (* t z) 2.15e-164)
             (* i c)
             (if (<= (* t z) 1.6e+124) (* b a) (* t z)))))))
    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double tmp;
    	if ((t * z) <= -3.8e+93) {
    		tmp = t * z;
    	} else if ((t * z) <= -2.16e-113) {
    		tmp = b * a;
    	} else if ((t * z) <= -4e-318) {
    		tmp = y * x;
    	} else if ((t * z) <= 2.15e-164) {
    		tmp = i * c;
    	} else if ((t * z) <= 1.6e+124) {
    		tmp = b * a;
    	} else {
    		tmp = t * z;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z, t, a, b, c, i)
        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), intent (in) :: c
        real(8), intent (in) :: i
        real(8) :: tmp
        if ((t * z) <= (-3.8d+93)) then
            tmp = t * z
        else if ((t * z) <= (-2.16d-113)) then
            tmp = b * a
        else if ((t * z) <= (-4d-318)) then
            tmp = y * x
        else if ((t * z) <= 2.15d-164) then
            tmp = i * c
        else if ((t * z) <= 1.6d+124) then
            tmp = b * a
        else
            tmp = t * z
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double tmp;
    	if ((t * z) <= -3.8e+93) {
    		tmp = t * z;
    	} else if ((t * z) <= -2.16e-113) {
    		tmp = b * a;
    	} else if ((t * z) <= -4e-318) {
    		tmp = y * x;
    	} else if ((t * z) <= 2.15e-164) {
    		tmp = i * c;
    	} else if ((t * z) <= 1.6e+124) {
    		tmp = b * a;
    	} else {
    		tmp = t * z;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a, b, c, i):
    	tmp = 0
    	if (t * z) <= -3.8e+93:
    		tmp = t * z
    	elif (t * z) <= -2.16e-113:
    		tmp = b * a
    	elif (t * z) <= -4e-318:
    		tmp = y * x
    	elif (t * z) <= 2.15e-164:
    		tmp = i * c
    	elif (t * z) <= 1.6e+124:
    		tmp = b * a
    	else:
    		tmp = t * z
    	return tmp
    
    function code(x, y, z, t, a, b, c, i)
    	tmp = 0.0
    	if (Float64(t * z) <= -3.8e+93)
    		tmp = Float64(t * z);
    	elseif (Float64(t * z) <= -2.16e-113)
    		tmp = Float64(b * a);
    	elseif (Float64(t * z) <= -4e-318)
    		tmp = Float64(y * x);
    	elseif (Float64(t * z) <= 2.15e-164)
    		tmp = Float64(i * c);
    	elseif (Float64(t * z) <= 1.6e+124)
    		tmp = Float64(b * a);
    	else
    		tmp = Float64(t * z);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a, b, c, i)
    	tmp = 0.0;
    	if ((t * z) <= -3.8e+93)
    		tmp = t * z;
    	elseif ((t * z) <= -2.16e-113)
    		tmp = b * a;
    	elseif ((t * z) <= -4e-318)
    		tmp = y * x;
    	elseif ((t * z) <= 2.15e-164)
    		tmp = i * c;
    	elseif ((t * z) <= 1.6e+124)
    		tmp = b * a;
    	else
    		tmp = t * z;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(t * z), $MachinePrecision], -3.8e+93], N[(t * z), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], -2.16e-113], N[(b * a), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], -4e-318], N[(y * x), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 2.15e-164], N[(i * c), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 1.6e+124], N[(b * a), $MachinePrecision], N[(t * z), $MachinePrecision]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;t \cdot z \leq -3.8 \cdot 10^{+93}:\\
    \;\;\;\;t \cdot z\\
    
    \mathbf{elif}\;t \cdot z \leq -2.16 \cdot 10^{-113}:\\
    \;\;\;\;b \cdot a\\
    
    \mathbf{elif}\;t \cdot z \leq -4 \cdot 10^{-318}:\\
    \;\;\;\;y \cdot x\\
    
    \mathbf{elif}\;t \cdot z \leq 2.15 \cdot 10^{-164}:\\
    \;\;\;\;i \cdot c\\
    
    \mathbf{elif}\;t \cdot z \leq 1.6 \cdot 10^{+124}:\\
    \;\;\;\;b \cdot a\\
    
    \mathbf{else}:\\
    \;\;\;\;t \cdot z\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if (*.f64 z t) < -3.7999999999999998e93 or 1.59999999999999996e124 < (*.f64 z t)

      1. Initial program 92.0%

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

        \[\leadsto \color{blue}{t \cdot z} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{z \cdot t} \]
        2. lower-*.f6470.9

          \[\leadsto \color{blue}{z \cdot t} \]
      5. Applied rewrites70.9%

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

      if -3.7999999999999998e93 < (*.f64 z t) < -2.16e-113 or 2.1499999999999999e-164 < (*.f64 z t) < 1.59999999999999996e124

      1. Initial program 96.6%

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

        \[\leadsto \color{blue}{a \cdot b} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{b \cdot a} \]
        2. lower-*.f6442.1

          \[\leadsto \color{blue}{b \cdot a} \]
      5. Applied rewrites42.1%

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

      if -2.16e-113 < (*.f64 z t) < -3.9999999e-318

      1. Initial program 97.1%

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

        \[\leadsto \color{blue}{x \cdot y} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{y \cdot x} \]
        2. lower-*.f6454.7

          \[\leadsto \color{blue}{y \cdot x} \]
      5. Applied rewrites54.7%

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

      if -3.9999999e-318 < (*.f64 z t) < 2.1499999999999999e-164

      1. Initial program 97.7%

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

        \[\leadsto \color{blue}{c \cdot i} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{i \cdot c} \]
        2. lower-*.f6449.1

          \[\leadsto \color{blue}{i \cdot c} \]
      5. Applied rewrites49.1%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot z \leq -3.8 \cdot 10^{+93}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;t \cdot z \leq -2.16 \cdot 10^{-113}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;t \cdot z \leq -4 \cdot 10^{-318}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;t \cdot z \leq 2.15 \cdot 10^{-164}:\\ \;\;\;\;i \cdot c\\ \mathbf{elif}\;t \cdot z \leq 1.6 \cdot 10^{+124}:\\ \;\;\;\;b \cdot a\\ \mathbf{else}:\\ \;\;\;\;t \cdot z\\ \end{array} \]
    5. Add Preprocessing

    Alternative 3: 66.2% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(y, x, b \cdot a\right)\\ \mathbf{if}\;t \cdot z \leq -5 \cdot 10^{+95}:\\ \;\;\;\;\mathsf{fma}\left(i, c, t \cdot z\right)\\ \mathbf{elif}\;t \cdot z \leq -1 \cdot 10^{-112}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \cdot z \leq 10^{-164}:\\ \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\ \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+126}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, b \cdot a\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i)
     :precision binary64
     (let* ((t_1 (fma y x (* b a))))
       (if (<= (* t z) -5e+95)
         (fma i c (* t z))
         (if (<= (* t z) -1e-112)
           t_1
           (if (<= (* t z) 1e-164)
             (fma i c (* y x))
             (if (<= (* t z) 2e+126) t_1 (fma z t (* b a))))))))
    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double t_1 = fma(y, x, (b * a));
    	double tmp;
    	if ((t * z) <= -5e+95) {
    		tmp = fma(i, c, (t * z));
    	} else if ((t * z) <= -1e-112) {
    		tmp = t_1;
    	} else if ((t * z) <= 1e-164) {
    		tmp = fma(i, c, (y * x));
    	} else if ((t * z) <= 2e+126) {
    		tmp = t_1;
    	} else {
    		tmp = fma(z, t, (b * a));
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b, c, i)
    	t_1 = fma(y, x, Float64(b * a))
    	tmp = 0.0
    	if (Float64(t * z) <= -5e+95)
    		tmp = fma(i, c, Float64(t * z));
    	elseif (Float64(t * z) <= -1e-112)
    		tmp = t_1;
    	elseif (Float64(t * z) <= 1e-164)
    		tmp = fma(i, c, Float64(y * x));
    	elseif (Float64(t * z) <= 2e+126)
    		tmp = t_1;
    	else
    		tmp = fma(z, t, Float64(b * a));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(y * x + N[(b * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t * z), $MachinePrecision], -5e+95], N[(i * c + N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], -1e-112], t$95$1, If[LessEqual[N[(t * z), $MachinePrecision], 1e-164], N[(i * c + N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 2e+126], t$95$1, N[(z * t + N[(b * a), $MachinePrecision]), $MachinePrecision]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \mathsf{fma}\left(y, x, b \cdot a\right)\\
    \mathbf{if}\;t \cdot z \leq -5 \cdot 10^{+95}:\\
    \;\;\;\;\mathsf{fma}\left(i, c, t \cdot z\right)\\
    
    \mathbf{elif}\;t \cdot z \leq -1 \cdot 10^{-112}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t \cdot z \leq 10^{-164}:\\
    \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\
    
    \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+126}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(z, t, b \cdot a\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if (*.f64 z t) < -5.00000000000000025e95

      1. Initial program 93.8%

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

        \[\leadsto \color{blue}{t \cdot z} + c \cdot i \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{z \cdot t} + c \cdot i \]
        2. lower-*.f6477.6

          \[\leadsto \color{blue}{z \cdot t} + c \cdot i \]
      5. Applied rewrites77.6%

        \[\leadsto \color{blue}{z \cdot t} + c \cdot i \]
      6. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{z \cdot t + c \cdot i} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{c \cdot i + z \cdot t} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{c \cdot i} + z \cdot t \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{i \cdot c} + z \cdot t \]
        5. lower-fma.f6479.6

          \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, z \cdot t\right)} \]
      7. Applied rewrites79.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)} \]

      if -5.00000000000000025e95 < (*.f64 z t) < -9.9999999999999995e-113 or 9.99999999999999962e-165 < (*.f64 z t) < 1.99999999999999985e126

      1. Initial program 96.7%

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

        \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
        2. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
        3. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + x \cdot y\right) \]
        4. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
        5. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
        6. lower-*.f6488.3

          \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
      5. Applied rewrites88.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
      6. Taylor expanded in c around 0

        \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
      7. Step-by-step derivation
        1. Applied rewrites68.5%

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

        if -9.9999999999999995e-113 < (*.f64 z t) < 9.99999999999999962e-165

        1. Initial program 97.4%

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

          \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
          2. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
          3. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + x \cdot y\right) \]
          4. lower-fma.f64N/A

            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
          5. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
          6. lower-*.f6498.7

            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
        5. Applied rewrites98.7%

          \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
        6. Taylor expanded in b around 0

          \[\leadsto c \cdot i + \color{blue}{x \cdot y} \]
        7. Step-by-step derivation
          1. Applied rewrites77.0%

            \[\leadsto \mathsf{fma}\left(i, \color{blue}{c}, y \cdot x\right) \]

          if 1.99999999999999985e126 < (*.f64 z t)

          1. Initial program 89.1%

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

            \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
            2. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
            3. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + x \cdot y\right) \]
            4. lower-fma.f64N/A

              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
            5. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
            6. lower-*.f6434.0

              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
          5. Applied rewrites34.0%

            \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
          6. Taylor expanded in c around 0

            \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
          7. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{b \cdot a} + \left(t \cdot z + x \cdot y\right) \]
            2. lower-fma.f64N/A

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

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

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

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

              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
            7. lower-*.f6489.1

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

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

            \[\leadsto a \cdot b + \color{blue}{t \cdot z} \]
          10. Step-by-step derivation
            1. Applied rewrites89.2%

              \[\leadsto \mathsf{fma}\left(z, \color{blue}{t}, b \cdot a\right) \]
          11. Recombined 4 regimes into one program.
          12. Final simplification76.2%

            \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot z \leq -5 \cdot 10^{+95}:\\ \;\;\;\;\mathsf{fma}\left(i, c, t \cdot z\right)\\ \mathbf{elif}\;t \cdot z \leq -1 \cdot 10^{-112}:\\ \;\;\;\;\mathsf{fma}\left(y, x, b \cdot a\right)\\ \mathbf{elif}\;t \cdot z \leq 10^{-164}:\\ \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\ \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+126}:\\ \;\;\;\;\mathsf{fma}\left(y, x, b \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, b \cdot a\right)\\ \end{array} \]
          13. Add Preprocessing

          Alternative 4: 87.8% accurate, 0.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \cdot z \leq -2 \cdot 10^{+92}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, t \cdot z\right)\right)\\ \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+126}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, b \cdot a\right)\\ \end{array} \end{array} \]
          (FPCore (x y z t a b c i)
           :precision binary64
           (if (<= (* t z) -2e+92)
             (fma b a (fma y x (* t z)))
             (if (<= (* t z) 2e+126) (fma b a (fma i c (* y x))) (fma z t (* b a)))))
          double code(double x, double y, double z, double t, double a, double b, double c, double i) {
          	double tmp;
          	if ((t * z) <= -2e+92) {
          		tmp = fma(b, a, fma(y, x, (t * z)));
          	} else if ((t * z) <= 2e+126) {
          		tmp = fma(b, a, fma(i, c, (y * x)));
          	} else {
          		tmp = fma(z, t, (b * a));
          	}
          	return tmp;
          }
          
          function code(x, y, z, t, a, b, c, i)
          	tmp = 0.0
          	if (Float64(t * z) <= -2e+92)
          		tmp = fma(b, a, fma(y, x, Float64(t * z)));
          	elseif (Float64(t * z) <= 2e+126)
          		tmp = fma(b, a, fma(i, c, Float64(y * x)));
          	else
          		tmp = fma(z, t, Float64(b * a));
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(t * z), $MachinePrecision], -2e+92], N[(b * a + N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 2e+126], N[(b * a + N[(i * c + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * t + N[(b * a), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;t \cdot z \leq -2 \cdot 10^{+92}:\\
          \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, t \cdot z\right)\right)\\
          
          \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+126}:\\
          \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(z, t, b \cdot a\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (*.f64 z t) < -2.0000000000000001e92

            1. Initial program 92.1%

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

              \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
              2. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
              3. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + x \cdot y\right) \]
              4. lower-fma.f64N/A

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
              5. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
              6. lower-*.f6439.8

                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
            5. Applied rewrites39.8%

              \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
            6. Taylor expanded in c around 0

              \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
            7. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{b \cdot a} + \left(t \cdot z + x \cdot y\right) \]
              2. lower-fma.f64N/A

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

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

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

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

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

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

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

            if -2.0000000000000001e92 < (*.f64 z t) < 1.99999999999999985e126

            1. Initial program 97.6%

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

              \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
              2. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
              3. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + x \cdot y\right) \]
              4. lower-fma.f64N/A

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
              5. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
              6. lower-*.f6493.7

                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
            5. Applied rewrites93.7%

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

            if 1.99999999999999985e126 < (*.f64 z t)

            1. Initial program 89.1%

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

              \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
              2. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
              3. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + x \cdot y\right) \]
              4. lower-fma.f64N/A

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
              5. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
              6. lower-*.f6434.0

                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
            5. Applied rewrites34.0%

              \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
            6. Taylor expanded in c around 0

              \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
            7. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{b \cdot a} + \left(t \cdot z + x \cdot y\right) \]
              2. lower-fma.f64N/A

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

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

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

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

                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
              7. lower-*.f6489.1

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

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

              \[\leadsto a \cdot b + \color{blue}{t \cdot z} \]
            10. Step-by-step derivation
              1. Applied rewrites89.2%

                \[\leadsto \mathsf{fma}\left(z, \color{blue}{t}, b \cdot a\right) \]
            11. Recombined 3 regimes into one program.
            12. Final simplification92.1%

              \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot z \leq -2 \cdot 10^{+92}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, t \cdot z\right)\right)\\ \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+126}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, b \cdot a\right)\\ \end{array} \]
            13. Add Preprocessing

            Alternative 5: 87.3% accurate, 0.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \cdot z \leq -5 \cdot 10^{+95}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+126}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, b \cdot a\right)\\ \end{array} \end{array} \]
            (FPCore (x y z t a b c i)
             :precision binary64
             (if (<= (* t z) -5e+95)
               (fma b a (fma i c (* t z)))
               (if (<= (* t z) 2e+126) (fma b a (fma i c (* y x))) (fma z t (* b a)))))
            double code(double x, double y, double z, double t, double a, double b, double c, double i) {
            	double tmp;
            	if ((t * z) <= -5e+95) {
            		tmp = fma(b, a, fma(i, c, (t * z)));
            	} else if ((t * z) <= 2e+126) {
            		tmp = fma(b, a, fma(i, c, (y * x)));
            	} else {
            		tmp = fma(z, t, (b * a));
            	}
            	return tmp;
            }
            
            function code(x, y, z, t, a, b, c, i)
            	tmp = 0.0
            	if (Float64(t * z) <= -5e+95)
            		tmp = fma(b, a, fma(i, c, Float64(t * z)));
            	elseif (Float64(t * z) <= 2e+126)
            		tmp = fma(b, a, fma(i, c, Float64(y * x)));
            	else
            		tmp = fma(z, t, Float64(b * a));
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(t * z), $MachinePrecision], -5e+95], N[(b * a + N[(i * c + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 2e+126], N[(b * a + N[(i * c + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * t + N[(b * a), $MachinePrecision]), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;t \cdot z \leq -5 \cdot 10^{+95}:\\
            \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\
            
            \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+126}:\\
            \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(z, t, b \cdot a\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if (*.f64 z t) < -5.00000000000000025e95

              1. Initial program 93.8%

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

                \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + t \cdot z\right) \]
                2. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + t \cdot z\right)} \]
                3. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + t \cdot z\right) \]
                4. lower-fma.f64N/A

                  \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)}\right) \]
                5. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{z \cdot t}\right)\right) \]
                6. lower-*.f6484.0

                  \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{z \cdot t}\right)\right) \]
              5. Applied rewrites84.0%

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

              if -5.00000000000000025e95 < (*.f64 z t) < 1.99999999999999985e126

              1. Initial program 97.0%

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

                \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                2. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                3. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + x \cdot y\right) \]
                4. lower-fma.f64N/A

                  \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                5. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                6. lower-*.f6493.2

                  \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
              5. Applied rewrites93.2%

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

              if 1.99999999999999985e126 < (*.f64 z t)

              1. Initial program 89.1%

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

                \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                2. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                3. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + x \cdot y\right) \]
                4. lower-fma.f64N/A

                  \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                5. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                6. lower-*.f6434.0

                  \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
              5. Applied rewrites34.0%

                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
              6. Taylor expanded in c around 0

                \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
              7. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \color{blue}{b \cdot a} + \left(t \cdot z + x \cdot y\right) \]
                2. lower-fma.f64N/A

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
                7. lower-*.f6489.1

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

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

                \[\leadsto a \cdot b + \color{blue}{t \cdot z} \]
              10. Step-by-step derivation
                1. Applied rewrites89.2%

                  \[\leadsto \mathsf{fma}\left(z, \color{blue}{t}, b \cdot a\right) \]
              11. Recombined 3 regimes into one program.
              12. Final simplification90.8%

                \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot z \leq -5 \cdot 10^{+95}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+126}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, b \cdot a\right)\\ \end{array} \]
              13. Add Preprocessing

              Alternative 6: 85.3% accurate, 0.7× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \cdot z \leq -5 \cdot 10^{+95}:\\ \;\;\;\;\mathsf{fma}\left(i, c, t \cdot z\right)\\ \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+126}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, b \cdot a\right)\\ \end{array} \end{array} \]
              (FPCore (x y z t a b c i)
               :precision binary64
               (if (<= (* t z) -5e+95)
                 (fma i c (* t z))
                 (if (<= (* t z) 2e+126) (fma b a (fma i c (* y x))) (fma z t (* b a)))))
              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
              	double tmp;
              	if ((t * z) <= -5e+95) {
              		tmp = fma(i, c, (t * z));
              	} else if ((t * z) <= 2e+126) {
              		tmp = fma(b, a, fma(i, c, (y * x)));
              	} else {
              		tmp = fma(z, t, (b * a));
              	}
              	return tmp;
              }
              
              function code(x, y, z, t, a, b, c, i)
              	tmp = 0.0
              	if (Float64(t * z) <= -5e+95)
              		tmp = fma(i, c, Float64(t * z));
              	elseif (Float64(t * z) <= 2e+126)
              		tmp = fma(b, a, fma(i, c, Float64(y * x)));
              	else
              		tmp = fma(z, t, Float64(b * a));
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(t * z), $MachinePrecision], -5e+95], N[(i * c + N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 2e+126], N[(b * a + N[(i * c + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * t + N[(b * a), $MachinePrecision]), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;t \cdot z \leq -5 \cdot 10^{+95}:\\
              \;\;\;\;\mathsf{fma}\left(i, c, t \cdot z\right)\\
              
              \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+126}:\\
              \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(z, t, b \cdot a\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if (*.f64 z t) < -5.00000000000000025e95

                1. Initial program 93.8%

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

                  \[\leadsto \color{blue}{t \cdot z} + c \cdot i \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \color{blue}{z \cdot t} + c \cdot i \]
                  2. lower-*.f6477.6

                    \[\leadsto \color{blue}{z \cdot t} + c \cdot i \]
                5. Applied rewrites77.6%

                  \[\leadsto \color{blue}{z \cdot t} + c \cdot i \]
                6. Step-by-step derivation
                  1. lift-+.f64N/A

                    \[\leadsto \color{blue}{z \cdot t + c \cdot i} \]
                  2. +-commutativeN/A

                    \[\leadsto \color{blue}{c \cdot i + z \cdot t} \]
                  3. lift-*.f64N/A

                    \[\leadsto \color{blue}{c \cdot i} + z \cdot t \]
                  4. *-commutativeN/A

                    \[\leadsto \color{blue}{i \cdot c} + z \cdot t \]
                  5. lower-fma.f6479.6

                    \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, z \cdot t\right)} \]
                7. Applied rewrites79.6%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)} \]

                if -5.00000000000000025e95 < (*.f64 z t) < 1.99999999999999985e126

                1. Initial program 97.0%

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

                  \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                  2. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                  3. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + x \cdot y\right) \]
                  4. lower-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                  5. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                  6. lower-*.f6493.2

                    \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                5. Applied rewrites93.2%

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

                if 1.99999999999999985e126 < (*.f64 z t)

                1. Initial program 89.1%

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

                  \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                  2. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                  3. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + x \cdot y\right) \]
                  4. lower-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                  5. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                  6. lower-*.f6434.0

                    \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                5. Applied rewrites34.0%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
                6. Taylor expanded in c around 0

                  \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
                7. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \color{blue}{b \cdot a} + \left(t \cdot z + x \cdot y\right) \]
                  2. lower-fma.f64N/A

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
                  7. lower-*.f6489.1

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

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

                  \[\leadsto a \cdot b + \color{blue}{t \cdot z} \]
                10. Step-by-step derivation
                  1. Applied rewrites89.2%

                    \[\leadsto \mathsf{fma}\left(z, \color{blue}{t}, b \cdot a\right) \]
                11. Recombined 3 regimes into one program.
                12. Final simplification90.0%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot z \leq -5 \cdot 10^{+95}:\\ \;\;\;\;\mathsf{fma}\left(i, c, t \cdot z\right)\\ \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+126}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, b \cdot a\right)\\ \end{array} \]
                13. Add Preprocessing

                Alternative 7: 41.9% accurate, 0.8× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \cdot a \leq -1 \cdot 10^{+144}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;b \cdot a \leq -1 \cdot 10^{-249}:\\ \;\;\;\;i \cdot c\\ \mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+67}:\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;b \cdot a\\ \end{array} \end{array} \]
                (FPCore (x y z t a b c i)
                 :precision binary64
                 (if (<= (* b a) -1e+144)
                   (* b a)
                   (if (<= (* b a) -1e-249) (* i c) (if (<= (* b a) 2e+67) (* y x) (* b a)))))
                double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                	double tmp;
                	if ((b * a) <= -1e+144) {
                		tmp = b * a;
                	} else if ((b * a) <= -1e-249) {
                		tmp = i * c;
                	} else if ((b * a) <= 2e+67) {
                		tmp = y * x;
                	} else {
                		tmp = b * a;
                	}
                	return tmp;
                }
                
                real(8) function code(x, y, z, t, a, b, c, i)
                    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), intent (in) :: c
                    real(8), intent (in) :: i
                    real(8) :: tmp
                    if ((b * a) <= (-1d+144)) then
                        tmp = b * a
                    else if ((b * a) <= (-1d-249)) then
                        tmp = i * c
                    else if ((b * a) <= 2d+67) then
                        tmp = y * x
                    else
                        tmp = b * a
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                	double tmp;
                	if ((b * a) <= -1e+144) {
                		tmp = b * a;
                	} else if ((b * a) <= -1e-249) {
                		tmp = i * c;
                	} else if ((b * a) <= 2e+67) {
                		tmp = y * x;
                	} else {
                		tmp = b * a;
                	}
                	return tmp;
                }
                
                def code(x, y, z, t, a, b, c, i):
                	tmp = 0
                	if (b * a) <= -1e+144:
                		tmp = b * a
                	elif (b * a) <= -1e-249:
                		tmp = i * c
                	elif (b * a) <= 2e+67:
                		tmp = y * x
                	else:
                		tmp = b * a
                	return tmp
                
                function code(x, y, z, t, a, b, c, i)
                	tmp = 0.0
                	if (Float64(b * a) <= -1e+144)
                		tmp = Float64(b * a);
                	elseif (Float64(b * a) <= -1e-249)
                		tmp = Float64(i * c);
                	elseif (Float64(b * a) <= 2e+67)
                		tmp = Float64(y * x);
                	else
                		tmp = Float64(b * a);
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z, t, a, b, c, i)
                	tmp = 0.0;
                	if ((b * a) <= -1e+144)
                		tmp = b * a;
                	elseif ((b * a) <= -1e-249)
                		tmp = i * c;
                	elseif ((b * a) <= 2e+67)
                		tmp = y * x;
                	else
                		tmp = b * a;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(b * a), $MachinePrecision], -1e+144], N[(b * a), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], -1e-249], N[(i * c), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 2e+67], N[(y * x), $MachinePrecision], N[(b * a), $MachinePrecision]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;b \cdot a \leq -1 \cdot 10^{+144}:\\
                \;\;\;\;b \cdot a\\
                
                \mathbf{elif}\;b \cdot a \leq -1 \cdot 10^{-249}:\\
                \;\;\;\;i \cdot c\\
                
                \mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+67}:\\
                \;\;\;\;y \cdot x\\
                
                \mathbf{else}:\\
                \;\;\;\;b \cdot a\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if (*.f64 a b) < -1.00000000000000002e144 or 1.99999999999999997e67 < (*.f64 a b)

                  1. Initial program 92.7%

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

                    \[\leadsto \color{blue}{a \cdot b} \]
                  4. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \color{blue}{b \cdot a} \]
                    2. lower-*.f6460.0

                      \[\leadsto \color{blue}{b \cdot a} \]
                  5. Applied rewrites60.0%

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

                  if -1.00000000000000002e144 < (*.f64 a b) < -1.00000000000000005e-249

                  1. Initial program 98.2%

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

                    \[\leadsto \color{blue}{c \cdot i} \]
                  4. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \color{blue}{i \cdot c} \]
                    2. lower-*.f6442.6

                      \[\leadsto \color{blue}{i \cdot c} \]
                  5. Applied rewrites42.6%

                    \[\leadsto \color{blue}{i \cdot c} \]

                  if -1.00000000000000005e-249 < (*.f64 a b) < 1.99999999999999997e67

                  1. Initial program 96.1%

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

                    \[\leadsto \color{blue}{x \cdot y} \]
                  4. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \color{blue}{y \cdot x} \]
                    2. lower-*.f6442.0

                      \[\leadsto \color{blue}{y \cdot x} \]
                  5. Applied rewrites42.0%

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -1 \cdot 10^{+144}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;b \cdot a \leq -1 \cdot 10^{-249}:\\ \;\;\;\;i \cdot c\\ \mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+67}:\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;b \cdot a\\ \end{array} \]
                5. Add Preprocessing

                Alternative 8: 64.9% accurate, 0.9× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \cdot a \leq -5 \cdot 10^{-8}:\\ \;\;\;\;\mathsf{fma}\left(z, t, b \cdot a\right)\\ \mathbf{elif}\;b \cdot a \leq 4 \cdot 10^{+20}:\\ \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, b \cdot a\right)\\ \end{array} \end{array} \]
                (FPCore (x y z t a b c i)
                 :precision binary64
                 (if (<= (* b a) -5e-8)
                   (fma z t (* b a))
                   (if (<= (* b a) 4e+20) (fma i c (* y x)) (fma y x (* b a)))))
                double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                	double tmp;
                	if ((b * a) <= -5e-8) {
                		tmp = fma(z, t, (b * a));
                	} else if ((b * a) <= 4e+20) {
                		tmp = fma(i, c, (y * x));
                	} else {
                		tmp = fma(y, x, (b * a));
                	}
                	return tmp;
                }
                
                function code(x, y, z, t, a, b, c, i)
                	tmp = 0.0
                	if (Float64(b * a) <= -5e-8)
                		tmp = fma(z, t, Float64(b * a));
                	elseif (Float64(b * a) <= 4e+20)
                		tmp = fma(i, c, Float64(y * x));
                	else
                		tmp = fma(y, x, Float64(b * a));
                	end
                	return tmp
                end
                
                code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(b * a), $MachinePrecision], -5e-8], N[(z * t + N[(b * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 4e+20], N[(i * c + N[(y * x), $MachinePrecision]), $MachinePrecision], N[(y * x + N[(b * a), $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;b \cdot a \leq -5 \cdot 10^{-8}:\\
                \;\;\;\;\mathsf{fma}\left(z, t, b \cdot a\right)\\
                
                \mathbf{elif}\;b \cdot a \leq 4 \cdot 10^{+20}:\\
                \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;\mathsf{fma}\left(y, x, b \cdot a\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if (*.f64 a b) < -4.9999999999999998e-8

                  1. Initial program 92.7%

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

                    \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                  4. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                    2. lower-fma.f64N/A

                      \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                    3. *-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + x \cdot y\right) \]
                    4. lower-fma.f64N/A

                      \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                    5. *-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                    6. lower-*.f6477.1

                      \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                  5. Applied rewrites77.1%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
                  6. Taylor expanded in c around 0

                    \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
                  7. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \color{blue}{b \cdot a} + \left(t \cdot z + x \cdot y\right) \]
                    2. lower-fma.f64N/A

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

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

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

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

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

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

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

                    \[\leadsto a \cdot b + \color{blue}{t \cdot z} \]
                  10. Step-by-step derivation
                    1. Applied rewrites75.1%

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

                    if -4.9999999999999998e-8 < (*.f64 a b) < 4e20

                    1. Initial program 96.9%

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

                      \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                      3. *-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + x \cdot y\right) \]
                      4. lower-fma.f64N/A

                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                      5. *-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                      6. lower-*.f6471.0

                        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                    5. Applied rewrites71.0%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
                    6. Taylor expanded in b around 0

                      \[\leadsto c \cdot i + \color{blue}{x \cdot y} \]
                    7. Step-by-step derivation
                      1. Applied rewrites69.9%

                        \[\leadsto \mathsf{fma}\left(i, \color{blue}{c}, y \cdot x\right) \]

                      if 4e20 < (*.f64 a b)

                      1. Initial program 94.4%

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

                        \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                      4. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                        2. lower-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                        3. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + x \cdot y\right) \]
                        4. lower-fma.f64N/A

                          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                        5. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                        6. lower-*.f6478.1

                          \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                      5. Applied rewrites78.1%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
                      6. Taylor expanded in c around 0

                        \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
                      7. Step-by-step derivation
                        1. Applied rewrites72.3%

                          \[\leadsto \mathsf{fma}\left(y, \color{blue}{x}, b \cdot a\right) \]
                      8. Recombined 3 regimes into one program.
                      9. Final simplification71.7%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -5 \cdot 10^{-8}:\\ \;\;\;\;\mathsf{fma}\left(z, t, b \cdot a\right)\\ \mathbf{elif}\;b \cdot a \leq 4 \cdot 10^{+20}:\\ \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, b \cdot a\right)\\ \end{array} \]
                      10. Add Preprocessing

                      Alternative 9: 65.8% accurate, 0.9× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(y, x, b \cdot a\right)\\ \mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+126}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \cdot a \leq 4 \cdot 10^{+20}:\\ \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                      (FPCore (x y z t a b c i)
                       :precision binary64
                       (let* ((t_1 (fma y x (* b a))))
                         (if (<= (* b a) -5e+126)
                           t_1
                           (if (<= (* b a) 4e+20) (fma i c (* y x)) t_1))))
                      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                      	double t_1 = fma(y, x, (b * a));
                      	double tmp;
                      	if ((b * a) <= -5e+126) {
                      		tmp = t_1;
                      	} else if ((b * a) <= 4e+20) {
                      		tmp = fma(i, c, (y * x));
                      	} else {
                      		tmp = t_1;
                      	}
                      	return tmp;
                      }
                      
                      function code(x, y, z, t, a, b, c, i)
                      	t_1 = fma(y, x, Float64(b * a))
                      	tmp = 0.0
                      	if (Float64(b * a) <= -5e+126)
                      		tmp = t_1;
                      	elseif (Float64(b * a) <= 4e+20)
                      		tmp = fma(i, c, Float64(y * x));
                      	else
                      		tmp = t_1;
                      	end
                      	return tmp
                      end
                      
                      code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(y * x + N[(b * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -5e+126], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 4e+20], N[(i * c + N[(y * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_1 := \mathsf{fma}\left(y, x, b \cdot a\right)\\
                      \mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+126}:\\
                      \;\;\;\;t\_1\\
                      
                      \mathbf{elif}\;b \cdot a \leq 4 \cdot 10^{+20}:\\
                      \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t\_1\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (*.f64 a b) < -4.99999999999999977e126 or 4e20 < (*.f64 a b)

                        1. Initial program 92.8%

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

                          \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                        4. Step-by-step derivation
                          1. *-commutativeN/A

                            \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                          2. lower-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                          3. *-commutativeN/A

                            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + x \cdot y\right) \]
                          4. lower-fma.f64N/A

                            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                          5. *-commutativeN/A

                            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                          6. lower-*.f6481.5

                            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                        5. Applied rewrites81.5%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
                        6. Taylor expanded in c around 0

                          \[\leadsto a \cdot b + \color{blue}{x \cdot y} \]
                        7. Step-by-step derivation
                          1. Applied rewrites75.9%

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

                          if -4.99999999999999977e126 < (*.f64 a b) < 4e20

                          1. Initial program 97.2%

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

                            \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                          4. Step-by-step derivation
                            1. *-commutativeN/A

                              \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                            2. lower-fma.f64N/A

                              \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                            3. *-commutativeN/A

                              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + x \cdot y\right) \]
                            4. lower-fma.f64N/A

                              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                            5. *-commutativeN/A

                              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                            6. lower-*.f6468.9

                              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                          5. Applied rewrites68.9%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
                          6. Taylor expanded in b around 0

                            \[\leadsto c \cdot i + \color{blue}{x \cdot y} \]
                          7. Step-by-step derivation
                            1. Applied rewrites66.9%

                              \[\leadsto \mathsf{fma}\left(i, \color{blue}{c}, y \cdot x\right) \]
                          8. Recombined 2 regimes into one program.
                          9. Final simplification70.8%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+126}:\\ \;\;\;\;\mathsf{fma}\left(y, x, b \cdot a\right)\\ \mathbf{elif}\;b \cdot a \leq 4 \cdot 10^{+20}:\\ \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, b \cdot a\right)\\ \end{array} \]
                          10. Add Preprocessing

                          Alternative 10: 64.0% accurate, 0.9× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \cdot z \leq -1.9 \cdot 10^{+160}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;t \cdot z \leq 1.68 \cdot 10^{+134}:\\ \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot z\\ \end{array} \end{array} \]
                          (FPCore (x y z t a b c i)
                           :precision binary64
                           (if (<= (* t z) -1.9e+160)
                             (* t z)
                             (if (<= (* t z) 1.68e+134) (fma i c (* y x)) (* t z))))
                          double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                          	double tmp;
                          	if ((t * z) <= -1.9e+160) {
                          		tmp = t * z;
                          	} else if ((t * z) <= 1.68e+134) {
                          		tmp = fma(i, c, (y * x));
                          	} else {
                          		tmp = t * z;
                          	}
                          	return tmp;
                          }
                          
                          function code(x, y, z, t, a, b, c, i)
                          	tmp = 0.0
                          	if (Float64(t * z) <= -1.9e+160)
                          		tmp = Float64(t * z);
                          	elseif (Float64(t * z) <= 1.68e+134)
                          		tmp = fma(i, c, Float64(y * x));
                          	else
                          		tmp = Float64(t * z);
                          	end
                          	return tmp
                          end
                          
                          code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(t * z), $MachinePrecision], -1.9e+160], N[(t * z), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 1.68e+134], N[(i * c + N[(y * x), $MachinePrecision]), $MachinePrecision], N[(t * z), $MachinePrecision]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;t \cdot z \leq -1.9 \cdot 10^{+160}:\\
                          \;\;\;\;t \cdot z\\
                          
                          \mathbf{elif}\;t \cdot z \leq 1.68 \cdot 10^{+134}:\\
                          \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;t \cdot z\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if (*.f64 z t) < -1.90000000000000006e160 or 1.68e134 < (*.f64 z t)

                            1. Initial program 91.7%

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

                              \[\leadsto \color{blue}{t \cdot z} \]
                            4. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \color{blue}{z \cdot t} \]
                              2. lower-*.f6477.0

                                \[\leadsto \color{blue}{z \cdot t} \]
                            5. Applied rewrites77.0%

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

                            if -1.90000000000000006e160 < (*.f64 z t) < 1.68e134

                            1. Initial program 96.7%

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

                              \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                            4. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + x \cdot y\right) \]
                              2. lower-fma.f64N/A

                                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + x \cdot y\right)} \]
                              3. *-commutativeN/A

                                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + x \cdot y\right) \]
                              4. lower-fma.f64N/A

                                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                              5. *-commutativeN/A

                                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                              6. lower-*.f6490.5

                                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                            5. Applied rewrites90.5%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
                            6. Taylor expanded in b around 0

                              \[\leadsto c \cdot i + \color{blue}{x \cdot y} \]
                            7. Step-by-step derivation
                              1. Applied rewrites63.1%

                                \[\leadsto \mathsf{fma}\left(i, \color{blue}{c}, y \cdot x\right) \]
                            8. Recombined 2 regimes into one program.
                            9. Final simplification67.1%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot z \leq -1.9 \cdot 10^{+160}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;t \cdot z \leq 1.68 \cdot 10^{+134}:\\ \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot z\\ \end{array} \]
                            10. Add Preprocessing

                            Alternative 11: 41.4% accurate, 1.1× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \cdot a \leq -1 \cdot 10^{+144}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;b \cdot a \leq 4 \cdot 10^{+20}:\\ \;\;\;\;i \cdot c\\ \mathbf{else}:\\ \;\;\;\;b \cdot a\\ \end{array} \end{array} \]
                            (FPCore (x y z t a b c i)
                             :precision binary64
                             (if (<= (* b a) -1e+144) (* b a) (if (<= (* b a) 4e+20) (* i c) (* b a))))
                            double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                            	double tmp;
                            	if ((b * a) <= -1e+144) {
                            		tmp = b * a;
                            	} else if ((b * a) <= 4e+20) {
                            		tmp = i * c;
                            	} else {
                            		tmp = b * a;
                            	}
                            	return tmp;
                            }
                            
                            real(8) function code(x, y, z, t, a, b, c, i)
                                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), intent (in) :: c
                                real(8), intent (in) :: i
                                real(8) :: tmp
                                if ((b * a) <= (-1d+144)) then
                                    tmp = b * a
                                else if ((b * a) <= 4d+20) then
                                    tmp = i * c
                                else
                                    tmp = b * a
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                            	double tmp;
                            	if ((b * a) <= -1e+144) {
                            		tmp = b * a;
                            	} else if ((b * a) <= 4e+20) {
                            		tmp = i * c;
                            	} else {
                            		tmp = b * a;
                            	}
                            	return tmp;
                            }
                            
                            def code(x, y, z, t, a, b, c, i):
                            	tmp = 0
                            	if (b * a) <= -1e+144:
                            		tmp = b * a
                            	elif (b * a) <= 4e+20:
                            		tmp = i * c
                            	else:
                            		tmp = b * a
                            	return tmp
                            
                            function code(x, y, z, t, a, b, c, i)
                            	tmp = 0.0
                            	if (Float64(b * a) <= -1e+144)
                            		tmp = Float64(b * a);
                            	elseif (Float64(b * a) <= 4e+20)
                            		tmp = Float64(i * c);
                            	else
                            		tmp = Float64(b * a);
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(x, y, z, t, a, b, c, i)
                            	tmp = 0.0;
                            	if ((b * a) <= -1e+144)
                            		tmp = b * a;
                            	elseif ((b * a) <= 4e+20)
                            		tmp = i * c;
                            	else
                            		tmp = b * a;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(b * a), $MachinePrecision], -1e+144], N[(b * a), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 4e+20], N[(i * c), $MachinePrecision], N[(b * a), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;b \cdot a \leq -1 \cdot 10^{+144}:\\
                            \;\;\;\;b \cdot a\\
                            
                            \mathbf{elif}\;b \cdot a \leq 4 \cdot 10^{+20}:\\
                            \;\;\;\;i \cdot c\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;b \cdot a\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if (*.f64 a b) < -1.00000000000000002e144 or 4e20 < (*.f64 a b)

                              1. Initial program 93.4%

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

                                \[\leadsto \color{blue}{a \cdot b} \]
                              4. Step-by-step derivation
                                1. *-commutativeN/A

                                  \[\leadsto \color{blue}{b \cdot a} \]
                                2. lower-*.f6456.5

                                  \[\leadsto \color{blue}{b \cdot a} \]
                              5. Applied rewrites56.5%

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

                              if -1.00000000000000002e144 < (*.f64 a b) < 4e20

                              1. Initial program 96.6%

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

                                \[\leadsto \color{blue}{c \cdot i} \]
                              4. Step-by-step derivation
                                1. *-commutativeN/A

                                  \[\leadsto \color{blue}{i \cdot c} \]
                                2. lower-*.f6434.8

                                  \[\leadsto \color{blue}{i \cdot c} \]
                              5. Applied rewrites34.8%

                                \[\leadsto \color{blue}{i \cdot c} \]
                            3. Recombined 2 regimes into one program.
                            4. Final simplification43.9%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -1 \cdot 10^{+144}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;b \cdot a \leq 4 \cdot 10^{+20}:\\ \;\;\;\;i \cdot c\\ \mathbf{else}:\\ \;\;\;\;b \cdot a\\ \end{array} \]
                            5. Add Preprocessing

                            Alternative 12: 25.9% accurate, 5.0× speedup?

                            \[\begin{array}{l} \\ b \cdot a \end{array} \]
                            (FPCore (x y z t a b c i) :precision binary64 (* b a))
                            double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                            	return b * a;
                            }
                            
                            real(8) function code(x, y, z, t, a, b, c, i)
                                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), intent (in) :: c
                                real(8), intent (in) :: i
                                code = b * a
                            end function
                            
                            public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                            	return b * a;
                            }
                            
                            def code(x, y, z, t, a, b, c, i):
                            	return b * a
                            
                            function code(x, y, z, t, a, b, c, i)
                            	return Float64(b * a)
                            end
                            
                            function tmp = code(x, y, z, t, a, b, c, i)
                            	tmp = b * a;
                            end
                            
                            code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(b * a), $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            b \cdot a
                            \end{array}
                            
                            Derivation
                            1. Initial program 95.3%

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

                              \[\leadsto \color{blue}{a \cdot b} \]
                            4. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \color{blue}{b \cdot a} \]
                              2. lower-*.f6426.5

                                \[\leadsto \color{blue}{b \cdot a} \]
                            5. Applied rewrites26.5%

                              \[\leadsto \color{blue}{b \cdot a} \]
                            6. Add Preprocessing

                            Reproduce

                            ?
                            herbie shell --seed 2024255 
                            (FPCore (x y z t a b c i)
                              :name "Linear.V4:$cdot from linear-1.19.1.3, C"
                              :precision binary64
                              (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))