Boost C++ Libraries: Ticket #11027: Add Lambert W function https://svn.boost.org/trac10/ticket/11027 <p> Thomas Lui supplied the following code via email: </p> <pre class="wiki">double plog(double x) { if (x == 0) { return 0; } double w0, w1; if (x &gt; 0) { w0 = log(1.2 * x / log(2.4 * x / log1p(2.4 * x))); } else { double v = 1.4142135623730950488 * sqrt(1 + 2.7182818284590452354 * x); double N2 = 10.242640687119285146 + 1.9797586132081854940 * v; double N1 = 0.29289321881345247560 * (1.4142135623730950488 + N2); w0 = -1 + v * (N2 + v) / (N2 + v + N1 * v); } while (true) { double e = exp(w0); double f = w0 * e - x; w1 = w0 - f / ((e * (w0 + 1) - (w0 + 2) * f / (w0+w0 + 2))); if (fabs(w0 / w1 - 1) &lt; 1.4901161193847656e-8) { break; } w0 = w1; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11027 Trac 1.4.3 John Maddock Sun, 25 Sep 2016 16:31:23 GMT <link>https://svn.boost.org/trac10/ticket/11027#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11027#comment:1</guid> <description> <p> Thomas Lui provides better code in his thesis: <a class="ext-link" href="http://discovery.ucl.ac.uk/1482128/1/Luu_thesis.pdf"><span class="icon">​</span>http://discovery.ucl.ac.uk/1482128/1/Luu_thesis.pdf</a>, see routine 11, and in Github as CUDA C++ device code: <a class="ext-link" href="https://github.com/thomasluu/plog/blob/master/plog.cu"><span class="icon">​</span>https://github.com/thomasluu/plog/blob/master/plog.cu</a>. </p> <p> We also have a more complex submission here: <a class="ext-link" href="https://github.com/CzB404/lambert_w/"><span class="icon">​</span>https://github.com/CzB404/lambert_w/</a> which includes support for complex numbered arguments. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Paul A. Bristow</dc:creator> <pubDate>Sat, 26 Nov 2016 17:10:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11027#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11027#comment:2</guid> <description> <p> I am now looking at comparing the two potential algorithms proposed for adding Lambert W to Boost.Math. </p> <p> Is the version at <a class="ext-link" href="https://github.com/CzB404/lambert_w/"><span class="icon">​</span>https://github.com/CzB404/lambert_w/</a> by Balazs Cziraki still under development? </p> <p> Thank you. </p> <p> Paul </p> <p> pbristow@… </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Tue, 31 Jul 2018 17:35:19 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11027#comment:3 https://svn.boost.org/trac10/ticket/11027#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">obsolete</span> </li> </ul> <p> Moved to <a class="ext-link" href="https://github.com/boostorg/math/issues/137"><span class="icon">​</span>https://github.com/boostorg/math/issues/137</a> </p> Ticket