diff options
author | Darren Bane <dbane@tilde.institute> | 2022-01-07 11:49:16 +0000 |
---|---|---|
committer | Darren Bane <dbane@tilde.institute> | 2022-01-07 11:49:16 +0000 |
commit | 3f26f5eeaeb94fc05db3b7f19982ed5eb4104c2d (patch) | |
tree | ab8371d04fe30c2812ba5f28e3ea4bc22e644818 /shen/rms-defs.shen | |
parent | 1942ee886453a3650666c9c731dcc3f64a798db1 (diff) | |
parent | ccb2aac02c83a057f9a22d59e6fbaecf25709073 (diff) | |
download | lsp-3f26f5eeaeb94fc05db3b7f19982ed5eb4104c2d.tar.gz |
Merge branch 'master' of /home/dbane/public_repos/lsp into master
Diffstat (limited to 'shen/rms-defs.shen')
-rw-r--r-- | shen/rms-defs.shen | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/shen/rms-defs.shen b/shen/rms-defs.shen new file mode 100644 index 0000000..7839a17 --- /dev/null +++ b/shen/rms-defs.shen @@ -0,0 +1,20 @@ +(define mean + { (list number) --> number } + Xs -> (/ (sum Xs) (length Xs))) + +(define square + { number --> number } + X -> (* X X)) + +(define rms + { (list number) --> number } + Xs -> (sqrt (mean (map (function square) Xs)))) + +(define iota-h + { number --> number --> (list number) } + X X -> [X] + X Lim -> (cons X (iota-h (+ X 1) Lim))) + +(define iota + { number --> (list number) } + Lim -> (iota-h 1 Lim)) |