Average Error: 44.3 → 44.3
Time: 1.0s
Precision: binary64
\[\sqrt{\left(x2 - x1\right) \cdot \left(x2 - x1\right) + \left(y2 - y1\right) \cdot \left(y2 - y1\right)}\]
\[\sqrt{\left(x2 - x1\right) \cdot \left(x2 - x1\right) + \left(y2 - y1\right) \cdot \left(y2 - y1\right)}\]
\sqrt{\left(x2 - x1\right) \cdot \left(x2 - x1\right) + \left(y2 - y1\right) \cdot \left(y2 - y1\right)}
\sqrt{\left(x2 - x1\right) \cdot \left(x2 - x1\right) + \left(y2 - y1\right) \cdot \left(y2 - y1\right)}
double code(double x2, double x1, double y2, double y1) {
	return ((double) sqrt(((double) (((double) (((double) (x2 - x1)) * ((double) (x2 - x1)))) + ((double) (((double) (y2 - y1)) * ((double) (y2 - y1))))))));
}
double code(double x2, double x1, double y2, double y1) {
	return ((double) sqrt(((double) (((double) (((double) (x2 - x1)) * ((double) (x2 - x1)))) + ((double) (((double) (y2 - y1)) * ((double) (y2 - y1))))))));
}

Error

Bits error versus x2

Bits error versus x1

Bits error versus y2

Bits error versus y1

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 44.3

    \[\sqrt{\left(x2 - x1\right) \cdot \left(x2 - x1\right) + \left(y2 - y1\right) \cdot \left(y2 - y1\right)}\]
  2. Final simplification44.3

    \[\leadsto \sqrt{\left(x2 - x1\right) \cdot \left(x2 - x1\right) + \left(y2 - y1\right) \cdot \left(y2 - y1\right)}\]

Reproduce

herbie shell --seed 2020153 
(FPCore (x2 x1 y2 y1)
  :name "(sqrt (+ (* (- x2 x1) (- x2 x1)) (* (- y2 y1) (- y2 y1))))"
  :precision binary64
  (sqrt (+ (* (- x2 x1) (- x2 x1)) (* (- y2 y1) (- y2 y1)))))