Using the MPC library (complex cousin of MPFR) for simplifications in gfortran

Steve Kargl sgk@troutmask.apl.washington.edu
Wed Jan 14 06:35:00 GMT 2009


On Tue, Jan 13, 2009 at 01:40:18PM -0700, Kaveh R. Ghazi wrote:
> From: "Tobias Burnus" <burnus@net-b.de>
> 
> >I'm wondering whether it would make sense to optionally use the MPC
> >library (http://www.multiprecision.org/mpc/) to simplify complex
> >numbers.
> 
> Heh, good timing. :-)  FWIW, I think using MPC would be useful.  In 
> addition to using it in the middle-end and fortran frontend for complex 
> trancendental function folding, there is another bug PR30789 that would 
> benefit from using MPC for complex folding of multiplication and division.  
> Also, the formulas currently implemented in the fortran frontend for 
> complex trancendental function evaluation do not appear to me to be last 
> bit accurate in all cases.  (MPC incorporates extra code to make sure 
> everything is perfectly rounded to the last bit).

The Fortran frontend code should be correctly evaluated in
round-to-nearest mode (with of course possible exceptions for bugs
in MPFR).  If you have a test case showing bad results, please
file a bug report.

> >The other question is whether it makes sense to wait for version 1.0 of
> >MPC. Note: Kaveh Ghazi is also interested to have them for the middle
> >end, cf.
> >http://lists.gforge.inria.fr/pipermail/mpc-discuss/2008-September/000015.html
> >Tobias
> 
> I think we can start using it now, but until version MPC 1.0 it out and/or 
> the API is declared stable, I suggest we make it optional like the 
> ppl/cloog libraries.  My configurey patch defines an autoconf macro one can 
> check for this purpose.
> 

IMHO, this is a very bad idea.

-- 
Steve



More information about the Fortran mailing list