Average Error: 0.0 → 0.0
Time: 816.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 r40790 = x;
        double r40791 = y;
        double r40792 = r40790 + r40791;
        double r40793 = z;
        double r40794 = 1.0;
        double r40795 = r40793 + r40794;
        double r40796 = r40792 * r40795;
        return r40796;
}

double f(double x, double y, double z) {
        double r40797 = z;
        double r40798 = x;
        double r40799 = y;
        double r40800 = r40798 + r40799;
        double r40801 = r40797 * r40800;
        double r40802 = 1.0;
        double r40803 = r40802 * r40799;
        double r40804 = fma(r40802, r40798, r40803);
        double r40805 = r40801 + r40804;
        return r40805;
}

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