[J3] [EXTERNAL] Re: More Bessel functions

Clune, Thomas L. (GSFC-6101) thomas.l.clune at nasa.gov
Wed Jan 20 19:23:14 UTC 2021


I want to second Steve's comments here.     (And also thank him for obviating the need to compose my own response.)


- Tom

On 1/19/21, 9:27 PM, "J3 on behalf of Steven G. Kargl via J3" <j3-bounces at mailman.j3-fortran.org on behalf of j3 at mailman.j3-fortran.org> wrote:

    On Tue, Jan 19, 2021 at 02:49:59PM -0800, Van Snyder via J3 wrote:
    > On Tue, 2021-01-19 at 12:28 -0700, Ondřej Čertík via J3 wrote:
    > > On Tue, Jan 19, 2021, at 12:11 PM, Steven G. Kargl via J3 wrote:
    > > > On Tue, Jan 19, 2021 at 10:45:22AM -0800, Van Snyder via J3 wrote:
    > > > > On Tue, 2021-01-19 at 16:38 +0000, Nathan Sircombe via J3 wrote:
    > > > > > They’re not implemented in libm as far as I can tell -
    > > > > > https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.gnu.org%2Fsoftware%2Flibc%2Fmanual%2Fhtml_node%2FSpecial-Functions.html&data=04%7C01%7Cthomas.l.clune%40nasa.gov%7C682aac9d8ea34e663ec008d8bceaf6eb%7C7005d45845be48ae8140d43da96dd17b%7C0%7C0%7C637467064639564370%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=3xldGOUDxz6QOjjOy9JGnPwDn6z380A9W0TzNeUSR78%3D&reserved=0
    > > > > > 
    > > > > > …so you don’t get them ‘for free’, although GSL has
    > > > > > animplementation.
    > > > > 
    > > > > There are more things in heaven and earth, Horatio, than are
    > > > > dreamt ofin your philosophy.There are more sources of freely-
    > > > > available reliable mathematicalsoftware than libm.
    > > > 
    > > > Isn't your second sentence an argument against adding these
    > > > functions to the Fortran standard?
    > > > As Bill points out, Abramowitz and Stegun is a rather thickbook on
    > > > special functions.  It is now updated and availablefor free at 
    > > > https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdlmf.nist.gov%2F&data=04%7C01%7Cthomas.l.clune%40nasa.gov%7C682aac9d8ea34e663ec008d8bceaf6eb%7C7005d45845be48ae8140d43da96dd17b%7C0%7C0%7C637467064639564370%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=OERpkOKHJsQNCLYQgaXAlaTnsFHmoZgyO8lFEx4CVPY%3D&reserved=0.  The NIST site contains linksto software,
    > > > e.g., https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdlmf.nist.gov%2F10.77&data=04%7C01%7Cthomas.l.clune%40nasa.gov%7C682aac9d8ea34e663ec008d8bceaf6eb%7C7005d45845be48ae8140d43da96dd17b%7C0%7C0%7C637467064639564370%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=a9VCz%2FzzeGb%2FaSj0L3j5YO0wH%2B5k92JzK9ep7Z9Y5fw%3D&reserved=0.  Should theFortran standard
    > > > include all of the functions covered by NIST?
    > 
    > The advantage of standards is they are, well, standard.
    > One can find software for just about any special function. Typically
    > several routines, with different interfaces.

    I think that this is slippery slope.

    I suspect that solving linear algebra problems far out
    paces the need for BESSEL_I0(x), etc.  Should the Standard
    include standardized interfaces for some, many, or all of
    the BLAS and LAPACK routines?  Perhaps, the Standard should
    include an intrinsic module named ISO_MATRIX that encapsulates
    BLAS and LAPACK interfaces.

    I also suspect forward and inverse FFTs far out pace
    the need for BESSEL_I0(x).  Again, should the Standard
    include standardized interfaces and an ISO_FOURIER intrinsic
    module?  Should it only include radix-2 FFTs?  I would
    advocate for Clive Temperton's prime factor FFT algorithms.

    > A competent vendor will provide a good one, perhaps by picking up one
    > in the public domain, and adjusting the name and argument list to meet
    > the standard.

    True.  One can find Sun Microsystem's libm implementation
    on Netlib.  fdlibm contains an implementation of jn(x) 
    (Copyright date of 1993), i.e., BESSEL_JN(X), which is the 
    basis of most (all?) open-source operating systems' libm.
    It only took 17 years for someone to find an serious bug
    in that implementation (countable many inf almost evenly
    spaced over the domain of x).  

    -- 
    Steve



More information about the J3 mailing list