Post Reply 
Π day
03-14-2022, 09:17 PM
Post: #11
RE: π day
(03-14-2022 03:35 AM)robve Wrote:  \( \frac{\pi}{6} = \frac{1}{\sqrt3}\left(1-\frac{1}{3^1\cdot3}+\frac{1}{3^2\cdot5}-\frac{1}{3^3\cdot7}+\cdots\right) \)

That's an alternating series so we can use Valentin's program:
(11C) Summation of infinite, alternating series

We write the program B to calculate the \(k\)-th term:

\(
\begin{align*}
a_k &= \frac{1}{3^k \, (2k + 1)}
\end{align*}
\)

Code:
084 - 42,21,12  LBL B
085 -        3  3
086 -       34  x<>y
087 -       14  y^x
088 -    43 36  LSTx
089 -        2  2
090 -       20  x
091 -        1  1
092 -       40  +
093 -       20  x
094 -       15  1/x
095 -    43 32  RTN

We use \(\text{PSum} = 10\), \(\text{NDif} = 7\) for maximum accuracy:

10 ENTER 7 A

After some time, we get the following result in the display:

0.9068996822

The correct result \(\frac{\pi}{\sqrt{12}}\) on the HP-11C is:

0.9068996821


Now you might be wondering: Isn't that like cracking a nut with a sledgehammer?

Let me use this program for the HP-42S instead:
Code:
00 { 17-Byte Prgm }
01▸LBL 00
02 1/X
03 LASTX
04 X<> ST Z
05 3
06 ÷
07 -
08 X<>Y
09 2
10 -
11 X>0?
12 GTO 00
13 R↓
14 END

We sum the terms backwards to improve accuracy.
It turns out that a starting value of \(43\) is good enough:

CLST
43
XEQ 00

We get:

0.906899682117

If we multiply that by \(\sqrt{12}\) we get:

3.14159265359


I must admit that I cheated a bit since I used this simulator for the HP-11C and Free42 instead of the real calculators.
Thus the results might be slightly off.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Π day - robve - 03-14-2022, 03:35 AM
RE: Π day - Dave Britten - 03-14-2022, 11:44 AM
RE: Π day - Gerson W. Barbosa - 03-14-2022, 12:25 PM
RE: Π day - robve - 03-14-2022, 05:52 PM
RE: Π day - Dave Britten - 03-14-2022, 06:15 PM
RE: Π day - Gerson W. Barbosa - 03-14-2022, 11:53 AM
RE: Π day - EdS2 - 03-14-2022, 01:55 PM
RE: Π day - Gerson W. Barbosa - 03-14-2022, 06:06 PM
RE: Π day - EdS2 - 03-15-2022, 12:05 PM
RE: Π day - robve - 03-14-2022, 09:35 PM
RE: Π day - Gerson W. Barbosa - 03-14-2022, 10:30 PM
RE: Π day - robve - 03-14-2022, 02:10 PM
RE: Π day - Gerson W. Barbosa - 03-14-2022, 08:29 PM
RE: π day - Thomas Klemm - 03-14-2022 09:17 PM
RE: Π day - robve - 03-15-2022, 04:56 PM
RE: Π day - ttw - 03-14-2022, 11:06 PM
RE: Π day - robve - 03-15-2022, 12:35 AM
RE: Π day - floppy - 04-02-2022, 11:12 AM
RE: Π day - Eddie W. Shore - 03-15-2022, 01:09 AM
RE: Π day - rprosperi - 03-15-2022, 12:25 PM
RE: Π day - Ren - 03-15-2022, 01:16 AM
RE: π day - Thomas Klemm - 03-15-2022, 07:55 PM
RE: Π day - robve - 03-15-2022, 08:49 PM
RE: Π day - Thomas Klemm - 03-17-2022, 03:40 AM
RE: Π day - robve - 03-18-2022, 01:04 AM
RE: Π day - Thomas Klemm - 03-17-2022, 03:54 AM
RE: Π day - Gerson W. Barbosa - 03-17-2022, 11:39 AM
RE: Π day - Thomas Klemm - 03-17-2022, 12:29 PM
RE: Π day - Gerson W. Barbosa - 03-17-2022, 02:10 PM
RE: Π day - Ángel Martin - 03-18-2022, 09:07 AM
RE: Π day - Frido Bohn - 03-19-2022, 09:45 AM
RE: Π day - Ángel Martin - 03-19-2022, 11:17 AM
RE: Π day - Frido Bohn - 03-19-2022, 01:01 PM
RE: Π day - Frido Bohn - 03-19-2022, 03:13 PM
RE: Π day - DavidM - 03-17-2022, 08:25 PM
RE: Π day - Xorand - 03-18-2022, 03:06 AM
RE: Π day - Steve Simpkin - 03-18-2022, 04:31 AM
RE: Π day - MeindertKuipers - 03-18-2022, 10:48 AM
RE: Π day - Ángel Martin - 03-18-2022, 11:04 AM
RE: Π day - Ángel Martin - 03-19-2022, 11:18 AM
RE: Π day - Ren - 04-02-2022, 03:14 AM
RE: Π day - Ángel Martin - 03-20-2022, 07:39 AM
RE: Π day - Frido Bohn - 03-20-2022, 07:28 PM
RE: π day - Thomas Klemm - 03-21-2022, 07:24 AM
RE: Π day - Frido Bohn - 03-21-2022, 04:03 PM
RE: Π day - Albert Chan - 03-21-2022, 10:45 PM
RE: Π day - Gerson W. Barbosa - 03-24-2022, 01:36 AM
RE: Π day - Albert Chan - 03-26-2022, 03:59 PM
RE: Π day - Gerson W. Barbosa - 03-26-2022, 05:37 PM
RE: Π day - Thomas Klemm - 03-21-2022, 05:27 PM
RE: π day - Thomas Klemm - 03-21-2022, 05:54 PM
RE: π day - Thomas Klemm - 03-21-2022, 06:33 PM
RE: Π day - Albert Chan - 03-26-2022, 11:24 PM
RE: Π day - Albert Chan - 03-27-2022, 01:44 PM
RE: Π day - Albert Chan - 03-27-2022, 04:00 PM
RE: Π day - ttw - 03-31-2022, 02:04 AM



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