catan and catanh can produce spurious underflow exceptions from squaring the real and imaginary parts of their arguments. These in turn can lead to other spurious exceptions and inaccurate results. Examples on x86_64: catan (1.0 + 0x1p-1020i) (spurious underflow), catan (0x1p-1020 + 1.0i) (spurious underflow and divide-by-zero), catan (0x1p-512 + 1.0i) (spurious underflow and overflow), catan (0x1.3p-536 - 1.0i) (spurious underflow, imaginary part of result is inaccurate, -185.9367... but should be -186.0240...).
Fixed for 2.18 by: commit 10de07f5fdd9eaf3a808d4461401f5b661095614 Author: Joseph Myers <joseph@codesourcery.com> Date: Wed May 1 10:07:00 2013 +0000 Fix catan, catanh spurious underflows (bug 15423).