Average Error: 43.9 → 43.9
Time: 1.4s
Precision: binary64
\[\sqrt{{\left(x_a - x_b\right)}^{2} + {\left(y_a - y_b\right)}^{2}}\]
\[\sqrt{{\left(x_a - x_b\right)}^{2} + {\left(y_a - y_b\right)}^{2}}\]
\sqrt{{\left(x_a - x_b\right)}^{2} + {\left(y_a - y_b\right)}^{2}}
\sqrt{{\left(x_a - x_b\right)}^{2} + {\left(y_a - y_b\right)}^{2}}
double code(double x_a, double x_b, double y_a, double y_b) {
	return ((double) sqrt(((double) (((double) pow(((double) (x_a - x_b)), 2.0)) + ((double) pow(((double) (y_a - y_b)), 2.0))))));
}
double code(double x_a, double x_b, double y_a, double y_b) {
	return ((double) sqrt(((double) (((double) pow(((double) (x_a - x_b)), 2.0)) + ((double) pow(((double) (y_a - y_b)), 2.0))))));
}

Error

Bits error versus x_a

Bits error versus x_b

Bits error versus y_a

Bits error versus y_b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 43.9

    \[\sqrt{{\left(x_a - x_b\right)}^{2} + {\left(y_a - y_b\right)}^{2}}\]
  2. Final simplification43.9

    \[\leadsto \sqrt{{\left(x_a - x_b\right)}^{2} + {\left(y_a - y_b\right)}^{2}}\]

Reproduce

herbie shell --seed 2020152 
(FPCore (x_a x_b y_a y_b)
  :name "(sqrt (+ (pow (- x_a x_b) 2) (pow (- y_a y_b) 2)))"
  :precision binary64
  (sqrt (+ (pow (- x_a x_b) 2.0) (pow (- y_a y_b) 2.0))))