Average Error: 0.0 → 0.0
Time: 2.1s
Precision: 64
\[\left(x + y\right) \cdot \left(z + 1\right)\]
\[\left(z \cdot x + z \cdot y\right) + \mathsf{fma}\left(1, x, 1 \cdot y\right)\]
\left(x + y\right) \cdot \left(z + 1\right)
\left(z \cdot x + z \cdot y\right) + \mathsf{fma}\left(1, x, 1 \cdot y\right)
double f(double x, double y, double z) {
        double r35799 = x;
        double r35800 = y;
        double r35801 = r35799 + r35800;
        double r35802 = z;
        double r35803 = 1.0;
        double r35804 = r35802 + r35803;
        double r35805 = r35801 * r35804;
        return r35805;
}

double f(double x, double y, double z) {
        double r35806 = z;
        double r35807 = x;
        double r35808 = r35806 * r35807;
        double r35809 = y;
        double r35810 = r35806 * r35809;
        double r35811 = r35808 + r35810;
        double r35812 = 1.0;
        double r35813 = r35812 * r35809;
        double r35814 = fma(r35812, r35807, r35813);
        double r35815 = r35811 + r35814;
        return r35815;
}

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. Using strategy rm
  7. Applied distribute-lft-in0.0

    \[\leadsto \color{blue}{\left(z \cdot x + z \cdot y\right)} + \mathsf{fma}\left(1, x, 1 \cdot y\right)\]
  8. Final simplification0.0

    \[\leadsto \left(z \cdot x + z \cdot y\right) + \mathsf{fma}\left(1, x, 1 \cdot y\right)\]

Reproduce

herbie shell --seed 2020033 +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)))