Average Error: 0.0 → 0.0
Time: 4.9s
Precision: 64
\[\left(x + y\right) \cdot \left(1 - z\right)\]
\[1 \cdot \left(x + y\right) + \left(-z\right) \cdot \left(x + y\right)\]
\left(x + y\right) \cdot \left(1 - z\right)
1 \cdot \left(x + y\right) + \left(-z\right) \cdot \left(x + y\right)
double f(double x, double y, double z) {
        double r39176 = x;
        double r39177 = y;
        double r39178 = r39176 + r39177;
        double r39179 = 1.0;
        double r39180 = z;
        double r39181 = r39179 - r39180;
        double r39182 = r39178 * r39181;
        return r39182;
}

double f(double x, double y, double z) {
        double r39183 = 1.0;
        double r39184 = x;
        double r39185 = y;
        double r39186 = r39184 + r39185;
        double r39187 = r39183 * r39186;
        double r39188 = z;
        double r39189 = -r39188;
        double r39190 = r39189 * r39186;
        double r39191 = r39187 + r39190;
        return r39191;
}

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. Final simplification0.0

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

Reproduce

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