Average Error: 29.4 → 0
Time: 781.0ms
Precision: 64
\[\left(1 + x\right) - x\]
\[1\]
\left(1 + x\right) - x
1
double f(double x) {
        double r8027 = 1.0;
        double r8028 = x;
        double r8029 = r8027 + r8028;
        double r8030 = r8029 - r8028;
        return r8030;
}

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

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 29.4

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

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

    \[\leadsto 1\]

Reproduce

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