Re: approach used in special function iti0k0

Robert Kern <[email protected]> Sun, 5 Jun 2022 10:35:41 -0400
Newsgroups gmane.comp.python.scientific.user
Message-ID <CAF6FJiu=fz2b_-rPSpEcN+vaT7oWu9Cvit2-YkvMbAAqi2=E2A@mail.gmail.com>
--===============3190041169610971541==
Content-Type: multipart/alternative; boundary="000000000000a3131405e0b446e4"

--000000000000a3131405e0b446e4
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sun, Jun 5, 2022 at 10:08 AM Mark Bakker <[email protected]> wrote:

> I am searching for the approach/algorithm used to compute the special fun=
ction iti0k0. The docs only state that the integrals \int_0^x I_0(t) dt and=
 \int_0^x K_0(t) dt are computed, but I couldn't find a link/reference to t=
he algorithm/approach used to compute these.
>
> Even iti0k0?? doesn't help.
>
>
> Anybody know?
>
>
It's implemented in FORTRAN. scipy.special ufunc wrappers are generated "in
bulk" from a JSON configuration file. Searching the Github repo for iti0k0
shows you the entry for iti0k0:

  https://github.com/scipy/scipy/search?q=3Diti0k0

https://github.com/scipy/scipy/blob/fdc31f3d2bfa90a2c214a398668f0e153632d2b=
b/scipy/special/functions.json#L788

So looking for the it1i0k0_wrap C function that's mentioned will show you
which FORTRAN subroutine that it's calling:


https://github.com/scipy/scipy/blob/fdc31f3d2bfa90a2c214a398668f0e153632d2b=
b/scipy/special/specfun_wrappers.c#L374

So now you can find the FORTRAN subroutine named ITIKA that actually
implements the algorithm:


https://github.com/scipy/scipy/blob/fdc31f3d2bfa90a2c214a398668f0e153632d2b=
b/scipy/special/specfun/specfun.f#L3735-L3804

At the top of the file, you can see that all of these functions come from
the book *Computation of Special Functions* which you can try to find a
copy of to get more information about it.

--=20
Robert Kern

--000000000000a3131405e0b446e4
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Sun, Jun 5, 2022 at 10:08 AM Mark Bakk=
er &lt;<a href=3D"mailto:[email protected]">[email protected]</a>&gt; wrote=
:<br></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddi=
ng-left:1ex"><div dir=3D"ltr"><pre style=3D"box-sizing:unset;border:none;ma=
rgin-top:0px;margin-bottom:0px;padding:0px;overflow:auto;word-break:break-a=
ll;white-space:pre-wrap">I am searching for the approach/algorithm used to =
compute the special function <span style=3D"font-family:Arial,Helvetica,san=
s-serif">iti0k0. The docs only state that the integrals </span><span style=
=3D"font-family:Arial,Helvetica,sans-serif">\int_0^x I_0(t) dt and </span><=
span style=3D"font-family:Arial,Helvetica,sans-serif">\int_0^x K_0(t) dt ar=
e computed, but I couldn&#39;t find a link/reference to the algorithm/appro=
ach used to compute these.=C2=A0</span></pre><pre style=3D"box-sizing:unset=
;border:none;margin-top:0px;margin-bottom:0px;padding:0px;overflow:auto;wor=
d-break:break-all;white-space:pre-wrap"><span style=3D"font-family:Arial,He=
lvetica,sans-serif">Even </span><span style=3D"font-family:Arial,Helvetica,=
sans-serif">iti0k0?? doesn&#39;t help.</span></pre><pre style=3D"box-sizing=
:unset;border:none;margin-top:0px;margin-bottom:0px;padding:0px;overflow:au=
to;word-break:break-all;white-space:pre-wrap"><span style=3D"font-family:Ar=
ial,Helvetica,sans-serif"><br></span></pre><pre style=3D"box-sizing:unset;b=
order:none;margin-top:0px;margin-bottom:0px;padding:0px;overflow:auto;word-=
break:break-all;white-space:pre-wrap"><span style=3D"font-family:Arial,Helv=
etica,sans-serif">Anybody know?</span></pre></div></blockquote><div><br></d=
iv><div>It&#39;s implemented in FORTRAN. scipy.special ufunc wrappers are g=
enerated &quot;in bulk&quot; from a JSON configuration file. Searching the =
Github repo for iti0k0 shows you the entry for iti0k0:</div><div><br></div>=
<div>=C2=A0 <a href=3D"https://github.com/scipy/scipy/search?q=3Diti0k0">ht=
tps://github.com/scipy/scipy/search?q=3Diti0k0</a><br></div><div>=C2=A0=C2=
=A0<a href=3D"https://github.com/scipy/scipy/blob/fdc31f3d2bfa90a2c214a3986=
68f0e153632d2bb/scipy/special/functions.json#L788">https://github.com/scipy=
/scipy/blob/fdc31f3d2bfa90a2c214a398668f0e153632d2bb/scipy/special/function=
s.json#L788</a></div><div><br></div><div>So looking for the=C2=A0it1i0k0_wr=
ap C function that&#39;s mentioned will show you which FORTRAN subroutine t=
hat it&#39;s calling:</div><div><br></div><div>=C2=A0=C2=A0<a href=3D"https=
://github.com/scipy/scipy/blob/fdc31f3d2bfa90a2c214a398668f0e153632d2bb/sci=
py/special/specfun_wrappers.c#L374">https://github.com/scipy/scipy/blob/fdc=
31f3d2bfa90a2c214a398668f0e153632d2bb/scipy/special/specfun_wrappers.c#L374=
</a></div><br>So now you can find the FORTRAN subroutine named ITIKA that a=
ctually implements the algorithm:</div><div class=3D"gmail_quote"><br></div=
><div class=3D"gmail_quote">=C2=A0=C2=A0<a href=3D"https://github.com/scipy=
/scipy/blob/fdc31f3d2bfa90a2c214a398668f0e153632d2bb/scipy/special/specfun/=
specfun.f#L3735-L3804">https://github.com/scipy/scipy/blob/fdc31f3d2bfa90a2=
c214a398668f0e153632d2bb/scipy/special/specfun/specfun.f#L3735-L3804</a><br=
><div>=C2=A0</div><div>At the top of the file, you can see that all=C2=A0of=
 these functions=C2=A0come=C2=A0from the book=C2=A0<i>Computation of Specia=
l Functions</i>=C2=A0which you can try to find a copy of to get more inform=
ation about it.</div><div><br></div></div>-- <br><div dir=3D"ltr" class=3D"=
gmail_signature">Robert Kern</div></div>

--000000000000a3131405e0b446e4--

--===============3190041169610971541==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
SciPy-User mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/scipy-user.python.org/
Member address: [email protected]

--===============3190041169610971541==--