Average Error: 31.7 → 31.7
Time: 911.0ms
Precision: binary64
\[\sqrt{{\left(x1 - x2\right)}^{2}}\]
\[\sqrt{{\left(x1 - x2\right)}^{2}}\]
\sqrt{{\left(x1 - x2\right)}^{2}}
\sqrt{{\left(x1 - x2\right)}^{2}}
double code(double x1, double x2) {
	return ((double) sqrt(((double) pow(((double) (x1 - x2)), 2.0))));
}
double code(double x1, double x2) {
	return ((double) sqrt(((double) pow(((double) (x1 - x2)), 2.0))));
}

Error

Bits error versus x1

Bits error versus x2

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 31.7

    \[\sqrt{{\left(x1 - x2\right)}^{2}}\]
  2. Final simplification31.7

    \[\leadsto \sqrt{{\left(x1 - x2\right)}^{2}}\]

Reproduce

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