Torricelli's equation: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
en>Addbot
m Bot: Migrating 6 interwiki links, now provided by Wikidata on d:q2670060 (Report Errors)
en>JSquish
No edit summary
 
Line 1: Line 1:
In [[mathematics]], the '''Lanczos approximation''' is a method for computing the [[Gamma function]] numerically, published by [[Cornelius Lanczos]] in 1964. It is a practical alternative to the more popular [[Stirling's approximation]] for calculating the Gamma function with fixed precision.
== rain Xiangshan ==


==Introduction==
I never thought anything in return,[http://www.alleganycountyfair.org/_vti_cnf/rakuten_oakley_72.htm オークリーサングラス取扱店].<br><br>......<br><br>rain Xiangshan,[http://www.alleganycountyfair.org/_vti_cnf/rakuten_oakley_27.htm オークリー サングラス ファストジャケット], Luo Feng manor original area.<br><br>Luo Feng quietly sitting in front of a desk,[http://www.alleganycountyfair.org/_vti_cnf/rakuten_oakley_4.htm オークリー サングラス 価格].<br><br>'trouble?' shoulder Baba Ta Hey laughed, 'now feel things are in trouble?'<br><br>'What trouble,[http://www.alleganycountyfair.org/_vti_cnf/rakuten_oakley_43.htm スポーツサングラス オークリー], big brother for so many years never once asked me to help busy with brother's character,[http://www.alleganycountyfair.org/_vti_cnf/rakuten_oakley_53.htm ロードバイク サングラス オークリー], this can please help me ...... then how I had shot!' Luo Feng laughed, 'What's more,[http://www.alleganycountyfair.org/_vti_cnf/rakuten_oakley_39.htm オークリー サングラス オーダー], this thing for me, really is not much more difficult, but I need a choice. '<br><br>'choice?' Baba Ta Wei suspect.<br><br>'ah.'<br><br>'I now have two ways to solve this problem.' Luo Feng said,[http://www.alleganycountyfair.org/_vti_cnf/rakuten_oakley_23.htm オークリー サングラス 激安], 'The first is to ask my teacher Yan Wang really come out! derivative as my teacher really dry witch king ...... even to the point of the country have to face the Lord that silver snow Hou certainly not neglect, as long as the problem is not just the teacher faces,[http://www.alleganycountyfair.org/_vti_cnf/rakuten_oakley_25.htm サングラス オークリー 人気], things will be solved
The Lanczos approximation consists of the formula
相关的主题文章:
<ul>
 
  <li>[http://www.scene-source.info/index.php?forums/dvdrip.4/&posted=1 http://www.scene-source.info/index.php?forums/dvdrip.4/&posted=1]</li>
 
  <li>[http://www.jdjysc.com/plus/feedback.php?aid=38 http://www.jdjysc.com/plus/feedback.php?aid=38]</li>
 
  <li>[http://bbs.jinrongren.net/home.php?mod=space&uid=10953 http://bbs.jinrongren.net/home.php?mod=space&uid=10953]</li>
 
</ul>


:<math>\Gamma(z+1) = \sqrt{2\pi} {\left( z + g + \frac{1}{2} \right)}^{z + \frac{1}{2} } e^{-\left(z+g+\frac{1}{2}\right)} A_g(z)</math>
== just lost a spare nothing. ==


for the Gamma function, with
Bale is ants.<br><br>'I have to be really clear face and kill the animal sector, you have time to kill and so smoothly.'<br><br>Bang ~<br><br>stars fly directly into the square tower waves began approaching toward the dark waters of the land,[http://www.alleganycountyfair.org/_vti_cnf/rakuten_oakley_11.htm オークリー サングラス 手入れ], the waters saw at the end of the endless darkness that is very dark soul development in the sector before the birth of the beast did,[http://www.alleganycountyfair.org/_vti_cnf/rakuten_oakley_65.htm オークリー サングラス ジュリエット], once caught in the dark place eternal depths they lost, it is difficult to escape again.<br><br>generally up around the edges, or the master of the universe has a spare, dare depth, even dead, just lost a spare nothing.<br><br>'Mo Luosa.' stars tower stopped at the edge of a dark place,[http://www.alleganycountyfair.org/_vti_cnf/rakuten_oakley_43.htm オークリー サングラス ジャパンフィット], far away watching the endless darkness.<br><br>Feng Luo small universe,[http://www.alleganycountyfair.org/_vti_cnf/rakuten_oakley_1.htm サングラス オークリー].<br><br>'Mo Luosa,[http://www.alleganycountyfair.org/_vti_cnf/rakuten_oakley_11.htm オークリー サングラス ゴルフ], the lair of the beast sector chart to carry.' divine incarnation Road,[http://www.alleganycountyfair.org/_vti_cnf/rakuten_oakley_11.htm オークリー サングラス 手入れ], 'as well as the ten million animals every industry sector position beast, are marked out.'<br><br>Mo Luosa respectfully replied: 'Yes,[http://www.alleganycountyfair.org/_vti_cnf/rakuten_oakley_48.htm オークリー サングラス 偏光レンズ], master,[http://www.alleganycountyfair.org/_vti_cnf/rakuten_oakley_66.htm オークリー サングラス], but the owner, although I can feel distant.
 
相关的主题文章:
:<math>A_g(z) = \frac{1}{2}p_0(g) + p_1(g) \frac{z}{z+1} + p_2(g) \frac{z(z-1)}{(z+1)(z+2)} + \cdots.</math>
<ul>
 
    
Here ''g'' is a [[Constant (mathematics)|constant]] that may be chosen arbitrarily subject to the restriction that Re(''z''+''g''+1/2) > 0. The coefficients ''p'', which depend on ''g'', are slightly more difficult to calculate (see below). Although the formula as stated here is only valid for arguments in the right complex [[half-plane]], it can be extended to the entire [[complex plane]] by the [[reflection formula]],
  <li>[http://wiki.fantasticgroup.co/index.php/User:Pnelqkbihy#these_four http://wiki.fantasticgroup.co/index.php/User:Pnelqkbihy#these_four]</li>
 
    
:<math>\Gamma(1-z) \; \Gamma(z) = {\pi \over \sin \pi z}.</math>
  <li>[http://www.tradingstandards.gov.uk/cgi-bin/nelincs/search.cgi http://www.tradingstandards.gov.uk/cgi-bin/nelincs/search.cgi]</li>
 
 
The series ''A'' is [[convergent series|convergent]], and may be truncated to obtain an approximation with the desired precision. By choosing an appropriate ''g'' (typically a small integer), only some 5-10 terms of the series are needed to compute the Gamma function with typical [[single precision|single]] or [[double precision|double]] [[floating point|floating-point]] precision. If a fixed ''g'' is chosen, the coefficients can be calculated in advance and the sum is recast into the following form:
  <li>[http://www7a.biglobe.ne.jp/~kaztea/aska/aska.cgi http://www7a.biglobe.ne.jp/~kaztea/aska/aska.cgi]</li>
 
 
:<math>A_g(z) = c_0 + \sum_{k=1}^{N} \frac{c_k}{z+k}</math>
</ul>
 
Thus computing the Gamma function becomes a matter of evaluating only a small number of [[elementary function]]s and multiplying by stored constants. The Lanczos approximation was popularized by ''[[Numerical Recipes]]'', according to which computing the Gamma function becomes "not much more difficult than other built-in functions that we take for granted, such as sin ''x'' or ''e''<sup>''x''</sup>". The method is also implemented in the [[GNU Scientific Library]].
 
==Coefficients==
The coefficients are given by
:<math>p_k(g) = \sum_{a=0}^k C(2k+1, 2a+1) \frac{\sqrt{2}}{\pi} \left(a - \begin{matrix} \frac{1}{2} \end{matrix} \right)!
{\left(a + g + \begin{matrix} \frac{1}{2} \end{matrix} \right)}^{- \left( a + \frac{1}{2} \right) } e^{a + g + \frac{1}{2} }</math>
 
with <math>C(i,j)</math> denoting the (''i'', ''j'')th element of the [[Chebyshev polynomial]] coefficient [[matrix (mathematics)|matrix]] which can be calculated [[recursion|recursively]] from the identities
 
:{|
|<math>C(1,1) = 1\,</math> ||
|-
|<math>C(2,2) = 1\,</math> ||
|-
|<math>C(i,1) = -C(i-2, 1)\,</math> || <math>i = 3, 4, \dots\,</math>
|-
|<math>C(i,j) = 2 C(i-1, j-1)\,</math> || <math>i = j = 3, 4, \dots\,</math>
|-
|<math>C(i,j) = 2 C(i-1, j-1) - C(i-2, j)\,</math> ||  <math>i > j = 2, 3, \dots .</math>
|}
 
Paul Godfrey describes how to obtain the coefficients and also the value of the truncated series ''A'' as a [[matrix multiplication|matrix product]].
 
==Derivation==
Lanczos derived the formula from [[Leonhard Euler]]'s [[integral]]
:<math>\Gamma(z+1) = \int_0^\infty  t^{z}\,e^{-t}\,dt,</math>
 
performing a sequence of basic manipulations to obtain
 
:<math>\Gamma(z+1) = (z+g+1)^{z+1} e^{-(z+g+1)} \int_0^e [v(1-\log v)]^{z-\frac{1}{2}} v^g\,dv,</math>
 
and deriving a series for the integral.
 
==Simple implementation==
The following implementation in the [[Python (programming language)|Python programming language]] works for complex arguments and typically gives 15 correct decimal places:
 
<source lang="python">
from cmath import *
 
# Coefficients used by the GNU Scientific Library
g = 7
p = [0.99999999999980993, 676.5203681218851, -1259.1392167224028,
    771.32342877765313, -176.61502916214059, 12.507343278686905,
    -0.13857109526572012, 9.9843695780195716e-6, 1.5056327351493116e-7]
 
def gamma(z):
    z = complex(z)
    # Reflection formula
    if z.real < 0.5:
        return pi / (sin(pi*z) * gamma(1-z))
    else:
        z -= 1
        x = p[0]
        for i in range(1, g+2):
            x += p[i]/(z+i)
        t = z + g + 0.5
        return sqrt(2*pi) * t**(z+0.5) * exp(-t) * x
</source>
 
==See also==
* [[Stirling's approximation]]
* [[Spouge's approximation]]
 
==References==
* {{cite web
|first1=Paul
|last1=Godfrey
|year=2001
|url=http://www.numericana.com/answer/info/godfrey.htm
|title=Lanczos Implementation of the Gamma Function
}}
* {{cite journal
   | last = Lanczos
  | first = Cornelius
  | authorlink = Cornelius Lanczos
  | title = A Precision Approximation of the Gamma Function
  | jstor = 2949767
  | journal = [http://www.siam.org/journals/sinum.php SIAM Journal on Numerical Analysis series B]
   | volume = 1
  | pages = 86&ndash;96
  | year = 1964
  | publisher = Society for Industrial and Applied Mathematics
  | id = ISSN: 0887459X
  | doi= 10.2307/2949767
  }}
* {{Citation | last1=Press | first1=W. H. | last2=Teukolsky | first2=S. A. | last3=Vetterling | first3=W. T. | last4=Flannery | first4=B. P. | year=2007 | title=Numerical Recipes: The Art of Scientific Computing | edition=3rd | publisher=Cambridge University Press |  publication-place=New York | isbn=978-0-521-88068-8 | chapter=Section 6.1. Gamma Function | chapter-url=http://apps.nrbook.com/empanel/index.html?pg=256}}
* {{cite thesis
|last=Pugh
|first=Glendon
|year=2004
|degree=PhD
|url=http://web.mala.bc.ca/pughg/phdThesis/phdThesis.pdf
|title=An analysis of the Lanczos Gamma approximation
}}
* {{cite web
|last1=Toth
|first1=Viktor
|year=2005
|url=http://www.rskey.org/lanczos.htm
|title=Programmable Calculators: The Lanczos Approximation
}}
* {{MathWorld|urlname=LanczosApproximation|title=Lanczos Approximation}}
 
[[Category:Gamma and related functions]]
[[Category:Numerical analysis]]
[[Category:Articles with example Python code]]

Latest revision as of 09:57, 24 December 2014

rain Xiangshan

I never thought anything in return,オークリーサングラス取扱店.

......

rain Xiangshan,オークリー サングラス ファストジャケット, Luo Feng manor original area.

Luo Feng quietly sitting in front of a desk,オークリー サングラス 価格.

'trouble?' shoulder Baba Ta Hey laughed, 'now feel things are in trouble?'

'What trouble,スポーツサングラス オークリー, big brother for so many years never once asked me to help busy with brother's character,ロードバイク サングラス オークリー, this can please help me ...... then how I had shot!' Luo Feng laughed, 'What's more,オークリー サングラス オーダー, this thing for me, really is not much more difficult, but I need a choice. '

'choice?' Baba Ta Wei suspect.

'ah.'

'I now have two ways to solve this problem.' Luo Feng said,オークリー サングラス 激安, 'The first is to ask my teacher Yan Wang really come out! derivative as my teacher really dry witch king ...... even to the point of the country have to face the Lord that silver snow Hou certainly not neglect, as long as the problem is not just the teacher faces,サングラス オークリー 人気, things will be solved 相关的主题文章:

just lost a spare nothing.

Bale is ants.

'I have to be really clear face and kill the animal sector, you have time to kill and so smoothly.'

Bang ~

stars fly directly into the square tower waves began approaching toward the dark waters of the land,オークリー サングラス 手入れ, the waters saw at the end of the endless darkness that is very dark soul development in the sector before the birth of the beast did,オークリー サングラス ジュリエット, once caught in the dark place eternal depths they lost, it is difficult to escape again.

generally up around the edges, or the master of the universe has a spare, dare depth, even dead, just lost a spare nothing.

'Mo Luosa.' stars tower stopped at the edge of a dark place,オークリー サングラス ジャパンフィット, far away watching the endless darkness.

Feng Luo small universe,サングラス オークリー.

'Mo Luosa,オークリー サングラス ゴルフ, the lair of the beast sector chart to carry.' divine incarnation Road,オークリー サングラス 手入れ, 'as well as the ten million animals every industry sector position beast, are marked out.'

Mo Luosa respectfully replied: 'Yes,オークリー サングラス 偏光レンズ, master,オークリー サングラス, but the owner, although I can feel distant. 相关的主题文章: