|
•
|
プログラムの改善により、高次かつ密な多項式の乗算、除算、累乗で処理速度が 4 倍以上になっています。メモリ使用は Maple 14 よりも 3/4 以上少なくなっています。
|
•
|
以下、効率のよい乗算、累乗、除算、法演算の例を示します。
|
>
|
f,g := seq(randpoly(x,degree=10^4,dense),i=1..2):
|
>
|
p := CodeTools[Usage](expand(f*g)):
|
memory used=1.70MiB, alloc change=1.87MiB, cpu time=69.00ms, real time=71.00ms
| |
>
|
p := CodeTools[Usage](expand((5*x-3*y)^10000)):
|
memory used=34.72MiB, alloc change=34.62MiB, cpu time=251.00ms, real time=251.00ms
| |
>
|
f := Expand((1+x+y+z+t)^30) mod n:
|
>
|
CodeTools[Usage](Divide(f,1+x+y+z+t,'q') mod n);
|
memory used=4.79MiB, alloc change=4.75MiB, cpu time=169.00ms, real time=168.00ms
| |
| (2.1) |
•
|
divide は、二番目のコールで見られるように、多項式が割り切れない場合すぐに判定します。
|
>
|
f,g := seq(randpoly([x,y,z],degree=30,terms=3000),i=1..2):
|
>
|
CodeTools[Usage](divide(p,f,'q')); # computes quotient
|
memory used=227.52KiB, alloc change=0 bytes, cpu time=898.00ms, real time=899.00ms
| |
| (2.2) |
>
|
CodeTools[Usage](divide(p+1,f,'q')); # fails instantly
|
memory used=0.61MiB, alloc change=0 bytes, cpu time=83.00ms, real time=83.00ms
| |
| (2.3) |
|