Average Error: 0.0 → 0.0
Time: 14.3s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)\]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r130079 = x;
        double r130080 = y;
        double r130081 = r130079 * r130080;
        double r130082 = z;
        double r130083 = t;
        double r130084 = r130082 * r130083;
        double r130085 = r130081 + r130084;
        double r130086 = a;
        double r130087 = b;
        double r130088 = r130086 * r130087;
        double r130089 = r130085 + r130088;
        double r130090 = c;
        double r130091 = i;
        double r130092 = r130090 * r130091;
        double r130093 = r130089 + r130092;
        return r130093;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r130094 = c;
        double r130095 = i;
        double r130096 = a;
        double r130097 = b;
        double r130098 = x;
        double r130099 = y;
        double r130100 = z;
        double r130101 = t;
        double r130102 = r130100 * r130101;
        double r130103 = fma(r130098, r130099, r130102);
        double r130104 = fma(r130096, r130097, r130103);
        double r130105 = fma(r130094, r130095, r130104);
        return r130105;
}

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. Final simplification0.0

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

Reproduce

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