Average Error: 0.0 → 0.0
Time: 14.3s
Precision: 64
\[\left(x + y\right) \cdot \left(1 - z\right)\]
\[x \cdot 1 + \left(1 \cdot y - \left(x + y\right) \cdot z\right)\]
\left(x + y\right) \cdot \left(1 - z\right)
x \cdot 1 + \left(1 \cdot y - \left(x + y\right) \cdot z\right)
double f(double x, double y, double z) {
        double r43713 = x;
        double r43714 = y;
        double r43715 = r43713 + r43714;
        double r43716 = 1.0;
        double r43717 = z;
        double r43718 = r43716 - r43717;
        double r43719 = r43715 * r43718;
        return r43719;
}

double f(double x, double y, double z) {
        double r43720 = x;
        double r43721 = 1.0;
        double r43722 = r43720 * r43721;
        double r43723 = y;
        double r43724 = r43721 * r43723;
        double r43725 = r43720 + r43723;
        double r43726 = z;
        double r43727 = r43725 * r43726;
        double r43728 = r43724 - r43727;
        double r43729 = r43722 + r43728;
        return r43729;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

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

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

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

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

    \[\leadsto x \cdot 1 + \left(1 \cdot y - \left(x + y\right) \cdot z\right)\]

Reproduce

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