Post Reply 
Physics brushup
04-21-2024, 12:21 AM
Post: #1
Physics brushup
Wife: "What are you doing?"
Me: "Refreshing my Physics!"

[Image: 53667672104_4db246c597_b.jpg]
Find all posts by this user
Quote this message in a reply
04-21-2024, 02:01 AM
Post: #2
RE: Physics brushup
\(\gamma\)
Find all posts by this user
Quote this message in a reply
04-21-2024, 03:32 AM
Post: #3
RE: Physics brushup
(04-21-2024 02:01 AM)Thomas Klemm Wrote:  \(\gamma\)

Yes, 14 steps and 14 bytes on the HP-15C. All 10 significant digits.

Can you do better? :-)
Find all posts by this user
Quote this message in a reply
04-21-2024, 06:57 AM
Post: #4
RE: Physics brushup
No, not using only basic arithmetic commands like you did.

But we can use:

\(
\gamma = - \int_0^1 \log \left( \log \left( \frac{1}{x} \right) \right)\mathrm{d}x
\)

With the following program:
Code:
   001 { 42 21 11 } f LBL A
   002 {       15 } 1/x
   003 {    43 12 } g ln
   004 {    43 12 } g ln
   005 {    43 32 } g RTN

Use:

1 ENTER 0 \(\int \begin{matrix}
x\\
y
\end{matrix}\) A

However, it will take a bit longer than your program.

[Image: attachment.php?aid=13471]


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
04-21-2024, 09:58 AM
Post: #5
RE: Physics brushup
Here's another one:
Code:
   001 { 42 21 11 } f LBL A
   002 {        3 } 3
   003 {       15 } 1/x
   004 {       11 } sqrt(x)
   005 {    43 32 } g RTN

0.5773502692

Short, fast but inaccurate.
But I'm sure you already knew that.
Find all posts by this user
Quote this message in a reply
04-21-2024, 12:25 PM
Post: #6
RE: Physics brushup
The exact 10-digit result is 0.5772156649.
The integral result is 0.5572156635 (FIX 9), both on the HP emulator and on the JRPN simulator.
On the HP-15CE the result is 0.5572156619 (FIX 8), but it takes about four minutes and twenty seconds. Nice integral anyway.
14 steps, including LBN and RTN, but perhaps the limit hasn’t been reached yet.
Find all posts by this user
Quote this message in a reply
04-23-2024, 03:09 AM (This post was last modified: 04-23-2024 03:10 AM by Namir.)
Post: #7
RE: Physics brushup
Euler constant = 1/sqrt(3+1/715) = 0.57721574 which is accurate to 6 decimals.

Namir
Find all posts by this user
Quote this message in a reply
04-24-2024, 01:32 AM
Post: #8
RE: Physics brushup
(04-23-2024 03:09 AM)Namir Wrote:  Euler constant = 1/sqrt(3+1/715) = 0.57721574 which is accurate to 6 decimals.

Namir

Yes,

I had tried that one as well, but it only returns 0.5772156648, even if the steps 12 and 13 are swapped. There is another 14-step program that returns 0.5772156649 on the 15C (rather obvious, I wonder how I missed it), but I’ll start a specific thread in the main forum later.

Regards,

Gerson.

Code:

#  Program occupies 14 bytes.

   000 {          } 
   001 { 42 21 11 } f LBL A
   002 {        7 } 7
   003 {        1 } 1
   004 {        4 } 4
   005 {       48 } .
   006 {        6 } 6
   007 {        2 } 2
   008 {        3 } 3
   009 {       15 } 1/x
   010 {        3 } 3
   011 {       40 } +
   012 {       11 } sqrt(x)
   013 {       15 } 1/x
   014 {    43 32 } g RTN
Find all posts by this user
Quote this message in a reply
Post Reply 




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