Average Error: 0.0 → 0.0
Time: 1.4s
Precision: 64
\[\left(x + y\right) \cdot \left(1 - z\right)\]
\[\left(1 \cdot \left(x + y\right) - x \cdot z\right) + \left(-z\right) \cdot y\]
\left(x + y\right) \cdot \left(1 - z\right)
\left(1 \cdot \left(x + y\right) - x \cdot z\right) + \left(-z\right) \cdot y
double f(double x, double y, double z) {
        double r47235 = x;
        double r47236 = y;
        double r47237 = r47235 + r47236;
        double r47238 = 1.0;
        double r47239 = z;
        double r47240 = r47238 - r47239;
        double r47241 = r47237 * r47240;
        return r47241;
}

double f(double x, double y, double z) {
        double r47242 = 1.0;
        double r47243 = x;
        double r47244 = y;
        double r47245 = r47243 + r47244;
        double r47246 = r47242 * r47245;
        double r47247 = z;
        double r47248 = r47243 * r47247;
        double r47249 = r47246 - r47248;
        double r47250 = -r47247;
        double r47251 = r47250 * r47244;
        double r47252 = r47249 + r47251;
        return r47252;
}

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

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

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

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

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

Reproduce

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