-
Notifications
You must be signed in to change notification settings - Fork 347
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
Use JTS doubledouble implementation instead of ttmath #303
Conversation
| static DD pow(const DD &d, int exp); | ||
| static DD trunc(const DD &d); | ||
|
|
||
| bool isNaN() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many of these methods seem like good candidates for inlining (either by defining them where they're declared, or by using a .inl file like much of the older work)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly they don't get called except in the tests. Most of the work happens in the arithmetic operators and selfAdd/selfMultiply.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like just about all the methods should be inlineable, no? Would be interesting to see the performance diff.
The ttmath library is quite large and full of fancy stuff like ASM and so on, and all we seem to need is doubledouble. Also ttmath has some issues on big-endian systems. Also, this implementation seems to be 5-10% faster than ttmath, and I haven't exactly fine tuned it. I think with some added unit tests from JTS we should consider dropping ttmath entirely, and maybe even back-porting this into 3.8, since there is no regression change at all (!!). (Maybe, at least so far testing only on my machine.)