Average Error: 0 → 0
Time: 388.0ms
Precision: binary64
\[\left|x\right| - x\]
\[\left|x\right| - x\]
\left|x\right| - x
\left|x\right| - x
double code(double x) {
	return ((double) (((double) fabs(x)) - x));
}
double code(double x) {
	return ((double) (((double) fabs(x)) - x));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0

    \[\left|x\right| - x\]
  2. Final simplification0

    \[\leadsto \left|x\right| - x\]

Reproduce

herbie shell --seed 2020153 
(FPCore (x)
  :name "(- (fabs x) x)"
  :precision binary64
  (- (fabs x) x))