add numerical recipes library
This commit is contained in:
18
lib/nr/cpp/recipes/sphbes.cpp
Normal file
18
lib/nr/cpp/recipes/sphbes.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <cmath>
|
||||
#include "nr.h"
|
||||
using namespace std;
|
||||
|
||||
void NR::sphbes(const int n, const DP x, DP &sj, DP &sy, DP &sjp, DP &syp)
|
||||
{
|
||||
const DP RTPIO2=1.253314137315500251;
|
||||
DP factor,order,rj,rjp,ry,ryp;
|
||||
|
||||
if (n < 0 || x <= 0.0) nrerror("bad arguments in sphbes");
|
||||
order=n+0.5;
|
||||
bessjy(x,order,rj,ry,rjp,ryp);
|
||||
factor=RTPIO2/sqrt(x);
|
||||
sj=factor*rj;
|
||||
sy=factor*ry;
|
||||
sjp=factor*rjp-sj/(2.0*x);
|
||||
syp=factor*ryp-sy/(2.0*x);
|
||||
}
|
||||
Reference in New Issue
Block a user