Complex arg-trig functions

Stephen Montgomery-Smith stephen at missouri.edu
Mon Aug 20 16:29:35 UTC 2012


On 08/15/12 15:56, Stephen Montgomery-Smith wrote:
> On 08/15/2012 08:35 AM, Bruce Evans wrote:
>> On Tue, 14 Aug 2012, Stephen Montgomery-Smith wrote:
>
>
>>> It seemed to me that there is a logic behind why the the infs and nans
>>> produce the results they do.  I noticed that do_the_hard_work()
>>> already got the answers correct for the real part *rx.  Getting the
>>> imaginary part to work as well seemed to me to be the cleanest way to
>>> make it work.  (I added all the nan and inf checking after writing the
>>> rest of the code.)
>>
>> An up-front check may still be simpler, and gives more control.  In
>> csqrt*(), I needed an explicit check and special expressions to get
>> uniform behaviour.

After thinking about it some more, I decided to go with your approach. 
The additional checks were so very few, and the code becomes quite a bit 
simpler.



More information about the freebsd-numerics mailing list