Average Error: 0.0 → 0.0
Time: 1.7s
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 r37113 = x;
        double r37114 = y;
        double r37115 = r37113 + r37114;
        double r37116 = 1.0;
        double r37117 = z;
        double r37118 = r37116 - r37117;
        double r37119 = r37115 * r37118;
        return r37119;
}

double f(double x, double y, double z) {
        double r37120 = 1.0;
        double r37121 = x;
        double r37122 = y;
        double r37123 = r37121 + r37122;
        double r37124 = r37120 * r37123;
        double r37125 = z;
        double r37126 = -r37125;
        double r37127 = r37126 * r37123;
        double r37128 = r37124 + r37127;
        return r37128;
}

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 2020049 
(FPCore (x y z)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, H"
  :precision binary64
  (* (+ x y) (- 1 z)))