Average Error: 0.0 → 0.0
Time: 4.4s
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 r48110 = x;
        double r48111 = y;
        double r48112 = r48110 + r48111;
        double r48113 = 1.0;
        double r48114 = z;
        double r48115 = r48113 - r48114;
        double r48116 = r48112 * r48115;
        return r48116;
}

double f(double x, double y, double z) {
        double r48117 = 1.0;
        double r48118 = x;
        double r48119 = y;
        double r48120 = r48118 + r48119;
        double r48121 = r48117 * r48120;
        double r48122 = z;
        double r48123 = -r48122;
        double r48124 = r48120 * r48123;
        double r48125 = r48121 + r48124;
        return r48125;
}

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 2020045 +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)))