Boost C++ Libraries: Ticket #7291: complex atan is not the best it could be https://svn.boost.org/trac10/ticket/7291 <p> For complex atan, when x and y are non-negative, the following formula is rather foolproof: </p> <p> atanh(z) = 0.25 * log1p(4*x / pow(|z-1|,2)) + 0.5 * I * atan2(2y, (1-x*x-y*y)) </p> <p> where z = x+I*y. Just handle the few special cases when you get overflow or underflow. </p> <p> I have implemented a C version at <a class="ext-link" href="http://people.freebsd.org/~stephen/catrig.c"><span class="icon">​</span>http://people.freebsd.org/~stephen/catrig.c</a>. </p> <p> Also, email Tom Fairgrieve &lt;tff@…&gt;. He has an unpublished work by Hull, himself, and Tang, very similar to the work they did on the complex arcsine. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7291 Trac 1.4.3 John Maddock Sun, 26 Aug 2012 17:10:05 GMT component changed; owner set https://svn.boost.org/trac10/ticket/7291#comment:1 https://svn.boost.org/trac10/ticket/7291#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">John Maddock</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">math</span> </li> </ul> Ticket Stephen Montgomery-Smith <stephen@…> Sun, 26 Aug 2012 21:34:41 GMT <link>https://svn.boost.org/trac10/ticket/7291#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7291#comment:2</guid> <description> <p> Use this for the imaginary part: 0.5 * atan2(2y, (1-x)*(1+x)-y*y) Replacing 1-x*x by (1-x)(1+x) improves the error quite a bit when x is close to 1. </p> </description> <category>Ticket</category> </item> <item> <author>Stephen Montgomery-Smith <stephen@…></author> <pubDate>Sun, 26 Aug 2012 21:35:45 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/7291 https://svn.boost.org/trac10/ticket/7291 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">atanh-patch</span> </li> </ul> Ticket Stephen Montgomery-Smith <stephen@…> Sun, 26 Aug 2012 21:37:41 GMT <link>https://svn.boost.org/trac10/ticket/7291#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7291#comment:3</guid> <description> <p> The patch I just uploaded is a diff to today's svn. It seems to work rather well. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 29 Nov 2012 13:27:36 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7291#comment:4 https://svn.boost.org/trac10/ticket/7291#comment:4 <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">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/81624" title="Lots of small patches. Update and regenerate docs. Fixes #7183. Fixes ...">[81624]</a>) Lots of small patches. Update and regenerate docs. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7183" title="#7183: Bugs: math::isinf compilation failure on FBSD (closed: fixed)">#7183</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7290" title="#7290: Bugs: complex acos is occasionally wrong (closed: fixed)">#7290</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7291" title="#7291: Bugs: complex atan is not the best it could be (closed: fixed)">#7291</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7649" title="#7649: Bugs: Minor comment typo in boost/math/constants/calculate_constants.hpp (closed: fixed)">#7649</a>. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7492" title="#7492: Bugs: add support of libc++ (closed: fixed)">#7492</a>. </p> Ticket