Coder Social home page Coder Social logo

samhocevar / lolremez Goto Github PK

View Code? Open in Web Editor NEW
390.0 390.0 36.0 138 KB

๐Ÿ“ˆ Polynomial Approximations using the Remez Algorithm

License: Do What The F*ck You Want To Public License

Makefile 1.78% Shell 6.25% M4 1.29% C++ 89.99% Dockerfile 0.69%

lolremez's People

Contributors

asa-hopkins avatar jylam avatar mch1307 avatar samhocevar avatar skal65535 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lolremez's Issues

Dependencies broken for submodules

git submodule update --init --recursive
Cloning into '/home/hanno/src/linux/science/lolremez/lol/src/private/nx'...
remote: Repository not found.
fatal: repository 'https://github.com/samhocevar/lol-nx.git/' not found
fatal: clone of 'https://github.com/samhocevar/lol-nx.git' into submodule path '/home/hanno/src/linux/science/lolremez/lol/src/private/nx' failed
Failed to clone 'src/private/nx'. Retry scheduled
Cloning into '/home/hanno/src/linux/science/lolremez/lol/src/private/nx'...
remote: Repository not found.
fatal: repository 'https://github.com/samhocevar/lol-nx.git/' not found
fatal: clone of 'https://github.com/samhocevar/lol-nx.git' into submodule path '/home/hanno/src/linux/science/lolremez/lol/src/private/nx' failed
Failed to clone 'src/private/nx' a second time, aborting
Failed to recurse into submodule path 'lol'

Did you remove the archives from your repository?

Amazing

Amazing and very useful app. One question. How can i increase the precision up to the 13th digit ?

When calculating the polynomial (for exp) values i setup the app to the 10th term using this:
lolremez -d 10 -r -1:1 "exp(x)" "exp(x)"

I gave a test and calculate the exp(5) which is:
148.413159102576603421115580040552279623....
but, the function returned to me this:
146.459145496305723

What iยดm doing wrong ? And what is the range used for ?

Error: Assertion `thread::has_threads()' failed.

Compiled and installed with no error, but when I try to run lolremez I get

lolremez: ../lol/include/lol/private/sys/threading.h:170: T lol::queue<T, N>::pop() [with T = int; int N = 128]: Assertion 'thread::has_threads()' failed.

What's happening?

My machine:
Linux debian 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64 GNU/Linux

Multi-interval remez algorithm

Hi, this project is very impressive, thanks for sharing this.
I wanted to ask if this implementation supports the multi-interval Remez algorithm. For example, is it possible to approximate sing(x) function on the intervals [-1,-0.01], [0.01,1]?

Thanks in advance!

Doesn't build with clang

Just FYI, this project doesn't seem to build with clang, failing at the linker step, because clang does not automatically link -lstdc++ like g++. In case anyone else has this problem, try

CC=/usr/bin/gcc CXX=/usr/bin/g++ ./configure
make

Installation on windows

Thanks for the great tool !

I don't manage to build the solution in Visual Studio. When building, I get lots of errors such as "cannot open source file "assert.h" ".
I am using Visual Studio 2019.
I also have this warning : "Platform 'ORBIS' referenced in the project file 'lolremez' cannot be found.".

Problem with compilation in Mac OS

Actually errors occur in make stage:
First:

In file included from ./lol/algorithm/all.h:13:
./lol/algorithm/sort.h:56:54: error: call to 'max' is ambiguous
        for (ptrdiff_t i = 0; i < count_s() - 1; i = lol::max(i + d, (ptrdiff_t)0))
                                                     ^~~~~~~~

Second:

In file included from ./lol/math/all.h:22:
./lol/math/arraynd.h:80:18: error: call to 'max' is ambiguous
        *sizes = max(*sizes, (ptrdiff_t)m_initializers.size());
                 ^~~

Third:

In file included from ./lol/math/all.h:22:
./lol/math/arraynd.h:48:18: error: call to 'max' is ambiguous
        *sizes = max(*sizes, (ptrdiff_t)m_initializers.size());
                 ^~~

SLN File no longer compiles

The SLN file appears to be missing a reference to the lol/ directory as an include directory. In addition, the Win8.1 SDK (in contrast with the Win10 SDK) does not include float.h. As such, the project does not compile. I've attempted to retarget against Win10 SDK with build tools 137, but this did not solve the issue.

Rational Approximation?

Thank you for this! Have you any thoughts or plans on extending the functionality from polynomial to rational approximation?

Lack of installation requirements

Thanks for providing this awesome library. While I managed to install the package, it would be useful if there were a couple lines in the README specifying the exact instructions for installing it. Would save a lot of time.

How to install

Hello, i can't quite understand how to compile this project
i tried make command with the makefile.am as input but it tried to use some file in the lol folder which is empty

Nice! Very nice!

Just wanted to say thank you. An extremely useful piece of tooling.

Marvellous. A couple of small suggestions?

Would be very handy to

a) have the error factors printed out in the code
b) be able to create a generated function name from range and a command line argument i.e. pow_64_127
c) be able to specify a list of ranges as in -r 1:64 -r 65:128 ...

I can send a PR when I get around to the above if you wish.

I am using the outputs to generate a (much) more compact form for a lookup table. Saves a massive number of cycles not having to index and interpolate with some 3rd order equation!

Invaluable. Thanks again.

Higher precision for log(x)

First of all, let me give props to the devs for this one, it's truly an incredible project. Secondly, whenever I try to approximate log(x) with the weight function being itself (lolremez -d 16 -r 1:2 "log(x)" "log(x)"), the program gets (seemingly?) stuck on iteration 1. The range seems normal, and so do the rest of the parameters. So what exactly is going on here?

Release 0.4 exe needs explicit stdout/stderr redirect

Running lolremez.exe doesn't seem to "do" anything unless one explicitly redirects the stdout (and stderr).

This works but one has to inspect the txt files afterwards manually:
lolremez >stdout.txt 2>stderr.txt

Add docker image

Avoid having to build locally by using a docker image.
I have proposed this in PR #18.
It would also be possible to build the docker image with Travis-ci and store/publish it in GitHub Container Registry (ghcr.io).
A simple docker run ghcr.io/samhocevar/lolremez:tag would be needed to run it

Query about the new --float --double --longdouble options

I had a query about the new --float --double --longdouble options in 0.4 - specifically is there a way to sub the correctly represented float values back into the result?

I've had problems in the past where the rounding error when going from some any-precision-float -> float for the higher order terms of polynomials throws out the overall ULP of the result, and in the past I've had to then manually re-encode the correctly represented float values back into the original remez run so that the next term in the polynomial is aware of the precision loss of the preceding terms.

Thanks!

Approximating erf

I'm trying to approximate erf. How do I extend or link to lolremez?

invalid function sinh and others

I'm trying to do the sinh and cosh function, here is the error

parse error: parse error matching tao::pegtl::pad<grammar::expression::r_expr, tao::pegtl::ascii::space>
Error: invalid function: sinh(x)

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.