Code covered by the BSD License  

Highlights from
slatec

from slatec by Ben Barrowes
The slatec library converted into matlab functions.

[x,ampl,theta]=d9b0mp(x,ampl,theta);
function [x,ampl,theta]=d9b0mp(x,ampl,theta);
persistent bm02cs bm0cs bt02cs bth0cs eta first firstCall nbm0 nbm02 nbt02 nbth0 pi4 xmax z ; if isempty(firstCall),firstCall=1;end; 

if isempty(eta), eta=0; end;
if isempty(nbm0), nbm0=0; end;
if isempty(nbm02), nbm02=0; end;
if isempty(nbt02), nbt02=0; end;
if isempty(nbth0), nbth0=0; end;
%***BEGIN PROLOGUE  D9B0MP
%***SUBSIDIARY
%***PURPOSE  Evaluate the modulus and phase for the J0 and Y0 Bessel
%            functions.
%***LIBRARY   SLATEC (FNLIB)
%***CATEGORY  C10A1
%***TYPE      doubleprecision (D9B0MP-D)
%***KEYWORDS  BESSEL FUNCTION, FNLIB, MODULUS, PHASE, SPECIAL FUNCTIONS
%***AUTHOR  Fullerton, W., (LANL)
%***DESCRIPTION
%
% Evaluate the modulus and phase for the Bessel J0 and Y0 functions.
%
% Series for BM0        on the interval  1.56250E-02 to  6.25000E-02
%                                        with weighted error   4.40E-32
%                                         log weighted error  31.36
%                               significant figures required  30.02
%                                    decimal places required  32.14
%
% Series for BTH0       on the interval  0.          to  1.56250E-02
%                                        with weighted error   2.66E-32
%                                         log weighted error  31.57
%                               significant figures required  30.67
%                                    decimal places required  32.40
%
% Series for BM02       on the interval  0.          to  1.56250E-02
%                                        with weighted error   4.72E-32
%                                         log weighted error  31.33
%                               significant figures required  30.00
%                                    decimal places required  32.13
%
% Series for BT02       on the interval  1.56250E-02 to  6.25000E-02
%                                        with weighted error   2.99E-32
%                                         log weighted error  31.52
%                               significant figures required  30.61
%                                    decimal places required  32.32
%
%***REFERENCES  (NONE)
%***ROUTINES CALLED  D1MACH, DCSEVL, INITDS, XERMSG
%***REVISION HISTORY  (YYMMDD)
%   770701  DATE WRITTEN
%   890531  Changed all specific intrinsics to generic.  (WRB)
%   890531  REVISION DATE from Version 3.2
%   891214  Prologue converted to Version 4.0 format.  (BAB)
%   900315  CALLs to XERROR changed to CALLs to XERMSG.  (THJ)
%   900720  Routine changed from user-callable to subsidiary.  (WRB)
%   920618  Removed space from variable names.  (RWC, WRB)
%***end PROLOGUE  D9B0MP
if isempty(bm0cs), bm0cs=zeros(1,37); end;
if isempty(bt02cs), bt02cs=zeros(1,39); end;
if isempty(bm02cs), bm02cs=zeros(1,40); end;
if isempty(bth0cs), bth0cs=zeros(1,44); end;
if isempty(xmax), xmax=0; end;
if isempty(pi4), pi4=0; end;
if isempty(z), z=0; end;
if isempty(first), first=false; end;
if firstCall,   bm0cs(1)=[+.9211656246827742712573767730182d-1];  end;
if firstCall,   bm0cs(2)=[-.1050590997271905102480716371755d-2];  end;
if firstCall,   bm0cs(3)=[+.1470159840768759754056392850952d-4];  end;
if firstCall,   bm0cs(4)=[-.5058557606038554223347929327702d-6];  end;
if firstCall,   bm0cs(5)=[+.2787254538632444176630356137881d-7];  end;
if firstCall,   bm0cs(6)=[-.2062363611780914802618841018973d-8];  end;
if firstCall,   bm0cs(7)=[+.1870214313138879675138172596261d-9];  end;
if firstCall,   bm0cs(8)=[-.1969330971135636200241730777825d-10];  end;
if firstCall,   bm0cs(9)=[+.2325973793999275444012508818052d-11];  end;
if firstCall,   bm0cs(10)=[-.3009520344938250272851224734482d-12];  end;
if firstCall,   bm0cs(11)=[+.4194521333850669181471206768646d-13];  end;
if firstCall,   bm0cs(12)=[-.6219449312188445825973267429564d-14];  end;
if firstCall,   bm0cs(13)=[+.9718260411336068469601765885269d-15];  end;
if firstCall,   bm0cs(14)=[-.1588478585701075207366635966937d-15];  end;
if firstCall,   bm0cs(15)=[+.2700072193671308890086217324458d-16];  end;
if firstCall,   bm0cs(16)=[-.4750092365234008992477504786773d-17];  end;
if firstCall,   bm0cs(17)=[+.8615128162604370873191703746560d-18];  end;
if firstCall,   bm0cs(18)=[-.1605608686956144815745602703359d-18];  end;
if firstCall,   bm0cs(19)=[+.3066513987314482975188539801599d-19];  end;
if firstCall,   bm0cs(20)=[-.5987764223193956430696505617066d-20];  end;
if firstCall,   bm0cs(21)=[+.1192971253748248306489069841066d-20];  end;
if firstCall,   bm0cs(22)=[-.2420969142044805489484682581333d-21];  end;
if firstCall,   bm0cs(23)=[+.4996751760510616453371002879999d-22];  end;
if firstCall,   bm0cs(24)=[-.1047493639351158510095040511999d-22];  end;
if firstCall,   bm0cs(25)=[+.2227786843797468101048183466666d-23];  end;
if firstCall,   bm0cs(26)=[-.4801813239398162862370542933333d-24];  end;
if firstCall,   bm0cs(27)=[+.1047962723470959956476996266666d-24];  end;
if firstCall,   bm0cs(28)=[-.2313858165678615325101260800000d-25];  end;
if firstCall,   bm0cs(29)=[+.5164823088462674211635199999999d-26];  end;
if firstCall,   bm0cs(30)=[-.1164691191850065389525401599999d-26];  end;
if firstCall,   bm0cs(31)=[+.2651788486043319282958336000000d-27];  end;
if firstCall,   bm0cs(32)=[-.6092559503825728497691306666666d-28];  end;
if firstCall,   bm0cs(33)=[+.1411804686144259308038826666666d-28];  end;
if firstCall,   bm0cs(34)=[-.3298094961231737245750613333333d-29];  end;
if firstCall,   bm0cs(35)=[+.7763931143074065031714133333333d-30];  end;
if firstCall,   bm0cs(36)=[-.1841031343661458478421333333333d-30];  end;
if firstCall,   bm0cs(37)=[+.4395880138594310737100799999999d-31];  end;
if firstCall,   bth0cs(1)=[-.24901780862128936717709793789967d+0];  end;
if firstCall,   bth0cs(2)=[+.48550299609623749241048615535485d-3];  end;
if firstCall,   bth0cs(3)=[-.54511837345017204950656273563505d-5];  end;
if firstCall,   bth0cs(4)=[+.13558673059405964054377445929903d-6];  end;
if firstCall,   bth0cs(5)=[-.55691398902227626227583218414920d-8];  end;
if firstCall,   bth0cs(6)=[+.32609031824994335304004205719468d-9];  end;
if firstCall,   bth0cs(7)=[-.24918807862461341125237903877993d-10];  end;
if firstCall,   bth0cs(8)=[+.23449377420882520554352413564891d-11];  end;
if firstCall,   bth0cs(9)=[-.26096534444310387762177574766136d-12];  end;
if firstCall,   bth0cs(10)=[+.33353140420097395105869955014923d-13];  end;
if firstCall,   bth0cs(11)=[-.47890000440572684646750770557409d-14];  end;
if firstCall,   bth0cs(12)=[+.75956178436192215972642568545248d-15];  end;
if firstCall,   bth0cs(13)=[-.13131556016891440382773397487633d-15];  end;
if firstCall,   bth0cs(14)=[+.24483618345240857495426820738355d-16];  end;
if firstCall,   bth0cs(15)=[-.48805729810618777683256761918331d-17];  end;
if firstCall,   bth0cs(16)=[+.10327285029786316149223756361204d-17];  end;
if firstCall,   bth0cs(17)=[-.23057633815057217157004744527025d-18];  end;
if firstCall,   bth0cs(18)=[+.54044443001892693993017108483765d-19];  end;
if firstCall,   bth0cs(19)=[-.13240695194366572724155032882385d-19];  end;
if firstCall,   bth0cs(20)=[+.33780795621371970203424792124722d-20];  end;
if firstCall,   bth0cs(21)=[-.89457629157111779003026926292299d-21];  end;
if firstCall,   bth0cs(22)=[+.24519906889219317090899908651405d-21];  end;
if firstCall,   bth0cs(23)=[-.69388422876866318680139933157657d-22];  end;
if firstCall,   bth0cs(24)=[+.20228278714890138392946303337791d-22];  end;
if firstCall,   bth0cs(25)=[-.60628500002335483105794195371764d-23];  end;
if firstCall,   bth0cs(26)=[+.18649748964037635381823788396270d-23];  end;
if firstCall,   bth0cs(27)=[-.58783732384849894560245036530867d-24];  end;
if firstCall,   bth0cs(28)=[+.18958591447999563485531179503513d-24];  end;
if firstCall,   bth0cs(29)=[-.62481979372258858959291620728565d-25];  end;
if firstCall,   bth0cs(30)=[+.21017901684551024686638633529074d-25];  end;
if firstCall,   bth0cs(31)=[-.72084300935209253690813933992446d-26];  end;
if firstCall,   bth0cs(32)=[+.25181363892474240867156405976746d-26];  end;
if firstCall,   bth0cs(33)=[-.89518042258785778806143945953643d-27];  end;
if firstCall,   bth0cs(34)=[+.32357237479762298533256235868587d-27];  end;
if firstCall,   bth0cs(35)=[-.11883010519855353657047144113796d-27];  end;
if firstCall,   bth0cs(36)=[+.44306286907358104820579231941731d-28];  end;
if firstCall,   bth0cs(37)=[-.16761009648834829495792010135681d-28];  end;
if firstCall,   bth0cs(38)=[+.64292946921207466972532393966088d-29];  end;
if firstCall,   bth0cs(39)=[-.24992261166978652421207213682763d-29];  end;
if firstCall,   bth0cs(40)=[+.98399794299521955672828260355318d-30];  end;
if firstCall,   bth0cs(41)=[-.39220375242408016397989131626158d-30];  end;
if firstCall,   bth0cs(42)=[+.15818107030056522138590618845692d-30];  end;
if firstCall,   bth0cs(43)=[-.64525506144890715944344098365426d-31];  end;
if firstCall,   bth0cs(44)=[+.26611111369199356137177018346367d-31];  end;
if firstCall,   bm02cs(1)=[+.9500415145228381369330861335560d-1];  end;
if firstCall,   bm02cs(2)=[-.3801864682365670991748081566851d-3];  end;
if firstCall,   bm02cs(3)=[+.2258339301031481192951829927224d-5];  end;
if firstCall,   bm02cs(4)=[-.3895725802372228764730621412605d-7];  end;
if firstCall,   bm02cs(5)=[+.1246886416512081697930990529725d-8];  end;
if firstCall,   bm02cs(6)=[-.6065949022102503779803835058387d-10];  end;
if firstCall,   bm02cs(7)=[+.4008461651421746991015275971045d-11];  end;
if firstCall,   bm02cs(8)=[-.3350998183398094218467298794574d-12];  end;
if firstCall,   bm02cs(9)=[+.3377119716517417367063264341996d-13];  end;
if firstCall,   bm02cs(10)=[-.3964585901635012700569356295823d-14];  end;
if firstCall,   bm02cs(11)=[+.5286111503883857217387939744735d-15];  end;
if firstCall,   bm02cs(12)=[-.7852519083450852313654640243493d-16];  end;
if firstCall,   bm02cs(13)=[+.1280300573386682201011634073449d-16];  end;
if firstCall,   bm02cs(14)=[-.2263996296391429776287099244884d-17];  end;
if firstCall,   bm02cs(15)=[+.4300496929656790388646410290477d-18];  end;
if firstCall,   bm02cs(16)=[-.8705749805132587079747535451455d-19];  end;
if firstCall,   bm02cs(17)=[+.1865862713962095141181442772050d-19];  end;
if firstCall,   bm02cs(18)=[-.4210482486093065457345086972301d-20];  end;
if firstCall,   bm02cs(19)=[+.9956676964228400991581627417842d-21];  end;
if firstCall,   bm02cs(20)=[-.2457357442805313359605921478547d-21];  end;
if firstCall,   bm02cs(21)=[+.6307692160762031568087353707059d-22];  end;
if firstCall,   bm02cs(22)=[-.1678773691440740142693331172388d-22];  end;
if firstCall,   bm02cs(23)=[+.4620259064673904433770878136087d-23];  end;
if firstCall,   bm02cs(24)=[-.1311782266860308732237693402496d-23];  end;
if firstCall,   bm02cs(25)=[+.3834087564116302827747922440276d-24];  end;
if firstCall,   bm02cs(26)=[-.1151459324077741271072613293576d-24];  end;
if firstCall,   bm02cs(27)=[+.3547210007523338523076971345213d-25];  end;
if firstCall,   bm02cs(28)=[-.1119218385815004646264355942176d-25];  end;
if firstCall,   bm02cs(29)=[+.3611879427629837831698404994257d-26];  end;
if firstCall,   bm02cs(30)=[-.1190687765913333150092641762463d-26];  end;
if firstCall,   bm02cs(31)=[+.4005094059403968131802476449536d-27];  end;
if firstCall,   bm02cs(32)=[-.1373169422452212390595193916017d-27];  end;
if firstCall,   bm02cs(33)=[+.4794199088742531585996491526437d-28];  end;
if firstCall,   bm02cs(34)=[-.1702965627624109584006994476452d-28];  end;
if firstCall,   bm02cs(35)=[+.6149512428936330071503575161324d-29];  end;
if firstCall,   bm02cs(36)=[-.2255766896581828349944300237242d-29];  end;
if firstCall,   bm02cs(37)=[+.8399707509294299486061658353200d-30];  end;
if firstCall,   bm02cs(38)=[-.3172997595562602355567423936152d-30];  end;
if firstCall,   bm02cs(39)=[+.1215205298881298554583333026514d-30];  end;
if firstCall,   bm02cs(40)=[-.4715852749754438693013210568045d-31];  end;
if firstCall,   bt02cs(1)=[-.24548295213424597462050467249324d+0];  end;
if firstCall,   bt02cs(2)=[+.12544121039084615780785331778299d-2];  end;
if firstCall,   bt02cs(3)=[-.31253950414871522854973446709571d-4];  end;
if firstCall,   bt02cs(4)=[+.14709778249940831164453426969314d-5];  end;
if firstCall,   bt02cs(5)=[-.99543488937950033643468850351158d-7];  end;
if firstCall,   bt02cs(6)=[+.85493166733203041247578711397751d-8];  end;
if firstCall,   bt02cs(7)=[-.86989759526554334557985512179192d-9];  end;
if firstCall,   bt02cs(8)=[+.10052099533559791084540101082153d-9];  end;
if firstCall,   bt02cs(9)=[-.12828230601708892903483623685544d-10];  end;
if firstCall,   bt02cs(10)=[+.17731700781805131705655750451023d-11];  end;
if firstCall,   bt02cs(11)=[-.26174574569485577488636284180925d-12];  end;
if firstCall,   bt02cs(12)=[+.40828351389972059621966481221103d-13];  end;
if firstCall,   bt02cs(13)=[-.66751668239742720054606749554261d-14];  end;
if firstCall,   bt02cs(14)=[+.11365761393071629448392469549951d-14];  end;
if firstCall,   bt02cs(15)=[-.20051189620647160250559266412117d-15];  end;
if firstCall,   bt02cs(16)=[+.36497978794766269635720591464106d-16];  end;
if firstCall,   bt02cs(17)=[-.68309637564582303169355843788800d-17];  end;
if firstCall,   bt02cs(18)=[+.13107583145670756620057104267946d-17];  end;
if firstCall,   bt02cs(19)=[-.25723363101850607778757130649599d-18];  end;
if firstCall,   bt02cs(20)=[+.51521657441863959925267780949333d-19];  end;
if firstCall,   bt02cs(21)=[-.10513017563758802637940741461333d-19];  end;
if firstCall,   bt02cs(22)=[+.21820381991194813847301084501333d-20];  end;
if firstCall,   bt02cs(23)=[-.46004701210362160577225905493333d-21];  end;
if firstCall,   bt02cs(24)=[+.98407006925466818520953651199999d-22];  end;
if firstCall,   bt02cs(25)=[-.21334038035728375844735986346666d-22];  end;
if firstCall,   bt02cs(26)=[+.46831036423973365296066286933333d-23];  end;
if firstCall,   bt02cs(27)=[-.10400213691985747236513382399999d-23];  end;
if firstCall,   bt02cs(28)=[+.23349105677301510051777740800000d-24];  end;
if firstCall,   bt02cs(29)=[-.52956825323318615788049749333333d-25];  end;
if firstCall,   bt02cs(30)=[+.12126341952959756829196287999999d-25];  end;
if firstCall,   bt02cs(31)=[-.28018897082289428760275626666666d-26];  end;
if firstCall,   bt02cs(32)=[+.65292678987012873342593706666666d-27];  end;
if firstCall,   bt02cs(33)=[-.15337980061873346427835733333333d-27];  end;
if firstCall,   bt02cs(34)=[+.36305884306364536682359466666666d-28];  end;
if firstCall,   bt02cs(35)=[-.86560755713629122479172266666666d-29];  end;
if firstCall,   bt02cs(36)=[+.20779909972536284571238399999999d-29];  end;
if firstCall,   bt02cs(37)=[-.50211170221417221674325333333333d-30];  end;
if firstCall,   bt02cs(38)=[+.12208360279441714184191999999999d-30];  end;
if firstCall,   bt02cs(39)=[-.29860056267039913454250666666666d-31];  end;
if firstCall,   pi4=[0.785398163397448309615660845819876d0];  end;
if firstCall,   first=[true];  end;
firstCall=0;
%***FIRST EXECUTABLE STATEMENT  D9B0MP
if( first )
eta = 0.1.*real(d1mach(3));
[nbm0 ,bm0cs,dumvar3,eta]=initds(bm0cs,37,eta);
[nbt02 ,bt02cs,dumvar3,eta]=initds(bt02cs,39,eta);
[nbm02 ,bm02cs,dumvar3,eta]=initds(bm02cs,40,eta);
[nbth0 ,bth0cs,dumvar3,eta]=initds(bth0cs,44,eta);
%
xmax = 1.0d0./d1mach(4);
end;
first = false;
%
if( x<4.0D0 )
xermsg('SLATEC','D9B0MP','X MUST BE GE 4',1,2);
end;
%
if( x>8.0d0 )
%
if( x>xmax )
xermsg('SLATEC','D9B0MP','NO PRECISION BECAUSE X IS BIG',2,2);
end;
%
z = 128.0d0./(x.*x) - 1.0d0;
ampl =(.75d0+dcsevl(z,bm02cs,nbm02))./sqrt(x);
theta = x - pi4 + dcsevl(z,bth0cs,nbth0)./x;
else;
z =(128.0d0./(x.*x)-5.0d0)./3.0d0;
ampl =(.75d0+dcsevl(z,bm0cs,nbm0))./sqrt(x);
theta = x - pi4 + dcsevl(z,bt02cs,nbt02)./x;
return;
end;
%
end
%DECK D9B1MP

Contact us