[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Symbolic pkg vpa trig speed
From: |
Colin Macdonald |
Subject: |
Symbolic pkg vpa trig speed |
Date: |
Wed, 6 Jul 2016 00:15:57 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 |
In a bug report Dan asked:
Just curious, from what you know about the arbitrary precision
library, is it slow to compute trig functions out to sixteen digits
compared to the floating point library?
Its currently a bit hard to tell, especially as Symbolic's handling of
large arrays of doubles is non-optimal (pending pytave GSoC work!) but
probably hundreds of times slower.
x = rand(10, 10);
% make vpa objects from x in 16, 32, 48 (of course these will not
magically have extra precision, its just for timing)
xv16 = vpa(x, 16);
xv32 = vpa(x, 32);
xv48 = vpa(x, 48);
tic; sin(x); toc
Elapsed time is 0.000461817 seconds.
tic; sin(xv16); toc
Elapsed time is 0.156639 seconds.
tic; sin(xv32); toc
Elapsed time is 0.118703 seconds.
tic; sin(xv48); toc
Elapsed time is 0.175145 seconds.
The xv16 = bit seems take longer than I expect..., I filed
https://github.com/cbm755/octsympy/issues/499)
best,
Colin
- Symbolic pkg vpa trig speed,
Colin Macdonald <=