Average Error: 0.0 → 0.0
Time: 2.0s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[\mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)\]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r61813 = x;
        double r61814 = y;
        double r61815 = r61813 * r61814;
        double r61816 = z;
        double r61817 = t;
        double r61818 = r61816 * r61817;
        double r61819 = r61815 + r61818;
        double r61820 = a;
        double r61821 = b;
        double r61822 = r61820 * r61821;
        double r61823 = r61819 + r61822;
        double r61824 = c;
        double r61825 = i;
        double r61826 = r61824 * r61825;
        double r61827 = r61823 + r61826;
        return r61827;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r61828 = i;
        double r61829 = c;
        double r61830 = b;
        double r61831 = a;
        double r61832 = x;
        double r61833 = y;
        double r61834 = z;
        double r61835 = t;
        double r61836 = r61834 * r61835;
        double r61837 = fma(r61832, r61833, r61836);
        double r61838 = fma(r61830, r61831, r61837);
        double r61839 = fma(r61828, r61829, r61838);
        return r61839;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus i

Derivation

  1. Initial program 0.0

    \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)}\]
  3. Final simplification0.0

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

Reproduce

herbie shell --seed 2020002 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Linear.V4:$cdot from linear-1.19.1.3"
  :precision binary64
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))