Average Error: 0.0 → 0.0
Time: 1.6s
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 r30931 = x;
        double r30932 = y;
        double r30933 = r30931 + r30932;
        double r30934 = z;
        double r30935 = 1.0;
        double r30936 = r30934 + r30935;
        double r30937 = r30933 * r30936;
        return r30937;
}

double f(double x, double y, double z) {
        double r30938 = z;
        double r30939 = x;
        double r30940 = y;
        double r30941 = r30939 + r30940;
        double r30942 = r30938 * r30941;
        double r30943 = 1.0;
        double r30944 = r30943 * r30940;
        double r30945 = fma(r30943, r30939, r30944);
        double r30946 = r30942 + r30945;
        return r30946;
}

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