Comments (6)
I added native support for big numbers in LODA. No external libraries are used. There is an upper limit of the size (configurable at compile time). Currently we support up to 180 decimal digits. Still room for performance improvements:
2021-08-01 16:33:18|INFO |Starting operations benchmark
2021-08-01 16:33:18|INFO |mov: 0.079µs
2021-08-01 16:33:18|INFO |add: 0.159µs
2021-08-01 16:33:18|INFO |sub: 0.279µs
2021-08-01 16:33:18|INFO |trn: 0.392µs
2021-08-01 16:33:18|INFO |mul: 2.369µs
2021-08-01 16:33:18|INFO |div: 15.448µs
2021-08-01 16:33:18|INFO |dif: 19.218µs
2021-08-01 16:33:19|INFO |mod: 19.025µs
2021-08-01 16:33:19|INFO |pow: 89.842µs
2021-08-01 16:33:20|INFO |gcd: 583.418µs
2021-08-01 16:33:20|INFO |bin: 36.602µs
2021-08-01 16:33:20|INFO |cmp: 0.028µs
2021-08-01 16:33:20|INFO |min: 0.128µs
2021-08-01 16:33:20|INFO |max: 0.117µs
from loda.
There are several, for example GMP (GNU Multiple Precision Arithmetic Library), but I don't know about their current status. Note that with any bignum-implementation comes the added headache of the need to allocate and deallocate lists, possibly largish. (OTOH, with only two 64-bit words we already go up to 340282366920938463463374607431768211456, unsigned). But with well-designed interfaces that kind of change might be mostly transparent (coding-wise), except perhaps in the execution times and memory usage? But I'm not an expert in C++, so I don't know all of its perks.
from loda.
I don't think we don't need arbitrary precision. I was thinking to use C++ templates with std::arrays. That should be much more efficient, because everything is stored directly on the stack.
from loda.
I've had decent success with the trio mpir+mprf+mpreal. If you are aiming for integer only operations mpir might suffice (e.g. mpz_class) or possibly own implementation/other lightweight library.
(Great project btw!)
from loda.
For evaluating programs with bigger number you can use LODA Lab. However this cannot do mining of new programs.
PROMPT> loda eval A42 -t 19
1,11,111,1111,11111,111111,1111111,11111111,111111111,1111111111,11111111111,111111111111,1111111111111,11111111111111,111111111111111,1111111111111111,11111111111111111,111111111111111111,1111111111111111111
PROMPT> loda-lab eval 42 -t 40
1,11,111,1111,11111,111111,1111111,11111111,111111111,1111111111,11111111111,111111111111,1111111111111,11111111111111,111111111111111,1111111111111111,11111111111111111,111111111111111111,1111111111111111111,11111111111111111111,111111111111111111111,1111111111111111111111,11111111111111111111111,111111111111111111111111,1111111111111111111111111,11111111111111111111111111,111111111111111111111111111,1111111111111111111111111111,11111111111111111111111111111,111111111111111111111111111111,1111111111111111111111111111111,11111111111111111111111111111111,111111111111111111111111111111111,1111111111111111111111111111111111,11111111111111111111111111111111111,111111111111111111111111111111111111,1111111111111111111111111111111111111,11111111111111111111111111111111111111,111111111111111111111111111111111111111,1111111111111111111111111111111111111111
(LODA is indeed a great project!)
from loda.
Awesome.
from loda.
Related Issues (20)
- Rename instruction from `cal` to `oeis` HOT 5
- Eval modes for rational and irrational numbers HOT 2
- Use libcurl
- Provide loda binaries HOT 1
- Use `$0` for output register HOT 3
- Semantics of binomial coefficient HOT 2
- Improve performance of div operation for big numbers HOT 1
- Question about minimizer's recommended deletions inside the loop. HOT 1
- Video/podcast explaining what LODA is about HOT 4
- Suggested new instructions: DID ("Divide (but only) If it Divides"). HOT 2
- Suggested new instructions: MAX ("Take maximum value of the operands"). HOT 3
- Check more terms HOT 5
- Run stats and list generation at start of maintenance
- Store multiple programs for the same sequence
- Move GitHub repo to a dedicated LODA project/organization? HOT 1
- Caching LODA code output locally with a default max terms to cache
- Miner produces an incorrect program: Intended to compute A276153, but computes A341356 instead, because upper limit too low. HOT 2
- Miner produces incorrect program for A235918, A236454, etc, by the use of dubious heuristics. HOT 2
- Call graph stats and visualization HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loda.