You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Division, SquareRoot and Logarithm are more difficult than addition and multiplication because they can result in infinite digits. The simple algorithm for long division gives a simple way to find the answer up to x digits though. Squareroot can also be found exactly up to x digits by using the bisection method (works particularly well for binary floats). But logarithm is slightly harder to get the precise answer up to ``x` digits because there isn't an exact exponential function either. This means that in order to get the correct rounding, more sophisticated error bounding is needed.
Typically this is done with Newton-Raphson iteration and precomputed tables, and continuing until the error is between floating-point values. I would like to keep the code simpler than anything more complex than what I can understand directly from reading the code though. One of the goals of this project is to have a readable, correct floating-point implementation; using more complex algorithms runs counter to that goal.
I'm not sure how to proceed. I will probably just work on other things until I get an idea (it worked for sqrt).
The text was updated successfully, but these errors were encountered:
I have come to the realization that a precise logarithm is not required by the specification. Instead only a logarithm to integers is needed, which is not difficult to do.
This should allow this project to move forward again. I may take it up as my main project for the remainder of the semester.
Division, SquareRoot and Logarithm are more difficult than addition and multiplication because they can result in infinite digits. The simple algorithm for long division gives a simple way to find the answer up to
x
digits though. Squareroot can also be found exactly up tox
digits by using the bisection method (works particularly well for binary floats). But logarithm is slightly harder to get the precise answer up to ``x` digits because there isn't an exact exponential function either. This means that in order to get the correct rounding, more sophisticated error bounding is needed.Typically this is done with Newton-Raphson iteration and precomputed tables, and continuing until the error is between floating-point values. I would like to keep the code simpler than anything more complex than what I can understand directly from reading the code though. One of the goals of this project is to have a readable, correct floating-point implementation; using more complex algorithms runs counter to that goal.
I'm not sure how to proceed. I will probably just work on other things until I get an idea (it worked for sqrt).
The text was updated successfully, but these errors were encountered: