Re: Ziggurat algorithm for normal deviates

Posted by Kakhkhor Abdijalilov on
URL: http://quantlib.414.s1.nabble.com/Ziggurat-algorithm-for-normal-deviates-tp13305p13307.html

OK, it is done. I submitted my implementation to SourceForge patch
system (Ziggurat Algorithm by renorm). The underlying RNG is
MersenneTwisterUniformRng (MT19937). In my tests Ziggurat was about
2-3 times faster than MT19937+Acklam and about 7 times faster than
MT19937+boot's quantile function. I tested Ziggurat with Diehard
battery and everything looked OK.

I also did some changes to MersenneTwisterUniformRng and
InverseCumulativeNormal (Acklam's method). On my platform
MersenneTwisterUniformRng  is slightly faster than boost's mt19937 and
considerable faster that the old MersenneTwisterUniformRng, especially
in debug mode. Apparently, using STL vector instead of plain array
makes a difference in this case.

InverseCumulativeNormal features static std_ic (standard normal
inverse cumulative) method. It computes inverse CDF with mean=0 and
sigma=0. Using std_ic instead of operator() saves us 2 floating point
operation. The performance difference is quite noticeable.

Regards,
Kakhkhor Abdijalilov.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev