samhocevar / lolremez Goto Github PK
View Code? Open in Web Editor NEW๐ Polynomial Approximations using the Remez Algorithm
License: Do What The F*ck You Want To Public License
๐ Polynomial Approximations using the Remez Algorithm
License: Do What The F*ck You Want To Public License
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
I'm trying to approximate erf. How do I extend or link to lolremez?
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.".
As stated in the title, we may want to find a polynom based on arbitrary, lower than 32 bits, precision.
Looks like there is a lol/half but it's a very precise f16 implementation.
would it be possible to add functions like erfc and expm1 for extra precision around zero?
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
Just wanted to say thank you. An extremely useful piece of tooling.
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());
^~~
When I checked issue #13 , I found that there is still a mis-ordered function for exp2 and exp
Thank you for this! Have you any thoughts or plans on extending the functionality from polynomial to rational approximation?
-2^2
is parsed as (-2)^2
.
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 ?
The submodule's server certificate verification failed. I fixed it with:
RUN install_packages \
apt-transport-https \
ca-certificates
RUN update-ca-certificates
There is also PR #26 that may fix it.
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
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?
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
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!
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.
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?
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)
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.
Please add a license so that others can use this code. See https://opensource.stackexchange.com/a/1721.
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.
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
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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.