Thank You Steven I consider complexe number and I'm glad u notice the same difference between those two ways to compute absolute value. I agree with you about the robustness, for sure. In my case I performed the functions directly on array, without making loop.
Regards Le lundi 18 mai 2015 16:51:48 UTC+2, antony schutz a écrit : > > Hello, > > I just discover abs2() function :v > > And I have to say that i'm really surprised that: > sqrt(abs2( x )) is quicker than abs( x ) > > For a Matrix of size 512*512 and then a vector of size 512 > 10000 realizations, the mean results are (on a macbook): > > abs(x[:,:]) > > 0.0073665214096 > > sqrt(abs2(x[:,:])) > > 0.0046861180318999995 > > abs(x[:]) > > 1.2221291200000001e-5 > > sqrt(abs2(x[:])) > > 1.15177585e-5 > > > Regards > > > >
