\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))))))));
}



Bits error versus x1



Bits error versus y1



Bits error versus x2



Bits error versus y2
Results
Initial program 25.3
Final simplification25.3
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)))))