This lists only the changes for the current release over the last version,
since HISTORY is now quite big:
* BigFloat: support "only" and "try", too
* Euler's constant => Euler's number
* make bexp() MUCH faster by caching the first coefficients and rewriting
the inner loop
* $N->bfac() is about twice as fast for $N > 15 (with dimishing returns when
$N is larger than about 5000)
* Calc: add _alen() (approximate length in base 10) and _1ex() and raise
api_version() to 2
Benchmark results for bfac(), done under/with:
Perl v5.8.8 (64 bit, threading)
AMD Athlon 64 3800+
Benchmark: running bfac(10), bfac(100), bfac(1000), bfac(10000), bfac(15), bfac(50),
bfac(500), bfac(5000) for at least 5 CPU seconds...
bfac(10): 5s ( 5.17 usr + 0.01 sys = 5.18 CPU) @ 41121.81/s (n=213011)
bfac(15): 5s ( 5.27 usr + 0.00 sys = 5.27 CPU) @ 18371.35/s (n=96817)
bfac(50): 5s ( 5.29 usr + 0.00 sys = 5.29 CPU) @ 3293.38/s (n=17422)
bfac(100): 6s ( 5.18 usr + 0.17 sys = 5.35 CPU) @ 1068.79/s (n=5718)
bfac(500): 6s ( 5.13 usr + 0.16 sys = 5.29 CPU) @ 44.80/s (n=237)
bfac(1000): 5s ( 5.12 usr + 0.00 sys = 5.12 CPU) @ 10.35/s (n=53)
bfac(5000): 6s ( 6.22 usr + 0.00 sys = 6.22 CPU) @ 0.32/s (n=2)
(warning: too few iterations for a reliable count)
bfac(10000): 14s (13.66 usr + 0.00 sys = 13.66 CPU) @ 0.07/s (n=1)
(warning: too few iterations for a reliable count)
Benchmark: running bfac(10), bfac(100), bfac(1000), bfac(10000), bfac(15), bfac(50),
bfac(500), bfac(5000) for at least 5 CPU seconds...
bfac(10): 6s ( 5.28 usr + 0.00 sys = 5.28 CPU) @ 41925.00/s (n=221364)
bfac(15): 6s ( 5.25 usr + 0.00 sys = 5.25 CPU) @ 22539.62/s (n=118333)
bfac(50): 5s ( 5.32 usr + 0.00 sys = 5.32 CPU) @ 7419.17/s (n=39470)
bfac(100): 5s ( 5.33 usr + 0.00 sys = 5.33 CPU) @ 2186.49/s (n=11654)
bfac(500): 5s ( 5.30 usr + 0.00 sys = 5.30 CPU) @ 89.25/s (n=473)
bfac(1000): 5s ( 5.12 usr + 0.00 sys = 5.12 CPU) @ 20.70/s (n=106)
bfac(5000): 5s ( 5.00 usr + 0.00 sys = 5.00 CPU) @ 0.40/s (n=2)
(warning: too few iterations for a reliable count)
bfac(10000): 13s (12.82 usr + 0.16 sys = 12.98 CPU) @ 0.08/s (n=1)
(warning: too few iterations for a reliable count)
Benchmark results for bexp(), done under/with:
Perl v5.8.8 (64 bit, threading)
GMP 4.1.7 (see note below)
gcc 4.1.0
AMD Athlon 64 3800+
Times in seconds for 1->bexp(N) or euler(1,N) in case of Math::Big:
| M::Big M::Big M::BI M::BI M::BI M::BI
| v1.11 v1.11 v1.82 v1.82 v1.83 v1.83
| Calc GMP Calc GMP Calc GMP
--------+--------------------------------------------------
100 | 0.3 0.2 0.1 0.1 0.1 0.1
1000 | 8.8 0.5 0.2 0.1 0.2 0.1
2000 | 54.4 1.2 0.4 0.1 0.3 0.1
5000 | 8.8 1.9 0.1 1.6 0.1
10000 | 45.5 6.7 0.2 6.0 0.1
20000 | 26.8 0.2 24.3 0.2
25000 | 45.8 0.2 38.0 0.2
50000 | 156.0 0.4 0.3
100000 | 1.0 0.4
200000 | 3.3 1.3
500000 | 16.0 6.7
1000000 | 61.1 23.1
2000000 | 98.3
5000000 | * * See note below:
Note: GMP 4.2.x would be required to compute bexp(5000000) under Math::BigInt
v1.82 due to a segmentation fault in GMP 4.1.7 when constructing
1E5000000 as the limit. Math::BigInt 1.83 works differently and thus
works with GMP 4.1.x and GMP 4.2.x, albeit still very slow.
##############################################################################
Please have Math::BigInt->bzero()->bpow('0.1')->bpow(-42) big amounts of fun.
Tels <http://bloodgate.com/perl>