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

Percentage Accurate: 95.6% → 98.0%
Time: 7.4s
Alternatives: 12
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 12 alternatives:

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

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

\\
\mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, a \cdot b\right)\right)\right)
\end{array}
Derivation
  1. Initial program 95.7%

    \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -2 \cdot 10^{+159}:\\
\;\;\;\;\mathsf{fma}\left(i, c, \mathsf{fma}\left(t, z, x \cdot y\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -1.9999999999999999e159

    1. Initial program 81.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 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. lower-fma.f64N/A

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

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

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

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

    if -1.9999999999999999e159 < (*.f64 c i) < 1.99999999999999988e39

    1. Initial program 99.4%

      \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999988e39 < (*.f64 c i)

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

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

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

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

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

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

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

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

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

Alternative 3: 89.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+127}:\\
\;\;\;\;\mathsf{fma}\left(x, y, \mathsf{fma}\left(c, i, a \cdot b\right)\right)\\

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+127}:\\
\;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, c, \mathsf{fma}\left(t, z, x \cdot y\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -1.99999999999999991e127

    1. Initial program 90.7%

      \[\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. *-commutativeN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites95.6%

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

      if -1.99999999999999991e127 < (*.f64 x y) < 5.0000000000000004e127

      1. Initial program 98.2%

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

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

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

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

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

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

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

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

      if 5.0000000000000004e127 < (*.f64 x y)

      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. Taylor expanded in a 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. lower-fma.f64N/A

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

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

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

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

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

    Alternative 4: 88.4% accurate, 0.7× speedup?

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

      1. Initial program 94.4%

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

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

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

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

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

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

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

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

      if -2.00000000000000002e55 < (*.f64 z t) < 2.0000000000000001e137

      1. Initial program 99.3%

        \[\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. *-commutativeN/A

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

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

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

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

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

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

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

      if 2.0000000000000001e137 < (*.f64 z t)

      1. Initial program 86.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 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. lower-fma.f64N/A

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

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

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

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

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

    Alternative 5: 89.9% accurate, 0.7× speedup?

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

      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. 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. *-commutativeN/A

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

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

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

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

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

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

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

      if -1.99999999999999991e127 < (*.f64 x y) < 1e104

      1. Initial program 98.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, 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 -2 \cdot 10^{+127}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, x \cdot y\right)\right)\\ \mathbf{elif}\;x \cdot y \leq 10^{+104}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, x \cdot y\right)\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 6: 84.8% accurate, 0.7× speedup?

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

      1. Initial program 87.9%

        \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, t, a \cdot \color{blue}{b}\right) \]
      9. Step-by-step derivation
        1. Applied rewrites25.2%

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

          \[\leadsto \color{blue}{x \cdot y} \]
        3. Step-by-step derivation
          1. lower-*.f6479.4

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

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

        if -4.1999999999999998e182 < (*.f64 x y) < 1.75000000000000002e251

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

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

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

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

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

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

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

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

      Alternative 7: 42.2% accurate, 0.8× speedup?

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

        1. Initial program 87.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(z, t, a \cdot \color{blue}{b}\right) \]
        9. Step-by-step derivation
          1. Applied rewrites80.8%

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

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

              \[\leadsto \color{blue}{t \cdot z} \]
          4. Applied rewrites72.1%

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

          if -5.0000000000000001e114 < (*.f64 z t) < 1.49999999999999992e-172

          1. Initial program 99.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 inf

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

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

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

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

          if 1.49999999999999992e-172 < (*.f64 z t) < 1e176

          1. Initial program 100.0%

            \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{x \cdot y} \]
            3. Step-by-step derivation
              1. lower-*.f6441.4

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

              \[\leadsto \color{blue}{x \cdot y} \]
          10. Recombined 3 regimes into one program.
          11. Final simplification51.6%

            \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot z \leq -5 \cdot 10^{+114}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;t \cdot z \leq 1.5 \cdot 10^{-172}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;t \cdot z \leq 10^{+176}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;t \cdot z\\ \end{array} \]
          12. Add Preprocessing

          Alternative 8: 66.3% accurate, 0.9× speedup?

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

            1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

              if -5.0000000000000001e114 < (*.f64 z t) < 2.0000000000000001e138

              1. Initial program 99.4%

                \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

                if 2.0000000000000001e138 < (*.f64 z t)

                1. Initial program 85.7%

                  \[\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 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. lower-fma.f64N/A

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(i, c, t \cdot z\right) \]
                7. Step-by-step derivation
                  1. Applied rewrites77.8%

                    \[\leadsto \mathsf{fma}\left(i, c, t \cdot z\right) \]
                8. Recombined 3 regimes into one program.
                9. Final simplification71.5%

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

                Alternative 9: 65.7% accurate, 0.9× speedup?

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

                  1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

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

                    if -5.0000000000000001e114 < (*.f64 z t) < 4.9999999999999998e-39

                    1. Initial program 99.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                    Alternative 10: 63.3% accurate, 0.9× speedup?

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

                      1. Initial program 88.2%

                        \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(z, t, a \cdot \color{blue}{b}\right) \]
                      9. Step-by-step derivation
                        1. Applied rewrites24.6%

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

                          \[\leadsto \color{blue}{x \cdot y} \]
                        3. Step-by-step derivation
                          1. lower-*.f6478.5

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

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

                        if -3.3000000000000001e182 < (*.f64 x y) < 1.3600000000000001e225

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

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(a, \color{blue}{b}, t \cdot z\right) \]
                        8. Recombined 2 regimes into one program.
                        9. Add Preprocessing

                        Alternative 11: 43.5% accurate, 1.1× speedup?

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

                          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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(z, t, a \cdot \color{blue}{b}\right) \]
                          9. Step-by-step derivation
                            1. Applied rewrites30.6%

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

                              \[\leadsto \color{blue}{x \cdot y} \]
                            3. Step-by-step derivation
                              1. lower-*.f6467.0

                                \[\leadsto \color{blue}{x \cdot y} \]
                            4. Applied rewrites67.0%

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

                            if -9.0000000000000001e125 < (*.f64 x y) < 1.01999999999999998e106

                            1. Initial program 98.2%

                              \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                            2. Add Preprocessing
                            3. 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. *-commutativeN/A

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, \color{blue}{b \cdot a}\right)\right)\right) \]
                              18. lower-*.f6499.4

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(z, t, a \cdot \color{blue}{b}\right) \]
                            9. Step-by-step derivation
                              1. Applied rewrites67.9%

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

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

                                  \[\leadsto \color{blue}{t \cdot z} \]
                              4. Applied rewrites35.6%

                                \[\leadsto \color{blue}{t \cdot z} \]
                            10. Recombined 2 regimes into one program.
                            11. Add Preprocessing

                            Alternative 12: 28.0% accurate, 5.0× speedup?

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

                              \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \color{blue}{t \cdot z} \]
                              4. Applied rewrites29.1%

                                \[\leadsto \color{blue}{t \cdot z} \]
                              5. Add Preprocessing

                              Reproduce

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