-
Notifications
You must be signed in to change notification settings - Fork 44
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
Implementation of trigonometric functions #331
Conversation
Interesting. Can you say something about the use cases here? |
Essentially, I would like to use rainier-core's features of online compilation and automated differentiation for numeric optimization. My current use case is in the control of hybrid systems where trigonometric functions are ubiquitous. Since such trigonometric functions can not be expressed in terms of anything else their absence in Rainier means I cannot use it and would need to maintain a fork. Overall, implementations of trigo functions should not be intrusive: its mostly additional unary ops as the ones for Another option would be to add an extension point to allow user-defined operations (which could also help for #227) but this would require some non-trivial refactoring and I really believe trigonometric functions have their place in the core. |
Got it, thanks for the context. I'm +1 to continuing with these. Thanks so much for the contributions! |
As a side note - I gather from this that you would probably be using the |
Great, I'll start working on it. Indeed, I am only interested in |
Codecov Report
@@ Coverage Diff @@
## develop #331 +/- ##
===========================================
+ Coverage 47.89% 48.29% +0.39%
===========================================
Files 80 80
Lines 2758 2812 +54
Branches 214 217 +3
===========================================
+ Hits 1321 1358 +37
- Misses 1437 1454 +17
Continue to review full report at Codecov.
|
@avi-stripe This should be ready for review now. I have also added methods on Real for hyperbolic functions that are defined in terms of the existing primitives. Those are not essential to this PR as they only introduce syntactic sugar. |
Wonderful, thank you! |
This is a proof of concept PR to gauge the interest in adding common trigonometric functions to
Real
.It currently only contains a simple implementation for
sin
andcos
to validate the approach and get early feedback before spending to much time on it.If there is interest we should: