Squaring the circle: all-MCODE Bessel functions - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: Squaring the circle: all-MCODE Bessel functions (/thread-163172.html) |
Squaring the circle: all-MCODE Bessel functions - Ángel Martin - 02-15-2010 It's done at last: an All-MCODE implementation of the Bessel functions IBS and JBS, for any real integer and any real argument. Not an easy feat by my standards, I had to go around numerous issues and limitations to coax the venerable coconut to pull this off! (no doubt my poor programming skills :) So if you're intrigued by it or interested in 30-year old technology warping its sensible limits, then make sure you check out the forthcoming version of the SandMath module, soon at a TOS near you :) Also a new mini-white paper on the Bessel functions is ready, including source code listings and even a FOCAL version for complex arguments and complex indexes. Can you spell J[(1+i),(-1-i)]?
Cheers, Re: Squaring the circle: all-MCODE Bessel functions - PeterP - 02-15-2010 do you ever sleep Angel? Your output these last few months has been nothing short of astonishing! Congratulations
Peter
Re: Squaring the circle: all-MCODE Bessel functions - Jean-Michel - 02-16-2010 Hi, my HP48 returns: J1+i(-1-i) = -8.88878423739 + 2.2945020794 i
Best regards, Re: Squaring the circle: all-MCODE Bessel functions - Ángel Martin - 02-16-2010 Excellent answer and correct result.
Here's validation of the ZJBS output then: and here's the answer from Wolfram Alfa:
-8.88878423734867397936687003371852995586164928241049073400... + I was never entirely comfortable using the 48, I guess it shows ;-)
Best wishes,
Edited: 16 Feb 2010, 7:35 a.m.
Re: Squaring the circle: all-MCODE Bessel functions - Ángel Martin - 02-17-2010 Thanks Peter, it was just rounding off some loose ends in the SandMath - but I admit it's taken me farther (and longer) than what I originally thought. Now I'm preparing some mini-papers to document the highlights of the module. As addictive as 41 MCODE is, it'll be good to rest for a while!
Cheers, Re: Squaring the circle: all-MCODE Bessel functions - Jean-Michel - 02-17-2010 Hi,
I've also written a "JNZ" program for the HP-41 -8.888784232 + 2.294502069 i
Roundoff-errors are more important,
All the Best, Re: Squaring the circle: all-MCODE Bessel functions - Ángel Martin - 02-18-2010 Let it be publicy said that your 41 Math library is nothing short of sensational, Jean-Marc. You have single-handedly built an impressibe body of programs, all posted here in the museum and obligued reference. I checked your Bessel functions entry but didn't see the complex treatment. Did I miss it somehow or is not posted yet? http://www.hpmuseum.org/software/41/41besslj.htm Yes rounding errors become more apparent when there's only 9 significant digits instead of ... 13, or 15? I'm not even sure what's the precission in the 48X anymore. Incidentally I found this problem to be less of an issue when doing complex numbers calculations. I'm probably wrong but it somehow seems to be a more forgiving environment. I now realize I should have used the 13-digit precision mainframe routines in some of my 41Z functions, and will revise them eventually. The exception to this "benign rule" has been the Lambert W function. Using the ZSOLVE program I can't always find the right root for the functional equation that defines W(z). I also tried with your program "ROOTZ", but the same issue occurs. http://www.hpmuseum.org/software/41/41cmpxf.htm
Have you tried using ROOTZ to calculate the Lamber W function with it?
LBL "*W" where the function's complex argument Z0 is stored in complex register ZR4, and the evaluated guesses of the equation z are in the complex stack register "Z" upon entry. It fares well for "small" Z0 values (say 1+i) but starts acting up when the argument "grows" - say (5+5i). In truth, I wonder to what extent one can use the secant method in the complex plane - where the mere concept doesn't hold up very gracefully.
Cheers,
Edited: 18 Feb 2010, 2:53 a.m.
Re: Squaring the circle: all-MCODE Bessel functions - Paul Dale - 02-18-2010 I've done complex Lambert's W for my 20b scientific firmware :) My references to the algorithm sources are:
http://en.wikipedia.org/wiki/Lambert_W_function These are quite probably not up to date. I used the algorithms from the wikipedia page. Start with the approximation under 7.2 and then refine it using Halley's method under 7.1 (I limited my maximum iterations to 20). - Pauli
Edited: 21 Feb 2010, 4:34 a.m.
Re: Squaring the circle: all-MCODE Bessel functions - Jean-Michel - 02-18-2010
Hi Angel, Re: Squaring the circle: all-MCODE Bessel functions - Ángel Martin - 02-21-2010 Hi Jean-Marc, Excellent news, thanks for looking into this. Yes, ZSOLVE now works fine for Lambert W using the better initial estimation as you suggest, using the logarithm instead of my crude choice. I'm impressed by the short execution times of your programs in general, also JNZ. Not bad at all considering you're not using MCODE routines. Are you programming the standard definition doing the summation, or other approximation perhaps? Shame to hear that your newer contributions aren't posted yet - I hope that gets corrected soon! BTW, I didn't find the reference you gave on the "Some MCODE routines for the 41" - is that another one not posted as well? I was curious to see if you used the standard mainframe routines or the 13-bit extended precision to program the complex functions. Thanks again for your inputs.
Edited: 21 Feb 2010, 4:17 a.m.
Re: Squaring the circle: all-MCODE Bessel functions - Paul Dale - 02-21-2010 I've also noticed the software library hasn't been updated for ages.
- Pauli
Re: Squaring the circle: all-MCODE Bessel functions - Ángel Martin - 02-21-2010 Thanks for the references Paul. So you wrote the firmware extensions for the 20B in machine code as well? Hmm, that makes me consider purchasing the machine, despite I'm sure I won;t understand half of it (never been a financial guy).
Cheers, Re: Squaring the circle: all-MCODE Bessel functions - Paul Dale - 02-21-2010 I've written everything so far in C. The 20b uses an ARM CPU and compilers for that are easy to get. I'm using HP-GCC.
- Pauli
Re: Squaring the circle: all-MCODE Bessel functions - Jean-Michel - 02-21-2010 Hi Angel,
I've just sent you the page on M-code routines
Best Regards, |