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

Percentage Accurate: 95.6% → 97.6%
Time: 6.9s
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.6% accurate, 1.0× speedup?

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

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

Alternative 1: 97.6% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{x \cdot y} + \left(a \cdot b + c \cdot i\right)\right) \]
    10. *-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.f6496.5

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

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

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

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

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

Alternative 2: 42.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -5 \cdot 10^{+114}:\\ \;\;\;\;i \cdot c\\ \mathbf{elif}\;c \cdot i \leq -0.2:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{-80}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;c \cdot i \leq -1 \cdot 10^{-246}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{-143}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{+137}:\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;i \cdot c\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= (* c i) -5e+114)
   (* i c)
   (if (<= (* c i) -0.2)
     (* t z)
     (if (<= (* c i) -2e-80)
       (* b a)
       (if (<= (* c i) -1e-246)
         (* y x)
         (if (<= (* c i) 2e-143)
           (* t z)
           (if (<= (* c i) 5e+137) (* y x) (* i c))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((c * i) <= -5e+114) {
		tmp = i * c;
	} else if ((c * i) <= -0.2) {
		tmp = t * z;
	} else if ((c * i) <= -2e-80) {
		tmp = b * a;
	} else if ((c * i) <= -1e-246) {
		tmp = y * x;
	} else if ((c * i) <= 2e-143) {
		tmp = t * z;
	} else if ((c * i) <= 5e+137) {
		tmp = y * x;
	} else {
		tmp = i * c;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((c * i) <= (-5d+114)) then
        tmp = i * c
    else if ((c * i) <= (-0.2d0)) then
        tmp = t * z
    else if ((c * i) <= (-2d-80)) then
        tmp = b * a
    else if ((c * i) <= (-1d-246)) then
        tmp = y * x
    else if ((c * i) <= 2d-143) then
        tmp = t * z
    else if ((c * i) <= 5d+137) then
        tmp = y * x
    else
        tmp = i * c
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((c * i) <= -5e+114) {
		tmp = i * c;
	} else if ((c * i) <= -0.2) {
		tmp = t * z;
	} else if ((c * i) <= -2e-80) {
		tmp = b * a;
	} else if ((c * i) <= -1e-246) {
		tmp = y * x;
	} else if ((c * i) <= 2e-143) {
		tmp = t * z;
	} else if ((c * i) <= 5e+137) {
		tmp = y * x;
	} else {
		tmp = i * c;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (c * i) <= -5e+114:
		tmp = i * c
	elif (c * i) <= -0.2:
		tmp = t * z
	elif (c * i) <= -2e-80:
		tmp = b * a
	elif (c * i) <= -1e-246:
		tmp = y * x
	elif (c * i) <= 2e-143:
		tmp = t * z
	elif (c * i) <= 5e+137:
		tmp = y * x
	else:
		tmp = i * c
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (Float64(c * i) <= -5e+114)
		tmp = Float64(i * c);
	elseif (Float64(c * i) <= -0.2)
		tmp = Float64(t * z);
	elseif (Float64(c * i) <= -2e-80)
		tmp = Float64(b * a);
	elseif (Float64(c * i) <= -1e-246)
		tmp = Float64(y * x);
	elseif (Float64(c * i) <= 2e-143)
		tmp = Float64(t * z);
	elseif (Float64(c * i) <= 5e+137)
		tmp = Float64(y * x);
	else
		tmp = Float64(i * c);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((c * i) <= -5e+114)
		tmp = i * c;
	elseif ((c * i) <= -0.2)
		tmp = t * z;
	elseif ((c * i) <= -2e-80)
		tmp = b * a;
	elseif ((c * i) <= -1e-246)
		tmp = y * x;
	elseif ((c * i) <= 2e-143)
		tmp = t * z;
	elseif ((c * i) <= 5e+137)
		tmp = y * x;
	else
		tmp = i * c;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -5e+114], N[(i * c), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -0.2], N[(t * z), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -2e-80], N[(b * a), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -1e-246], N[(y * x), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2e-143], N[(t * z), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 5e+137], N[(y * x), $MachinePrecision], N[(i * c), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \cdot i \leq -0.2:\\
\;\;\;\;t \cdot z\\

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 c i) < -5.0000000000000001e114 or 5.0000000000000002e137 < (*.f64 c i)

    1. Initial program 88.6%

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

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

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

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

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

    if -5.0000000000000001e114 < (*.f64 c i) < -0.20000000000000001 or -9.99999999999999956e-247 < (*.f64 c i) < 1.9999999999999999e-143

    1. Initial program 95.5%

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

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

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

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

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

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

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

      \[\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 rewrites70.5%

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

        \[\leadsto a \cdot b \]
      3. Step-by-step derivation
        1. Applied rewrites29.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-*.f6446.6

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

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

        if -0.20000000000000001 < (*.f64 c i) < -1.99999999999999992e-80

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

            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{t \cdot z}\right)\right) \]
        5. Applied rewrites84.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 rewrites77.5%

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

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

              \[\leadsto b \cdot a \]

            if -1.99999999999999992e-80 < (*.f64 c i) < -9.99999999999999956e-247 or 1.9999999999999999e-143 < (*.f64 c i) < 5.0000000000000002e137

            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 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-*.f6455.7

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

              \[\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 rewrites45.5%

                \[\leadsto \mathsf{fma}\left(a, \color{blue}{b}, t \cdot z\right) \]
              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-*.f6444.4

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

                \[\leadsto \color{blue}{y \cdot x} \]
            8. Recombined 4 regimes into one program.
            9. Add Preprocessing

            Alternative 3: 89.9% accurate, 0.7× speedup?

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

              1. Initial program 90.1%

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

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

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

              if -1e94 < (*.f64 z t) < 5.00000000000000025e141

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
              5. Applied rewrites93.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 simplification90.6%

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

            Alternative 4: 89.8% accurate, 0.7× speedup?

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

              1. Initial program 93.1%

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

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

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

              if -1e94 < (*.f64 z t) < 1e103

              1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

              if 1e103 < (*.f64 z t)

              1. Initial program 87.5%

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

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

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

            Alternative 5: 85.2% accurate, 0.7× speedup?

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

              1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if -9.9999999999999996e210 < (*.f64 x y) < 2.00000000000000015e244

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

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

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

                    if 2.00000000000000015e244 < (*.f64 x y)

                    1. Initial program 88.8%

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(b, \color{blue}{a}, y \cdot x\right) \]
                      4. Recombined 3 regimes into one program.
                      5. Add Preprocessing

                      Alternative 6: 42.7% accurate, 0.8× speedup?

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

                        1. Initial program 91.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-*.f6483.6

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

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

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

                            \[\leadsto a \cdot b \]
                          3. Step-by-step derivation
                            1. Applied rewrites17.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-*.f6462.9

                                \[\leadsto \color{blue}{t \cdot z} \]
                            4. Applied rewrites62.9%

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

                            if -5.00000000000000011e63 < (*.f64 z t) < 3.99999999999999986e-274

                            1. Initial program 96.6%

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

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

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

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

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

                            if 3.99999999999999986e-274 < (*.f64 z t) < 1e103

                            1. Initial program 97.1%

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

                                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{t \cdot z}\right)\right) \]
                            5. Applied rewrites72.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 rewrites44.5%

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

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

                                  \[\leadsto b \cdot a \]
                              4. Recombined 3 regimes into one program.
                              5. Add Preprocessing

                              Alternative 7: 67.2% accurate, 0.9× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+141} \lor \neg \left(a \cdot b \leq 10^{+18}\right):\\ \;\;\;\;\mathsf{fma}\left(a, b, t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\ \end{array} \end{array} \]
                              (FPCore (x y z t a b c i)
                               :precision binary64
                               (if (or (<= (* a b) -2e+141) (not (<= (* a b) 1e+18)))
                                 (fma a b (* t z))
                                 (fma i c (* y x))))
                              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                              	double tmp;
                              	if (((a * b) <= -2e+141) || !((a * b) <= 1e+18)) {
                              		tmp = fma(a, b, (t * z));
                              	} else {
                              		tmp = fma(i, c, (y * x));
                              	}
                              	return tmp;
                              }
                              
                              function code(x, y, z, t, a, b, c, i)
                              	tmp = 0.0
                              	if ((Float64(a * b) <= -2e+141) || !(Float64(a * b) <= 1e+18))
                              		tmp = fma(a, b, Float64(t * z));
                              	else
                              		tmp = fma(i, c, Float64(y * x));
                              	end
                              	return tmp
                              end
                              
                              code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -2e+141], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e+18]], $MachinePrecision]], N[(a * b + N[(t * z), $MachinePrecision]), $MachinePrecision], N[(i * c + N[(y * x), $MachinePrecision]), $MachinePrecision]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+141} \lor \neg \left(a \cdot b \leq 10^{+18}\right):\\
                              \;\;\;\;\mathsf{fma}\left(a, b, t \cdot z\right)\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if (*.f64 a b) < -2.00000000000000003e141 or 1e18 < (*.f64 a b)

                                1. Initial program 93.3%

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

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

                                  \[\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 rewrites75.4%

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

                                  if -2.00000000000000003e141 < (*.f64 a b) < 1e18

                                  1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

                                      Alternative 8: 67.1% accurate, 0.9× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+94} \lor \neg \left(z \cdot t \leq 5 \cdot 10^{+142}\right):\\ \;\;\;\;\mathsf{fma}\left(a, b, t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, y \cdot x\right)\\ \end{array} \end{array} \]
                                      (FPCore (x y z t a b c i)
                                       :precision binary64
                                       (if (or (<= (* z t) -1e+94) (not (<= (* z t) 5e+142)))
                                         (fma a b (* t z))
                                         (fma b a (* y x))))
                                      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                      	double tmp;
                                      	if (((z * t) <= -1e+94) || !((z * t) <= 5e+142)) {
                                      		tmp = fma(a, b, (t * z));
                                      	} else {
                                      		tmp = fma(b, a, (y * x));
                                      	}
                                      	return tmp;
                                      }
                                      
                                      function code(x, y, z, t, a, b, c, i)
                                      	tmp = 0.0
                                      	if ((Float64(z * t) <= -1e+94) || !(Float64(z * t) <= 5e+142))
                                      		tmp = fma(a, b, Float64(t * z));
                                      	else
                                      		tmp = fma(b, a, Float64(y * x));
                                      	end
                                      	return tmp
                                      end
                                      
                                      code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -1e+94], N[Not[LessEqual[N[(z * t), $MachinePrecision], 5e+142]], $MachinePrecision]], N[(a * b + N[(t * z), $MachinePrecision]), $MachinePrecision], N[(b * a + N[(y * x), $MachinePrecision]), $MachinePrecision]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+94} \lor \neg \left(z \cdot t \leq 5 \cdot 10^{+142}\right):\\
                                      \;\;\;\;\mathsf{fma}\left(a, b, t \cdot z\right)\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\mathsf{fma}\left(b, a, y \cdot x\right)\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 2 regimes
                                      2. if (*.f64 z t) < -1e94 or 5.0000000000000001e142 < (*.f64 z t)

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

                                            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{t \cdot z}\right)\right) \]
                                        5. Applied rewrites86.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 rewrites78.6%

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

                                          if -1e94 < (*.f64 z t) < 5.0000000000000001e142

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

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

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

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

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

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

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

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

                                            Alternative 9: 62.1% accurate, 0.9× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+169} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+282}\right):\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, b, t \cdot z\right)\\ \end{array} \end{array} \]
                                            (FPCore (x y z t a b c i)
                                             :precision binary64
                                             (if (or (<= (* x y) -2e+169) (not (<= (* x y) 5e+282)))
                                               (* y x)
                                               (fma 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 (((x * y) <= -2e+169) || !((x * y) <= 5e+282)) {
                                            		tmp = y * x;
                                            	} else {
                                            		tmp = fma(a, b, (t * z));
                                            	}
                                            	return tmp;
                                            }
                                            
                                            function code(x, y, z, t, a, b, c, i)
                                            	tmp = 0.0
                                            	if ((Float64(x * y) <= -2e+169) || !(Float64(x * y) <= 5e+282))
                                            		tmp = Float64(y * x);
                                            	else
                                            		tmp = fma(a, b, Float64(t * z));
                                            	end
                                            	return tmp
                                            end
                                            
                                            code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2e+169], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e+282]], $MachinePrecision]], N[(y * x), $MachinePrecision], N[(a * b + N[(t * z), $MachinePrecision]), $MachinePrecision]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+169} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+282}\right):\\
                                            \;\;\;\;y \cdot x\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\mathsf{fma}\left(a, b, t \cdot z\right)\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if (*.f64 x y) < -1.99999999999999987e169 or 4.99999999999999978e282 < (*.f64 x y)

                                              1. Initial program 89.8%

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

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

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

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

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

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

                                                  \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{t \cdot z}\right)\right) \]
                                              5. Applied rewrites29.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 rewrites20.8%

                                                  \[\leadsto \mathsf{fma}\left(a, \color{blue}{b}, t \cdot z\right) \]
                                                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-*.f6478.2

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

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

                                                if -1.99999999999999987e169 < (*.f64 x y) < 4.99999999999999978e282

                                                1. Initial program 95.9%

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

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

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

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

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

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

                                                Alternative 10: 43.0% accurate, 1.1× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+141} \lor \neg \left(a \cdot b \leq 4 \cdot 10^{+159}\right):\\ \;\;\;\;b \cdot a\\ \mathbf{else}:\\ \;\;\;\;i \cdot c\\ \end{array} \end{array} \]
                                                (FPCore (x y z t a b c i)
                                                 :precision binary64
                                                 (if (or (<= (* a b) -2e+141) (not (<= (* a b) 4e+159))) (* b a) (* i c)))
                                                double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                	double tmp;
                                                	if (((a * b) <= -2e+141) || !((a * b) <= 4e+159)) {
                                                		tmp = b * a;
                                                	} else {
                                                		tmp = i * c;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                real(8) function code(x, y, z, t, a, b, c, i)
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    real(8), intent (in) :: z
                                                    real(8), intent (in) :: t
                                                    real(8), intent (in) :: a
                                                    real(8), intent (in) :: b
                                                    real(8), intent (in) :: c
                                                    real(8), intent (in) :: i
                                                    real(8) :: tmp
                                                    if (((a * b) <= (-2d+141)) .or. (.not. ((a * b) <= 4d+159))) then
                                                        tmp = b * a
                                                    else
                                                        tmp = i * c
                                                    end if
                                                    code = tmp
                                                end function
                                                
                                                public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                	double tmp;
                                                	if (((a * b) <= -2e+141) || !((a * b) <= 4e+159)) {
                                                		tmp = b * a;
                                                	} else {
                                                		tmp = i * c;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                def code(x, y, z, t, a, b, c, i):
                                                	tmp = 0
                                                	if ((a * b) <= -2e+141) or not ((a * b) <= 4e+159):
                                                		tmp = b * a
                                                	else:
                                                		tmp = i * c
                                                	return tmp
                                                
                                                function code(x, y, z, t, a, b, c, i)
                                                	tmp = 0.0
                                                	if ((Float64(a * b) <= -2e+141) || !(Float64(a * b) <= 4e+159))
                                                		tmp = Float64(b * a);
                                                	else
                                                		tmp = Float64(i * c);
                                                	end
                                                	return tmp
                                                end
                                                
                                                function tmp_2 = code(x, y, z, t, a, b, c, i)
                                                	tmp = 0.0;
                                                	if (((a * b) <= -2e+141) || ~(((a * b) <= 4e+159)))
                                                		tmp = b * a;
                                                	else
                                                		tmp = i * c;
                                                	end
                                                	tmp_2 = tmp;
                                                end
                                                
                                                code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -2e+141], N[Not[LessEqual[N[(a * b), $MachinePrecision], 4e+159]], $MachinePrecision]], N[(b * a), $MachinePrecision], N[(i * c), $MachinePrecision]]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+141} \lor \neg \left(a \cdot b \leq 4 \cdot 10^{+159}\right):\\
                                                \;\;\;\;b \cdot a\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;i \cdot c\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 2 regimes
                                                2. if (*.f64 a b) < -2.00000000000000003e141 or 3.9999999999999997e159 < (*.f64 a b)

                                                  1. Initial program 91.5%

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

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

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

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

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

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

                                                        \[\leadsto b \cdot a \]

                                                      if -2.00000000000000003e141 < (*.f64 a b) < 3.9999999999999997e159

                                                      1. Initial program 95.9%

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

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

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

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

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

                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+141} \lor \neg \left(a \cdot b \leq 4 \cdot 10^{+159}\right):\\ \;\;\;\;b \cdot a\\ \mathbf{else}:\\ \;\;\;\;i \cdot c\\ \end{array} \]
                                                    6. Add Preprocessing

                                                    Alternative 11: 27.8% accurate, 5.0× speedup?

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

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

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

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

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

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

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

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

                                                        Reproduce

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