Average Error: 0.0 → 0.0
Time: 7.2s
Precision: 64
\[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
\[\mathsf{fma}\left(a, b, \mathsf{fma}\left(t, z, x \cdot y\right)\right)\]
\left(x \cdot y + z \cdot t\right) + a \cdot b
\mathsf{fma}\left(a, b, \mathsf{fma}\left(t, z, x \cdot y\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r116092 = x;
        double r116093 = y;
        double r116094 = r116092 * r116093;
        double r116095 = z;
        double r116096 = t;
        double r116097 = r116095 * r116096;
        double r116098 = r116094 + r116097;
        double r116099 = a;
        double r116100 = b;
        double r116101 = r116099 * r116100;
        double r116102 = r116098 + r116101;
        return r116102;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r116103 = a;
        double r116104 = b;
        double r116105 = t;
        double r116106 = z;
        double r116107 = x;
        double r116108 = y;
        double r116109 = r116107 * r116108;
        double r116110 = fma(r116105, r116106, r116109);
        double r116111 = fma(r116103, r116104, r116110);
        return r116111;
}

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.2

    \[\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.2

    \[\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.2

    \[\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.2

    \[\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.2

    \[\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.2

    \[\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. Final simplification0.0

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

Reproduce

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