Average Error: 0.0 → 0.0
Time: 2.4s
Precision: 64
\[\left(x + y\right) \cdot z\]
\[\mathsf{fma}\left(x, z, z \cdot y\right)\]
\left(x + y\right) \cdot z
\mathsf{fma}\left(x, z, z \cdot y\right)
double f(double x, double y, double z) {
        double r7611 = x;
        double r7612 = y;
        double r7613 = r7611 + r7612;
        double r7614 = z;
        double r7615 = r7613 * r7614;
        return r7615;
}

double f(double x, double y, double z) {
        double r7616 = x;
        double r7617 = z;
        double r7618 = y;
        double r7619 = r7617 * r7618;
        double r7620 = fma(r7616, r7617, r7619);
        return r7620;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Initial program 0.0

    \[\left(x + y\right) \cdot z\]
  2. Using strategy rm
  3. Applied pow10.0

    \[\leadsto \left(x + y\right) \cdot \color{blue}{{z}^{1}}\]
  4. Applied pow10.0

    \[\leadsto \color{blue}{{\left(x + y\right)}^{1}} \cdot {z}^{1}\]
  5. Applied pow-prod-down0.0

    \[\leadsto \color{blue}{{\left(\left(x + y\right) \cdot z\right)}^{1}}\]
  6. Simplified0.0

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

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

Reproduce

herbie shell --seed 2020001 +o rules:numerics
(FPCore (x y z)
  :name "Text.Parsec.Token:makeTokenParser from parsec-3.1.9, B"
  :precision binary64
  (* (+ x y) z))