Average Error: 0.0 → 0.0
Time: 2.4s
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 r119910 = x;
        double r119911 = y;
        double r119912 = r119910 * r119911;
        double r119913 = z;
        double r119914 = t;
        double r119915 = r119913 * r119914;
        double r119916 = r119912 + r119915;
        double r119917 = a;
        double r119918 = b;
        double r119919 = r119917 * r119918;
        double r119920 = r119916 + r119919;
        double r119921 = c;
        double r119922 = i;
        double r119923 = r119921 * r119922;
        double r119924 = r119920 + r119923;
        return r119924;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r119925 = i;
        double r119926 = c;
        double r119927 = t;
        double r119928 = z;
        double r119929 = a;
        double r119930 = b;
        double r119931 = x;
        double r119932 = y;
        double r119933 = r119931 * r119932;
        double r119934 = fma(r119929, r119930, r119933);
        double r119935 = fma(r119927, r119928, r119934);
        double r119936 = fma(r119925, r119926, r119935);
        return r119936;
}

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