Git Product home page Git Product logo

Comments (7)

shibatch avatar shibatch commented on May 5, 2024

Could you explain in what situation argument reduction for such huge arguments is needed?
I think you are the 4th person who asked me to implement that feature, but no one has explained that point.

from sleef.

carlkl avatar carlkl commented on May 5, 2024

See i.e. Derek O'Conners quote on the Python bug tracker https://bugs.python.org/issue8309

I quote from Ng's paper :
http://www.derekroconnor.net/Software/Ng--ArgReduction.pdf

It is often argued that being concerned about large arguments is unnecessary, because sophisticated users simply know better than to compute with large angles. It is our contention that this position is suboptimal, because:

  1. It places an unnecessary burden on the user.
  2. The consequences of producing incorrect (inaccurate)answers may be catastrophic; many people assume that computers can do arithmetic very well. While numerical analysts know better, not all programmers are numerical analysts, nor should they be.
  3. It is a vendors responsibility to provide answers that are as correct as possible.

Derek O'Connor

I think the non-vectorized trig functions should be as exact as possible even for huge arguments mainly because of the 2nd argument.

EDIT

The bug mentions above has nothing to do with sleef. However, it can be assumed that most developers assume at least valid calculations from mid term sized arguments as supported from the INTEL hardware (FPU).

For the vectorized variants it is more easy to find arguments for a reduzed range of valid arguments.

I stumbled about this issue, because the range for floats RANGEMAXS is really small according to your specifications

from sleef.

shibatch avatar shibatch commented on May 5, 2024

If the argument is very large, obviously ULP of that argument becomes large.
So, the result of computation of trig functions become inaccurate anyway.
The assumption that computers always do arithmetic very well is just wrong.
This burden exists since when the user decides to use FP numbers of limited precision.

from sleef.

carlkl avatar carlkl commented on May 5, 2024

At least the reduced range for trig functions should also be mentioned in the README.

BTW: An accuracy problem for trigs was found in the FPU hardware, see Intel overstates FPU accuracy even for small sized arguments near PI. Numerical deviations in such cases can be avoided with using sleef AFAIK. This could be mentioned as well.

from sleef.

shibatch avatar shibatch commented on May 5, 2024

Please see doc/SPECIFICATION.
SLEEF is accurate for small sized arguments near (n PI).

from sleef.

carlkl avatar carlkl commented on May 5, 2024

Thanks

from sleef.

shibatch avatar shibatch commented on May 5, 2024

You're welcome.
Please don't hesitate to ask me if you have other questions.

from sleef.

Related Issues (20)

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.