Average Error: 0.0 → 0.0
Time: 7.0s
Precision: 64
\[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
\[\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\]
\left(x \cdot y + z \cdot t\right) + a \cdot b
\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r76352 = x;
        double r76353 = y;
        double r76354 = r76352 * r76353;
        double r76355 = z;
        double r76356 = t;
        double r76357 = r76355 * r76356;
        double r76358 = r76354 + r76357;
        double r76359 = a;
        double r76360 = b;
        double r76361 = r76359 * r76360;
        double r76362 = r76358 + r76361;
        return r76362;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r76363 = t;
        double r76364 = z;
        double r76365 = a;
        double r76366 = b;
        double r76367 = x;
        double r76368 = y;
        double r76369 = r76367 * r76368;
        double r76370 = fma(r76365, r76366, r76369);
        double r76371 = fma(r76363, r76364, r76370);
        return r76371;
}

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

Derivation

  1. Initial program 0.0

    \[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)}\]
  3. Taylor expanded around inf 0.0

    \[\leadsto \color{blue}{t \cdot z + \left(a \cdot b + x \cdot y\right)}\]
  4. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)}\]
  5. Final simplification0.0

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

Reproduce

herbie shell --seed 2019326 +o rules:numerics
(FPCore (x y z t a b)
  :name "Linear.V3:$cdot from linear-1.19.1.3, B"
  :precision binary64
  (+ (+ (* x y) (* z t)) (* a b)))