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

Percentage Accurate: 96.0% → 98.0%
Time: 10.2s
Alternatives: 14
Speedup: 1.3×

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 14 alternatives:

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

Initial Program: 96.0% accurate, 1.0× speedup?

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

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

Alternative 1: 98.0% accurate, 1.3× speedup?

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

\\
\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, \mathsf{fma}\left(a, b, c \cdot i\right)\right)\right)
\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. Step-by-step derivation
    1. lift-+.f64N/A

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

      \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} + c \cdot i \]
    3. associate-+l+N/A

      \[\leadsto \color{blue}{\left(x \cdot y + z \cdot t\right) + \left(a \cdot b + c \cdot i\right)} \]
    4. lift-+.f64N/A

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

      \[\leadsto \color{blue}{\left(z \cdot t + x \cdot y\right)} + \left(a \cdot b + c \cdot i\right) \]
    6. associate-+l+N/A

      \[\leadsto \color{blue}{z \cdot t + \left(x \cdot y + \left(a \cdot b + c \cdot i\right)\right)} \]
    7. lift-*.f64N/A

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

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, \mathsf{fma}\left(a, b, c \cdot i\right)\right)\right)} \]
  5. Add Preprocessing

Alternative 2: 43.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+107}:\\
\;\;\;\;z \cdot t\\

\mathbf{elif}\;z \cdot t \leq -2 \cdot 10^{-276}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;z \cdot t \leq 10^{-316}:\\
\;\;\;\;c \cdot i\\

\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{-87}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+79}:\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 z t) < -5.0000000000000002e107 or 1.99999999999999993e79 < (*.f64 z t)

    1. Initial program 94.1%

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

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

        \[\leadsto \color{blue}{t \cdot z} \]
    5. Applied rewrites62.1%

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

    if -5.0000000000000002e107 < (*.f64 z t) < -2e-276 or 9.999999837e-317 < (*.f64 z t) < 2.00000000000000004e-87

    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 a around inf

      \[\leadsto \color{blue}{a \cdot b} \]
    4. Step-by-step derivation
      1. lower-*.f6445.5

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

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

    if -2e-276 < (*.f64 z t) < 9.999999837e-317

    1. Initial program 86.2%

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

      \[\leadsto \color{blue}{c \cdot i} \]
    4. Step-by-step derivation
      1. lower-*.f6459.9

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

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

    if 2.00000000000000004e-87 < (*.f64 z t) < 1.99999999999999993e79

    1. Initial program 94.0%

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

        \[\leadsto \color{blue}{x \cdot y} \]
    5. Applied rewrites45.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+107}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;z \cdot t \leq -2 \cdot 10^{-276}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;z \cdot t \leq 10^{-316}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{-87}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+79}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 42.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+107}:\\
\;\;\;\;z \cdot t\\

\mathbf{elif}\;z \cdot t \leq -2 \cdot 10^{-276}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;z \cdot t \leq 10^{-316}:\\
\;\;\;\;c \cdot i\\

\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{-87}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+201}:\\
\;\;\;\;c \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 z t) < -5.0000000000000002e107 or 4.9999999999999995e201 < (*.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 z around inf

      \[\leadsto \color{blue}{t \cdot z} \]
    4. Step-by-step derivation
      1. lower-*.f6470.9

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

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

    if -5.0000000000000002e107 < (*.f64 z t) < -2e-276 or 9.999999837e-317 < (*.f64 z t) < 2.00000000000000004e-87

    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 a around inf

      \[\leadsto \color{blue}{a \cdot b} \]
    4. Step-by-step derivation
      1. lower-*.f6445.5

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

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

    if -2e-276 < (*.f64 z t) < 9.999999837e-317 or 2.00000000000000004e-87 < (*.f64 z t) < 4.9999999999999995e201

    1. Initial program 92.7%

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

      \[\leadsto \color{blue}{c \cdot i} \]
    4. Step-by-step derivation
      1. lower-*.f6445.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+107}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;z \cdot t \leq -2 \cdot 10^{-276}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;z \cdot t \leq 10^{-316}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{-87}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+201}:\\ \;\;\;\;c \cdot i\\ \mathbf{else}:\\ \;\;\;\;z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 75.0% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+193}:\\
\;\;\;\;\mathsf{fma}\left(a, b, c \cdot i\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)) < -9.9999999999999997e106 or 2.00000000000000013e193 < (+.f64 (*.f64 x y) (*.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. Step-by-step derivation
      1. lift-+.f64N/A

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

        \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} + c \cdot i \]
      3. associate-+l+N/A

        \[\leadsto \color{blue}{\left(x \cdot y + z \cdot t\right) + \left(a \cdot b + c \cdot i\right)} \]
      4. lift-+.f64N/A

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

        \[\leadsto \color{blue}{\left(z \cdot t + x \cdot y\right)} + \left(a \cdot b + c \cdot i\right) \]
      6. associate-+l+N/A

        \[\leadsto \color{blue}{z \cdot t + \left(x \cdot y + \left(a \cdot b + c \cdot i\right)\right)} \]
      7. lift-*.f64N/A

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{x \cdot y}\right) \]
    6. Step-by-step derivation
      1. lower-*.f6485.0

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

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

    if -9.9999999999999997e106 < (+.f64 (*.f64 x y) (*.f64 z t)) < 2.00000000000000013e193

    1. Initial program 98.4%

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

      \[\leadsto \color{blue}{a \cdot b} \]
    4. Step-by-step derivation
      1. lower-*.f6441.8

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

      \[\leadsto \color{blue}{a \cdot b} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(a, b, c \cdot i\right) \]
    10. Step-by-step derivation
      1. Applied rewrites79.2%

        \[\leadsto \mathsf{fma}\left(a, b, c \cdot i\right) \]
    11. Recombined 2 regimes into one program.
    12. Add Preprocessing

    Alternative 5: 66.2% accurate, 0.7× speedup?

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

      1. Initial program 91.5%

        \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

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

          \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} + c \cdot i \]
        3. associate-+l+N/A

          \[\leadsto \color{blue}{\left(x \cdot y + z \cdot t\right) + \left(a \cdot b + c \cdot i\right)} \]
        4. lift-+.f64N/A

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

          \[\leadsto \color{blue}{\left(z \cdot t + x \cdot y\right)} + \left(a \cdot b + c \cdot i\right) \]
        6. associate-+l+N/A

          \[\leadsto \color{blue}{z \cdot t + \left(x \cdot y + \left(a \cdot b + c \cdot i\right)\right)} \]
        7. lift-*.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{c \cdot i}\right) \]
      6. Step-by-step derivation
        1. lower-*.f6474.7

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

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

      if -2.0000000000000001e92 < (*.f64 z t) < 2.00000000000000004e-87

      1. Initial program 95.0%

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

        \[\leadsto \color{blue}{a \cdot b} \]
      4. Step-by-step derivation
        1. lower-*.f6442.2

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

        \[\leadsto \color{blue}{a \cdot b} \]
      6. Taylor expanded in x around 0

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a, b, c \cdot i\right) \]
      10. Step-by-step derivation
        1. Applied rewrites72.0%

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

        if 2.00000000000000004e-87 < (*.f64 z t) < 5.00000000000000024e25

        1. Initial program 96.2%

          \[\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} + c \cdot i \]
        4. Step-by-step derivation
          1. lower-*.f6477.3

            \[\leadsto \color{blue}{x \cdot y} + c \cdot i \]
        5. Applied rewrites77.3%

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

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

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

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

            \[\leadsto \color{blue}{i \cdot c} + x \cdot y \]
          5. lower-fma.f6481.0

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

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

        if 5.00000000000000024e25 < (*.f64 z t)

        1. Initial program 95.1%

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

          \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]
        4. Step-by-step derivation
          1. lower-*.f6436.1

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, a \cdot b\right)} \]
        8. Taylor expanded in z around inf

          \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{t \cdot z}\right) \]
        9. Step-by-step derivation
          1. lower-*.f6479.0

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

          \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{t \cdot z}\right) \]
      11. Recombined 4 regimes into one program.
      12. Final simplification75.1%

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

      Alternative 6: 66.2% accurate, 0.7× speedup?

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

        1. Initial program 93.6%

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

          \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]
        4. Step-by-step derivation
          1. lower-*.f6429.6

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, a \cdot b\right)} \]
        8. Taylor expanded in z around inf

          \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{t \cdot z}\right) \]
        9. Step-by-step derivation
          1. lower-*.f6476.2

            \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{t \cdot z}\right) \]
        10. Applied rewrites76.2%

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

        if -2.0000000000000001e92 < (*.f64 z t) < 2.00000000000000004e-87

        1. Initial program 95.0%

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

          \[\leadsto \color{blue}{a \cdot b} \]
        4. Step-by-step derivation
          1. lower-*.f6442.2

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

          \[\leadsto \color{blue}{a \cdot b} \]
        6. Taylor expanded in x around 0

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(a, b, c \cdot i\right) \]
        10. Step-by-step derivation
          1. Applied rewrites72.0%

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

          if 2.00000000000000004e-87 < (*.f64 z t) < 5.00000000000000024e25

          1. Initial program 96.2%

            \[\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} + c \cdot i \]
          4. Step-by-step derivation
            1. lower-*.f6477.3

              \[\leadsto \color{blue}{x \cdot y} + c \cdot i \]
          5. Applied rewrites77.3%

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

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

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

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

              \[\leadsto \color{blue}{i \cdot c} + x \cdot y \]
            5. lower-fma.f6481.0

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)} \]
        11. Recombined 3 regimes into one program.
        12. Final simplification74.7%

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

        Alternative 7: 89.4% accurate, 0.7× speedup?

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

          1. Initial program 85.1%

            \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-+.f64N/A

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

              \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} + c \cdot i \]
            3. associate-+l+N/A

              \[\leadsto \color{blue}{\left(x \cdot y + z \cdot t\right) + \left(a \cdot b + c \cdot i\right)} \]
            4. lift-+.f64N/A

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

              \[\leadsto \color{blue}{\left(z \cdot t + x \cdot y\right)} + \left(a \cdot b + c \cdot i\right) \]
            6. associate-+l+N/A

              \[\leadsto \color{blue}{z \cdot t + \left(x \cdot y + \left(a \cdot b + c \cdot i\right)\right)} \]
            7. lift-*.f64N/A

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, \color{blue}{a \cdot b}\right)\right) \]
          6. Step-by-step derivation
            1. lower-*.f6493.4

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

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

          if -9.9999999999999997e106 < (*.f64 x y) < 9.9999999999999993e111

          1. Initial program 98.3%

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

            \[\leadsto \color{blue}{a \cdot b} \]
          4. Step-by-step derivation
            1. lower-*.f6431.8

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

            \[\leadsto \color{blue}{a \cdot b} \]
          6. Taylor expanded in x around 0

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

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

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

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

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

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

        Alternative 8: 89.4% accurate, 0.7× speedup?

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

          1. Initial program 85.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. associate-+r+N/A

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

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

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

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

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

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

          if -9.9999999999999997e106 < (*.f64 x y) < 9.9999999999999993e111

          1. Initial program 98.3%

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

            \[\leadsto \color{blue}{a \cdot b} \]
          4. Step-by-step derivation
            1. lower-*.f6431.8

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

            \[\leadsto \color{blue}{a \cdot b} \]
          6. Taylor expanded in x around 0

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

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

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

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

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

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

        Alternative 9: 87.0% accurate, 0.7× speedup?

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

          1. Initial program 91.3%

            \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-+.f64N/A

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

              \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} + c \cdot i \]
            3. associate-+l+N/A

              \[\leadsto \color{blue}{\left(x \cdot y + z \cdot t\right) + \left(a \cdot b + c \cdot i\right)} \]
            4. lift-+.f64N/A

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

              \[\leadsto \color{blue}{\left(z \cdot t + x \cdot y\right)} + \left(a \cdot b + c \cdot i\right) \]
            6. associate-+l+N/A

              \[\leadsto \color{blue}{z \cdot t + \left(x \cdot y + \left(a \cdot b + c \cdot i\right)\right)} \]
            7. lift-*.f64N/A

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{x \cdot y}\right) \]
          6. Step-by-step derivation
            1. lower-*.f6487.3

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

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

          if -5.0000000000000002e107 < (*.f64 z t) < 5.00000000000000024e25

          1. Initial program 95.2%

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

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

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

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

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

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

          if 5.00000000000000024e25 < (*.f64 z t)

          1. Initial program 95.1%

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

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

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

            \[\leadsto \color{blue}{a \cdot b} \]
          6. Taylor expanded in x around 0

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

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

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

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

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

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

        Alternative 10: 85.9% accurate, 0.7× speedup?

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

          1. Initial program 85.1%

            \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-+.f64N/A

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

              \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} + c \cdot i \]
            3. associate-+l+N/A

              \[\leadsto \color{blue}{\left(x \cdot y + z \cdot t\right) + \left(a \cdot b + c \cdot i\right)} \]
            4. lift-+.f64N/A

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

              \[\leadsto \color{blue}{\left(z \cdot t + x \cdot y\right)} + \left(a \cdot b + c \cdot i\right) \]
            6. associate-+l+N/A

              \[\leadsto \color{blue}{z \cdot t + \left(x \cdot y + \left(a \cdot b + c \cdot i\right)\right)} \]
            7. lift-*.f64N/A

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{x \cdot y}\right) \]
          6. Step-by-step derivation
            1. lower-*.f6485.5

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

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

          if -1.15e107 < (*.f64 x y) < 5.60000000000000023e123

          1. Initial program 98.3%

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

            \[\leadsto \color{blue}{a \cdot b} \]
          4. Step-by-step derivation
            1. lower-*.f6431.8

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

            \[\leadsto \color{blue}{a \cdot b} \]
          6. Taylor expanded in x around 0

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

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

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

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

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

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

        Alternative 11: 66.1% accurate, 0.9× speedup?

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

          1. Initial program 94.0%

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

            \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]
          4. Step-by-step derivation
            1. lower-*.f6430.5

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, a \cdot b\right)} \]
          8. Taylor expanded in z around inf

            \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{t \cdot z}\right) \]
          9. Step-by-step derivation
            1. lower-*.f6474.0

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

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

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

          1. Initial program 94.9%

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

            \[\leadsto \color{blue}{a \cdot b} \]
          4. Step-by-step derivation
            1. lower-*.f6439.6

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

            \[\leadsto \color{blue}{a \cdot b} \]
          6. Taylor expanded in x around 0

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(a, b, c \cdot i\right) \]
          10. Step-by-step derivation
            1. Applied rewrites69.7%

              \[\leadsto \mathsf{fma}\left(a, b, c \cdot i\right) \]
          11. Recombined 2 regimes into one program.
          12. Final simplification71.7%

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

          Alternative 12: 62.7% accurate, 0.9× speedup?

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

              \[\leadsto \color{blue}{t \cdot z} \]
            4. Step-by-step derivation
              1. lower-*.f6470.9

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

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

            if -5.0000000000000002e107 < (*.f64 z t) < 4.9999999999999995e201

            1. Initial program 95.4%

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

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

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

              \[\leadsto \color{blue}{a \cdot b} \]
            6. Taylor expanded in x around 0

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(a, b, c \cdot i\right) \]
            10. Step-by-step derivation
              1. Applied rewrites66.5%

                \[\leadsto \mathsf{fma}\left(a, b, c \cdot i\right) \]
            11. Recombined 2 regimes into one program.
            12. Final simplification67.9%

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

            Alternative 13: 42.2% accurate, 1.1× speedup?

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

              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 a around inf

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

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

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

              if -4.39999999999999983e106 < (*.f64 a b) < 3.05e119

              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 inf

                \[\leadsto \color{blue}{c \cdot i} \]
              4. Step-by-step derivation
                1. lower-*.f6434.5

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

                \[\leadsto \color{blue}{c \cdot i} \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 14: 26.9% accurate, 5.0× speedup?

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

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

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

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

            Reproduce

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