Average Error: 0.0 → 0.0
Time: 1.7s
Precision: 64
\[\left(x + y\right) \cdot \left(z + 1\right)\]
\[z \cdot x + \mathsf{fma}\left(y, z, \mathsf{fma}\left(1, x, 1 \cdot y\right)\right)\]
\left(x + y\right) \cdot \left(z + 1\right)
z \cdot x + \mathsf{fma}\left(y, z, \mathsf{fma}\left(1, x, 1 \cdot y\right)\right)
double f(double x, double y, double z) {
        double r33553 = x;
        double r33554 = y;
        double r33555 = r33553 + r33554;
        double r33556 = z;
        double r33557 = 1.0;
        double r33558 = r33556 + r33557;
        double r33559 = r33555 * r33558;
        return r33559;
}

double f(double x, double y, double z) {
        double r33560 = z;
        double r33561 = x;
        double r33562 = r33560 * r33561;
        double r33563 = y;
        double r33564 = 1.0;
        double r33565 = r33564 * r33563;
        double r33566 = fma(r33564, r33561, r33565);
        double r33567 = fma(r33563, r33560, r33566);
        double r33568 = r33562 + r33567;
        return r33568;
}

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-lft-in0.0

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

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

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

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

Reproduce

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