Re: [eigen] sse asin implementation

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


For general exponentiation, I think a cheap and easy route would be
just exp(b*log(a))

I looked at the cephes library implementation of pow and they do a lot
of hacks just to get 3 bits of precision. In the use case that you
have cited, I think it's better to just have the above implementation.
It is certainly good enough for the -ffast-math case.

BTW, what do you think of enabling the fast math paths in eigen when
just -ffast-math is supplied to gcc. It can be detected by the
__FAST_MATH__ macro.

On Tue, Mar 31, 2009 at 9:47 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
> 2009/3/31 Rohit Garg <rpg.314@xxxxxxxxx>:
>>> As I said, there's at least one very useful function that's not yet
>>> vectorized: pow.
>>
>> You are looking towards Packet4f pow(Packet4f a, Packet4f b) right?
>
> Yes, exactly. Actually, I think that in most cases b would be just a
> scalar, however if you implement the above, we'll get that by passing
> a constant packet as b.
>
> If it makes things faster / easier, I'd say don't hesitate to go for
> Packet4f pow(Packet4f a, float b)
> instead. This would then be called when the user does
>
> result_vector = vector.cwise().pow(b);  // where b is a float.
>
> Cheers,
> Benoit
>
>>
>>
>> --
>> Rohit Garg
>>
>> http://rpg-314.blogspot.com/
>>
>> Senior Undergraduate
>> Department of Physics
>> Indian Institute of Technology
>> Bombay
>>
>>
>>
>
>
>



-- 
Rohit Garg

http://rpg-314.blogspot.com/

Senior Undergraduate
Department of Physics
Indian Institute of Technology
Bombay



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/