Average Error: 25.3 → 25.3
Time: 2.4s
Precision: binary64
\[\cos^{-1} \left(\frac{x1 \cdot y1 + x2 \cdot y2}{\mathsf{hypot}\left(x1, x2\right) \cdot \mathsf{hypot}\left(y1, y2\right)}\right)\]
\[\cos^{-1} \left(\frac{x1 \cdot y1 + x2 \cdot y2}{\mathsf{hypot}\left(x1, x2\right) \cdot \mathsf{hypot}\left(y1, y2\right)}\right)\]
\cos^{-1} \left(\frac{x1 \cdot y1 + x2 \cdot y2}{\mathsf{hypot}\left(x1, x2\right) \cdot \mathsf{hypot}\left(y1, y2\right)}\right)
\cos^{-1} \left(\frac{x1 \cdot y1 + x2 \cdot y2}{\mathsf{hypot}\left(x1, x2\right) \cdot \mathsf{hypot}\left(y1, y2\right)}\right)
double code(double x1, double y1, double x2, double y2) {
	return ((double) acos(((double) (((double) (((double) (x1 * y1)) + ((double) (x2 * y2)))) / ((double) (((double) hypot(x1, x2)) * ((double) hypot(y1, y2))))))));
}
double code(double x1, double y1, double x2, double y2) {
	return ((double) acos(((double) (((double) (((double) (x1 * y1)) + ((double) (x2 * y2)))) / ((double) (((double) hypot(x1, x2)) * ((double) hypot(y1, y2))))))));
}

Error

Bits error versus x1

Bits error versus y1

Bits error versus x2

Bits error versus y2

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 25.3

    \[\cos^{-1} \left(\frac{x1 \cdot y1 + x2 \cdot y2}{\mathsf{hypot}\left(x1, x2\right) \cdot \mathsf{hypot}\left(y1, y2\right)}\right)\]
  2. Final simplification25.3

    \[\leadsto \cos^{-1} \left(\frac{x1 \cdot y1 + x2 \cdot y2}{\mathsf{hypot}\left(x1, x2\right) \cdot \mathsf{hypot}\left(y1, y2\right)}\right)\]

Reproduce

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