-
Notifications
You must be signed in to change notification settings - Fork 160
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
Add TaylorSeriesRationalFunction
and improve Derivative
for univariate rational functions
#4104
Conversation
This is a new documented feature, so it does need release notes. I've changed the PR title to a suitable candidate for the release notes entry. |
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.
Looks OK in principle but I have some suggestions. But it's also OK to merge as-is shrug
t:=Zero(f); | ||
for i in [0..deg] do | ||
if i>0 then | ||
f:=Derivative(f); | ||
fi; | ||
t:=t+Value(f,at)*(x-at)^i/Factorial(i); | ||
od; |
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.
Assuming we require deg >= 0
(which is not clear to me from the description of the function), could also do this
t:=Zero(f); | |
for i in [0..deg] do | |
if i>0 then | |
f:=Derivative(f); | |
fi; | |
t:=t+Value(f,at)*(x-at)^i/Factorial(i); | |
od; | |
t:=Value(f,at)*x^0; | |
for i in [1..deg] do | |
f:=Derivative(f); | |
t:=t+Value(f,at)*(x-at)^i/Factorial(i); | |
od; |
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.
I think this is a wash in terms of cost or code readability, so I left it out. (Added test for deg\ge0)
TaylorSeriesRationalFunction
and improve Derivative
for univariate rational functions
Includes better method for derivative of rational function.
Taylor series coefficients may be useful for Molien series or Growth series