Average Error: 0.0 → 0.0
Time: 11.5s
Precision: 64
\[x \cdot y + z \cdot t\]
\[\mathsf{fma}\left(t, z, x \cdot y\right)\]
x \cdot y + z \cdot t
\mathsf{fma}\left(t, z, x \cdot y\right)
double f(double x, double y, double z, double t) {
        double r114675 = x;
        double r114676 = y;
        double r114677 = r114675 * r114676;
        double r114678 = z;
        double r114679 = t;
        double r114680 = r114678 * r114679;
        double r114681 = r114677 + r114680;
        return r114681;
}

double f(double x, double y, double z, double t) {
        double r114682 = t;
        double r114683 = z;
        double r114684 = x;
        double r114685 = y;
        double r114686 = r114684 * r114685;
        double r114687 = fma(r114682, r114683, r114686);
        return r114687;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Initial program 0.0

    \[x \cdot y + z \cdot t\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z \cdot t\right)}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt31.7

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

    \[\leadsto \sqrt{\mathsf{fma}\left(x, y, z \cdot t\right)} \cdot \sqrt{\color{blue}{1 \cdot \mathsf{fma}\left(x, y, z \cdot t\right)}}\]
  7. Applied sqrt-prod31.7

    \[\leadsto \sqrt{\mathsf{fma}\left(x, y, z \cdot t\right)} \cdot \color{blue}{\left(\sqrt{1} \cdot \sqrt{\mathsf{fma}\left(x, y, z \cdot t\right)}\right)}\]
  8. Applied *-un-lft-identity31.7

    \[\leadsto \sqrt{\color{blue}{1 \cdot \mathsf{fma}\left(x, y, z \cdot t\right)}} \cdot \left(\sqrt{1} \cdot \sqrt{\mathsf{fma}\left(x, y, z \cdot t\right)}\right)\]
  9. Applied sqrt-prod31.7

    \[\leadsto \color{blue}{\left(\sqrt{1} \cdot \sqrt{\mathsf{fma}\left(x, y, z \cdot t\right)}\right)} \cdot \left(\sqrt{1} \cdot \sqrt{\mathsf{fma}\left(x, y, z \cdot t\right)}\right)\]
  10. Applied swap-sqr31.7

    \[\leadsto \color{blue}{\left(\sqrt{1} \cdot \sqrt{1}\right) \cdot \left(\sqrt{\mathsf{fma}\left(x, y, z \cdot t\right)} \cdot \sqrt{\mathsf{fma}\left(x, y, z \cdot t\right)}\right)}\]
  11. Simplified31.7

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

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

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

Reproduce

herbie shell --seed 2019208 +o rules:numerics
(FPCore (x y z t)
  :name "Linear.V2:$cdot from linear-1.19.1.3, A"
  :precision binary64
  (+ (* x y) (* z t)))