Post Reply 
(15C)Bessel Functions, Arbitrary Order for HP-15C
11-27-2023, 05:16 PM (This post was last modified: 11-27-2023 07:03 PM by C.Ret.)
Post: #6
RE: (15C)Bessel Functions, Arbitrary Order for HP-15C
Thanks to you two.

I wanted to check the results that Namir obtains with those that I obtain with a code that I used before.

[Image: file.php?id=3481]

I then realized that my program for calculating the values of \( B_n(x) \) only works for integer values of \(n\).
I may therefore have to modify it by adding an INT instruction before storing \(n\) in the R0 register.

My code uses the integration function, which is more explicit than the nifty algorithm found by Namir, but takes much more time. It is based on the following relationship:

[Image: 875b6a42ac01ced9289bce0f61b3249d046e3286]

Obviously, digital integration takes a very long time on my HP-15C from 1985. But it's no longer very serious, today only the old HP-15Cs are struggling. The time factor is no longer a concern on the HP-15C LE or CE and other DM-15s.

As the calculation time no longer matters, I can try to use a second integration for the corrective term when calculating \(B_\alpha(x) \) with non-integer \(\alpha\).

[Image: 5615c4aa9e5c433936319e30dfc33f4fd8704d41]

As a short circuit, my code tests the fractional part of the argument x and jumps to label 2 if it does not exist.
The second integral grow up to infinity ! But don't be crazy, note that \(sinh(9)\simeq4\;052\) is already almost too large since already \(e^{-4\;052}\ll10^{-10}\) and 'larger' infinity limit may lead to erroneous integration by the \(\int_y^x\) operator.

The calculations are very long, fortunately, I took the precaution of saving the result in register R2 because most of the time, my HP-15C turn off before I wake up to read the result. As for the first version, the argument \(x\) is stored in register R1 and the order \(n\) or \(\alpha\) of the Bessel function in register R0.


The code completed by the calculation of the two integrations is not much shorter nor more implicit than the code proposed by Namir. I give it here just to illustrate my points, I don't think it will be of use to anyone. Especially since it takes an infinitely long time to display the slightest result.

[Image: file.php?id=5626]

Furthermore, integration towards infinity is not, by far, the fastest operation that can be performed on an HP-15C. Using an iterative algorithm like the one Namir propose is therefore an excellent and fully justified idea.


Thank all of you for sharing this code which is very effective and efficient, especially for long-term users of an HP-15c from 1985 as me.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (15C)Bessel Functions, Arbitrary Order for HP-15C - C.Ret - 11-27-2023 05:16 PM



User(s) browsing this thread: 1 Guest(s)