Average Error: 0.0 → 0.0
Time: 2.7s
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 r61961 = x;
        double r61962 = y;
        double r61963 = r61961 * r61962;
        double r61964 = z;
        double r61965 = t;
        double r61966 = r61964 * r61965;
        double r61967 = r61963 + r61966;
        double r61968 = a;
        double r61969 = b;
        double r61970 = r61968 * r61969;
        double r61971 = r61967 + r61970;
        double r61972 = c;
        double r61973 = i;
        double r61974 = r61972 * r61973;
        double r61975 = r61971 + r61974;
        return r61975;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r61976 = i;
        double r61977 = c;
        double r61978 = t;
        double r61979 = z;
        double r61980 = a;
        double r61981 = b;
        double r61982 = x;
        double r61983 = y;
        double r61984 = r61982 * r61983;
        double r61985 = fma(r61980, r61981, r61984);
        double r61986 = fma(r61978, r61979, r61985);
        double r61987 = fma(r61976, r61977, r61986);
        return r61987;
}

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