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

Commit

Permalink
Trac #19540: note on log(s).factorial()
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrenn committed Feb 15, 2016
1 parent c801853 commit 139f7c8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/sage/rings/asymptotic/asymptotic_ring.py
Expand Up @@ -2866,6 +2866,21 @@ def factorial(self):
+ 145/128/sqrt(pi)*(e^n)^(2*log(2))*n^(-7/2)
+ O((e^n)^(2*log(2))*n^(-9/2))
Note that this method substitutes the asymptotic expansion into
Stirling's formula. This substitution has to be possible which is
not always guaranteed::
sage: S.<s> = AsymptoticRing(growth_group='s^QQ * log(s)^QQ', coefficient_ring=QQ, default_prec=4)
sage: log(s).factorial()
Traceback (most recent call last):
...
TypeError: Cannot apply the substitution rules {s: log(s)} on
sqrt(2)*sqrt(pi)*e^(s*log(s))*(e^s)^(-1)*s^(1/2)
+ O(e^(s*log(s))*(e^s)^(-1)*s^(-1/2)) in
Asymptotic Ring <(e^(s*log(s)))^QQ * (e^s)^QQ * s^QQ * log(s)^QQ>
over Symbolic Constants Subring.
...
.. SEEALSO::
:meth:`~sage.rings.asymptotic.asymptotic_expansion_generators.AsymptoticExpansionGenerators.Stirling`
Expand Down

0 comments on commit 139f7c8

Please sign in to comment.