Performance - Maple Help

Performance

Maple 2020 improves the performance of several key functions

Natural Logarithms

In Maple 2020, the natural logarithm of large integers computes much faster and with less memory.

On an i7-8650U processor, Maple 2020 computes the following in about 14 seconds. Maple 2019, however, takes 17 minutes

$\mathrm{restart}:\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}a≔{2}^{{10}^{5}\mathrm{nextprime}\left({10}^{4}\right)}:\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathrm{length}\left(a\right)$

 ${301240717}$ (1.1)

$\mathrm{CodeTools}:-\mathrm{Usage}\left(\mathrm{ln}\left(a\right)\right)$

 ${1000700000}{}{\mathrm{ln}}{}\left({2}\right)$ (1.2)

This directly translates to performance gains in computing logarithms in all integer bases, as they work by computing natural logarithms.

Factorial

The factorial function is faster for large arguments. This case is about three times faster than in Maple 2019.

$\mathrm{CodeTools}:-\mathrm{Usage}\left(\mathrm{length}\left(\mathrm{threemillion}!\right)\right);$

 ${18128484}$ (2.1)

Integer Least Common Multiple

The integer least common multiple function (ilcm) has become much faster when called many times on smaller arguments. The following case is about ten times faster than in Maple 2019.

 memory used=62.21MiB, alloc change=-110.98MiB, cpu time=562.00ms, real time=538.00ms, gc time=62.50ms

Integration in the VectorCalculus and MultivariateCalculus Packages

The integration commands from the VectorCalculus and MultivariateCalculus packages (and the corresponding Student subpackages) now use the collapsed rather than the nested form for multiple integration. This allows the outer integration steps to use and benefit directly from the knowledge of the ranges of the inner integration steps.

This allows computation to complete more quickly for some examples, and to succeed in some examples which previously did not succeed or which required special assumptions to be made.

The following example now computes in under one second, on a machine where previously it took 100 seconds unless executed under the assumption that abs(y)<z .
$\mathrm{with}\left(\mathrm{Student}:-\mathrm{MultivariateCalculus}\right):$$\mathrm{MultiInt}\left(4{\left(-{y}^{2}+{z}^{2}\right)}^{\frac{3}{2}}+10\sqrt{-{y}^{2}+{z}^{2}},y=-z..z,z=0..1,\mathrm{coordinates}={\mathrm{cartesian}}_{y,z}\right)$

 $\frac{{59}{}{\mathrm{\pi }}}{{30}}$ (4.1)

The following example now computes in approximately one second, whereas previously it used a prohibitively large amount of time and memory resources.
$\mathrm{MultiInt}\left(\sqrt{xy},\left[x,y,z\right]=\mathrm{Tetrahedron}\left(⟨0,0,0⟩,⟨1,0,0⟩,⟨0,1,0⟩,⟨0,0,1⟩\right)\right)$

 $\frac{{\mathrm{\pi }}}{{96}}$ (4.2)

The following examples erroneously returned 0 in Maple2019.
$\mathrm{with}\left(\mathrm{Student}:-\mathrm{VectorCalculus}\right):$$\mathrm{int}\left(\frac{{ⅇ}^{x+yI}}{1-x+yI},\left[x,y\right]=\mathrm{Circle}\left(⟨0,0⟩,1\right)\right)$

 ${2}{}{\mathrm{\pi }}{}\left({-}\frac{{1}}{{2}}{+}\frac{{ⅇ}}{{2}}\right)$ (4.3)

$\mathrm{int}\left({ⅇ}^{x}\mathrm{cos}\left(y\right),\left[x,y\right]=\mathrm{Circle}\left(⟨0,0⟩,1\right)\right)$

 ${\mathrm{\pi }}$ (4.4)

The following example now computes in a few seconds, but did not complete in Maple 2019.
$\mathrm{int}\left(\frac{1}{{x}^{2}+{y}^{2}+{z}^{2}},\left[x,y,z\right]=\mathrm{Sphere}\left(⟨2,0,0⟩,1\right)\right)$

 ${-}{\mathrm{\pi }}{}\left({-}\frac{{\mathrm{arcsinh}}{}\left(\frac{{4}}{{3}}\right)}{{2}}{-}{2}{+}{2}{}{\mathrm{ln}}{}\left({3}\right)\right)$ (4.5)

The underlying structure of the returned inert form illustrates the change in behavior.
$\mathrm{Ex}≔\mathrm{int}\left(\frac{1}{{x}^{2}+{y}^{2}+{z}^{2}},\left[x,y,z\right]=\mathrm{Sphere}\left(⟨2,0,0⟩,1\right),\mathrm{inert}\right)$

 ${\mathrm{Ex}}{≔}{{\int }}_{{0}}^{{1}}{{\int }}_{{0}}^{{\mathrm{\pi }}}{{\int }}_{{0}}^{{2}{}{\mathrm{\pi }}}\frac{{{r}}^{{2}}{}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right)}{{4}{}{r}{}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right){}{\mathrm{cos}}{}\left({\mathrm{\theta }}\right){+}{{r}}^{{2}}{+}{4}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{\mathrm{\theta }}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{\mathrm{\phi }}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{r}$ (4.6)

 Int(r^2*sin(phi)/(4*r*sin(phi)*cos(theta)+r^2+4),[theta = 0 .. 2*Pi, phi = 0 .. Pi, r = 0 .. 1])

Previously the inert form would consist of multiple, nested calls to Int.

 Int(Int(Int(r^2*sin(phi)/(4*r*sin(phi)*cos(theta)+r^2+4),theta = 0 .. 2*Pi),phi= 0 .. Pi),r = 0 .. 1)