AdamWhiteHat / BigRational

Arbitrary precision rational number class
MIT License
24 stars 2 forks source link

Added Muller's Recurrence test, to check that BigRational is holding … #4

Closed stewienj closed 5 years ago

stewienj commented 5 years ago

…accuracy over many iterations.

Here's a link to explain https://scipython.com/blog/mullers-recurrence/

Needed to add some operators to cut down on the verboseness of the test. Trying to use the Divide and Subtract functions on a complex equation made the equation difficult for a human to parse.

This is the current equation:

BigRational Xnext = c108 - (c815 - c1500 / Xprevious) / Xn;

Without the operator overloads it looked like this, which took me a while to get right as I made a few mistakes the first time I typed it in:

BigRational Xnext = BigRational.Subtract(c108,BigRational.Divide(BigRational.Subtract(c815, BigRational.Divide(c1500,Xprevious))), Xn);