RFC: Using the MPC library (complex cousin of MPFR) for simplifications in gfortran
Tobias Burnus
burnus@net-b.de
Tue Jan 13 18:08:00 GMT 2009
Hi all, hi Kaveh,
I'm wondering whether it would make sense to optionally use the MPC
library (http://www.multiprecision.org/mpc/) to simplify complex
numbers. The number of supported functions is currently not complete
though (sqrt, exp, log, sin, cos, tan, sinh, cosh, tanh plus the obious
stuff (+-*/, norm etc.).* MPC is based on MPFR and has some overlap in
terms of developers.
I think it might be useful for some initialization expressions, but on
the other hand, we already handle several of those (such as
gfc_simplify_sin) but not all. For instance, SINH with complex arguments
(Fortran 2008) is not yet supported [not only for simplification]. It
can be implemented in terms of MPFR (as done in MPC) but the question is
whether relying on a libray is better than re-inventing the wheel.
Some support - whether home grown or via MPC - is needed for get full
Fortran 2003 initialization-expression support (cf. also PR 38822 for
the latest bug).
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
* Missing are at least acos(h),asin(h), atan(h), and pow; plus some more
special functions such as (l)gamma or erf(c). For the intent to
implement those, see:
http://lists.gforge.inria.fr/pipermail/mpc-discuss/2008-September/000016.html
More information about the Fortran
mailing list