make phi’->dz more efficient

The new algorithm is not aequivalent to the old algorithm. However, for my test-input data, the results are almost (or even exactly) identical, and the calculation is about 3-4 times faster for the largest input-data set.