Average Error: 44.3 → 44.3
Time: 1.1s
Precision: binary64
\[\sqrt{\left(x - x0\right) \cdot \left(x - x0\right) + \left(y - y0\right) \cdot \left(y - y0\right)}\]
\[\sqrt{\left(x - x0\right) \cdot \left(x - x0\right) + \left(y - y0\right) \cdot \left(y - y0\right)}\]
\sqrt{\left(x - x0\right) \cdot \left(x - x0\right) + \left(y - y0\right) \cdot \left(y - y0\right)}
\sqrt{\left(x - x0\right) \cdot \left(x - x0\right) + \left(y - y0\right) \cdot \left(y - y0\right)}
double code(double x, double x0, double y, double y0) {
	return ((double) sqrt(((double) (((double) (((double) (x - x0)) * ((double) (x - x0)))) + ((double) (((double) (y - y0)) * ((double) (y - y0))))))));
}
double code(double x, double x0, double y, double y0) {
	return ((double) sqrt(((double) (((double) (((double) (x - x0)) * ((double) (x - x0)))) + ((double) (((double) (y - y0)) * ((double) (y - y0))))))));
}

Error

Bits error versus x

Bits error versus x0

Bits error versus y

Bits error versus y0

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 44.3

    \[\sqrt{\left(x - x0\right) \cdot \left(x - x0\right) + \left(y - y0\right) \cdot \left(y - y0\right)}\]
  2. Final simplification44.3

    \[\leadsto \sqrt{\left(x - x0\right) \cdot \left(x - x0\right) + \left(y - y0\right) \cdot \left(y - y0\right)}\]

Reproduce

herbie shell --seed 2020153 
(FPCore (x x0 y y0)
  :name "(sqrt (+ (* (- x x0) (- x x0)) (* (- y y0) (- y y0))))"
  :precision binary64
  (sqrt (+ (* (- x x0) (- x x0)) (* (- y y0) (- y y0)))))