After crunching some numbers, I calculated that my cache hit was approximately 70%, so I'm thinking about keeping this example in my code for now (if not for the performance gain, then at the very least as a reminder).
Given your usage pattern, and considering the size of the CPU's data cache on today's processors, this may work out well in your use pattern. If you are frequently computing the trig functions on a small set of common angles, and you are doing it frequently enough that they stay local to the CPU instead of getting evicted from the cache, it will absolutely help.
But as others point out, keep measuring and monitoring.
It looks like for now you are only using it where it makes sense. But add some debug blocks to your code to notify you when the situation changes.
If you reach the point where your comparisons are no longer in the cache, or if you are multithreaded and your writes need to be slowly propagated to all the processors, then you'll need to revisit your design. If you start doing more operations on a wider variety of values, or values that are not quite identical, those could also trip your routine up.