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

Development #132

Draft
wants to merge 16 commits into
base: Rel/2024-04-m1
Choose a base branch
from
Draft

Development #132

wants to merge 16 commits into from

Conversation

Jsoto22
Copy link
Collaborator

@Jsoto22 Jsoto22 commented Apr 21, 2024

This PR is preliminary and will be completed by the end of April 2024. Does not currently pass checks due to lines covered in unit testing. Please read notes at the end.

Additions:

  • Logarithmic functions ($ e^{n}$, $ e^{n}-1$, $ \text{Log}2^{n}$, and $ \text{Log}10^{n}$)
  • Logarithmic constants (E, LN2, LN2E, LN10, and LN10E)
  • Trigonometric functions
    • Sine and Hyperbolic Sine
    • Cosine and Hyperbolic Cosine
    • Tangent and Hyperbolic Tangent
  • Includes changes added in PR Powers, Roots, and more #131 and Rel/2024 04 m1 #130.

Issues Addressed:

Drafting this PR for now until Todo list is completed.

  • Implement Inverse trig functions
  • Implement unit testing
  • Update README
  • Update package version (major)
Notes on approximations and performance

Nature of approximations

Many of the added functions utilize approximations where the precision is accurate up to ULP (Unit in the last place) of 1. The default precision is 32 decimal places and uses the default rounding mode when returning the result.

The approximations themselves utilize specific formulas and various types of mathematical series. For values close to one after argument reduction, convergence rates are relatively fast, although convergence rates for some functions will never truly converge for irrational numbers, as they can be infinitely approximated to any point of precision. To limit these operations, a tolerance within the desired precision is used as such:

$$\displaylines{\left| X_{n-1} - X_{n} \right| \lt \epsilon \\ X_{n} \approx f_{n}\left( x \right) \text{; where } 0\le n \le \infty \\ \epsilon = 10^{-32}}$$

$ X_{n}$ represents the approximation value of the loop at step $n$. When the difference between the previous and next values are less than the tolerance, any further iterations will be inconsequential to the desired precision, ending the loop.

The current bigO complexity has yet to be evaluated, but many of the algorithms have been modeled after IEEE 754 and other resources. More optimizations will likely be implemented, and evaluation of performance will follow.

- Allows for any size Integer to be used as an exponent
Adds 'Euclidean division' Modulus operation and simplifies Modulus Remainder sign logic. Unit tests added.
Implements support for fractional exponents in powers and integer only roots
Adds new features and updates REAMDME.md
Todo: expand unit testing for new features.
- Fixed typing issues in BigDecimal validate
- Removed deprecated substr functions
- Added wrapper logic functions to compareTo
- Fully implemented 'UNNECESSARY' rounding mode
todo: Unit testing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implementing Roots Returning "0" in divide() is ignoring precision Implement pow
1 participant