0
Z odpowiedzią

# speed up of expm (4.8.3.14440)

Michal Kvasnicka 3 lat temu Ostatnio zmodyfikowane przez Pavel Holoborodko 3 lat temu

The presented improvement of expm speed (version 4.8.3.14440) is for mp.Digits = 34 or 100???

+1
Z odpowiedzią

Speed-up is valid for all precisions, including quadruple.  For quadruple speed is improved by ~2 times, e.g.:

```>> mp.Digits(34);M=500;A=(rand(M,'mp'))*10;
>> tic; expm(A); toc; % new
Elapsed time is 12.147127 seconds.

>> tic; expm(A); toc;  % old
Elapsed time is 26.809653 seconds.
```

We can make it 4 times for quadruple is well, let me know if you are interested.

Sorry, wrong formulation of my question. I am asking for what precision are presented CPU times?

Of course Pavel, any additional speed up of expm for quadruple precision would be great, especially for me :). I just trying to effectively solve the stiff system of 1st order linear ODEs (constants differ by magnitudes of order), so expm plays crucial role.

+1

In our changelog we use 100 digits, but speed-up is implemented for any precision level.

Ok, we can make quadruple even faster, e.g. like this:

```>> mp.Digits(34);M=500;A=(rand(M,'mp'))*10;
>> tic; expm(A); toc; % new
Elapsed time is 5.859282 seconds.

>> tic; expm(A); toc;  % old
Elapsed time is 26.809653 seconds.```

Roughly ~5 times speed-up.

Give me a minute, I will send you mpexpm.p with appropriate changes for quadruple.