Average Error: 0.0 → 0.0
Time: 2.0s
Precision: 64
\[\left(x + y\right) \cdot \left(1 - z\right)\]
\[x \cdot 1 + \left(1 \cdot y - z \cdot \left(x + y\right)\right)\]
\left(x + y\right) \cdot \left(1 - z\right)
x \cdot 1 + \left(1 \cdot y - z \cdot \left(x + y\right)\right)
double f(double x, double y, double z) {
        double r43989 = x;
        double r43990 = y;
        double r43991 = r43989 + r43990;
        double r43992 = 1.0;
        double r43993 = z;
        double r43994 = r43992 - r43993;
        double r43995 = r43991 * r43994;
        return r43995;
}

double f(double x, double y, double z) {
        double r43996 = x;
        double r43997 = 1.0;
        double r43998 = r43996 * r43997;
        double r43999 = y;
        double r44000 = r43997 * r43999;
        double r44001 = z;
        double r44002 = r43996 + r43999;
        double r44003 = r44001 * r44002;
        double r44004 = r44000 - r44003;
        double r44005 = r43998 + r44004;
        return r44005;
}

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. Simplified0.0

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

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

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

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

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

Reproduce

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