@@ -1859,109 +1859,6 @@ class Factorial(PostfixOperator, _MPMathFunction):
18591859 precedence = 610
18601860 mpmath_name = "factorial"
18611861
1862-
1863- class Gamma (_MPMathMultiFunction ):
1864- """
1865- <dl>
1866- <dt>'Gamma[$z$]'
1867- <dd>is the gamma function on the complex number $z$.
1868- <dt>'Gamma[$z$, $x$]'
1869- <dd>is the upper incomplete gamma function.
1870- <dt>'Gamma[$z$, $x0$, $x1$]'
1871- <dd>is equivalent to 'Gamma[$z$, $x0$] - Gamma[$z$, $x1$]'.
1872- </dl>
1873-
1874- 'Gamma[$z$]' is equivalent to '($z$ - 1)!':
1875- >> Simplify[Gamma[z] - (z - 1)!]
1876- = 0
1877-
1878- Exact arguments:
1879- >> Gamma[8]
1880- = 5040
1881- >> Gamma[1/2]
1882- = Sqrt[Pi]
1883- >> Gamma[1, x]
1884- = E ^ (-x)
1885- >> Gamma[0, x]
1886- = ExpIntegralE[1, x]
1887-
1888- Numeric arguments:
1889- >> Gamma[123.78]
1890- = 4.21078*^204
1891- >> Gamma[1. + I]
1892- = 0.498016 - 0.15495 I
1893-
1894- Both 'Gamma' and 'Factorial' functions are continuous:
1895- >> Plot[{Gamma[x], x!}, {x, 0, 4}]
1896- = -Graphics-
1897-
1898- ## Issue 203
1899- #> N[Gamma[24/10], 100]
1900- = 1.242169344504305404913070252268300492431517240992022966055507541481863694148882652446155342679460339
1901- #> N[N[Gamma[24/10],100]/N[Gamma[14/10],100],100]
1902- = 1.400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
1903- #> % // Precision
1904- = 100.
1905-
1906- #> Gamma[1.*^20]
1907- : Overflow occurred in computation.
1908- = Overflow[]
1909-
1910- ## Needs mpmath support for lowergamma
1911- #> Gamma[1., 2.]
1912- = Gamma[1., 2.]
1913- """
1914-
1915- mpmath_names = {
1916- 1 : "gamma" ,
1917- }
1918- sympy_names = {
1919- 1 : "gamma" ,
1920- 2 : "uppergamma" ,
1921- }
1922-
1923- rules = {
1924- "Gamma[z_, x0_, x1_]" : "Gamma[z, x0] - Gamma[z, x1]" ,
1925- "Gamma[1 + z_]" : "z!" ,
1926- "Derivative[1][Gamma]" : "(Gamma[#1]*PolyGamma[0, #1])&" ,
1927- "Derivative[1, 0][Gamma]" : "(Gamma[#1, #2]*Log[#2] + MeijerG[{{}, {1, 1}}, {{0, 0, #1}, {}}, #2])&" ,
1928- "Derivative[0, 1][Gamma]" : "(-(#2^(-1 + #1)/E^#2))&" ,
1929- }
1930-
1931- def get_sympy_names (self ):
1932- return ["gamma" , "uppergamma" , "lowergamma" ]
1933-
1934- def from_sympy (self , sympy_name , leaves ):
1935- if sympy_name == "lowergamma" :
1936- # lowergamma(z, x) -> Gamma[z, 0, x]
1937- z , x = leaves
1938- return Expression (self .get_name (), z , Integer0 , x )
1939- else :
1940- return Expression (self .get_name (), * leaves )
1941-
1942-
1943- class Pochhammer (SympyFunction ):
1944- """
1945- <dl>
1946- <dt>'Pochhammer[$a$, $n$]'
1947- <dd>is the Pochhammer symbol (a)_n.
1948- </dl>
1949-
1950- >> Pochhammer[4, 8]
1951- = 6652800
1952- """
1953-
1954- attributes = ("Listable" , "NumericFunction" , "Protected" )
1955-
1956- sympy_name = "RisingFactorial"
1957-
1958- rules = {
1959- "Pochhammer[a_, n_]" : "Gamma[a + n] / Gamma[a]" ,
1960- "Derivative[1,0][Pochhammer]" : "(Pochhammer[#1, #2]*(-PolyGamma[0, #1] + PolyGamma[0, #1 + #2]))&" ,
1961- "Derivative[0,1][Pochhammer]" : "(Pochhammer[#1, #2]*PolyGamma[0, #1 + #2])&" ,
1962- }
1963-
1964-
19651862class HarmonicNumber (_MPMathFunction ):
19661863 """
19671864 <dl>
0 commit comments