Skip to content

Instantly share code, notes, and snippets.

View coderkhalide's full-sized avatar

Khalid Saifullah coderkhalide

View GitHub Profile
@coderkhalide
coderkhalide / norminv.js
Created July 31, 2024 11:58 — forked from kmpm/norminv.js
Compute the quantile function for the normal distribution. - like Excel NORMINV
/// Original C++ implementation found at http://www.wilmott.com/messageview.cfm?catid=10&threadid=38771
/// C# implementation found at http://weblogs.asp.net/esanchez/archive/2010/07/29/a-quick-and-dirty-implementation-of-excel-norminv-function-in-c.aspx
/*
* Compute the quantile function for the normal distribution.
*
* For small to moderate probabilities, algorithm referenced
* below is used to obtain an initial approximation which is
* polished with a final Newton step.
*
* For very large arguments, an algorithm of Wichura is used.