Speed improvements for Shrake & Rupley, by precalculating as many values as possible.