Average Error: 29.6 → 0
Time: 700.0ms
Precision: 64
\[\left(1 + x\right) - x\]
\[1\]
\left(1 + x\right) - x
1
double f(double x) {
        double r144 = 1.0;
        double r145 = x;
        double r146 = r144 + r145;
        double r147 = r146 - r145;
        return r147;
}

double f(double __attribute__((unused)) x) {
        double r148 = 1.0;
        return r148;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 29.6

    \[\left(1 + x\right) - x\]
  2. Simplified0

    \[\leadsto \color{blue}{1}\]
  3. Final simplification0

    \[\leadsto 1\]

Reproduce

herbie shell --seed 2020001 
(FPCore (x)
  :name "Cancel like terms"
  :precision binary64
  (- (+ 1 x) x))