From 976bd82fb0e830876cca117c302c8a19048033a4 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Thu, 24 Nov 2022 08:58:41 -0500 Subject: =?UTF-8?q?Specify=20more=20=E2=80=A2math=20functions=20and=20impl?= =?UTF-8?q?ement=20JS=20Fact,=20Comb,=20GCD,=20LCM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/spec/system.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/spec') diff --git a/docs/spec/system.html b/docs/spec/system.html index 5e076378..9b43e094 100644 --- a/docs/spec/system.html +++ b/docs/spec/system.html @@ -601,9 +601,10 @@

More accurately the modifier •_maxTime_ may fail if execution of 𝔽 takes over 𝕨𝔾𝕩 seconds, and should fail as quickly as it is practically able to. The most likely way to implement this modifier is to interrupt execution at the given time. If 𝔽 completes before the interrupt there is no need to measure the amount of time it actually took.

Math

System namespace •math contains mathematical utilities that are not easily implemented with basic arithmetic, analogous to C's math.h.

-

Constants ln1010, ln22, log10e÷⋆10, log2e÷⋆2 computed in full precision.

Other correctly-rounded arithmetic: monadic Cbrt3, Log22, Log1010, Log1p1+, Expm11-˜; dyadic Hypot+(ט).

Standard trigonometric functions Sin, Cos, Tan, Sinh, Cosh, Tanh, with inverses preceded by a (ASin, etc.) and accessable with . Additionally, the dyadic function ATan2 giving the angle of vector 𝕨𝕩 relative to 10. All trig functions measure angles in radians.

+

Special functions Fact and LogFact giving the factorial and its natural logarithm, possibly generalized to reals as the gamma function Γ(1+𝕩), and Comb giving the binomial function "𝕨 choose 𝕩". Also the error function Erf and its complement ErfC. The implementations LogFact Fact and ErfC 1-Erf are mathematically correct but these two functions should support greater precision for a large argument.

+

The greatest common divison GCD and least common multiple LCM of two numbers. Behavior for arguments other than natural numbers is not yet specified.

Random generation

•MakeRand initializes a deterministic pseudorandom number generator with seed value 𝕩. •rand, if it exists, is a globally accessible generator initialized at first use; this initialization should use randomness from an outside source if available. These random generators aren't required to be cryptographically secure and should always be treated as insecure. A random generator has the following member functions:

-- cgit v1.2.3