Changes in progress, added calculations for FinDiff greeks

This commit is contained in:
Kevin Keogh
2017-07-24 22:58:41 -04:00
parent 58d17adfa2
commit 15d750abf1
7 changed files with 186 additions and 99 deletions

View File

@@ -1,5 +1,10 @@
#include <math.h>
#include <stdlib.h>
#include <time.h>
#define M_PI 3.14159265358979323846264338327950288
double normalcdf(double z)
{
@@ -23,6 +28,13 @@ double normalcdf(double z)
return 0.5 * (1 + sign * y);
}
double normalpdf(double z)
{
return exp(-0.5 * pow(z, 2)) / pow(M_PI * 2, 0.5);
}
double gaussrand()
{
/* Marsaglia and Bray, ``A Convenient Method for Generating Normal Variables'' */