Average Error: 0.0 → 0.0
Time: 20.9s
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, 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(i, c, \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 r18036321 = x;
        double r18036322 = y;
        double r18036323 = r18036321 * r18036322;
        double r18036324 = z;
        double r18036325 = t;
        double r18036326 = r18036324 * r18036325;
        double r18036327 = r18036323 + r18036326;
        double r18036328 = a;
        double r18036329 = b;
        double r18036330 = r18036328 * r18036329;
        double r18036331 = r18036327 + r18036330;
        double r18036332 = c;
        double r18036333 = i;
        double r18036334 = r18036332 * r18036333;
        double r18036335 = r18036331 + r18036334;
        return r18036335;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r18036336 = i;
        double r18036337 = c;
        double r18036338 = a;
        double r18036339 = b;
        double r18036340 = x;
        double r18036341 = y;
        double r18036342 = z;
        double r18036343 = t;
        double r18036344 = r18036342 * r18036343;
        double r18036345 = fma(r18036340, r18036341, r18036344);
        double r18036346 = fma(r18036338, r18036339, r18036345);
        double r18036347 = fma(r18036336, r18036337, r18036346);
        return r18036347;
}

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, z \cdot t\right)\right)\right)\]

Reproduce

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