\cos^{-1} \left(x1 \cdot y1 + \frac{x2 \cdot y2}{\mathsf{hypot}\left(x1, x2\right) \cdot \mathsf{hypot}\left(y1, y2\right)}\right)\cos^{-1} \left(x1 \cdot y1 + \frac{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) (x1 * y1)) + ((double) (((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) (x1 * y1)) + ((double) (((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 14.9
Final simplification14.9
herbie shell --seed 2020152
(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))))))