Average Error: 0.0 → 0.0
Time: 819.0ms
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 r29710 = x;
        double r29711 = y;
        double r29712 = r29710 + r29711;
        double r29713 = z;
        double r29714 = 1.0;
        double r29715 = r29713 + r29714;
        double r29716 = r29712 * r29715;
        return r29716;
}

double f(double x, double y, double z) {
        double r29717 = z;
        double r29718 = x;
        double r29719 = y;
        double r29720 = r29718 + r29719;
        double r29721 = r29717 * r29720;
        double r29722 = 1.0;
        double r29723 = r29722 * r29719;
        double r29724 = fma(r29722, r29718, r29723);
        double r29725 = r29721 + r29724;
        return r29725;
}

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 2020056 +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)))