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

[RFC]: Add C implementation for @stdlib/math/base/tools/evalpoly #4564

Open
3 tasks done
ShabiShett07 opened this issue Jan 5, 2025 · 4 comments
Open
3 tasks done
Labels
Needs Discussion Needs further discussion. RFC Request for comments. Feature requests and proposed changes.

Comments

@ShabiShett07
Copy link

Description

This RFC proposes adding a C implementation, including a Node.js native addon, C benchmarks, and C examples, for the @stdlib/math/base/tools/evalpoly package.

Related Issues

Related issues #649

Questions

No.

Other

No.

Checklist

  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.
@kgryte
Copy link
Member

kgryte commented Jan 6, 2025

Why do we need this? We typically use the package evalpoly-compile for generating functions implementing Horner's rule.

@kgryte kgryte added RFC Request for comments. Feature requests and proposed changes. Needs Discussion Needs further discussion. labels Jan 6, 2025
@ShabiShett07
Copy link
Author

Ok, but I thought it would make things easy to implement if we do this.

@kgryte
Copy link
Member

kgryte commented Jan 7, 2025

In principle, we could add a C implementation which is equivalent to the main export; however, it is not something that we'd use in our C implementations. There, we use evalpoly-compile to generate functions AOT and in-line them into C source code. This allows avoiding loop overhead when evaluating polynomials.

@ShabiShett07
Copy link
Author

That makes sense! Also I understood that it can be tackled in a different way!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Discussion Needs further discussion. RFC Request for comments. Feature requests and proposed changes.
Projects
None yet
Development

No branches or pull requests

2 participants