Average Error: 0.0 → 0.0
Time: 9.4s
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 r93921 = x;
        double r93922 = y;
        double r93923 = r93921 * r93922;
        double r93924 = z;
        double r93925 = t;
        double r93926 = r93924 * r93925;
        double r93927 = r93923 + r93926;
        double r93928 = a;
        double r93929 = b;
        double r93930 = r93928 * r93929;
        double r93931 = r93927 + r93930;
        double r93932 = c;
        double r93933 = i;
        double r93934 = r93932 * r93933;
        double r93935 = r93931 + r93934;
        return r93935;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r93936 = c;
        double r93937 = i;
        double r93938 = t;
        double r93939 = z;
        double r93940 = a;
        double r93941 = b;
        double r93942 = x;
        double r93943 = y;
        double r93944 = r93942 * r93943;
        double r93945 = fma(r93940, r93941, r93944);
        double r93946 = fma(r93938, r93939, r93945);
        double r93947 = fma(r93936, r93937, r93946);
        return r93947;
}

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)))