the competition's expm vs ours

Marco Caliari marco.caliari at univr.it
Wed Dec 10 02:23:48 CST 2008


> On  9-Dec-2008, Jaroslav Hajek wrote:
>
> I wonder whether there's
> room to optimize further, but I don't see anything left.

If you allow to precompute another auxiliary matrix

a4 = a2^2;

then you can rewrite

x = (c(8) * a4 + c(6) * a2) * a4 + c(4) * a4 + c(2) * a2 + id;

At this point, you can even increase by one the degree of the 
approximation (at the same cost) and write

y = ((c(9) * a4 + c(7) * a2) * a4 + c(5) * a4 + c(3) * a2 + c(1) * id) * 
aa;

Of course, you need a new set of coefficients c(1:9).

Best regards,

Marco


More information about the Octave-maintainers mailing list