Giter Club home page Giter Club logo

Comments (10)

dpsanders avatar dpsanders commented on July 22, 2024

What do you think about this @lbenet?

from intervalarithmetic.jl.

lbenet avatar lbenet commented on July 22, 2024

I think the default should be to get the tightest intervals, and it that sense, it shouldn't be the default. I wouldn't mind to have it as default for the :wide rounding mode, though.

Do you think that the current ^ could be speed-up using power_by_squaring somewhere?

from intervalarithmetic.jl.

dpsanders avatar dpsanders commented on July 22, 2024

In this particular case, I don't agree. The reason is simply that using the tight ^ requires the use of BigFloat (rounding powers is difficult), and hence is reaallly slooow.

For a real use case I just tried, just changing the two instances of ^ to pow in a function that is evaluated many times gave a 10x speedup.

As soon as power_by_squaring is used, tightness is lost -- but (a lot of) speed is gained.
(I believe it is still possible to speed up, and possibly make more accurate, pow in :errorfree mode.)

I also don't think that we should change the behaviour based on the rounding type (more than is necessary).

from intervalarithmetic.jl.

lbenet avatar lbenet commented on July 22, 2024

Just to make my point clear: I am in favor of the slow version (^), since it assures tighter intervals.

My comment about the :wide mode is, simply, that in this case we already loose the tightness of the intervals, and therefore it may be appropriate to have ^ equivalent to pow`. But I guess this may complicate things a lot.

You are probably right; using Base.power_by_squaring may not be useful as such to get tighter intervals. What I had in mind was to use the same algorithm but with tighter versions (e.g., a^2 instead of a*a). I'll think about it...

from intervalarithmetic.jl.

dpsanders avatar dpsanders commented on July 22, 2024

My proposal is not to remove the tight version, just to not make it the default.
In my opinion, it's more of a "gotcha" (unpleasant, unexpected outcome) to surprise the user by making the standard functions too slow, rather than to document that a very slightly tighter option is the pow function (in the new version).

from intervalarithmetic.jl.

lbenet avatar lbenet commented on July 22, 2024

I understand your point for the "gotcha" about the speed, and agree that the problem lies in the conversion to BigFloat's, performing there the calculations, and convert back to Float64.

Yet, I think the aim of the package is reliability rather than speed, and this includes the tightness of the bounds. Tightness is so important that it is mentioned in the standard. We give the option to the user who prefers speed (by sacrificing tightness) which is the :wide rounding mode. I think it is consistent with this to have the slow ^ version as default, but allow to use pow.

from intervalarithmetic.jl.

lbenet avatar lbenet commented on July 22, 2024

I recall that when I was dealing with ^, few (special) ITF1788 tests where failing. I couldn't get around them with Float64 which led to using BigFloats. Maybe we should use only for those special cases the trick with big53. That would speed things up again.

from intervalarithmetic.jl.

dpsanders avatar dpsanders commented on July 22, 2024

I believe that the standard only requires documenting how strict each function is.

The current pow is correct, and only slightly wider in most cases.

from intervalarithmetic.jl.

lbenet avatar lbenet commented on July 22, 2024

I do think that the standard requires tightness for pown. I must go out now, but I'll look later to get the specific reference to this.

In any case, see #47 for an implementation of pown without big53.

from intervalarithmetic.jl.

lucaferranti avatar lucaferranti commented on July 22, 2024

addressed in #388

from intervalarithmetic.jl.

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.