[gfortran] use numerically safe algorithm for folding CABS
Tobias Schlüter
tobias.schlueter@physik.uni-muenchen.de
Wed Oct 6 23:08:00 GMT 2004
Joseph S. Myers wrote:
> On Thu, 7 Oct 2004, [ISO-8859-1] Tobias Schlüter wrote:
>>>Can't you use mpfr_hypot?
>>
>>No, I can't because the version of mpfr distributed with GMP doesn't have it.
>>One more reason to import mpfr into the GCC tree, I assume. I will add a
>>comment pointing out that this code can be replaced when we import mpfr into
>>the tree.
>
>
> It looks to me to be in GMP 4.1,
Silly me! I had only checked the documentation, but not looked at mpfr.h.
Indeed, even the version of mpfr supplied with gmp has mpfr_hypot. So I
propose this revised patch, which simply uses the mpfr_hypot function.
Built and tested. Ok?
- Tobi
2004-10-06 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
* simplify.c (gfc_simplify_abs): Use mpfr_hypot for CABS.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cabs.diff
Type: text/x-patch
Size: 1156 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20041006/59289ae0/attachment.bin>
More information about the Fortran
mailing list