On Thu, Sep 24, 2015 at 4:42 PM, Erik Schnetter <schnet...@gmail.com> wrote: > In the native code above, the C function `pow(double, double)` is called in > both cases. Maybe `llvm_powi` is involved; if so, it is lowered to the same > `pow` function. The speed difference must have a different reason.
Not necessarily, IIRC. we use the openlibm functions by default but llvm will use the system libm version. > > Sometimes there are random things occurring that invalidate benchmark > results. (This could be caused by how the compiled functions are aligned > respective to cache lines or page boundaries, etc. -- this is black magic I > like to invoke if there's a result that I can't explain. You can just ignore > my ramblings here.) You could restart Julia, reboot the machine, try a > different machine, define several identical functions `f` and `f_float` and > look at their speeds, etc... > > (I would have hoped that this function is translated to the equivalent of > `c=cos(x); c2=c*c; return c*c2`, but this is obviously not happening.) > > -erik > > On Thu, Sep 24, 2015 at 4:24 PM, Kristoffer Carlsson <kcarlsso...@gmail.com> > wrote: >> >> But the floating ones are the faster ones. Shouldn't it be the opposite? > > > > > -- > Erik Schnetter <schnet...@gmail.com> > http://www.perimeterinstitute.ca/personal/eschnetter/