Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement logarithm function #3

Open
TheThirdOne opened this issue Oct 23, 2017 · 1 comment
Open

Implement logarithm function #3

TheThirdOne opened this issue Oct 23, 2017 · 1 comment

Comments

@TheThirdOne
Copy link
Owner

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).

@TheThirdOne
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant