Average Error: 0.0 → 0.0
Time: 14.1s
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(a, b, \mathsf{fma}\left(x, y, t \cdot z\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(a, b, \mathsf{fma}\left(x, y, t \cdot z\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r5414264 = x;
        double r5414265 = y;
        double r5414266 = r5414264 * r5414265;
        double r5414267 = z;
        double r5414268 = t;
        double r5414269 = r5414267 * r5414268;
        double r5414270 = r5414266 + r5414269;
        double r5414271 = a;
        double r5414272 = b;
        double r5414273 = r5414271 * r5414272;
        double r5414274 = r5414270 + r5414273;
        double r5414275 = c;
        double r5414276 = i;
        double r5414277 = r5414275 * r5414276;
        double r5414278 = r5414274 + r5414277;
        return r5414278;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r5414279 = i;
        double r5414280 = c;
        double r5414281 = a;
        double r5414282 = b;
        double r5414283 = x;
        double r5414284 = y;
        double r5414285 = t;
        double r5414286 = z;
        double r5414287 = r5414285 * r5414286;
        double r5414288 = fma(r5414283, r5414284, r5414287);
        double r5414289 = fma(r5414281, r5414282, r5414288);
        double r5414290 = fma(r5414279, r5414280, r5414289);
        return r5414290;
}

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(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)}\]
  3. Final simplification0.0

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

Reproduce

herbie shell --seed 2019172 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Linear.V4:$cdot from linear-1.19.1.3, C"
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))