Re: [Numpy-discussion] optimization of arr**-2

2007-07-15 Thread Timothy Hochberg
On 7/15/07, Sebastian Haase <[EMAIL PROTECTED]> wrote: Hi, I compared for a 256x256 float32 normal-noise (x0=100,sigma=1) array the times to do 1./ (a*a) vs. a**-2 >>> U.timeIt('1./(a*a)', 1000) (0.00090877471871, 0.00939644563778, 0.00120674694689, 0.00068554628) >>> U.timeIt('a**-2', 100

[Numpy-discussion] optimization of arr**-2

2007-07-15 Thread Sebastian Haase
Hi, I compared for a 256x256 float32 normal-noise (x0=100,sigma=1) array the times to do 1./ (a*a) vs. a**-2 >>> U.timeIt('1./(a*a)', 1000) (0.00090877471871, 0.00939644563778, 0.00120674694689, 0.00068554628) >>> U.timeIt('a**-2', 1000) (0.00876591857354, 0.0263829620803, 0.00952076311375, 0