Popularity
0.9
Growing
Activity
10.0
Stable
3
1
1

Description

BigRational is a rational number class for arbitrary-precision arithmetic. There are no practical limits to the precision except the ones implied by the available memory. In difference to the usual implementations of such a class, the new system offers a significantly better performance and better memory usage. This is mainly due to the advantages of a stack machine, which minimizes the need for memory allocations and copies, and which allows to apply more efficient numerical algorithms. The way it works and the Api Documentation is available on GitHub-Pages.

As ultimate speed test compared to an ordinary BigRational class based on BigInteger, here the Mandelbrot set. This example contains everything, all basic numeric operations, small and big numbers, numbers with few and with many digits, iterations, threading and is generally very computationally intensive. It shows that the new system is many times faster than what is even possible with conventional technique. Theoretically, the

Programming language: C#
License: MIT License
Tags: Caching     .Net Core     Rational     BigRational    

BigRational alternatives and similar packages

Based on the "Caching" category.
Alternatively, view RationalNumerics alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of BigRational or a related project?

Add another 'Caching' Package

README

BigRational - a novel rational number class.

BigRational is a rational number class for arbitrary-precision arithmetic.
There are no practical limits to the precision except the ones implied by the available memory.
In difference to the usual implementations of such a class, the new system offers a significantly better performance and better memory usage.
This is mainly due to the advantages of a stack machine, which minimizes the need for memory allocations and copies, and which allows to apply more efficient numerical algorithms. The way it works and the Api Documentation is available on GitHub-Pages.

As ultimate speed test compared to an ordinary BigRational class based on BigInteger, here the Mandelbrot set.
This example contains everything, all basic numeric operations, small and big numbers, numbers with few and with many digits, iterations, threading and is generally very computationally intensive.
It shows that the new system is many times faster than what is even possible with conventional technique.
Theoretically, the increase in performance should be around factor of 10, which is confirmed by the test.
By zooming deeper into the Mandelbrot set, a factor of 20 and more is possible due to the massive memory garbage the old system implies.

[mandel1](docs/images/mandel1.png)

The second example is an ultimate test for the stacking machine.
The Tesselator uses its own instance of a BigRational.CPU stack machine, which is also used as a vertex buffer. Almost all CPU instructions are in use.
In this form no further memory allocations are necessary at runtime and the tessellation can never fail what is a big problem for any floating-point tessellation algorithm.

[tess1](docs/images/tess1.png)

The third example, a calculator, is intended for testing BigRational's high-level functions API.
No problem to calculate with thousands of decimal digits.
Precisission, string formattings and speed for the several functions can be checked.

[tess1](docs/images/calc1.png)

More detailed benchmarks coming soon.