Average Error: 0.0 → 0.0
Time: 4.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 r11854 = x;
        double r11855 = y;
        double r11856 = r11854 * r11855;
        double r11857 = z;
        double r11858 = t;
        double r11859 = r11857 * r11858;
        double r11860 = r11856 + r11859;
        double r11861 = a;
        double r11862 = b;
        double r11863 = r11861 * r11862;
        double r11864 = r11860 + r11863;
        return r11864;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r11865 = t;
        double r11866 = z;
        double r11867 = a;
        double r11868 = b;
        double r11869 = x;
        double r11870 = y;
        double r11871 = r11869 * r11870;
        double r11872 = fma(r11867, r11868, r11871);
        double r11873 = fma(r11865, r11866, r11872);
        return r11873;
}

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