Average Error: 0.0 → 0.0
Time: 5.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(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(i, c, \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 r70922 = x;
        double r70923 = y;
        double r70924 = r70922 * r70923;
        double r70925 = z;
        double r70926 = t;
        double r70927 = r70925 * r70926;
        double r70928 = r70924 + r70927;
        double r70929 = a;
        double r70930 = b;
        double r70931 = r70929 * r70930;
        double r70932 = r70928 + r70931;
        double r70933 = c;
        double r70934 = i;
        double r70935 = r70933 * r70934;
        double r70936 = r70932 + r70935;
        return r70936;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r70937 = i;
        double r70938 = c;
        double r70939 = t;
        double r70940 = z;
        double r70941 = a;
        double r70942 = b;
        double r70943 = x;
        double r70944 = y;
        double r70945 = r70943 * r70944;
        double r70946 = fma(r70941, r70942, r70945);
        double r70947 = fma(r70939, r70940, r70946);
        double r70948 = fma(r70937, r70938, r70947);
        return r70948;
}

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. Taylor expanded around inf 0.0

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

    \[\leadsto \mathsf{fma}\left(i, c, \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(i, c, \mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\right)\]

Reproduce

herbie shell --seed 2020100 +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)))