Perimeter of the Ellipse (HP-15C)
|
06-04-2021, 10:47 PM
Post: #21
|
|||
|
|||
RE: Perimeter of the Ellipse (HP-15C)
Thank you very much, C.Ret, for the HP-15C version!
The HP-15C was my first calculator and I am supposed to know how to program it, yet I had no idea on how to start. The results almost exactly match my latest table, except for 1, 2 or 3 ULPs. There was only one result with a 5-ULP difference, but it turned out to be still close to the actual result, but on the other side. Only about 8 seconds on my HP-15C, purchased brand-new in ‘83 or ‘84. As a comparison, one AGM iteration takes 2.5 seconds, but then again my program might not be nearly as optimized as it could. |
|||
06-05-2021, 12:31 AM
(This post was last modified: 06-05-2021 05:03 AM by C.Ret.)
Post: #22
|
|||
|
|||
RE: Perimeter of the Ellipse (HP-15C)
Code: 001- ►LBL E |
|||
06-05-2021, 10:31 AM
Post: #23
|
|||
|
|||
RE: Perimeter of the Ellipse (HP-15C)
I found this paper that uses a modified AGM (MAGM) sequence. It may be of interest to some people (expecially Albert Chan if he hasn't already seen it!).
An Eloquent Formula for the Perimeter of an Ellipse Semjon Adlaj — Ian Abbott |
|||
06-05-2021, 03:40 PM
(This post was last modified: 06-05-2021 03:41 PM by C.Ret.)
Post: #24
|
|||
|
|||
RE: Perimeter of the Ellipse (HP-15C)
Thank a lot for the publication reference.
I was wandering what AGM stand for and I was at the point asking for explanations. Through this instructive reading, I have now the good definitions and explanations of what are AGM and MAGM. That all I need for a better understanding on how my program works ! |
|||
06-05-2021, 08:00 PM
Post: #25
|
|||
|
|||
RE: Perimeter of the Ellipse (HP-15C)
(06-04-2021 06:12 PM)Gerson W. Barbosa Wrote: ——————— While this forces an exact result for y = 0, it only spoils the other results. The same happens when the 1/3 constant is used. A better option for both 10 and 12-digit results is to discard even the 1/3 constant: p(a, b) ~ π(a - b)(y + 1/(4y - 1/(4y - 3/(4y - 3/(4y - 11/(12y - (4/(2y - 1)))))))) Code:
In C.Ret’s program just delete the steps 16 through 18 [ 3 1/x + ]. |
|||
06-05-2021, 10:35 PM
Post: #26
|
|||
|
|||
RE: Perimeter of the Ellipse (HP-15C)
(06-05-2021 08:00 PM)Gerson W. Barbosa Wrote: A better option for both 10 and 12-digit results is to discard even the 1/3 constant: Try replacing last constant 1 as (19/18)/y. This keep rel error below 1 ppm, well until h = ((a-b)/(a+b))^2 > 0.9616 |
|||
06-06-2021, 07:07 AM
(This post was last modified: 06-07-2021 07:25 PM by C.Ret.)
Post: #27
|
|||
|
|||
RE: Perimeter of the Ellipse (HP-15C)
(06-05-2021 08:00 PM)Gerson W. Barbosa Wrote: A better option for both 10 and 12-digit results is to discard even the 1/3 constant: (06-05-2021 10:35 PM)Albert Chan Wrote: Try replacing last constant 1 as (19/18)/y. This keep rel error below 1 ppm, well until h = ((a-b)/(a+b))^2 > 0.9616 Code: 001- ►LBL E \( P(a,b)\approx\pi(a-b)(y+1/(4y-1/(4y-3/(4y-3/(4y-11/(12y-(4/(2y-19/18y)))))))) \) \( P(a,b)\approx\pi(a-b)\frac{110592y^8-122880y^6+18704y^4+7488y^2-627}{110592y^7-150528y^5+54608y^3-4244y} \) with \( y=\frac{a+b}{a-b} \) \( P(a,b)\approx\pi(a+b)\frac{110592-122880h+18704h^2+7488h^3-627h^4}{110592-150528h+54608h^2-4244h^3} \) with \( h=\left(\frac{a-b}{a+b}\right)^2 \) Code: a b P(a,b) Calc'Lap 7 DATA 19,18, 4,2, 11,12, 3,4, 3,4, 1,4, 1,4 10 INPUT "Elps Radii A,B ";A,B @ IF A<>B THEN Y=(A+B)/(A-B) ELSE P=2*PI*A @ GOTO 30 20 C=0 @ FOR I=1 TO 7 @ READ N,D @ C=N/(D*Y-C) @ NEXT I @ P=PI*(A-B)*(Y+C) 30 DISP USING 40;A,B,P 40 IMAGE "P("K",",K")=",4D.8D |
|||
07-14-2021, 11:34 PM
(This post was last modified: 07-14-2021 11:36 PM by Gerson W. Barbosa.)
Post: #28
|
|||
|
|||
RE: Perimeter of the Ellipse (HP-15C)
(06-05-2021 12:31 AM)C.Ret Wrote: Just for the record, here is a version of your program using three registers, by former forum member Mike (Stgt), from Jun/06. Actually, he wrote it for the HP-15C, like you did, but I prefer the HP-32S II, because it’s faster. Code:
Regards, Gerson. |
|||
04-18-2023, 09:24 AM
Post: #29
|
|||
|
|||
RE: Perimeter of the Ellipse (HP-15C)
(05-26-2021 11:49 AM)MeindertKuipers Wrote: Some background on the approximations for the perimeter of an ellipse, amazing video to watch (like most of this series)Remark: Parker is an "non-reference" (a bit a tik-tok math-touch video. however, took me time to come to this conclusion). Comments regarding this video page 8 of https://indico-hlit.jinr.ru/event/187/co...SAdlaj.pdf HP71B 4TH/ASM/Multimod, HP41CV/X/Y & Nov64d, PILBOX, HP-IL 821.62A & 64A & 66A, Deb11 64b-PC & PI2 3 4 w/ ILPER, VIDEO80, V41 & EMU71, DM41X |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)