math.matrices.elimination: move to extra
math.matrices.extras: expand with esoteric, less-used and unfinished code from basis
- math.matrices and .extras receive more words, tests, and docs
- matrix has become a predicate class
- 94% of matrices words have complete docs
- 77% of matrices.extras words have complete docs
- much more consistent naming for constructors etc
- added missing words / features such as main-diagonal and anti-transpose
- optimizations
- lots of documentation
This is for calculating e^x-1 for small values more accurately. You can also
call expm1(x) function if you want, and it's available on your platform.
FUNCTION: double expm1 ( double x )
IN: scratchpad [
{ byte-array } declare
[ 0 alien-unsigned-4 32 shift ]
[ 4 alien-unsigned-4 ] bi bitor
64 >signed
] optimized.
! working
[
dup >R 0 alien-unsigned-4 32 fixnum-shift
R> 4 alien-unsigned-4 over tag 0 eq?
[ fixnum-bitor ] [ fixnum>bignum bignum-bitor ] if
18446744073709551615 >R >bignum R> bignum-bitand
dup 63 bignum-bit? [ 18446744073709551616 bignum- ] [ ] if
]
! broken
[
dup >R 0 alien-unsigned-4 32 fixnum-shift
R> 4 alien-unsigned-4 over tag 0 eq?
[ fixnum-bitor ] [ fixnum>bignum bignum-bitor ] if
dup 63 bignum-bit? [ 18446744073709551616 bignum- ] [ ] if
]
The second case correctly eliminates the bitand but incorrectly assumes
that the item on the stack (which is an integer -- either a fixnum or a
bignum), was converted to a bignum.
Addresses #2170
- fixed: `interval-bitor` caused bit-growth
- improved: `interval-bitor` more exact about lower bounds
The added utility words could be used as a basis to make the other bitwise
interval operations more exact also.
Make both `empty-interval` and `full-interval` singletons, use generic functions
and methods where they are special-cased.
All words which work with interval points should also now work with the special
intervals.
Afaik, the mean word works both for population data and for
samples. Which is different from standard deviations, where you have
different formulas for population and sample std.
Functors contain nested definitions, much like <PRIVATE PRIVATE> blocks.
A new parser will be able to parse nested definitions unambigiously without
knowledge of the definition of <FUNCTOR: itself, which is not the case if
it looks like FUNCTOR: instead.