Average Error: 0.0 → 0.0
Time: 1.1s
Precision: 64
\[\left(x + y\right) \cdot \left(z + 1\right)\]
\[x \cdot z + \mathsf{fma}\left(y, z, \mathsf{fma}\left(1, x, 1 \cdot y\right)\right)\]
\left(x + y\right) \cdot \left(z + 1\right)
x \cdot z + \mathsf{fma}\left(y, z, \mathsf{fma}\left(1, x, 1 \cdot y\right)\right)
double f(double x, double y, double z) {
        double r21460 = x;
        double r21461 = y;
        double r21462 = r21460 + r21461;
        double r21463 = z;
        double r21464 = 1.0;
        double r21465 = r21463 + r21464;
        double r21466 = r21462 * r21465;
        return r21466;
}

double f(double x, double y, double z) {
        double r21467 = x;
        double r21468 = z;
        double r21469 = r21467 * r21468;
        double r21470 = y;
        double r21471 = 1.0;
        double r21472 = r21471 * r21470;
        double r21473 = fma(r21471, r21467, r21472);
        double r21474 = fma(r21470, r21468, r21473);
        double r21475 = r21469 + r21474;
        return r21475;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Initial program 0.0

    \[\left(x + y\right) \cdot \left(z + 1\right)\]
  2. Using strategy rm
  3. Applied distribute-lft-in0.0

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

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

    \[\leadsto z \cdot \left(x + y\right) + \color{blue}{\mathsf{fma}\left(1, x, 1 \cdot y\right)}\]
  6. Using strategy rm
  7. Applied distribute-rgt-in0.0

    \[\leadsto \color{blue}{\left(x \cdot z + y \cdot z\right)} + \mathsf{fma}\left(1, x, 1 \cdot y\right)\]
  8. Applied associate-+l+0.0

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

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

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

Reproduce

herbie shell --seed 2020021 +o rules:numerics
(FPCore (x y z)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, G"
  :precision binary64
  (* (+ x y) (+ z 1)))