Average Error: 0.0 → 0.0
Time: 989.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 r24695 = x;
        double r24696 = y;
        double r24697 = r24695 + r24696;
        double r24698 = z;
        double r24699 = 1.0;
        double r24700 = r24698 + r24699;
        double r24701 = r24697 * r24700;
        return r24701;
}

double f(double x, double y, double z) {
        double r24702 = z;
        double r24703 = x;
        double r24704 = y;
        double r24705 = r24703 + r24704;
        double r24706 = r24702 * r24705;
        double r24707 = 1.0;
        double r24708 = r24707 * r24704;
        double r24709 = fma(r24707, r24703, r24708);
        double r24710 = r24706 + r24709;
        return r24710;
}

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