Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #19510: modify constant factor: factor sqrt(k-1) is removed, too.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheuberg committed Jan 23, 2016
1 parent 1529a4d commit 3e30659
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/sage/rings/asymptotic/asymptotic_expansion_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,17 +355,20 @@ def Binomial_kn_over_n(var, k, precision=None, skip_constant_factor=False,
sage: asymptotic_expansions.Binomial_kn_over_n(
....: 'n', k=5, precision=5, skip_constant_factor=True)
1/2*(e^n)^(5*log(5)
- 4*log(4))*n^(-1/2)
- 7/160*(e^n)^(5*log(5) - 4*log(4))*n^(-3/2)
+ 49/25600*(e^n)^(5*log(5) - 4*log(4))*n^(-5/2)
(e^n)^(5*log(5) - 4*log(4))*n^(-1/2)
- 7/80*(e^n)^(5*log(5) - 4*log(4))*n^(-3/2)
+ 49/12800*(e^n)^(5*log(5) - 4*log(4))*n^(-5/2)
+ O((e^n)^(5*log(5) - 4*log(4))*n^(-7/2))
sage: _.parent()
Asymptotic Ring <(e^(n*log(n)))^(Symbolic Constants Subring)
* (e^n)^(Symbolic Constants Subring)
* n^(Symbolic Constants Subring)
* log(n)^(Symbolic Constants Subring)>
over Rational Field
sage: asymptotic_expansions.Binomial_kn_over_n(
....: 'n', k=4, precision=4, skip_constant_factor=True)
(e^n)^(4*log(4) - 3*log(3))*n^(-1/2)
+ O((e^n)^(4*log(4) - 3*log(3))*n^(-3/2))
sage: all( # long time
....: asymptotic_expansions.Binomial_kn_over_n('n', k=k,
....: precision=5, algorithm='direct').has_same_summands(
Expand Down Expand Up @@ -420,7 +423,7 @@ def Binomial_kn_over_n(var, k, precision=None, skip_constant_factor=False,
if skip_constant_factor:
from sage.rings.rational_field import QQ
result = result.parent().change_parameter(
coefficient_ring=QQ)(result / SCR(k.sqrt()))
coefficient_ring=QQ)(result * SCR((k-1).sqrt()) / SCR(k.sqrt()))
return result

# Easy access to the asymptotic expansions generators from the command line:
Expand Down

0 comments on commit 3e30659

Please sign in to comment.