Average Error: 0.0 → 0.0
Time: 8.6s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[\mathsf{fma}\left(c, i, \mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\right)\]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\mathsf{fma}\left(c, i, \mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r94720 = x;
        double r94721 = y;
        double r94722 = r94720 * r94721;
        double r94723 = z;
        double r94724 = t;
        double r94725 = r94723 * r94724;
        double r94726 = r94722 + r94725;
        double r94727 = a;
        double r94728 = b;
        double r94729 = r94727 * r94728;
        double r94730 = r94726 + r94729;
        double r94731 = c;
        double r94732 = i;
        double r94733 = r94731 * r94732;
        double r94734 = r94730 + r94733;
        return r94734;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r94735 = c;
        double r94736 = i;
        double r94737 = t;
        double r94738 = z;
        double r94739 = a;
        double r94740 = b;
        double r94741 = x;
        double r94742 = y;
        double r94743 = r94741 * r94742;
        double r94744 = fma(r94739, r94740, r94743);
        double r94745 = fma(r94737, r94738, r94744);
        double r94746 = fma(r94735, r94736, r94745);
        return r94746;
}

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(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)}\]
  3. Taylor expanded around inf 0.0

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

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

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

Reproduce

herbie shell --seed 2019323 +o rules:numerics
(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)))