Average Error: 44.3 → 44.3
Time: 1.3s
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 44.3

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

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

Reproduce

herbie shell --seed 2020153 
(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))))