Revision history for Math::BigInt::Pari
2007-04-17 v1.12 Tels 5258 tests
* require Math::BigInt v1.83, Math::BigRat v0.19, Math::Pari v2.010709
* use native sqrtint() for _sqrt(), making it faster
* use native sqrtn() for _root(), making it faster
* support api_version() 2: add:
+ _from_oct(), _as_oct()
+ _10ex(), _alen()
2005-01-02 v1.11 Tels 5055 tests
* require Math::BigInt v1.74 and Math::Pari v2.010602
* testsuite from MBI v1.74
* support API from BigInt v1.70 and better
* add _is_two, _is_ten, _two, _ten, _log_int, _zeros, _sqrt, _root() etc
2004-01-07 v1.10 Tels
* testsuite from MBI v1.68 - 4583 tests
* _as_hex() and _as_bin() handle zero, tests for that
* bacmp() is about 11% faster due to _acmp() using gcmp() vs. "<=>"
* added _modinv() and tests
2002-07-07 v1.09 Tels
- testsuite from MBI v1.60 - 4061 tests
- prerequisite fixed
- _copy() uses $zero instead of PARI(0) - benchmark for full BigInt copy():
copy: 6 secs ( 5.16 usr + 0.04 sys = 5.20 CPU) @ 23649.23/s (n=122976)
copy: 5 secs ( 5.19 usr + 0.06 sys = 5.25 CPU) @ 27047.05/s (n=141997)
- digit() now uses a method that scales much better when extracting digits
counting from the right side ($n > 0)
- likeweise, _inc and _dec use $one instead of PARI(0). Benchmark over
Math::BigInt->bdec() and binc() (not just _inc() and _dec()!):
1.08, 100 and 1000 digit numbers (speed is largely irrel. of number size):
dec 100: 4 secs ( 5.11 usr + 0.06 sys = 5.17 CPU) @ 17412.57/s (n=90023)
dec 1000: 6 secs ( 5.17 usr + 0.08 sys = 5.25 CPU) @ 17147.24/s (n=90023)
inc 100: 5 secs ( 5.05 usr + 0.13 sys = 5.18 CPU) @ 17463.51/s (n=90461)
inc 1000: 6 secs ( 5.15 usr + 0.05 sys = 5.20 CPU) @ 17312.12/s (n=90023)
v1.09, 100 and 1000 digit long numbers:
dec 100: 6 secs ( 5.28 usr + 0.02 sys = 5.30 CPU) @ 24095.47/s (n=127706)
dec 1000: 4 secs ( 5.00 usr + 0.00 sys = 5.00 CPU) @ 23957.20/s (n=119786)
inc 100: 6 secs ( 5.39 usr + 0.00 sys = 5.39 CPU) @ 24157.70/s (n=130210)
inc 1000: 5 secs ( 4.93 usr + 0.07 sys = 5.00 CPU) @ 24108.80/s (n=120544)
2002-03-23 v1.08 Tels
- testsuite from MBI v1.55 - 3881 tests
- prerequisite fixed
2002-02-21 v1.07 Tels
- Math::Pari has _hex_cvt(), which makes from_hex() fast, but doesn't have
something for from_bin(). Now _from_bin() repacks the input as hex number
and then passes it to _hex_cvt().
- tests from Math::BigInt v1.51
- replaced _core_lib() by config()->{lib}
2002-02-10 v1.06 Tels
- _lsft() and _rsft() do now bases != 2, too
- tests are now from v1.50
- added _fac() for faster factorial() (used from MBI v1.50 onwards)
#!/usr/bin/perl -w
use lib 'lib';
use Math::BigInt lib => 'Pari';
use Benchmark;
my $c = 20000;
my $x = Math::BigInt->new(1); my $z = $x->copy()->blsft($c);
my $x1 = Math::BigInt->new(1); my $z1 = $x->copy()->blsft($c*10);
timethese ( -3, {
right_1_10 => sub { $x->brsft(1,10); },
left_1_10 => sub { $z->blsft(1,10); },
right_10_10 => sub { $x1->blsft(10,10); },
left_10_10 => sub { $z1->brsft(10,10); }, } );
Results (operations per second) on a 1Ghz Athlon:
v1.05 v1.06 Factor
-------------------------------------
left_10_10: 1990 6000 3.0
left_1_10: 2280 5150 2.2
right_10_10: 1130 1560 1.4
right_1_10: 2570 6433 2.5
2001-11-11 v1.05 Tels
- fixed _inc() and _dec() so that they can be used by MBI v1.46
2001-11-01 v1.04 Tels
- tests from BigInt v1.45
- added _mod() for faster % operator (about two times faster now)
- added _lsft() and _rsft() for faster shifting
#!/usr/bin/perl -w
use lib 'lib';
use Math::BigInt lib => 'Pari';
use Benchmark;
my $c = 20000;
my $x = Math::BigInt->new(1); my $z = $x->copy()->blsft($c);
my $x1 = Math::BigInt->new(1); my $z1 = $x->copy()->blsft($c*10);
timethese ( $c, {
right_1 => sub { $x->brsft(1,2); },
left_1 => sub { $z->blsft(1,2); },
right_10 => sub { $x1->blsft(10,2); },
left_10 => sub { $z1->brsft(10,2); }, } );
Results (operations per second) on a 1Ghz Athlon:
v1.03 v1.04 Factor
-------------------------------------
left_1: 2577 6450 2.5
left_10: 881 3086 3.5
right_1: 2928 6990 2.4
right_10: 2020 5465 2.7
1.03 2001.09.02 btrott
- Incorporated Tels's changes: no longer need to EXPORT_OK functions;
added empty import method.
- Added _as_hex and _as_bin implementations for Math::Pari integers,
to support as_hex and as_bin Math::BigInt methods.
1.02 2001.08.05 btrott
- Added _gcd method; uses PARI library function to return gcd.
- Incorporated Tels's changes: _copy() is now linear; _is_zero,
_is_one, is_even, and is_odd now use PARI library functions
rather than overloaded ops and should thus be faster. Also
added new tests from Math::BigInt 1.40.
1.01 2001.07.14 btrott
- Incorporated Tels's changes per calling args to plugin methods
(now class is *always* the first arg, so no more checking).
Fixed some tests per Math::BigInt changes.
1.00 2001.07.11 btrott
- Initial release.