Average Error: 0.0 → 0.0
Time: 2.5s
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 r62990 = x;
        double r62991 = y;
        double r62992 = r62990 * r62991;
        double r62993 = z;
        double r62994 = t;
        double r62995 = r62993 * r62994;
        double r62996 = r62992 + r62995;
        double r62997 = a;
        double r62998 = b;
        double r62999 = r62997 * r62998;
        double r63000 = r62996 + r62999;
        double r63001 = c;
        double r63002 = i;
        double r63003 = r63001 * r63002;
        double r63004 = r63000 + r63003;
        return r63004;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r63005 = i;
        double r63006 = c;
        double r63007 = t;
        double r63008 = z;
        double r63009 = a;
        double r63010 = b;
        double r63011 = x;
        double r63012 = y;
        double r63013 = r63011 * r63012;
        double r63014 = fma(r63009, r63010, r63013);
        double r63015 = fma(r63007, r63008, r63014);
        double r63016 = fma(r63005, r63006, r63015);
        return r63016;
}

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"
  :precision binary64
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))