Average Error: 0.0 → 0.0
Time: 10.9s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[c \cdot i + \mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
c \cdot i + \mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r63947 = x;
        double r63948 = y;
        double r63949 = r63947 * r63948;
        double r63950 = z;
        double r63951 = t;
        double r63952 = r63950 * r63951;
        double r63953 = r63949 + r63952;
        double r63954 = a;
        double r63955 = b;
        double r63956 = r63954 * r63955;
        double r63957 = r63953 + r63956;
        double r63958 = c;
        double r63959 = i;
        double r63960 = r63958 * r63959;
        double r63961 = r63957 + r63960;
        return r63961;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r63962 = c;
        double r63963 = i;
        double r63964 = r63962 * r63963;
        double r63965 = t;
        double r63966 = z;
        double r63967 = a;
        double r63968 = b;
        double r63969 = x;
        double r63970 = y;
        double r63971 = r63969 * r63970;
        double r63972 = fma(r63967, r63968, r63971);
        double r63973 = fma(r63965, r63966, r63972);
        double r63974 = r63964 + r63973;
        return r63974;
}

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. Using strategy rm
  6. Applied fma-udef0.0

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

    \[\leadsto c \cdot i + \mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\]

Reproduce

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