Boost C++ Libraries: Ticket #1437: normal_distribution.hpp, improvements to distribution and possibly speed https://svn.boost.org/trac10/ticket/1437 <p> Hello, I have adapted the current normal_distribution from the polar form to the outward Cartesian form. See here <a class="ext-link" href="http://web.mat.bham.ac.uk/marijke/bm/yabm.pdf"><span class="icon">​</span>http://web.mat.bham.ac.uk/marijke/bm/yabm.pdf</a> listing the benefits of the Cartesian form for the distribution of numbers. This also eliminates trigonometric function calls, however, it does reject pairs of random numbers. Most websites (wolfram, wikipedia) state that the inward Cartesian form is faster but this is generator speed dependent. </p> <p> I've found with my tests (mt19937, double datatype, gcc (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2), -O2) its about 1.5x slower than the polar form. Although with faster generators I expect it to outperform the polar version. </p> <p> I think this is an improvement on the current normal_distribution.hpp in time critical situations (if a fast generator is used) and it gives a better distribution of numbers, (points rather than bands of inaccessible numbers). I have also found that this version doesn't produce the "may be used uninitialised" warning when compiling with optimisations that I get when I use the original. </p> <p> Posted to boost.developers 2007-11-11 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1437 Trac 1.4.3 m.bannerman@… Tue, 13 Nov 2007 09:01:37 GMT attachment set https://svn.boost.org/trac10/ticket/1437 https://svn.boost.org/trac10/ticket/1437 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">normal_distribution.hpp</span> </li> </ul> <p> Improved normal_distribution.hpp </p> Ticket m.bannerman@… Sun, 18 Nov 2007 09:54:01 GMT <link>https://svn.boost.org/trac10/ticket/1437#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1437#comment:1</guid> <description> <p> I forgot to mention that this also has a smaller memory footprint than the previous version. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Sat, 09 Feb 2008 01:09:24 GMT</pubDate> <title>owner set https://svn.boost.org/trac10/ticket/1437#comment:2 https://svn.boost.org/trac10/ticket/1437#comment:2 <ul> <li><strong>owner</strong> set to <span class="trac-author">No-Maintainer</span> </li> </ul> Ticket Steven Watanabe Tue, 11 Mar 2014 17:49:09 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1437#comment:3 https://svn.boost.org/trac10/ticket/1437#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> I've completely re-written normal_distribution since this ticket was created. </p> Ticket