Average Error: 0.0 → 0.0
Time: 10.1s
Precision: 64
\[\left(x + y\right) \cdot \left(z + 1\right)\]
\[\mathsf{fma}\left(x, z, \mathsf{fma}\left(1, y + x, y \cdot z\right)\right)\]
\left(x + y\right) \cdot \left(z + 1\right)
\mathsf{fma}\left(x, z, \mathsf{fma}\left(1, y + x, y \cdot z\right)\right)
double f(double x, double y, double z) {
        double r1816776 = x;
        double r1816777 = y;
        double r1816778 = r1816776 + r1816777;
        double r1816779 = z;
        double r1816780 = 1.0;
        double r1816781 = r1816779 + r1816780;
        double r1816782 = r1816778 * r1816781;
        return r1816782;
}

double f(double x, double y, double z) {
        double r1816783 = x;
        double r1816784 = z;
        double r1816785 = 1.0;
        double r1816786 = y;
        double r1816787 = r1816786 + r1816783;
        double r1816788 = r1816786 * r1816784;
        double r1816789 = fma(r1816785, r1816787, r1816788);
        double r1816790 = fma(r1816783, r1816784, r1816789);
        return r1816790;
}

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-rgt-in0.0

    \[\leadsto \color{blue}{z \cdot \left(x + y\right) + 1 \cdot \left(x + y\right)}\]
  4. Using strategy rm
  5. Applied distribute-rgt-in0.0

    \[\leadsto \color{blue}{\left(x \cdot z + y \cdot z\right)} + 1 \cdot \left(x + y\right)\]
  6. Applied associate-+l+0.0

    \[\leadsto \color{blue}{x \cdot z + \left(y \cdot z + 1 \cdot \left(x + y\right)\right)}\]
  7. Simplified0.0

    \[\leadsto x \cdot z + \color{blue}{\mathsf{fma}\left(1, x + y, z \cdot y\right)}\]
  8. Using strategy rm
  9. Applied fma-def0.0

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

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

Reproduce

herbie shell --seed 2019171 +o rules:numerics
(FPCore (x y z)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, G"
  (* (+ x y) (+ z 1.0)))