Average Error: 0.0 → 0.0
Time: 1.2s
Precision: 64
\[\left(x + y\right) \cdot \left(1 - z\right)\]
\[\left(1 \cdot \left(x + y\right) - x \cdot z\right) + y \cdot \left(-z\right)\]
\left(x + y\right) \cdot \left(1 - z\right)
\left(1 \cdot \left(x + y\right) - x \cdot z\right) + y \cdot \left(-z\right)
double f(double x, double y, double z) {
        double r27541 = x;
        double r27542 = y;
        double r27543 = r27541 + r27542;
        double r27544 = 1.0;
        double r27545 = z;
        double r27546 = r27544 - r27545;
        double r27547 = r27543 * r27546;
        return r27547;
}

double f(double x, double y, double z) {
        double r27548 = 1.0;
        double r27549 = x;
        double r27550 = y;
        double r27551 = r27549 + r27550;
        double r27552 = r27548 * r27551;
        double r27553 = z;
        double r27554 = r27549 * r27553;
        double r27555 = r27552 - r27554;
        double r27556 = -r27553;
        double r27557 = r27550 * r27556;
        double r27558 = r27555 + r27557;
        return r27558;
}

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

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

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

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

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

Reproduce

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