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

Percentage Accurate: 95.7% → 97.9%
Time: 7.3s
Alternatives: 11
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 11 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.7% accurate, 1.0× speedup?

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

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

Alternative 1: 97.9% 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 97.6%

    \[\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: 44.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.2 \cdot 10^{+108}:\\
\;\;\;\;c \cdot i\\

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

\mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{-145}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;c \cdot i \leq 0:\\
\;\;\;\;x \cdot y\\

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

\mathbf{else}:\\
\;\;\;\;c \cdot i\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 c i) < -1.20000000000000009e108 or 9.99999999999999953e67 < (*.f64 c i)

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

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

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

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

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

        \[\leadsto a \cdot b \]
      3. Step-by-step derivation
        1. Applied rewrites14.1%

          \[\leadsto b \cdot a \]
        2. Taylor expanded in c around inf

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

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

            \[\leadsto \color{blue}{i \cdot c} \]
        4. Applied rewrites62.8%

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

        if -1.20000000000000009e108 < (*.f64 c i) < -9.99999999999999928e-35 or -4.9999999999999998e-145 < (*.f64 c i) < -0.0

        1. Initial program 100.0%

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

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

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

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

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

            \[\leadsto a \cdot b \]
          3. Step-by-step derivation
            1. Applied rewrites25.3%

              \[\leadsto b \cdot a \]
            2. Taylor expanded in x around inf

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

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

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

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

            if -9.99999999999999928e-35 < (*.f64 c i) < -4.9999999999999998e-145

            1. Initial program 99.9%

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

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

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

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

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

                \[\leadsto a \cdot b \]
              3. Step-by-step derivation
                1. Applied rewrites62.4%

                  \[\leadsto b \cdot a \]

                if -0.0 < (*.f64 c i) < 9.99999999999999953e67

                1. Initial program 96.9%

                  \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                2. Add Preprocessing
                3. Taylor expanded in 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-*.f6459.1

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

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

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

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

                    \[\leadsto a \cdot b \]
                  3. Step-by-step derivation
                    1. Applied rewrites28.0%

                      \[\leadsto b \cdot a \]
                    2. Taylor expanded in z around inf

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

                        \[\leadsto \color{blue}{t \cdot z} \]
                    4. Applied rewrites42.7%

                      \[\leadsto \color{blue}{t \cdot z} \]
                  4. Recombined 4 regimes into one program.
                  5. Final simplification55.1%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -1.2 \cdot 10^{+108}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -1 \cdot 10^{-34}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{-145}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;c \cdot i \leq 0:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \cdot i \leq 10^{+68}:\\ \;\;\;\;t \cdot z\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]
                  6. Add Preprocessing

                  Alternative 3: 63.9% accurate, 0.5× speedup?

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

                    1. Initial program 94.9%

                      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                    2. Add Preprocessing
                    3. Taylor expanded in 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-*.f6487.9

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

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

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

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

                        \[\leadsto a \cdot b \]
                      3. Step-by-step derivation
                        1. Applied rewrites12.3%

                          \[\leadsto b \cdot a \]
                        2. Taylor expanded in c around inf

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

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

                            \[\leadsto \color{blue}{i \cdot c} \]
                        4. Applied rewrites70.6%

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

                        if -1.20000000000000009e108 < (*.f64 c i) < -0.0 or 5e64 < (*.f64 c i) < 9.9999999999999999e202

                        1. Initial program 99.9%

                          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                        2. Add Preprocessing
                        3. Taylor expanded in 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-*.f6482.8

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

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

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

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

                          if -0.0 < (*.f64 c i) < 5e64

                          1. Initial program 96.7%

                            \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                          2. Add Preprocessing
                          3. Taylor expanded in 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-*.f6475.9

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

                            \[\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 rewrites66.3%

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

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

                          Alternative 4: 67.1% accurate, 0.7× speedup?

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

                            1. Initial program 96.0%

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

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

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

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

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

                                \[\leadsto a \cdot b \]
                              3. Step-by-step derivation
                                1. Applied rewrites12.9%

                                  \[\leadsto b \cdot a \]
                                2. Taylor expanded in a around 0

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

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

                                  if -5.00000000000000011e63 < (*.f64 c i) < -0.0

                                  1. Initial program 100.0%

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

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

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

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

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

                                    if -0.0 < (*.f64 c i) < 9.9999999999999998e100

                                    1. Initial program 97.0%

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

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

                                      \[\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 rewrites66.3%

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

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

                                    Alternative 5: 89.3% accurate, 0.7× speedup?

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

                                      1. Initial program 94.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-*.f6490.1

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

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

                                      if -4.99999999999999997e88 < (*.f64 z t) < 9.99999999999999982e108

                                      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-*.f6496.9

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

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

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot z \leq -5 \cdot 10^{+88}:\\ \;\;\;\;\mathsf{fma}\left(i, c, \mathsf{fma}\left(t, z, x \cdot y\right)\right)\\ \mathbf{elif}\;t \cdot z \leq 10^{+109}:\\ \;\;\;\;\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 6: 89.7% accurate, 0.7× speedup?

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

                                      1. Initial program 94.6%

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

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

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

                                      if -4.99999999999999997e88 < (*.f64 z t) < 5.0000000000000002e91

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

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

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

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot z \leq -5 \cdot 10^{+88}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \mathbf{elif}\;t \cdot z \leq 5 \cdot 10^{+91}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, 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 7: 85.6% accurate, 0.7× speedup?

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

                                      1. Initial program 99.9%

                                        \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                      2. Add Preprocessing
                                      3. Taylor expanded in 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.5

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

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

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

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

                                        if -4.9999999999999997e174 < (*.f64 x y) < 9.9999999999999996e86

                                        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-*.f6489.4

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

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

                                        if 9.9999999999999996e86 < (*.f64 x y)

                                        1. Initial program 94.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-*.f6488.0

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

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

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

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

                                            \[\leadsto a \cdot b \]
                                          3. Step-by-step derivation
                                            1. Applied rewrites9.4%

                                              \[\leadsto b \cdot a \]
                                            2. Taylor expanded in a around 0

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

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

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

                                            Alternative 8: 42.6% accurate, 0.8× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \cdot z \leq -5 \cdot 10^{+88}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;t \cdot z \leq 5 \cdot 10^{-218}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;t \cdot z \leq 10^{+109}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;t \cdot z\\ \end{array} \end{array} \]
                                            (FPCore (x y z t a b c i)
                                             :precision binary64
                                             (if (<= (* t z) -5e+88)
                                               (* t z)
                                               (if (<= (* t z) 5e-218) (* c i) (if (<= (* t z) 1e+109) (* a b) (* 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+88) {
                                            		tmp = t * z;
                                            	} else if ((t * z) <= 5e-218) {
                                            		tmp = c * i;
                                            	} else if ((t * z) <= 1e+109) {
                                            		tmp = a * b;
                                            	} 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+88)) then
                                                    tmp = t * z
                                                else if ((t * z) <= 5d-218) then
                                                    tmp = c * i
                                                else if ((t * z) <= 1d+109) then
                                                    tmp = a * b
                                                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+88) {
                                            		tmp = t * z;
                                            	} else if ((t * z) <= 5e-218) {
                                            		tmp = c * i;
                                            	} else if ((t * z) <= 1e+109) {
                                            		tmp = a * b;
                                            	} else {
                                            		tmp = t * z;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(x, y, z, t, a, b, c, i):
                                            	tmp = 0
                                            	if (t * z) <= -5e+88:
                                            		tmp = t * z
                                            	elif (t * z) <= 5e-218:
                                            		tmp = c * i
                                            	elif (t * z) <= 1e+109:
                                            		tmp = a * b
                                            	else:
                                            		tmp = t * z
                                            	return tmp
                                            
                                            function code(x, y, z, t, a, b, c, i)
                                            	tmp = 0.0
                                            	if (Float64(t * z) <= -5e+88)
                                            		tmp = Float64(t * z);
                                            	elseif (Float64(t * z) <= 5e-218)
                                            		tmp = Float64(c * i);
                                            	elseif (Float64(t * z) <= 1e+109)
                                            		tmp = Float64(a * b);
                                            	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+88)
                                            		tmp = t * z;
                                            	elseif ((t * z) <= 5e-218)
                                            		tmp = c * i;
                                            	elseif ((t * z) <= 1e+109)
                                            		tmp = a * b;
                                            	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+88], N[(t * z), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 5e-218], N[(c * i), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 1e+109], N[(a * b), $MachinePrecision], N[(t * z), $MachinePrecision]]]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;t \cdot z \leq -5 \cdot 10^{+88}:\\
                                            \;\;\;\;t \cdot z\\
                                            
                                            \mathbf{elif}\;t \cdot z \leq 5 \cdot 10^{-218}:\\
                                            \;\;\;\;c \cdot i\\
                                            
                                            \mathbf{elif}\;t \cdot z \leq 10^{+109}:\\
                                            \;\;\;\;a \cdot b\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;t \cdot z\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 3 regimes
                                            2. if (*.f64 z t) < -4.99999999999999997e88 or 9.99999999999999982e108 < (*.f64 z t)

                                              1. Initial program 94.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-*.f6442.9

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

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

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

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

                                                  \[\leadsto a \cdot b \]
                                                3. Step-by-step derivation
                                                  1. Applied rewrites15.6%

                                                    \[\leadsto b \cdot a \]
                                                  2. Taylor expanded in z around inf

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

                                                      \[\leadsto \color{blue}{t \cdot z} \]
                                                  4. Applied rewrites66.3%

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

                                                  if -4.99999999999999997e88 < (*.f64 z t) < 5.00000000000000041e-218

                                                  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 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-*.f6497.8

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

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

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

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

                                                      \[\leadsto a \cdot b \]
                                                    3. Step-by-step derivation
                                                      1. Applied rewrites26.2%

                                                        \[\leadsto b \cdot a \]
                                                      2. Taylor expanded in c around inf

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

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

                                                          \[\leadsto \color{blue}{i \cdot c} \]
                                                      4. Applied rewrites41.1%

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

                                                      if 5.00000000000000041e-218 < (*.f64 z t) < 9.99999999999999982e108

                                                      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. 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-*.f6495.3

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

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

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

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

                                                          \[\leadsto a \cdot b \]
                                                        3. Step-by-step derivation
                                                          1. Applied rewrites38.6%

                                                            \[\leadsto b \cdot a \]
                                                        4. Recombined 3 regimes into one program.
                                                        5. Final simplification49.2%

                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot z \leq -5 \cdot 10^{+88}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;t \cdot z \leq 5 \cdot 10^{-218}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;t \cdot z \leq 10^{+109}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;t \cdot z\\ \end{array} \]
                                                        6. Add Preprocessing

                                                        Alternative 9: 62.4% accurate, 0.9× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+181}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 10^{+87}:\\ \;\;\;\;\mathsf{fma}\left(b, a, 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) -5e+181)
                                                           (* x y)
                                                           (if (<= (* x y) 1e+87) (fma b a (* 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) <= -5e+181) {
                                                        		tmp = x * y;
                                                        	} else if ((x * y) <= 1e+87) {
                                                        		tmp = fma(b, a, (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) <= -5e+181)
                                                        		tmp = Float64(x * y);
                                                        	elseif (Float64(x * y) <= 1e+87)
                                                        		tmp = fma(b, a, 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], -5e+181], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+87], N[(b * a + N[(t * z), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
                                                        
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+181}:\\
                                                        \;\;\;\;x \cdot y\\
                                                        
                                                        \mathbf{elif}\;x \cdot y \leq 10^{+87}:\\
                                                        \;\;\;\;\mathsf{fma}\left(b, a, 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) < -5.0000000000000003e181 or 9.9999999999999996e86 < (*.f64 x y)

                                                          1. Initial program 96.5%

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

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

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

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

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

                                                              \[\leadsto a \cdot b \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites9.7%

                                                                \[\leadsto b \cdot a \]
                                                              2. Taylor expanded in x around inf

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

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

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

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

                                                              if -5.0000000000000003e181 < (*.f64 x y) < 9.9999999999999996e86

                                                              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-*.f6489.1

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

                                                                \[\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 rewrites59.3%

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

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

                                                              Alternative 10: 43.8% accurate, 1.1× speedup?

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

                                                                1. Initial program 96.1%

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

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

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

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

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

                                                                    \[\leadsto a \cdot b \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites12.7%

                                                                      \[\leadsto b \cdot a \]
                                                                    2. Taylor expanded in c around inf

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

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

                                                                        \[\leadsto \color{blue}{i \cdot c} \]
                                                                    4. Applied rewrites59.2%

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

                                                                    if -5e51 < (*.f64 c i) < 9.9999999999999998e100

                                                                    1. Initial program 98.6%

                                                                      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                                                                    2. Add Preprocessing
                                                                    3. Taylor expanded in z around 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-*.f6473.3

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

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

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

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

                                                                        \[\leadsto a \cdot b \]
                                                                      3. Step-by-step derivation
                                                                        1. Applied rewrites34.2%

                                                                          \[\leadsto b \cdot a \]
                                                                      4. Recombined 2 regimes into one program.
                                                                      5. Final simplification44.4%

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

                                                                      Alternative 11: 27.7% accurate, 5.0× speedup?

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

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

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

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

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

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

                                                                          \[\leadsto a \cdot b \]
                                                                        3. Step-by-step derivation
                                                                          1. Applied rewrites25.5%

                                                                            \[\leadsto b \cdot a \]
                                                                          2. Final simplification25.5%

                                                                            \[\leadsto a \cdot b \]
                                                                          3. Add Preprocessing

                                                                          Reproduce

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