Average Error: 28.7 → 0
Time: 560.0ms
Precision: binary64
\[\left(10^{6} + x\right) - x\]
\[10^{6}\]
\left(10^{6} + x\right) - x
10^{6}
double code(double x) {
	return ((double) (((double) (1000000.0 + x)) - x));
}
double code(double x) {
	return 1000000.0;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 28.7

    \[\left(10^{6} + x\right) - x\]
  2. Simplified0

    \[\leadsto \color{blue}{10^{6}}\]
  3. Final simplification0

    \[\leadsto 10^{6}\]

Reproduce

herbie shell --seed 2020152 
(FPCore (x)
  :name "(- (+ 1000000 x) x)"
  :precision binary64
  (- (+ 1000000.0 x) x))