Average Error: 0.0 → 0.0
Time: 1.3s
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 r29790 = x;
        double r29791 = y;
        double r29792 = r29790 + r29791;
        double r29793 = z;
        double r29794 = 1.0;
        double r29795 = r29793 + r29794;
        double r29796 = r29792 * r29795;
        return r29796;
}

double f(double x, double y, double z) {
        double r29797 = z;
        double r29798 = x;
        double r29799 = y;
        double r29800 = r29798 + r29799;
        double r29801 = r29797 * r29800;
        double r29802 = 1.0;
        double r29803 = r29802 * r29799;
        double r29804 = fma(r29802, r29798, r29803);
        double r29805 = r29801 + r29804;
        return r29805;
}

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