[PATCH]: PR middle-end/30447 handle builtin csin

Kaveh R. GHAZI ghazi@caip.rutgers.edu
Mon Jan 22 03:47:00 GMT 2007


On Sat, 20 Jan 2007, Joseph S. Myers wrote:

> On Fri, 19 Jan 2007, Kaveh R. GHAZI wrote:
>
> (I am not at all confident in the accuracy of glibc's mathematical
> functions in many cases, and there certainly have been sign bugs in such
> functions in the past.  But I don't think any other implementation has any
> greater chance of being correct rather than simply having different bugs;
> these functions are intrinsically hard to get right, so it's better to
> cooperate on fewer implementations and on shared testcases where different
> implementations are needed.)

I agree, in a perfect world we'd have one implementation that was well
tested.  I raised the issue of complex stuff with the MPFR folks and they
seemed to feel that it wasn't appropriate for MPFR itself.

http://sympa.loria.fr/wwsympa/arc/mpfr/2007-01/msg00022.html

There is a complex analogue library called MPC, but the authors of that
don't expect to have implementations of what I'd need any time soon.

http://sympa.loria.fr/wwsympa/arc/mpfr/2007-01/msg00028.html

The direction I was given was to basically do the math myself like the
fortran frontend does right now.

http://sympa.loria.fr/wwsympa/arc/mpfr/2007-01/msg00024.html

Now I'm getting conflicting advice from you. :-/

I think I'll leave the patch as-is.  It uses twice the precision of the
target type and does exactly one multiplication using MPFR for an exact
result, then rounds.  If that isn't good enough, then someone better
versed in this stuff can implement a better csin routine.  In the mean
time, I think my contribution is progress.

		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu



More information about the Gcc-patches mailing list