Average Error: 0.0 → 0.0
Time: 1.2s
Precision: 64
\[\left(x + y\right) \cdot \left(z + 1\right)\]
\[z \cdot \left(x + y\right) + \mathsf{fma}\left(1, x, 1 \cdot y\right)\]
\left(x + y\right) \cdot \left(z + 1\right)
z \cdot \left(x + y\right) + \mathsf{fma}\left(1, x, 1 \cdot y\right)
double f(double x, double y, double z) {
        double r26712 = x;
        double r26713 = y;
        double r26714 = r26712 + r26713;
        double r26715 = z;
        double r26716 = 1.0;
        double r26717 = r26715 + r26716;
        double r26718 = r26714 * r26717;
        return r26718;
}

double f(double x, double y, double z) {
        double r26719 = z;
        double r26720 = x;
        double r26721 = y;
        double r26722 = r26720 + r26721;
        double r26723 = r26719 * r26722;
        double r26724 = 1.0;
        double r26725 = r26724 * r26721;
        double r26726 = fma(r26724, r26720, r26725);
        double r26727 = r26723 + r26726;
        return r26727;
}

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. Final simplification0.0

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

Reproduce

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