These diagrams illustrate the behaviour of the elementary Floating functions in the complex plane. They are based on those in "Common Lisp The Language Second Addition" by Guy L. Steele Jr. () The code was re-implemented in Haskell (using this).

This page shows the behaviour of Complex Double with the original Data.Complex implementation as in GHC 8.10.7. The graphs illustrate some of the defects, e.g.:

Different pages show diagrams with: original Complex.hs, fixed Complex.hs for Double, fixed Complex.hs for Float and fixed Complex.hs for a type like Double, but without support for negative zero.

id


sqrt


exp


log


sin


asin


cos


acos


tan


atan


sinh


asinh


cosh


acosh

I think the solid line from 0 to -pi/2 i in the CL book is an error. p314: "A number with real part zero is in the range if its imaginary part is between zero (inclusive) and pi (inclusive)."


tanh


atanh