Average Error: 0.0 → 0.0
Time: 4.2s
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 r64958 = x;
        double r64959 = y;
        double r64960 = r64958 * r64959;
        double r64961 = z;
        double r64962 = t;
        double r64963 = r64961 * r64962;
        double r64964 = r64960 + r64963;
        double r64965 = a;
        double r64966 = b;
        double r64967 = r64965 * r64966;
        double r64968 = r64964 + r64967;
        double r64969 = c;
        double r64970 = i;
        double r64971 = r64969 * r64970;
        double r64972 = r64968 + r64971;
        return r64972;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r64973 = i;
        double r64974 = c;
        double r64975 = t;
        double r64976 = z;
        double r64977 = a;
        double r64978 = b;
        double r64979 = x;
        double r64980 = y;
        double r64981 = r64979 * r64980;
        double r64982 = fma(r64977, r64978, r64981);
        double r64983 = fma(r64975, r64976, r64982);
        double r64984 = fma(r64973, r64974, r64983);
        return r64984;
}

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