Average Error: 30.0 → 30.0
Time: 900.0ms
Precision: binary64
\[\sqrt{{x}^{2}} - x\]
\[\sqrt{{x}^{2}} - x\]
\sqrt{{x}^{2}} - x
\sqrt{{x}^{2}} - x
double code(double x) {
	return ((double) (((double) sqrt(((double) pow(x, 2.0)))) - x));
}
double code(double x) {
	return ((double) (((double) sqrt(((double) pow(x, 2.0)))) - x));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 30.0

    \[\sqrt{{x}^{2}} - x\]
  2. Final simplification30.0

    \[\leadsto \sqrt{{x}^{2}} - x\]

Reproduce

herbie shell --seed 2020153 
(FPCore (x)
  :name "(- (sqrt (pow x 2)) x)"
  :precision binary64
  (- (sqrt (pow x 2.0)) x))