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

Should the API allow worse-than-single-precision accuracy for some operations? #3

Open
opera-mage opened this issue Oct 25, 2013 · 0 comments

Comments

@opera-mage
Copy link
Owner

There's a significant performance advantage that can be gained for some operations if they are allowed to be implemented with an algorithm that generates less than 24 bits of mantissa precision.

For instance, sqrt() and div() can be implemented with ~21 bits of precision with more than double the performance compared to 24 bits of precision on x86 and ARM architectures.

In general I don't like the idea of the possible differences between client implementations. On the other hand it might be acceptable if:

  1. The (possibly) reduced accuracy is clearly defined in the specification for the operations in question (i.e. stay away from these operations unless you know what you're doing).

  2. There are alternative methods that can provide the same functionality but with full accuracy (e.g. sqrt(x) could be substituted by pow(x, 0.5)).

The rationale is of course that the #1 priority of the API is to provide access to as fast methods as possible, to be used in real-time/performance critical applications rather than scientific applications (in the latter case you'd probably want double precision to begin with).

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

No branches or pull requests

1 participant