GithubHelp home page GithubHelp logo

Comments (4)

jacobwilliams avatar jacobwilliams commented on August 18, 2024

The solution that uses:

#if defined(EXPORT_REAL)
    ! export the single precision names (qag, etc.)
    generic, public :: qag => dqag
    generic, public :: qage => dqage
...

Works with fort, but not Gfortran. I think this may be a Fortran 2018 feature?

from quadpack.

jacobwilliams avatar jacobwilliams commented on August 18, 2024

Fixed in #4

from quadpack.

ivan-pi avatar ivan-pi commented on August 18, 2024

For the quad procedures, don't you need to (re)generate the weights of the Gauss-Kronrod quadrature with higher precision?
According to the comments in the original source code:

        ! gauss quadrature weights and kronrod quadrature abscissae and weights
        ! as evaluated with 80 decimal digit arithmetic by l. w. fullerton,
        ! bell labs, nov. 1981.

I'm not sure what 80-decimal digit arithmetic means exactly; do they mean 80-bit extended precision? The Wikipedia page on quad precision states:

The IEEE 754 standard specifies a binary128 as having:

  • Sign bit: 1 bit
  • Exponent width: 15 bits
  • Significand precision: 113 bits (112 explicitly stored)

This gives from 33 to 36 significant decimal digits precision. [emphasis added] If a decimal string with at most 33 significant digits is converted to IEEE 754 quadruple-precision representation, and then converted back to a decimal string with the same number of digits, the final result should match the original string. If an IEEE 754 quadruple-precision number is converted to a decimal string with at least 36 significant digits, and then converted back to quadruple-precision representation, the final result must match the original number.

The current implementation provides the constants with 33 decimal digits (presumably all of which are correct?), however a few significant digits might be missing for the quad implementation.

The QUADPACK manual (Piessens et al., 1983, pg. 7) contains the paragraph:

In the single precision QUADPACK version, these constants are given to 16 figures. Two double precision versions are supplied with constants given to 16 or to 33 figures. With a few exceptions, the mathematically correct values are irrational and thus the tabulated data are only approximations. The formulae which use this data are thus incapable of providing accurate results to more than, say, 16 or 33 places even for a very simple integrand. This then, becomes a fundamental limitation of virtually all the QUADPACK routines.

There are some coefficient-based tests to verify the adequacy of a quadrature formula, see

Walter Gautschi, How and how not to check Gaussian quadrature formulae, Bit 23, 1983, 209-216. https://www.cs.purdue.edu/homes/wxg/selected_works/section_08/084.pdf

Alternatively, we could verify their precision by comparison with the results from numerical integration with arbitrary-precision ball arithmetic (Arb).

from quadpack.

jacobwilliams avatar jacobwilliams commented on August 18, 2024

Yes, we need to see about regenerating them with more precision. I haven't looked into it yet. I can open a new issue for that.

from quadpack.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.