Coder Social home page Coder Social logo

Amazing about lolremez HOT 1 CLOSED

samhocevar avatar samhocevar commented on September 21, 2024
Amazing

from lolremez.

Comments (1)

samhocevar avatar samhocevar commented on September 21, 2024

The range is indeed the problem. It states what the valid range for the resulting polynomial is (it is impossible to create an approximation polynomial for arbitrarily large values). So if you want to be able to compute exp(5) you will need to provide a larger range, e.g.:

lolremez -d 10 -r -5:5 "exp(x)" "exp(x)"

This will give the following value:

148.303891984497

That’s already closer. Another problem is that exp(x) behaves very differently for positive and negative values, so I suggest only computing for the 0:5 range:

lolremez -d 10 -r -0:5 "exp(x)" "exp(x)"

And calling the function like this:

x >= 0 ? exp(x) : 1.0 / exp(x)

This is the value for exp(5):

148.413082305473

Also note that if you use exp(x) as the error function, exp(5) will be the less precise value. You may wish to distribute the error in a more homogeneous way:

lolremez -d 10 -r -0:5 "exp(x)"

Which gives for exp(5):

148.413150926903

from lolremez.

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.