Skip to content

Commit

Permalink
Add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev committed Jun 7, 2021
1 parent 61313e3 commit 0166a68
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
19 changes: 16 additions & 3 deletions diofant/tests/series/test_series.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import pytest

from diofant import (Derivative, E, Function, Integer, Integral, O, Rational,
Subs, Symbol, cos, exp, log, oo, pi, series, sin, sqrt,
symbols)
from diofant import (Derivative, E, Function, Integer, Integral, Mul, O,
Rational, Subs, Symbol, cos, exp, log, oo, pi, series,
sin, sqrt, symbols)
from diofant.abc import x, y


Expand Down Expand Up @@ -254,3 +254,16 @@ def test_sympyissue_20697():
(b0**2*p1 - b0*b1*p2 - p3*(b0*b2 - b1**2))/b0**3)/y))

assert e.series(y, n=3) == b2*y**2 + b1*y + b0 + O(y**3)


def test_sympyissue_21245():
fi = (1 + sqrt(5))/2
e = 1/(1 - x - x**2)
assert (e.series(x, 1/fi, 2) ==
-sqrt(5)/(Mul(5, x - 1/(Rational(1, 2) + sqrt(5)/2),
evaluate=False)) + sqrt(5)/(5 + 5*sqrt(5)) +
1/(5 + 5*sqrt(5)) +
(x - 1/(Rational(1, 2) + sqrt(5)/2))*(-6*sqrt(5)/(50*sqrt(5) + 150) -
10/(50*sqrt(5) + 150)) +
O((x - sqrt(5)/2 + Rational(1, 2))**2,
(x, -Rational(1, 2) + sqrt(5)/2)))
1 change: 1 addition & 0 deletions docs/release/notes-0.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,4 @@ These Sympy issues also were addressed:
* :sympyissue:`21557`: Summation of geometric series with non-real exponent does not evaluate
* :sympyissue:`21550`: Bug: limit returns wrong result for rational function
* :sympyissue:`21177`: Incorrect residue for cot(pi*x)/(x**2 - 3*x + 3)
* :sympyissue:`21245`: laurent series Fibonacci generating fuction

0 comments on commit 0166a68

Please sign in to comment.