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

Percentage Accurate: 95.8% → 98.0%
Time: 8.4s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 95.8% 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: 98.0% 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(b, a, \mathsf{fma}\left(y, x, t \cdot z\right)\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 b a (fma y x (* t z))))))
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(b, a, fma(y, x, (t * z)));
	}
	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(b, a, fma(y, x, Float64(t * z)));
	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[(b * a + N[(y * x + N[(t * z), $MachinePrecision]), $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(b, a, \mathsf{fma}\left(y, x, t \cdot z\right)\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 c around 0

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, z \cdot t\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. 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(b, a, \mathsf{fma}\left(y, x, t \cdot z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 43.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \cdot x \leq -5 \cdot 10^{+97}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;y \cdot x \leq -5 \cdot 10^{-44}:\\ \;\;\;\;i \cdot c\\ \mathbf{elif}\;y \cdot x \leq -1 \cdot 10^{-199}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;y \cdot x \leq 10^{-265}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{-84}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{+34}:\\ \;\;\;\;i \cdot c\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= (* y x) -5e+97)
   (* y x)
   (if (<= (* y x) -5e-44)
     (* i c)
     (if (<= (* y x) -1e-199)
       (* t z)
       (if (<= (* y x) 1e-265)
         (* b a)
         (if (<= (* y x) 5e-84)
           (* t z)
           (if (<= (* y x) 5e+34) (* i c) (* y x))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y * x) <= -5e+97) {
		tmp = y * x;
	} else if ((y * x) <= -5e-44) {
		tmp = i * c;
	} else if ((y * x) <= -1e-199) {
		tmp = t * z;
	} else if ((y * x) <= 1e-265) {
		tmp = b * a;
	} else if ((y * x) <= 5e-84) {
		tmp = t * z;
	} else if ((y * x) <= 5e+34) {
		tmp = i * c;
	} else {
		tmp = y * x;
	}
	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 ((y * x) <= (-5d+97)) then
        tmp = y * x
    else if ((y * x) <= (-5d-44)) then
        tmp = i * c
    else if ((y * x) <= (-1d-199)) then
        tmp = t * z
    else if ((y * x) <= 1d-265) then
        tmp = b * a
    else if ((y * x) <= 5d-84) then
        tmp = t * z
    else if ((y * x) <= 5d+34) then
        tmp = i * c
    else
        tmp = y * x
    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 ((y * x) <= -5e+97) {
		tmp = y * x;
	} else if ((y * x) <= -5e-44) {
		tmp = i * c;
	} else if ((y * x) <= -1e-199) {
		tmp = t * z;
	} else if ((y * x) <= 1e-265) {
		tmp = b * a;
	} else if ((y * x) <= 5e-84) {
		tmp = t * z;
	} else if ((y * x) <= 5e+34) {
		tmp = i * c;
	} else {
		tmp = y * x;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (y * x) <= -5e+97:
		tmp = y * x
	elif (y * x) <= -5e-44:
		tmp = i * c
	elif (y * x) <= -1e-199:
		tmp = t * z
	elif (y * x) <= 1e-265:
		tmp = b * a
	elif (y * x) <= 5e-84:
		tmp = t * z
	elif (y * x) <= 5e+34:
		tmp = i * c
	else:
		tmp = y * x
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (Float64(y * x) <= -5e+97)
		tmp = Float64(y * x);
	elseif (Float64(y * x) <= -5e-44)
		tmp = Float64(i * c);
	elseif (Float64(y * x) <= -1e-199)
		tmp = Float64(t * z);
	elseif (Float64(y * x) <= 1e-265)
		tmp = Float64(b * a);
	elseif (Float64(y * x) <= 5e-84)
		tmp = Float64(t * z);
	elseif (Float64(y * x) <= 5e+34)
		tmp = Float64(i * c);
	else
		tmp = Float64(y * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((y * x) <= -5e+97)
		tmp = y * x;
	elseif ((y * x) <= -5e-44)
		tmp = i * c;
	elseif ((y * x) <= -1e-199)
		tmp = t * z;
	elseif ((y * x) <= 1e-265)
		tmp = b * a;
	elseif ((y * x) <= 5e-84)
		tmp = t * z;
	elseif ((y * x) <= 5e+34)
		tmp = i * c;
	else
		tmp = y * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(y * x), $MachinePrecision], -5e+97], N[(y * x), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], -5e-44], N[(i * c), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], -1e-199], N[(t * z), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 1e-265], N[(b * a), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 5e-84], N[(t * z), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 5e+34], N[(i * c), $MachinePrecision], N[(y * x), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \cdot x \leq -5 \cdot 10^{+97}:\\
\;\;\;\;y \cdot x\\

\mathbf{elif}\;y \cdot x \leq -5 \cdot 10^{-44}:\\
\;\;\;\;i \cdot c\\

\mathbf{elif}\;y \cdot x \leq -1 \cdot 10^{-199}:\\
\;\;\;\;t \cdot z\\

\mathbf{elif}\;y \cdot x \leq 10^{-265}:\\
\;\;\;\;b \cdot a\\

\mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{-84}:\\
\;\;\;\;t \cdot z\\

\mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{+34}:\\
\;\;\;\;i \cdot c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -4.99999999999999999e97 or 4.9999999999999998e34 < (*.f64 x y)

    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 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-*.f6462.0

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

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

    if -4.99999999999999999e97 < (*.f64 x y) < -5.00000000000000039e-44 or 5.0000000000000002e-84 < (*.f64 x y) < 4.9999999999999998e34

    1. Initial program 93.5%

      \[\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-*.f6459.0

        \[\leadsto \color{blue}{i \cdot c} \]
    5. Applied rewrites59.0%

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

    if -5.00000000000000039e-44 < (*.f64 x y) < -9.99999999999999982e-200 or 9.99999999999999985e-266 < (*.f64 x y) < 5.0000000000000002e-84

    1. Initial program 97.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} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

    if -9.99999999999999982e-200 < (*.f64 x y) < 9.99999999999999985e-266

    1. Initial program 98.1%

      \[\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-*.f6445.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot x \leq -5 \cdot 10^{+97}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;y \cdot x \leq -5 \cdot 10^{-44}:\\ \;\;\;\;i \cdot c\\ \mathbf{elif}\;y \cdot x \leq -1 \cdot 10^{-199}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;y \cdot x \leq 10^{-265}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{-84}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{+34}:\\ \;\;\;\;i \cdot c\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 75.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(y, x, t \cdot z\right)\\ t_2 := t \cdot z + y \cdot x\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+97}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+41}:\\ \;\;\;\;\mathsf{fma}\left(i, c, b \cdot a\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{fma}\left(y, x, b \cdot a\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 (* t z))) (t_2 (+ (* t z) (* y x))))
   (if (<= t_2 -1e+97)
     t_1
     (if (<= t_2 4e+41)
       (fma i c (* b a))
       (if (<= t_2 2e+112) (fma y x (* b a)) 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, (t * z));
	double t_2 = (t * z) + (y * x);
	double tmp;
	if (t_2 <= -1e+97) {
		tmp = t_1;
	} else if (t_2 <= 4e+41) {
		tmp = fma(i, c, (b * a));
	} else if (t_2 <= 2e+112) {
		tmp = fma(y, x, (b * a));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = fma(y, x, Float64(t * z))
	t_2 = Float64(Float64(t * z) + Float64(y * x))
	tmp = 0.0
	if (t_2 <= -1e+97)
		tmp = t_1;
	elseif (t_2 <= 4e+41)
		tmp = fma(i, c, Float64(b * a));
	elseif (t_2 <= 2e+112)
		tmp = fma(y, x, Float64(b * a));
	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[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+97], t$95$1, If[LessEqual[t$95$2, 4e+41], N[(i * c + N[(b * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+112], N[(y * x + N[(b * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, x, t \cdot z\right)\\
t_2 := t \cdot z + y \cdot x\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+97}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+41}:\\
\;\;\;\;\mathsf{fma}\left(i, c, b \cdot a\right)\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+112}:\\
\;\;\;\;\mathsf{fma}\left(y, x, b \cdot a\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (*.f64 x y) (*.f64 z t)) < -1.0000000000000001e97 or 1.9999999999999999e112 < (+.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 92.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 0

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

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

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

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

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

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

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

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

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

      \[\leadsto t \cdot z + \color{blue}{x \cdot y} \]
    7. Step-by-step derivation
      1. Applied rewrites79.9%

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

      if -1.0000000000000001e97 < (+.f64 (*.f64 x y) (*.f64 z t)) < 4.00000000000000002e41

      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} + c \cdot i \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{b \cdot a} + c \cdot i \]
        2. lower-*.f6487.2

          \[\leadsto \color{blue}{b \cdot a} + c \cdot i \]
      5. Applied rewrites87.2%

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

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

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

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

          \[\leadsto \color{blue}{i \cdot c} + b \cdot a \]
        5. lower-fma.f6489.5

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

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

      if 4.00000000000000002e41 < (+.f64 (*.f64 x y) (*.f64 z t)) < 1.9999999999999999e112

      1. Initial program 99.9%

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

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

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

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

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

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

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

      Alternative 4: 65.9% accurate, 0.5× speedup?

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

        1. Initial program 88.5%

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

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

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

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

          \[\leadsto \mathsf{fma}\left(b, a, t \cdot z\right) \]
        7. Step-by-step derivation
          1. Applied rewrites78.0%

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

          if -1.99999999999999991e68 < (*.f64 a b) < -9.99999999999999934e-276 or 1.99999999999999987e-148 < (*.f64 a b) < 5.0000000000000004e90

          1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(i, c, x \cdot y\right) \]
          7. Step-by-step derivation
            1. Applied rewrites73.3%

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

            if -9.99999999999999934e-276 < (*.f64 a b) < 1.99999999999999987e-148

            1. Initial program 98.1%

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
              7. lower-*.f64100.0

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

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

              \[\leadsto t \cdot z + \color{blue}{x \cdot y} \]
            7. Step-by-step derivation
              1. Applied rewrites86.6%

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

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

            Alternative 5: 82.8% accurate, 0.5× speedup?

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

              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 c around 0

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

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

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

              if -1.0000000000000001e97 < (+.f64 (*.f64 x y) (*.f64 z t)) < 4.00000000000000002e41

              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} + c \cdot i \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \color{blue}{b \cdot a} + c \cdot i \]
                2. lower-*.f6487.2

                  \[\leadsto \color{blue}{b \cdot a} + c \cdot i \]
              5. Applied rewrites87.2%

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

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

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

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

                  \[\leadsto \color{blue}{i \cdot c} + b \cdot a \]
                5. lower-fma.f6489.5

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, b \cdot a\right)} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification89.1%

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

            Alternative 6: 42.4% accurate, 0.6× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \cdot x \leq -5 \cdot 10^{+97}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;y \cdot x \leq -2 \cdot 10^{-9}:\\ \;\;\;\;i \cdot c\\ \mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{-247}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{+34}:\\ \;\;\;\;i \cdot c\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \end{array} \]
            (FPCore (x y z t a b c i)
             :precision binary64
             (if (<= (* y x) -5e+97)
               (* y x)
               (if (<= (* y x) -2e-9)
                 (* i c)
                 (if (<= (* y x) 5e-247)
                   (* b a)
                   (if (<= (* y x) 5e+34) (* i c) (* y x))))))
            double code(double x, double y, double z, double t, double a, double b, double c, double i) {
            	double tmp;
            	if ((y * x) <= -5e+97) {
            		tmp = y * x;
            	} else if ((y * x) <= -2e-9) {
            		tmp = i * c;
            	} else if ((y * x) <= 5e-247) {
            		tmp = b * a;
            	} else if ((y * x) <= 5e+34) {
            		tmp = i * c;
            	} else {
            		tmp = y * x;
            	}
            	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 ((y * x) <= (-5d+97)) then
                    tmp = y * x
                else if ((y * x) <= (-2d-9)) then
                    tmp = i * c
                else if ((y * x) <= 5d-247) then
                    tmp = b * a
                else if ((y * x) <= 5d+34) then
                    tmp = i * c
                else
                    tmp = y * x
                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 ((y * x) <= -5e+97) {
            		tmp = y * x;
            	} else if ((y * x) <= -2e-9) {
            		tmp = i * c;
            	} else if ((y * x) <= 5e-247) {
            		tmp = b * a;
            	} else if ((y * x) <= 5e+34) {
            		tmp = i * c;
            	} else {
            		tmp = y * x;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t, a, b, c, i):
            	tmp = 0
            	if (y * x) <= -5e+97:
            		tmp = y * x
            	elif (y * x) <= -2e-9:
            		tmp = i * c
            	elif (y * x) <= 5e-247:
            		tmp = b * a
            	elif (y * x) <= 5e+34:
            		tmp = i * c
            	else:
            		tmp = y * x
            	return tmp
            
            function code(x, y, z, t, a, b, c, i)
            	tmp = 0.0
            	if (Float64(y * x) <= -5e+97)
            		tmp = Float64(y * x);
            	elseif (Float64(y * x) <= -2e-9)
            		tmp = Float64(i * c);
            	elseif (Float64(y * x) <= 5e-247)
            		tmp = Float64(b * a);
            	elseif (Float64(y * x) <= 5e+34)
            		tmp = Float64(i * c);
            	else
            		tmp = Float64(y * x);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t, a, b, c, i)
            	tmp = 0.0;
            	if ((y * x) <= -5e+97)
            		tmp = y * x;
            	elseif ((y * x) <= -2e-9)
            		tmp = i * c;
            	elseif ((y * x) <= 5e-247)
            		tmp = b * a;
            	elseif ((y * x) <= 5e+34)
            		tmp = i * c;
            	else
            		tmp = y * x;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(y * x), $MachinePrecision], -5e+97], N[(y * x), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], -2e-9], N[(i * c), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 5e-247], N[(b * a), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 5e+34], N[(i * c), $MachinePrecision], N[(y * x), $MachinePrecision]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \cdot x \leq -5 \cdot 10^{+97}:\\
            \;\;\;\;y \cdot x\\
            
            \mathbf{elif}\;y \cdot x \leq -2 \cdot 10^{-9}:\\
            \;\;\;\;i \cdot c\\
            
            \mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{-247}:\\
            \;\;\;\;b \cdot a\\
            
            \mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{+34}:\\
            \;\;\;\;i \cdot c\\
            
            \mathbf{else}:\\
            \;\;\;\;y \cdot x\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if (*.f64 x y) < -4.99999999999999999e97 or 4.9999999999999998e34 < (*.f64 x y)

              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 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-*.f6462.0

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

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

              if -4.99999999999999999e97 < (*.f64 x y) < -2.00000000000000012e-9 or 4.99999999999999978e-247 < (*.f64 x y) < 4.9999999999999998e34

              1. Initial program 94.5%

                \[\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.9

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

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

              if -2.00000000000000012e-9 < (*.f64 x y) < 4.99999999999999978e-247

              1. Initial program 97.8%

                \[\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-*.f6440.7

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

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

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

            Alternative 7: 89.6% accurate, 0.7× speedup?

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

              1. Initial program 87.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 0

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

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

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

              if -1.4e97 < (*.f64 z t) < 5.0000000000000004e43

              1. Initial program 96.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}{\left(a \cdot b + x \cdot y\right)} + c \cdot i \]
              4. Step-by-step derivation
                1. +-commutativeN/A

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

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

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

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

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

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

              if 5.0000000000000004e43 < (*.f64 z t)

              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 b around 0

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, \mathsf{fma}\left(y, x, z \cdot t\right)\right)} \]
            3. Recombined 3 regimes into one program.
            4. Final simplification93.4%

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

            Alternative 8: 89.9% accurate, 0.7× speedup?

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

              1. Initial program 91.9%

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

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

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

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

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

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

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

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

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

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

              if -1.00000000000000002e100 < (*.f64 c i) < 2e19

              1. Initial program 96.5%

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

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

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

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

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

            Alternative 9: 67.8% accurate, 0.9× speedup?

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

              1. Initial program 88.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 0

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

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

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

                \[\leadsto \mathsf{fma}\left(b, a, t \cdot z\right) \]
              7. Step-by-step derivation
                1. Applied rewrites83.5%

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

                if -7.4999999999999999e82 < (*.f64 z t) < 6.29999999999999998e62

                1. Initial program 96.8%

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

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

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

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

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

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

                  if 6.29999999999999998e62 < (*.f64 z t)

                  1. Initial program 93.2%

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
                    7. lower-*.f6496.8

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

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

                    \[\leadsto t \cdot z + \color{blue}{x \cdot y} \]
                  7. Step-by-step derivation
                    1. Applied rewrites83.7%

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot z \leq -7.5 \cdot 10^{+82}:\\ \;\;\;\;\mathsf{fma}\left(b, a, t \cdot z\right)\\ \mathbf{elif}\;t \cdot z \leq 6.3 \cdot 10^{+62}:\\ \;\;\;\;\mathsf{fma}\left(y, x, b \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\ \end{array} \]
                  10. Add Preprocessing

                  Alternative 10: 67.6% accurate, 0.9× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(y, x, t \cdot z\right)\\ \mathbf{if}\;t \cdot z \leq -1.45 \cdot 10^{+97}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \cdot z \leq 6.3 \cdot 10^{+62}:\\ \;\;\;\;\mathsf{fma}\left(y, x, b \cdot a\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 (* t z))))
                     (if (<= (* t z) -1.45e+97)
                       t_1
                       (if (<= (* t z) 6.3e+62) (fma y x (* b a)) 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, (t * z));
                  	double tmp;
                  	if ((t * z) <= -1.45e+97) {
                  		tmp = t_1;
                  	} else if ((t * z) <= 6.3e+62) {
                  		tmp = fma(y, x, (b * a));
                  	} else {
                  		tmp = t_1;
                  	}
                  	return tmp;
                  }
                  
                  function code(x, y, z, t, a, b, c, i)
                  	t_1 = fma(y, x, Float64(t * z))
                  	tmp = 0.0
                  	if (Float64(t * z) <= -1.45e+97)
                  		tmp = t_1;
                  	elseif (Float64(t * z) <= 6.3e+62)
                  		tmp = fma(y, x, Float64(b * a));
                  	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[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t * z), $MachinePrecision], -1.45e+97], t$95$1, If[LessEqual[N[(t * z), $MachinePrecision], 6.3e+62], N[(y * x + N[(b * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_1 := \mathsf{fma}\left(y, x, t \cdot z\right)\\
                  \mathbf{if}\;t \cdot z \leq -1.45 \cdot 10^{+97}:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{elif}\;t \cdot z \leq 6.3 \cdot 10^{+62}:\\
                  \;\;\;\;\mathsf{fma}\left(y, x, b \cdot a\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_1\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (*.f64 z t) < -1.44999999999999994e97 or 6.29999999999999998e62 < (*.f64 z t)

                    1. Initial program 90.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 0

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

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

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

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

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

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

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

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

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

                      \[\leadsto t \cdot z + \color{blue}{x \cdot y} \]
                    7. Step-by-step derivation
                      1. Applied rewrites83.9%

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

                      if -1.44999999999999994e97 < (*.f64 z t) < 6.29999999999999998e62

                      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 c around 0

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

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

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

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

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot z \leq -1.45 \cdot 10^{+97}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\ \mathbf{elif}\;t \cdot z \leq 6.3 \cdot 10^{+62}:\\ \;\;\;\;\mathsf{fma}\left(y, x, b \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\ \end{array} \]
                      10. Add Preprocessing

                      Alternative 11: 63.9% accurate, 0.9× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \cdot z \leq -1.35 \cdot 10^{+158}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+115}:\\ \;\;\;\;\mathsf{fma}\left(y, x, b \cdot a\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.35e+158)
                         (* t z)
                         (if (<= (* t z) 2e+115) (fma y x (* 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) <= -1.35e+158) {
                      		tmp = t * z;
                      	} else if ((t * z) <= 2e+115) {
                      		tmp = fma(y, x, (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) <= -1.35e+158)
                      		tmp = Float64(t * z);
                      	elseif (Float64(t * z) <= 2e+115)
                      		tmp = fma(y, x, Float64(b * a));
                      	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.35e+158], N[(t * z), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 2e+115], N[(y * x + N[(b * a), $MachinePrecision]), $MachinePrecision], N[(t * z), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;t \cdot z \leq -1.35 \cdot 10^{+158}:\\
                      \;\;\;\;t \cdot z\\
                      
                      \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+115}:\\
                      \;\;\;\;\mathsf{fma}\left(y, x, b \cdot a\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t \cdot z\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (*.f64 z t) < -1.34999999999999989e158 or 2e115 < (*.f64 z t)

                        1. Initial program 88.5%

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

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

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

                        if -1.34999999999999989e158 < (*.f64 z t) < 2e115

                        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 c around 0

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

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

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

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

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

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

                        Alternative 12: 42.5% accurate, 1.1× speedup?

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

                          1. Initial program 91.8%

                            \[\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-*.f6455.9

                              \[\leadsto \color{blue}{i \cdot c} \]
                          5. Applied rewrites55.9%

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

                          if -1.00000000000000002e100 < (*.f64 c i) < 4.9999999999999996e22

                          1. Initial program 96.5%

                            \[\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-*.f6435.4

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

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

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

                        Alternative 13: 26.5% 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 94.5%

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

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

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

                        Reproduce

                        ?
                        herbie shell --seed 2024249 
                        (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)))