Groups | Search | Server Info | Login | Register


Groups > comp.soft-sys.math.maple > #1386

Hi Maple QA! There is an urgent need for action here!

Newsgroups comp.soft-sys.math.maple
Date 2023-04-30 11:28 -0700
Message-ID <50da99f7-ade1-4e39-9d52-408aa7999628n@googlegroups.com> (permalink)
Subject Hi Maple QA! There is an urgent need for action here!
From "peter....@gmail.com" <peter.luschny@gmail.com>

Show all headers | View raw


Please consider:

restart;

egfCoeff := proc(egf, n) local k, c, j, ser;
    ser := taylor(egf(x, z), z=0, n + 1):
    c := k -> k! * normal(coeff(ser, z, k)):
    [seq(coeff(c(n), x, k), k = 0..n)]
end:

omg := (x, z) ->  ((exp(z) + 2 * exp(-cos(Pi / 5) * z) * cos(sin(Pi / 5) * z)
     + 2 * exp(cos((2 * Pi) / 5) * z) * cos(sin((2 * Pi) / 5) * z) ) / 5)^x:

t := time();
egfCoeff(omg,  5): simplify(%);
egfCoeff(omg, 10): simplify(%);
egfCoeff(omg, 15): simplify(%);
egfCoeff(omg, 20): simplify(%);
time() - t;

This takes 60 sec on my machine.
Now compare with SageMath:

def egfList(egf, n) -> list[int]:
    x, z = var("x, z")
    t = egf(x, z).taylor(z, 0, n)
    return (factorial(n) * t.coefficient(z, n)).list()

def omg(x, z):
    return ((exp(z) + 2 * exp(-cos(pi / 5) * z) * cos(sin(pi / 5) * z) + 2 * exp(cos((2 * pi) / 5) * z) * cos(sin((2 * pi) / 5) * z) ) / 5)^x

print(egfList(omg,  5)) 
print(egfList(omg, 10)) 
print(egfList(omg, 15)) 
print(egfList(omg, 20)) 

This takes less than 0.2 sec on my machine. In other words, 
SageMath is more than 300 times faster than Maple 2023 here!

Also, the output in Jupyter Notebooks doesn't work in any useful way, as you can see from the last two threads.

Back to comp.soft-sys.math.maple | Previous | Next | Find similar


Thread

Hi Maple QA! There is an urgent need for action here! "peter....@gmail.com" <peter.luschny@gmail.com> - 2023-04-30 11:28 -0700

csiph-web