-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve accuracy for atan2(y,x) when x is near-zero (#19)
`atan2(y,x)` requires a lot of bits in the integer part when `x` is near-zero. This is because `atan2(y,x)` does `atan(y/x)` internally and `y/x` easily overflows for very small `x` unless you have more integer bits than fraction bits. However, `atan(q)` does `1/q` if `q > 1`, thereby inverting the original division in `atan2`. So this overflow can be avoided if these divisions are shortcut. Closes #18
- Loading branch information
1 parent
44fbdeb
commit 8b488e3
Showing
2 changed files
with
85 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters