Comments and discussion on Valentin's 4th "Then and Now" - Area
|
01-20-2023, 12:07 AM
(This post was last modified: 01-20-2023 12:39 PM by Albert Chan.)
Post: #6
|
|||
|
|||
RE: Comments and discussion on Valentin's 4th "Then and Now" - Area
(01-19-2023 06:57 PM)Albert Chan Wrote: Although I knew of the speck, I thought it were not OP were asking ... I guessed wrong. I had already spent my 1 post in VA thread. This update included the speck too. 10 DESTROY ALL @ M=30.07 @ A=.831971149978 @ B=2.82740261413-A @ P=10^(-8) 20 T=1/3 @ DEF FND(Y,S)=SGN(Y+S)*ABS(Y+S)^T-SGN(Y-S)*ABS(Y-S)^T 30 DEF FNF(Y)=FND(Y,SQR(-LN(Y*Y/M+EXP(-SIN(Y))))) 40 B=B*2 @ DEF FNG(Z)=(FNF(A*Z)+FNF(A-A*Z))*A+FNF(A+B*Z)*B 50 SETTIME 0 @ I=INTEGRAL(0,1,P,FNG(.5*IVAR^3)*IVAR^2)*1.5 @ DISP I;"+"; 60 DISP INTEGRAL(-4.08514674762,-4.04921226445,P,FNF(IVAR));"=";I+RES,TIME >run 2.07662636775 + 7.19761930307E-5 = 2.07669834394 1.14 HP17B estimated timing = 1.14*200 = 228 s (≈ 4 minutes) FNF(y) calls: main : speck = 381 : 63 ≈ 6.05 : 1 Time spent : main : speck = .98 : .16 ≈ 6.13 : 1 Update Jan 20,2023: Above hard coded constants are obtained from another section of code. I normally code it this way, to keep core part clean. >list 999,9999 999 END 1000 DEF FNE(Y)=Y*Y/M+EXP(-SIN(Y))-1 1010 DISP "main: 0",FNROOT(.5,1,FNE(FVAR)-EXPM1(-FVAR^2)),FNROOT(2,3,FNE(FVAR)) 1020 DISP "speck:",FNROOT(-4.1,-4.05,FNE(FVAR)),FNROOT(-4.05,-4,FNE(FVAR)) >run 1000 ! integral limits main: 0 .831971149978 2.82740261413 speck: -4.08514674762 -4.04921226445 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)