Average Error: 0.0 → 0.0
Time: 5.2s
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 r76436 = x;
        double r76437 = y;
        double r76438 = r76436 * r76437;
        double r76439 = z;
        double r76440 = t;
        double r76441 = r76439 * r76440;
        double r76442 = r76438 + r76441;
        double r76443 = a;
        double r76444 = b;
        double r76445 = r76443 * r76444;
        double r76446 = r76442 + r76445;
        double r76447 = c;
        double r76448 = i;
        double r76449 = r76447 * r76448;
        double r76450 = r76446 + r76449;
        return r76450;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r76451 = i;
        double r76452 = c;
        double r76453 = a;
        double r76454 = b;
        double r76455 = x;
        double r76456 = y;
        double r76457 = t;
        double r76458 = z;
        double r76459 = r76457 * r76458;
        double r76460 = fma(r76455, r76456, r76459);
        double r76461 = fma(r76453, r76454, r76460);
        double r76462 = fma(r76451, r76452, r76461);
        return r76462;
}

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