Psi
Psi (digamma) function
Controller: CodeCogs
Contents
Dependents
Interface
C++
Excel
Psi
doublepsi( | double | x | ) |
MISSING IMAGE!
1/psi.gif cannot be found in /users/1/psi.gif. Please contact the submission author.
Accuracy:
Relative error (except absolute when |psi| < 1): <pre> domain # trials peak rms -30,0 40000 1.5e-15 2.2e-16 </pre>Error Message:
psi singularity x integer <=0 MAXNUMReferences:
- Cephes Math Library Release 2.8: June, 2000
- http://mathworld.wolfram.com/DigammaFunction.html
Example 1
#include <stdio.h> #include <codecogs/maths/special/gamma/psi.h> int main() { for(double x=-0.9; x<4; x+=0.2) { double y=Maths::Special::Gamma::psi(x); printf("\n psi(%.1lf)=%lf", x,y); } return 0; }
Output:psi(-0.9)=-9.312644 psi(-0.7)=-2.073953 psi(-0.5)=0.036490 psi(-0.3)=2.113310 psi(-0.1)=9.245073 psi(0.1)=-10.423755 psi(0.3)=-3.502524 psi(0.5)=-1.963510 psi(0.7)=-1.220024 psi(0.9)=-0.754927 psi(1.1)=-0.423755 psi(1.3)=-0.169191 psi(1.5)=0.036490 psi(1.7)=0.208548 psi(1.9)=0.356184 psi(2.1)=0.485336 psi(2.3)=0.600040 psi(2.5)=0.703157 psi(2.7)=0.796783 psi(2.9)=0.882500 psi(3.1)=0.961526 psi(3.3)=1.034822 psi(3.5)=1.103157 psi(3.7)=1.167154 psi(3.9)=1.227328
Parameters
x input
Authors
- Stephen L. Moshier. Copyright 1984, 1987, 2000
Documented and Corrected by Will Bateman (August 2005)
Source Code
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.