[VA] SRC#001 - Spiky Integral
07-16-2018, 12:31 AM (This post was last modified: 07-16-2018 12:53 AM by Gerson W. Barbosa.)
Post: #25
 Gerson W. Barbosa Senior Member Posts: 1,343 Joined: Dec 2013
RE: [VA] SRC#001 - Spiky Integral
(07-15-2018 06:26 PM)Thomas Klemm Wrote:  This RPL program calculates the coefficients:
Code:
«   « → m     « { 1 m } 0 CON OBJ→ DROP m →LIST     »   » → n ZEROS   « { 0 1 } 2 n     FOR k DUP SIZE → a s       « k ZEROS EVAL a +         a 1 k SUB 0 + REVLIST s 1 - ZEROS EVAL +         ADD         a k 1 + s SUB k 2 * ZEROS EVAL +         ADD       »     NEXT   » »

Thanks! We now can use it to compute the integrals much faster than I was able to before:

%%HP: T(3)A(R)F(.);
\<< DUPDUP DUPDUP * + 2 / 2 MOD
IF NOT
THEN
\<<
\<< \-> m
\<< 0 m NDUPN \->LIST
\>>
\>> \-> n ZEROS
\<< { 0 1 } 2 n
FOR k DUP SIZE \-> a s
\<< k ZEROS EVAL a + a 1 k SUB 0 + REVLIST s 1 - ZEROS EVAL + ADD a k 1 + s SUB k 2 * ZEROS EVAL + ADD
\>>
NEXT
\>>
\>> EVAL 1 GET 2 ROT 2 - ^ / \pi *
ELSE DROP2 0
END
\>>

(I've only replaced { 1 m } 0 CON OBJ→ DROP m →LIST with John Keith's contribution elsewhere in this thread).

20 -> '1909/65536*π', after 15.1 seconds (previously 118.4 seconds)

And here is a list containing the results of the integrals, starting from n = 1 up to n = 71:

{ 0 0 '1/2*π' '1/4*π' 0 0 '1/8*π' '7/64*π' 0 0 '35/512*π' '31/512*π' 0 0 '361/8192*π' '657/16384*π' 0 0 '2055/65536*π' '1909/65536*π' 0 0 '24955/1048576*π' '46923/2097152*π' 0 0 '316301/16777216*π' '299973/16777216*π' 0 0 '4136805/268435456*π' '15796439/1073741824*π' 0 0 '13853361/1073741824*π' '26585247/2147483648*π' 0 0 '756388295/68719476736*π' '182188585/17179869184*π' 0 0 '20965992017/2199023255552*π' '20268008015/2199023255552*π' 0 0 '294245741167/35184372088832*π' '570497115729/70368744177664*π' 0 0 '4173319332859/562949953421312*π' '4055330794367/562949953421312*π' 0 0 '59723919552183/9007199254740992*π' '58153763705741/9007199254740992*π' 0 0 '430665931945033/72057594037927936*π' '840170667413757/144115188075855872*π' 0 0 '12505857230438737/2305843009213693952*π' '12217503312833669/2305843009213693952*π' 0 0 '182650875111521033/36893488147419103232*π' '44670833701814021/9223372036854775808*π' 0 0 '335205518724079925/73786976294838206464*π' }

Just a few minutes on the emulator.

Thanks again for providing both the program and an explanation why this works!

Gerson.

PS: Here is the result for n = 100, in case someone wants to check it :-)

'432756001487181254158446581/158456325028528675187087900672*π' (399 seconds, on the emulator)
 « Next Oldest | Next Newest »

 Messages In This Thread [VA] SRC#001 - Spiky Integral - Valentin Albillo - 07-10-2018, 10:10 PM RE: [VA] SRC#001 - Spiky Integral - pier4r - 07-11-2018, 11:10 AM RE: [VA] SRC#001 - Spiky Integral - Valentin Albillo - 07-12-2018, 10:43 PM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-13-2018, 03:54 AM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-12-2018, 04:23 AM RE: [VA] SRC#001 - Spiky Integral - Massimo Gnerucci - 07-12-2018, 06:10 AM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-12-2018, 08:29 PM RE: [VA] SRC#001 - Spiky Integral - Pjwum - 07-12-2018, 10:32 AM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-12-2018, 08:10 PM RE: [VA] SRC#001 - Spiky Integral - ijabbott - 07-13-2018, 06:52 PM RE: [VA] SRC#001 - Spiky Integral - rprosperi - 07-14-2018, 01:30 AM RE: [VA] SRC#001 - Spiky Integral - ijabbott - 07-14-2018, 01:39 AM RE: [VA] SRC#001 - Spiky Integral - ijabbott - 07-14-2018, 02:08 PM RE: [VA] SRC#001 - Spiky Integral - Thomas Klemm - 07-14-2018, 08:38 PM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-15-2018, 02:53 PM RE: [VA] SRC#001 - Spiky Integral - Valentin Albillo - 07-15-2018, 09:03 PM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-15-2018, 09:55 PM RE: [VA] SRC#001 - Spiky Integral - Valentin Albillo - 07-14-2018, 10:54 PM RE: [VA] SRC#001 - Spiky Integral - Thomas Klemm - 07-15-2018, 06:26 PM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-15-2018, 07:35 PM RE: [VA] SRC#001 - Spiky Integral - DavidM - 07-15-2018, 07:53 PM RE: [VA] SRC#001 - Spiky Integral - John Keith - 07-15-2018, 09:22 PM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-15-2018, 10:16 PM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-16-2018 12:31 AM RE: [VA] SRC#001 - Spiky Integral - Valentin Albillo - 07-18-2018, 12:36 AM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-18-2018, 03:07 AM RE: [VA] SRC#001 - Spiky Integral - Valentin Albillo - 07-18-2018, 11:39 PM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-19-2018, 01:31 AM RE: [VA] SRC#001 - Spiky Integral - Valentin Albillo - 07-19-2018, 09:07 PM RE: [VA] SRC#001 - Spiky Integral - Albert Chan - 07-20-2018, 08:06 PM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-21-2018, 04:06 AM RE: [VA] SRC#001 - Spiky Integral - Albert Chan - 07-21-2018, 04:00 PM RE: [VA] SRC#001 - Spiky Integral - Valentin Albillo - 07-22-2018, 12:33 AM RE: [VA] SRC#001 - Spiky Integral - Albert Chan - 07-22-2018, 04:50 AM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-15-2018, 07:10 PM RE: [VA] SRC#001 - Spiky Integral - Thomas Klemm - 07-16-2018, 03:27 AM RE: [VA] SRC#001 - Spiky Integral - John Keith - 07-16-2018, 01:18 PM RE: [VA] SRC#001 - Spiky Integral - Werner - 07-18-2018, 06:17 AM RE: [VA] SRC#001 - Spiky Integral - ijabbott - 07-18-2018, 05:32 PM RE: [VA] SRC#001 - Spiky Integral - Thomas Klemm - 07-19-2018, 12:27 AM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-19-2018, 01:22 AM RE: [VA] SRC#001 - Spiky Integral - Albert Chan - 07-20-2018, 02:30 PM RE: [VA] SRC#001 - Spiky Integral - Albert Chan - 07-22-2018, 02:01 PM RE: [VA] SRC#001 - Spiky Integral - Valentin Albillo - 07-22-2018, 09:06 PM RE: [VA] SRC#001 - Spiky Integral - Albert Chan - 07-24-2018, 12:13 AM

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