Average Error: 0.0 → 0.0
Time: 3.6s
Precision: 64
\[\left(x + y\right) \cdot \left(1 - z\right)\]
\[1 \cdot \left(x + y\right) + \left(x + y\right) \cdot \left(-z\right)\]
\left(x + y\right) \cdot \left(1 - z\right)
1 \cdot \left(x + y\right) + \left(x + y\right) \cdot \left(-z\right)
double f(double x, double y, double z) {
        double r41997 = x;
        double r41998 = y;
        double r41999 = r41997 + r41998;
        double r42000 = 1.0;
        double r42001 = z;
        double r42002 = r42000 - r42001;
        double r42003 = r41999 * r42002;
        return r42003;
}

double f(double x, double y, double z) {
        double r42004 = 1.0;
        double r42005 = x;
        double r42006 = y;
        double r42007 = r42005 + r42006;
        double r42008 = r42004 * r42007;
        double r42009 = z;
        double r42010 = -r42009;
        double r42011 = r42007 * r42010;
        double r42012 = r42008 + r42011;
        return r42012;
}

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

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

Reproduce

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