Average Error: 0.0 → 0.0
Time: 7.4s
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 r123622 = x;
        double r123623 = y;
        double r123624 = r123622 * r123623;
        double r123625 = z;
        double r123626 = t;
        double r123627 = r123625 * r123626;
        double r123628 = r123624 + r123627;
        double r123629 = a;
        double r123630 = b;
        double r123631 = r123629 * r123630;
        double r123632 = r123628 + r123631;
        return r123632;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r123633 = t;
        double r123634 = z;
        double r123635 = a;
        double r123636 = b;
        double r123637 = x;
        double r123638 = y;
        double r123639 = r123637 * r123638;
        double r123640 = fma(r123635, r123636, r123639);
        double r123641 = fma(r123633, r123634, r123640);
        return r123641;
}

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. Using strategy rm
  4. Applied add-cbrt-cube31.0

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

    \[\leadsto \mathsf{fma}\left(a, b, \sqrt[3]{\color{blue}{{\left(\mathsf{fma}\left(x, y, z \cdot t\right)\right)}^{3}}}\right)\]
  6. Using strategy rm
  7. Applied *-un-lft-identity31.0

    \[\leadsto \mathsf{fma}\left(a, b, \sqrt[3]{{\color{blue}{\left(1 \cdot \mathsf{fma}\left(x, y, z \cdot t\right)\right)}}^{3}}\right)\]
  8. Applied unpow-prod-down31.0

    \[\leadsto \mathsf{fma}\left(a, b, \sqrt[3]{\color{blue}{{1}^{3} \cdot {\left(\mathsf{fma}\left(x, y, z \cdot t\right)\right)}^{3}}}\right)\]
  9. Applied cbrt-prod31.0

    \[\leadsto \mathsf{fma}\left(a, b, \color{blue}{\sqrt[3]{{1}^{3}} \cdot \sqrt[3]{{\left(\mathsf{fma}\left(x, y, z \cdot t\right)\right)}^{3}}}\right)\]
  10. Simplified31.0

    \[\leadsto \mathsf{fma}\left(a, b, \color{blue}{1} \cdot \sqrt[3]{{\left(\mathsf{fma}\left(x, y, z \cdot t\right)\right)}^{3}}\right)\]
  11. Simplified0.0

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

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

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

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

Reproduce

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