Average Error: 29.8 → 0
Time: 723.0ms
Precision: 64
\[\left(1 + x\right) - x\]
\[1\]
\left(1 + x\right) - x
1
double f(double x) {
        double r8036 = 1.0;
        double r8037 = x;
        double r8038 = r8036 + r8037;
        double r8039 = r8038 - r8037;
        return r8039;
}

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

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 29.8

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

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

    \[\leadsto 1\]

Reproduce

herbie shell --seed 2019133 +o rules:numerics
(FPCore (x)
  :name "Cancel like terms"
  (- (+ 1 x) x))