The bug #629 is caused by the mistaken cache key calculation.
Unrelated: I also found that it segfaults for (large) negative angles, but that happened before as well.
For the large angles, perhaps we could use a mod function on the angle first.