-
Notifications
You must be signed in to change notification settings - Fork 1
/
funcs.ries
28 lines (23 loc) · 995 Bytes
/
funcs.ries
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Some user-defined functions.
#
# --define WEIGHT:NAME:DESC:FORMULA
# sinh, cosh, tanh
--define "4:sinh:sinh = hyperbolic sine:E|r-2/"
--define "4:cosh:cosh = hyperbolic cosine:E|r+2/"
# Can define tanh in terms of sinh and cosh!
--define "4:tanh:tanh = hyperbolic tangent::dup sinh swap cosh /"
# From source: XeX and Inverse Dilbert Lambda
--define "4:XeX:XeX(x) = x*exp(x):|E*"
--define "4:IDL:Inverse Dilbert Lambda = x*exp(-x^2):|snE*"
--define "4:hypot:Hypot = sqrt(a^2 + b^2):s@s+q"
--define "4:avg:avg = (a + b)/2:+2/"
--define "4:geomean:geomean = sqrt(a*b):*q"
--define "4:harmean:harmean = 1/avg(1/a, 1/b):r@r+2/r"
# "super" square root? t(a) = x s.t. x^x = a
# requires riesw
--define "4:ssqrt:ssqrt(x)^ssqrt(x) = x:lWE"
# Alternatively, would you get (mostly?) the same results if you did
# --define "4:ssq:ssq(x) = x^x::dup **"
# and just let that happen on the other side of the = ?
# Gaussian normal function, 1/sqrt(2pi) * exp(-x^2)
--define "4:normal:normal(x):snE2p*q/"