(12C Platinum) Day of Easter
|
09-04-2016, 03:45 PM
(This post was last modified: 09-04-2016 03:57 PM by Eddie W. Shore.)
Post: #1
|
|||
|
|||
(12C Platinum) Day of Easter
Instructions: Enter the four digit year. Press [ R/S ]. The month will be displayed (stored in R1). Press [ R/S ] to get the day (stored in R2).
For background information and notes, click here: http://edspi31415.blogspot.com/2016/09/h...aster.html HP12C Platinum Program: Easter Code:
Examples and Test Data: 2016: 3, 27 Keystrokes: 2016 [R/S] [R/S] 1995: 4, 16 2124: 4, 2 1977: 4, 10 2017: 4, 16 1826: 3, 26 These results have been verified. Source: The United States Naval Observatory “The Date of Easter” March 11, 2016. http://aa.usno.navy.mil/faq/docs/easter.php Retrieved September 2, 2016 |
|||
09-12-2016, 11:00 PM
Post: #2
|
|||
|
|||
RE: (12C Platinum) Day of Easter
Thanks, Eddie, for posting. I'm curious, on your 12C Platinum, what date are you getting for Easter 1950? I don't have a Platinum, so I am running it on my HP-67 simulator and a modified version on my HP-38C simulator. I get Apr 2 on the 38 (which I think is a week early) and I get something else on the 67 that isn't even a real date. I'm curious what date you get on the real McCoy.
Thanks, Bob Regards, Bob |
|||
09-12-2016, 11:46 PM
Post: #3
|
|||
|
|||
RE: (12C Platinum) Day of Easter
I get April 9, 1950 on my 50g program.
|
|||
09-13-2016, 01:26 AM
Post: #4
|
|||
|
|||
RE: (12C Platinum) Day of Easter
(09-12-2016 11:46 PM)Bob Patton Wrote: I get April 9, 1950 on my 50g program. On my HP-42S program I get Carnival: Feb-19-1950 Easter: Apr-09-1950 (Just tested it on Free42 on my cell phone) Longer (a direct conversion of a Basic program) and a somewhat limited range (1900 <= year <= 2099), but includes Carnival. I used it to choose my next year's vacation time in order to optimize vacation length :-) |
|||
09-14-2016, 04:36 AM
Post: #5
|
|||
|
|||
RE: (12C Platinum) Day of Easter
For what it's worth, I'm posting my program for the HP-38C simulator, RPN-38CX. Since this simulator is limited to 99 steps, I loaded all the constants into registers, even financial registers, and replaced many of the arithmetic operators with RCL arithmetic to save steps. This modified program works for most years, but gives a result that is off by one week for 1930, 1950, 1970, 1974, and 1994 in the last century and 2025, 2045, 2065, 2069 & 2089 in the current century. I'm hoping someone might spot where this is going wrong for those years. I suspect it may be a result of the simulator having much greater internal precision (about 15-16 digits) than an actual HP-12C platinum. I think some of you have the RPN-38 CX simulator.
This program requires the following constants be loaded in order to work and for the date format to be set to D.MY format. If you select and copy all of the constants, you can copy to the display of RPN-38 CX and they will be pasted into the correct registers. R5: 100 R6: 17 R7: 1 R8: 25 R9: 3 R.0: 4 R.1: 19 R.2: 30 R.3: 11 R.4: 2 R.5: 7 R.6: 40 R.7: 44 R.8: 31 R.9: 28 n: 15 i: 29 PV: 21 PMT: 27 FV: 0.000001 Program listing: (in program mode, copy and paste the program steps to the display to copy the entire program) 01 - 21 0 STO 0 02 - 22 71 5 RCL ÷ 5 03 - 24 61 INTGR 04 - 21 1 STO 1 05 - 21 4 STO 4 06 - 31 ENTER 07 - 86 71 0 RCL ÷ .0 08 - 24 61 INTGR 09 - 21 41 4 STO − 4 10 - 25 33 R↓ 11 - 31 ENTER 12 - 22 41 6 RCL − 6 13 - 22 71 8 RCL ÷ 8 14 - 24 61 INTGR 15 - 21 3 STO 3 16 - 41 − 17 - 22 71 9 RCL ÷ 9 18 - 24 61 INTGR 19 - 21 41 4 STO − 4 20 - 22 11 RCL n 21 - 21 51 4 STO + 4 22 - 22 0 RCL 0 23 - 86 71 1 RCL ÷ .1 24 - 25 61 FRAC 25 - 86 61 1 RCL × .1 26 - 21 2 STO 2 27 - 86 61 1 RCL × .1 28 - 21 51 4 STO + 4 29 - 22 4 RCL 4 30 - 86 71 2 RCL ÷ .2 31 - 25 61 FRAC 32 - 86 61 2 RCL × .2 33 - 21 4 STO 4 34 - 22 14 RCL PMT 35 - 22 4 RCL 4 36 - 25 5 x≤y 37 - 25 7 53 GTO 53 38 - 22 12 RCL i 39 - 22 4 RCL 4 40 - 22 51 7 RCL + 7 41 - 71 ÷ 42 - 24 61 INTGR 43 - 61 × 44 - 1 1 45 - 33 x≷y 46 - 41 − 47 - 22 13 RCL PV 48 - 22 41 2 RCL − 2 49 - 86 71 3 RCL ÷ .3 50 - 24 61 INTGR 51 - 61 × 52 - 21 41 4 STO − 4 53 - 22 0 RCL 0 54 - 21 2 STO 2 55 - 86 71 0 RCL ÷ .0 56 - 24 61 INTGR 57 - 21 51 2 STO + 2 58 - 22 4 RCL 4 59 - 86 51 4 RCL + .4 60 - 22 41 1 RCL − 1 61 - 21 51 2 STO + 2 62 - 22 1 RCL 1 63 - 86 71 0 RCL ÷ .0 64 - 24 61 INTGR 65 - 21 51 2 STO + 2 66 - 22 2 RCL 2 67 - 86 71 5 RCL ÷ .5 68 - 25 61 FRAC 69 - 86 61 5 RCL × .5 70 - 21 2 STO 2 71 - 22 4 RCL 4 72 - 33 x≷y 73 - 41 − 74 - 21 3 STO 3 75 - 86 51 6 RCL + .6 76 - 86 71 7 RCL ÷ .7 77 - 24 61 INTGR 78 - 22 51 9 RCL + 9 79 - 21 1 STO 1 80 - 86 71 0 RCL ÷ .0 81 - 24 61 INTGR 82 - 86 61 8 RCL × .8 83 - 32 CHS 84 - 86 51 9 RCL + .9 85 - 22 51 3 RCL + 3 86 - 22 1 RCL 1 87 - 22 71 5 RCL ÷ 5 88 - 51 + 89 - 22 15 RCL FV 90 - 22 61 0 RCL × 0 91 - 51 + 92 - 25 7 00 GTO 00 Regards, Bob Regards, Bob |
|||
09-14-2016, 01:20 PM
Post: #6
|
|||
|
|||
RE: (12C Platinum) Day of Easter
(09-14-2016 04:36 AM)bshoring Wrote: For what it's worth, I'm posting my program for the HP-38C simulator, RPN-38CX. Since this simulator is limited to 99 steps, I loaded all the constants into registers, even financial registers, and replaced many of the arithmetic operators with RCL arithmetic to save steps. May I draw your attention to this 95-step program for the 29C? I think it can be ported to other calculators. However, the 38C is a bit tricky since a modulo subroutine is called and the 38C offers no GSB. The program can even be shortened as the linked version calculates all easter dates in the entered year and the following ones. If you don't need this simply omit steps 83...86. Hint: the "print this article" link retrieves a PDF. (09-14-2016 04:36 AM)bshoring Wrote: Program listing: (in program mode, copy and paste the program steps to the display to copy the entire program) Bob, if you use [code] and [/code] tags around your listing it will be properly formatted: Code: 01 - 21 0 STO 0 Dieter |
|||
09-14-2016, 08:40 PM
(This post was last modified: 09-14-2016 10:46 PM by Dieter.)
Post: #7
|
|||
|
|||
RE: (12C Platinum) Day of Easter
(09-14-2016 01:20 PM)Dieter Wrote: May I draw your attention to this 95-step program for the 29C? I think it can be ported to other calculators. However, the 38C is a bit tricky since a modulo subroutine is called and the 38C offers no GSB. Here is a 12C version of this algorithm. It does not require any subroutine calls and takes advantage of the DATE function which allows the code to fit in 94 lines. This way even the date format setting is observed (MM.DDYYYY or DD.MMYYYY). I did not try this on a 38C/E but it looks like this should run on these as well. Code: 01 INTG If you feel that using the date function is cheating: it can also be done in 99 steps without it. ;-) For the record, here is a version for the 67/97 that uses only standard functions. Code: 001 LBL A For the latter version the Easter date is shown in MM.DDYYYY format. For DD.MMYYYY simply change line 83ff: Code: ... ... Still fits on a single card track. ;-) Dieter |
|||
09-14-2016, 10:36 PM
(This post was last modified: 09-14-2016 10:37 PM by Dieter.)
Post: #8
|
|||
|
|||
RE: (12C Platinum) Day of Easter
(09-13-2016 01:26 AM)Gerson W. Barbosa Wrote: On my HP-42S program I get You can also do this with the 12C program I posted. For carnival, add –49 DATE at the end. Or –48 DATE over here (Rosenmontag). It still fits in 99 lines. ;-) Dieter |
|||
09-15-2016, 01:15 AM
(This post was last modified: 09-15-2016 01:17 AM by Gerson W. Barbosa.)
Post: #9
|
|||
|
|||
RE: (12C Platinum) Day of Easter
(09-14-2016 10:36 PM)Dieter Wrote:(09-13-2016 01:26 AM)Gerson W. Barbosa Wrote: On my HP-42S program I get Very nice! I will try it when I find my 3-cell 12C. Unfortunately my HP-42S program gets Easter of 1954 wrong (Apr-25 instead of Apr-18). Hopefully not my fault as this agrees with the original Basic program: Code:
This program was published eons ago in a poster on calendars that came with Superinteressante magazine (in Portuguese). I did the conversion from Basic to RPN so blindly that even the modulus subroutine made into the program instead of the built-in MOD function. Anyway, I was using the HP-42S then only as a replacement after I had sold my HP-28S and before I got my first HP-48 GX. Gerson. |
|||
09-15-2016, 01:15 PM
(This post was last modified: 09-15-2016 05:36 PM by Dieter.)
Post: #10
|
|||
|
|||
RE: (12C Platinum) Day of Easter
(09-15-2016 01:15 AM)Gerson W. Barbosa Wrote: Very nice! I will try it when I find my 3-cell 12C. You can also implement that algorithm on the 42s. This avoids the error you got with the program you linked to: (09-15-2016 01:15 AM)Gerson W. Barbosa Wrote: Unfortunately my HP-42S program gets Easter of 1954 wrong (Apr-25 instead of Apr-18). Hopefully not my fault as this agrees with the original Basic program: Yes, the error is "by design" – obviously the calculation gets something wrong. I tried the BASIC algorithm in another 42s implementation and it gets the same errors. But in a much shorter program and with merely two data registers: Code: 00 { 123-Byte Prgm } Edit: replaced program with an updated version, including a bugfix. OK, this is without the carnival part. ;-) But Free42 features additional calendar functions, so a simple –49 DATE+ at the end will get you the date of carnival. But once again: there is an error in this algorithm. The mentioned 29C program seems to work fine. So what about a 42s version? Dieter |
|||
09-15-2016, 05:35 PM
Post: #11
|
|||
|
|||
RE: (12C Platinum) Day of Easter
(09-14-2016 01:20 PM)Dieter Wrote:(09-14-2016 04:36 AM)bshoring Wrote: For what it's worth, I'm posting my program for the HP-38C simulator, RPN-38CX. Since this simulator is limited to 99 steps, I loaded all the constants into registers, even financial registers, and replaced many of the arithmetic operators with RCL arithmetic to save steps. Dieter, Thanks for the link to the 29C program. I got it to work on my 38C emulator just fine. First put it on my 67 emulator, which worked well, then by storing several constants, I got it working on the 38C. I verified that it is 100% accurate in the range 1900-2100. I'm guessing it is accurate for a much wider range. When I have time to clean it up and make it presentable I'll post it here. Thanks, Bob Regards, Bob |
|||
09-15-2016, 05:46 PM
(This post was last modified: 09-15-2016 05:47 PM by Dieter.)
Post: #12
|
|||
|
|||
RE: (12C Platinum) Day of Easter
(09-15-2016 05:35 PM)bshoring Wrote: Thanks for the link to the 29C program. I got it to work on my 38C emulator just fine. First put it on my 67 emulator, which worked well, then by storing several constants, I got it working on the 38C. The 12C version I posted should work just as well on the 38C (94 steps, 5 registers). No storing of constants or other tricks required. (09-15-2016 05:35 PM)bshoring Wrote: I verified that it is 100% accurate in the range 1900-2100. I'm guessing it is accurate for a much wider range. I hope so – at least it comes from a source I think we can trust. ;-) It claims the original program is correct for any date of the Gregorian calendar until 3999. Dieter |
|||
09-15-2016, 08:42 PM
(This post was last modified: 09-15-2016 08:54 PM by Dieter.)
Post: #13
|
|||
|
|||
RE: (12C Platinum) Day of Easter
(09-15-2016 01:15 PM)Dieter Wrote: OK, this is without the carnival part. ;-) Here is a 67/97 version with the (at least I think so) correctly working algorithm of the 29C program. And especially for you, Gerson: it includes the date of carnival Sunday. ;-) Code: 001 LBL A The 49 in line 117/118 is the number of days before Easter for the carnival date. Users in Central Europe may replace this with 48 to get the date of the following Monday. Output is in D.MY format. If you prefer, this can easily be changed to M.DY (see listing). I have not done much testing with this program, so beware: it may contain any error you can imagine (and even those you can't ;-)). So try it and see what you get. Example: 1954 [A] => 18.041954 [R/S] => 28.021954 At the end both dates are stored in X and Y. Dieter |
|||
09-15-2016, 10:39 PM
Post: #14
|
|||
|
|||
RE: (12C Platinum) Day of Easter
Here is the listing and instructions for the 29C Easter date program modified to work on RPN-38 CX, the iPhone simulator for the HP-38C.
Easter DMY Enter the year R/S to get Date on which Easter falls. (Date appears in dd,mmyyyy format). If the user prefers mm.ddyyyy format simply delete program lines 74-80. Program has been tested valid for years from 1900-2100. May be valid for a much longer period. Tested against table at: http://tlarsen2.tripod.com/thomaslarsen/...dates.html This program requires the following constants be loaded in order to work: Code: R.0: 19 This program makes extensive use of RCL arithmetic and loaded constants. Program is based on a program written by E. L. R. Webb for the HP-29 C in 1979. Modified in 2016 for the RPN-38 CX similator by Bob Shoring. Code: 01 - 24 61 INTGR Regards, Bob |
|||
09-16-2016, 01:51 AM
Post: #15
|
|||
|
|||
RE: (12C Platinum) Day of Easter
(09-14-2016 08:40 PM)Dieter Wrote: Here is a 12C version of this algorithm. It does not require any subroutine calls and takes advantage of the DATE function which allows the code to fit in 94 lines. This way even the date format setting is observed (MM.DDYYYY or DD.MMYYYY). I did not try this on a 38C/E but it looks like this should run on these as well. It does work on RPN-38 CX: Easter By Dieter 01 - 24 61 INTGR 02 - 21 1 STO 1 03 - 21 0 STO 0 04 - 1 1 05 - 9 9 06 - 71 ÷ 07 - 24 61 INTGR 08 - 1 1 09 - 9 9 10 - 61 × 11 - 21 41 0 STO − 0 12 - 22 0 RCL 0 13 - 1 1 14 - 1 1 15 - 21 61 0 STO × 0 16 - 71 ÷ 17 - 21 2 STO 2 18 - 4 4 19 - 4 4 20 - 21 51 0 STO + 0 21 - 1 1 22 - 22 1 RCL 1 23 - 23 % 24 - 24 61 INTGR 25 - 51 + 26 - 3 3 27 - 2 2 28 - 23 % 29 - 73 . 30 - 2 2 31 - 51 + 32 - 24 61 INTGR 33 - 21 51 0 STO + 0 34 - 25 33 R↓ 35 - 7 7 36 - 5 5 37 - 23 % 38 - 24 61 INTGR 39 - 21 3 STO 3 40 - 21 41 0 STO − 0 41 - 22 0 RCL 0 42 - 3 3 43 - 0 0 44 - 71 ÷ 45 - 24 61 INTGR 46 - 3 3 47 - 0 0 48 - 61 × 49 - 21 41 0 STO − 0 50 - 22 2 RCL 2 51 - 22 0 RCL 0 52 - 25 5 x≤y 53 - 25 7 55 GTO 55 54 - 25 7 57 GTO 57 55 - 1 1 56 - 51 + 57 - 21 4 STO 4 58 - 32 CHS 59 - 22 1 RCL 1 60 - 73 . 61 - 8 8 62 - 71 ÷ 63 - 24 61 INTGR 64 - 51 + 65 - 22 41 3 RCL − 3 66 - 3 3 67 - 51 + 68 - 21 0 STO 0 69 - 7 7 70 - 71 ÷ 71 - 24 61 INTGR 72 - 7 7 73 - 61 × 74 - 22 41 0 RCL − 0 75 - 22 41 4 RCL − 4 76 - 5 5 77 - 4 4 78 - 51 + 79 - 22 1 RCL 1 80 - 25 32 EEX 81 - 6 6 82 - 71 ÷ 83 - 3 3 84 - 73 . 85 - 0 0 86 - 3 3 87 - 51 + 88 - 33 x≷y 89 - 24 51 DATE 90 - 24 6 FIX 6 91 - 25 7 00 GTO 00 1950 R/S -> 4,09,1950 7 (M.DY) or 9,04,1950 7 (D.MY) (Out of code box for easier copying and pasting into RPN-38 CX) Regards, Gerson. |
|||
09-16-2016, 03:00 AM
Post: #16
|
|||
|
|||
RE: (12C Platinum) Day of Easter
Thanks Dieter and Gerson. I pasted the listing directly into my RPN-38 CX and it's running like a charm. This is, so far, the most compact program I've seen for getting the date of Easter. Nice thing is, it works in either mm.ddyyyy or did.mmyyyy mode, depending on the setting of the switch.
Regards, Bob Regards, Bob |
|||
09-16-2016, 06:03 AM
Post: #17
|
|||
|
|||
RE: (12C Platinum) Day of Easter
(09-16-2016 01:51 AM)Gerson W. Barbosa Wrote: It does work on RPN-38 CX: Good to have this confirmed. Thank you. (09-16-2016 01:51 AM)Gerson W. Barbosa Wrote: Easter I did just the transcoding for the 12C/38C. The elegant and very compact algorithm is by E. L. R. Webb as published in his 1979 paper by the Royal Astronomical Society of Canada. (09-16-2016 01:51 AM)Gerson W. Barbosa Wrote: (Out of code box for easier copying and pasting into RPN-38 CX) Copy/Paste is no problem even with code boxes if you use the "View a printable version" link at the bottom of the page. Dieter |
|||
09-16-2016, 06:14 AM
Post: #18
|
|||
|
|||
RE: (12C Platinum) Day of Easter
(09-16-2016 03:00 AM)bshoring Wrote: Thanks Dieter and Gerson. I pasted the listing directly into my RPN-38 CX and it's running like a charm. This is, so far, the most compact program I've seen for getting the date of Easter. Nice thing is, it works in either mm.ddyyyy or did.mmyyyy mode, depending on the setting of the switch. That's why it uses the DATE function. ;-) I modified the original 29C program so that it essentially calculates the Easter date as the number of days after the 3rd of March. Which is 3,03yyyy in either date mode. Dieter |
|||
09-17-2016, 07:12 PM
(This post was last modified: 09-17-2016 09:28 PM by Dieter.)
Post: #19
|
|||
|
|||
RE: (12C Platinum) Day of Easter
(09-15-2016 01:15 AM)Gerson W. Barbosa Wrote: Unfortunately my HP-42S program gets Easter of 1954 wrong (Apr-25 instead of Apr-18). Hopefully not my fault as this agrees with the original Basic program: Gerson, I just happened to find this algorithm via Google books in a Turbo Pascal book by Nell Dale and Chip Weems. There is a remark saying that the program works for years between 1982 and 2048 (!). And within the period from 1900 to 2099 there are four years where the result is one week late: 1954 (sic!), 1981, 2049 and 2076. ;-) If you still have the magazine article you mentioned, you may look if there is a similar remark with this restriction. Update: Here is a 42s version of the Easter/Carnival program based on the 29C algorithm. The method for determining the number of days in February is explained at this 35s program. Code: 00 { 216-Byte Prgm } Example: 1954 XEQ "EASTER" => Easter: 18-4-1954 Carnival: 28-2-1954 Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 6 Guest(s)