-
Notifications
You must be signed in to change notification settings - Fork 100
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
Cin function #397
base: master
Are you sure you want to change the base?
Cin function #397
Conversation
Codecov Report
@@ Coverage Diff @@
## master #397 +/- ##
==========================================
+ Coverage 91.99% 93.61% +1.62%
==========================================
Files 12 12
Lines 2809 2773 -36
==========================================
+ Hits 2584 2596 +12
+ Misses 225 177 -48
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
This seems a little large. I would usually aim for a relative error < 1e-13 everywhere. |
What are the expectations on relative error when the function value is 0? |
I updated the function such that it relies on the existing |
Also, possibly for a different PR but |
When the function value is exactly zero, you want to also return 0. And where the function value is near zero, you still want low relative error. Often this means switching to a Taylor expansion in the vicinity of a root. |
OK, that's what I did exactly. I assume the PR should be fine then. One might want to tune the |
(Disclaimer: first time contributor to a Julia project.)
Added the Cin function, which is the other cosine integral function given by the integral of (1-cost)/t from 0 to x.
Approximation obtained using Mathematica's EconomizedRationalApproximation. Maximum error is 1.1e-10 in the range [0,16] for the input.
I named it cosint2. maybe cin is a better name?