Post Reply 
(41/42) AGM - Arithmetic-Geometric Mean
06-10-2020, 01:16 PM (This post was last modified: 06-10-2020 02:23 PM by Werner.)
Post: #8
RE: (41/42) AGM - Arithmetic-Geometric Mean
Seeing that yours really is only 29 bytes (if you replace the GTO "AGM" by a short numeric label), it was not easy to do better. But not impossible, and 41-compatible:

Code:
00 { 27-Byte Prgm } @   X       Y       Z       T
01▸LBL 02
02 X<>Y
03 X<> ST T
04 2
05 ÷
06▸LBL "AGM" @          a       b       z
07 STO ST T @           a       b       z       a
08 X<>Y
09 STO+ ST T @          b       a       z       2AM
10 STO× ST Y
11 X<>Y
12 SQRT @               GM      b       z       2AM
13 X≠Y?
14 GTO 02
15 R↓
16 END

Cheers, Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (41/42) AGM - Arithmetic-Geometric Mean - Werner - 06-10-2020 01:16 PM



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