Average Error: 0.0 → 0.0
Time: 2.4s
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 r79038 = x;
        double r79039 = y;
        double r79040 = r79038 * r79039;
        double r79041 = z;
        double r79042 = t;
        double r79043 = r79041 * r79042;
        double r79044 = r79040 + r79043;
        double r79045 = a;
        double r79046 = b;
        double r79047 = r79045 * r79046;
        double r79048 = r79044 + r79047;
        double r79049 = c;
        double r79050 = i;
        double r79051 = r79049 * r79050;
        double r79052 = r79048 + r79051;
        return r79052;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r79053 = i;
        double r79054 = c;
        double r79055 = t;
        double r79056 = z;
        double r79057 = a;
        double r79058 = b;
        double r79059 = x;
        double r79060 = y;
        double r79061 = r79059 * r79060;
        double r79062 = fma(r79057, r79058, r79061);
        double r79063 = fma(r79055, r79056, r79062);
        double r79064 = fma(r79053, r79054, r79063);
        return r79064;
}

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