Average Error: 0.0 → 0.0
Time: 949.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 r24600 = x;
        double r24601 = y;
        double r24602 = r24600 + r24601;
        double r24603 = z;
        double r24604 = 1.0;
        double r24605 = r24603 + r24604;
        double r24606 = r24602 * r24605;
        return r24606;
}

double f(double x, double y, double z) {
        double r24607 = z;
        double r24608 = x;
        double r24609 = y;
        double r24610 = r24608 + r24609;
        double r24611 = r24607 * r24610;
        double r24612 = 1.0;
        double r24613 = r24612 * r24609;
        double r24614 = fma(r24612, r24608, r24613);
        double r24615 = r24611 + r24614;
        return r24615;
}

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