Do not need anything. On any platform with good C99 math (e.g. iphone), there is already everything you need - in particular, the erfc function, which is a small option:
#import <math.h> double cumulativeNormal(double x) { return 0.5 * erfc(-x * M_SQRT1_2); }
Note that this is the standard normal distribution (i.e. average = 0, variance = 1), you will need to use the appropriate scaling - so for some average and variance, this will be:
return 0.5 * erfc(((mean - x)/sqrt(variance)) * M_SQRT1_2);
If you don't need double precision, change the paired numbers to float, use the erfcf function and change the literals to literals with the same precision.
Remember that Objective-C is an extremely easy extension for C. Each C function is an Objective-C function, without the need for wrapping or other fraud.
source share