Post Reply 
41Z Routine of the Week: Complex Fibonacci
07-25-2020, 09:11 AM (This post was last modified: 05-14-2021 11:54 AM by Ángel Martin.)
Post: #3
RE: 41Z Routine of the Week: Complex Fibonacci
Very nice JM, thanks for your contribution.

here's the 41Z version to use for complex orders - which requires a modified Binet formula using an interesting correction term:

input is the complex order z in {Y, X}
41 bytes / SIZE 000

Code:
01 LBL "ZFIB"
02  ZRPL^
03  PHI
04  X^Z   
05  ZENTER^
06  ZINV
07  ZRUP
08  PI
09  ST*  Z
10  *
11  ZCOS
12  Z*
13  Z-
14  5
15  SQRT
16  ST/  Z
17  /
18  ZAVIEW
19  END

Example: Fi(3+4i) ~ -5,248.511-J14,195.962

Cheers,
ÁM

"To live or die by your own sword one must first learn to wield it aptly."
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: 41Z Routine of the Week: Complex Fibonacci - Ángel Martin - 07-25-2020 09:11 AM



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