Average Error: 0.0 → 0.0
Time: 5.5s
Precision: 64
\[\left(x + y\right) \cdot \left(1 - z\right)\]
\[1 \cdot x + \mathsf{fma}\left(x + y, -z, y \cdot 1\right)\]
\left(x + y\right) \cdot \left(1 - z\right)
1 \cdot x + \mathsf{fma}\left(x + y, -z, y \cdot 1\right)
double f(double x, double y, double z) {
        double r26618 = x;
        double r26619 = y;
        double r26620 = r26618 + r26619;
        double r26621 = 1.0;
        double r26622 = z;
        double r26623 = r26621 - r26622;
        double r26624 = r26620 * r26623;
        return r26624;
}

double f(double x, double y, double z) {
        double r26625 = 1.0;
        double r26626 = x;
        double r26627 = r26625 * r26626;
        double r26628 = y;
        double r26629 = r26626 + r26628;
        double r26630 = z;
        double r26631 = -r26630;
        double r26632 = r26628 * r26625;
        double r26633 = fma(r26629, r26631, r26632);
        double r26634 = r26627 + r26633;
        return r26634;
}

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(1 - z\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.0

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019350 +o rules:numerics
(FPCore (x y z)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, H"
  :precision binary64
  (* (+ x y) (- 1 z)))