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

Implementing Formal Power Series, rational algorithm #9572

Closed
wants to merge 6 commits into from

Conversation

leosartaj
Copy link
Member

TODO

  • Formal Power Series Class (without operations)
  • rational algorithm

I have implemented first version of FormalPowerSeries and rational_algorithm. Still needs a lot of work.

Ping @jcrist @flacjacket @certik

@leosartaj
Copy link
Member Author

This is built over code in #9523 which is under review.

@leosartaj
Copy link
Member Author

Some results

>>> %timeit series(atan(x), n=200)
1 loops, best of 3: 3.51 s per loop
>>> %timeit fps(atan(x), full=True).truncate(n=200)
1 loops, best of 3: 721 ms per loop

>>> %timeit series(ln(1 + x), n=200)
1 loops, best of 3: 7.95 s per loop
>>> %timeit fps(ln(1 + x)).truncate(n=200)
1 loops, best of 3: 557 ms per loop

As, FormalPowerSeries is formula based, speedup comes when number of terms is high.

>>> %timeit series(ln(1 + x), n=500)
1 loops, best of 3: 39.4 s per loop
>>> %timeit fps(ln(1 + x)).truncate(n=500)
1 loops, best of 3: 1.34 s per loop

>>> %timeit series(atan(x), n=500)
1 loops, best of 3: 10.1 s per loop
>>> %timeit fps(atan(x), full=True).truncate(n=500)
1 loops, best of 3: 2.09 s per loop

@aktech aktech added the GSoC label Jun 25, 2015
@aktech aktech added the series label Jun 29, 2015
@leosartaj leosartaj changed the title [WIP]Implementing Formal Power Series Implementing Formal Power Series, rational algorithm Jul 1, 2015
@leosartaj leosartaj changed the title Implementing Formal Power Series, rational algorithm [WIP]Implementing Formal Power Series, rational algorithm Jul 1, 2015
@leosartaj
Copy link
Member Author

I have written a lot of code on top of this, that is currently in my hyper2 branch. Should I open it is as well or it's better to first go through this?

There are some merge conflicts due to #9523. I will fix them.

@leosartaj leosartaj changed the title [WIP]Implementing Formal Power Series, rational algorithm Implementing Formal Power Series, rational algorithm Jul 9, 2015
num /= xc**j

ak = ((-1)**j * num * binomial(j + k - 1, k)
.rewrite(factorial) / a**(j + k))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you break this line somewhere else? I didn't even realize it was legal to break a line before a period...

@leosartaj
Copy link
Member Author

I have updated the docstrings and other comments except these 1, 2. I will fix them in #9639. As I have made some changes in the code in these particular areas. It's best if I change there and save myself from solving conflicts.

@leosartaj
Copy link
Member Author

All the changes were merged in #9639.

@leosartaj leosartaj closed this Jul 29, 2015
@leosartaj leosartaj deleted the fps branch July 29, 2015 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants