Proposal for arbitrary precision data type and arbitrary precision Lapack/Blas
Like to see an arbitrary precision data type in stdlib. Other languages like python, c++, java and Julia have already implemented. As a programming language for scientific calculation, Fortran should have the arbitrary precision data type implemented as well.
GNU has a GMP multiple precision library for c++. To the Fortran side, there are David Bailey's MPfun2015 package (https://www.davidhbailey.com/dhbsoftware/) and David Smith's FM package (https://dmsmith.lmu.build/).
For arbitrary precision Lapack/Blas, there is mpack(http://mplapack.sourceforge.net/).
I like the idea - while I do not usually need multiple precision in my daily work or my hobbies, having such a feature readily available is certainly welcome. Something that might also be useful: arbitrary precision integer data.
Have you checked the status and the licence of the various libraries?
Regards,
Arjen
Op do 10 sep. 2020 om 19:18 schreef Jing [email protected]:
Like to see an arbitrary precision data type in stdlib. Other languages like python, c++, java and Julia have already implemented. As a programming language for scientific calculation, Fortran should have the arbitrary precision data type implemented as well.
GNU has a GMP multiple precision library for c++. To the Fortran side, there are David Bailey's MPfun2015 package ( https://www.davidhbailey.com/dhbsoftware/) and David Smith's FM package ( https://dmsmith.lmu.build/).
For arbitrary precision Lapack/Blas, there is mpack( http://mplapack.sourceforge.net/).
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/fortran-lang/stdlib/issues/231, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN6YR3P3GD2R4P5RE5KRO3SFEC7BANCNFSM4RFPDUUA .
For mpack, it is 2-caluse BSD style license. It has not been updated since 2012. For MPfun2015 package, it has LIMITED BSD LICENSE, i do know what that means. For FM package, it is free.
Thanks for looking into this. I cannot find any information about a limited BSD license, but there is a Github mirror by @jacobwilliams for this package. Maybe Jacob can explain this? In any case, there are no obvious restrictions based on the license text I found there to the use of theat package in the Fortran stdlib.
Op zo 20 sep. 2020 om 17:56 schreef Jing [email protected]:
For mpack, it is 2-caluse BSD style license. It has not been updated since 2012. For MPfun2015 package, it has LIMITED BSD LICENSE, i do know what that means. For FM package, it is free.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/fortran-lang/stdlib/issues/231#issuecomment-695802946, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN6YR5SXBO2M7L3B2RHF43SGYQ2FANCNFSM4RFPDUUA .
FYI: the latest version of mplapack (the name has been changed because of https://github.com/nakatamaho/mplapack/issues/2) is sitting here: https://github.com/nakatamaho/mplapack.
Yes, Fortran definitely needs an arbitrary precision floating point, as either a library or part of stdlib.
Arbitrary precision lapack/blas is also occasionally useful. I've used quadruple precision Lapack in the past by recompiling Lapack in quadruple precision. Not the best, but it worked to give me some extra precision.
@Jim-215-Fisher, would you be interested in working on this?
Yes, I would be glad to introduce an arbitrary precision package to stdlib. I need some feedback about implementation and interface.
Here is some thoughts about the implementation and interface of the arbitrary precision module for stdlib.
module multiprecision
type :: mp
integer, allocatable :: n(:)
end type mp
! use integer array to represent sign, exponent and digits of a float with a desired precision
public :: set_precision ! call for precision setup
interface operator(+) ! operator overload for arithmetic
interface operatoe(-)
interface operator(*)
interface operator(/)
interface assignment(=) ! operator overload for assignment
interface operator(==) ! operator overload for logic comparison
interface operator(<)
interface operator(<=)
interface operator(>)
interface operator(>=)
interface abs ! intrinsic function overload
interface sin
interface cos
...
end module multiprecision
Any suggestion or comment?
CC @awvwgk, @milancurcic, @LKedward, @arjenmarkus
What would be the best approach?
I have rather limited experience with multiprecision libraries (used them once for code generation in Ruby, but this is years ago).
Probably worth to collect some information what other libraries/languages are doing regarding representation, functionality and interfaces. A couple of Fortran compatible libraries are already linked above.
Another question is how much effort a multiprecision implementation in stdlib is going to be, especially regarding code review, testing and validation. Do we have the tools for this available?