User:NorwegianBlue/cpp program for calculating d3

Calculating d3 - supplementary info to refdesk question
The program below is an attempt at calculating the control chart constants d2 and d3. It works for d2, but fails miserably for d3. The approximation of the cumulative normal distribution is something I wrote 15 years ago, and I checked it thoroughly then, but haven't done so now. However, the fact that it produces highly accurate results for d2, suggests that an error in the implementation of cumulative_normal_distribution is unlikely to be the reason why d3 does not work correctly.