Average Error: 0.0 → 0.0
Time: 2.0s
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 r5229 = x;
        double r5230 = y;
        double r5231 = r5229 + r5230;
        double r5232 = z;
        double r5233 = r5231 * r5232;
        return r5233;
}

double f(double x, double y, double z) {
        double r5234 = x;
        double r5235 = z;
        double r5236 = y;
        double r5237 = r5235 * r5236;
        double r5238 = fma(r5234, r5235, r5237);
        return r5238;
}

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 2020062 +o rules:numerics
(FPCore (x y z)
  :name "Text.Parsec.Token:makeTokenParser from parsec-3.1.9, B"
  :precision binary64
  (* (+ x y) z))