Average Error: 26.2 → 26.2
Time: 1.0s
Precision: binary64
\[\frac{tdx \cdot dx + tdy \cdot dy}{dx \cdot dx + dy \cdot dy}\]
\[\frac{tdx \cdot dx + tdy \cdot dy}{dx \cdot dx + dy \cdot dy}\]
\frac{tdx \cdot dx + tdy \cdot dy}{dx \cdot dx + dy \cdot dy}
\frac{tdx \cdot dx + tdy \cdot dy}{dx \cdot dx + dy \cdot dy}
double code(double tdx, double dx, double tdy, double dy) {
	return ((double) (((double) (((double) (tdx * dx)) + ((double) (tdy * dy)))) / ((double) (((double) (dx * dx)) + ((double) (dy * dy))))));
}
double code(double tdx, double dx, double tdy, double dy) {
	return ((double) (((double) (((double) (tdx * dx)) + ((double) (tdy * dy)))) / ((double) (((double) (dx * dx)) + ((double) (dy * dy))))));
}

Error

Bits error versus tdx

Bits error versus dx

Bits error versus tdy

Bits error versus dy

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 26.2

    \[\frac{tdx \cdot dx + tdy \cdot dy}{dx \cdot dx + dy \cdot dy}\]
  2. Final simplification26.2

    \[\leadsto \frac{tdx \cdot dx + tdy \cdot dy}{dx \cdot dx + dy \cdot dy}\]

Reproduce

herbie shell --seed 2020153 
(FPCore (tdx dx tdy dy)
  :name "(/ (+ (* tdx dx) (* tdy dy)) (+ (* dx dx) (* dy dy)))"
  :precision binary64
  (/ (+ (* tdx dx) (* tdy dy)) (+ (* dx dx) (* dy dy))))