Zeta Function - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: HP-41C Software Library (/forum-11.html) +--- Thread: Zeta Function (/thread-5559.html) |
Zeta Function - Namir - 01-19-2016 09:57 PM Here is a program that calculates the Zeta function. The program prompts you for s, the argument for the function, and for the tolerance value (recommend 1e-8). The function places the function's value in the X stack register, Code: 1 LBL "ZETA" The memory map for the program is: Code: R00 = s The function uses a fast converging series (see Wikipedia) and can give results for small arguments of s such as Zeta(1.1). Namir PS: I am aware that Jean-Marie Baillard has a Zeta function implemented in the HP-41C Software Library. His program is shorter than mine and uses just two registers. However, I tried to calculate Zeta(1.1) using his version and I had to stop after the HP-41CX emulator went on and on and on! RE: Zeta Function - Ángel Martin - 01-24-2016 09:25 AM (01-19-2016 09:57 PM)Namir Wrote: PS: I am aware that Jean-Marie Baillard has a Zeta function implemented in the HP-41C Software Library. His program is shorter than mine and uses just two registers. However, I tried to calculate Zeta(1.1) using his version and I had to stop after the HP-41CX emulator went on and on and on! Hi Namir, I guess you must have something wrong in your V41 setup - or a bad transcription of the program code. I just ran the case x=1.1 using ZETAX in the SandMath (which implements Jean-Marc's Borwein algorithm) and it took 13.48 seconds to return the result 10.58444847. I also ran it for x=1.001, which returned 1,000.577289 in approximately the same time. Both examples done at the default speed, i.e. NOT in TURBO mode. Cheers, 'AM |