Re: [eigen] sse asin implementation

[ Thread Index | Date Index | More Archives ]


What is the motivation for vectorizing asin in Eigen? Do you mean for
people who want a "cwise asin" on a vector? Do you have a use case for

Concerning Eigen's own needs, so far, we use some atan and acos but we
do not presently use asin. More importantly, from just a quick look at
it, it does not seem that our use of atan/acos is easily vectorizable
: vectorizing it would require to handle more than one object at once,
which would not be transparent to the user.

bjacob@kiwi:~/kde/kdesupport/eigen2/Eigen> grep -R acos . | grep -v
"~" | grep -v svn
../src/Geometry/AngleAxis.h:    m_angle = 2*std::acos(q.w());
../src/Geometry/Quaternion.h:  return Scalar(2) * std::acos(d);
../src/Geometry/Quaternion.h:  Scalar theta = std::acos(absD);
bjacob@kiwi:~/kde/kdesupport/eigen2/Eigen> grep -R asin . | grep -v
asing | grep -v "~" | grep -v svn
bjacob@kiwi:~/kde/kdesupport/eigen2/Eigen> grep -R atan . | grep -v
"~" | grep -v svn
../src/Geometry/Rotation2D.h:  m_angle = ei_atan2(mat.coeff(1,0),
../src/Geometry/EulerAngles.h:    res[1] = std::atan2(s, coeff(i,i));
../src/Geometry/EulerAngles.h:      res[0] = std::atan2(coeff(j,i), coeff(k,i));
../src/Geometry/EulerAngles.h:      res[2] = std::atan2(coeff(i,j),-coeff(i,k));
../src/Geometry/EulerAngles.h:      res[2] =
(coeff(i,i)>0?1:-1)*std::atan2(-coeff(k,j), coeff(j,j));
../src/Geometry/EulerAngles.h:    res[1] = std::atan2(-coeff(i,k), c);
../src/Geometry/EulerAngles.h:      res[0] = std::atan2(coeff(j,k), coeff(k,k));
../src/Geometry/EulerAngles.h:      res[2] = std::atan2(coeff(i,j), coeff(i,i));
../src/Geometry/EulerAngles.h:      res[2] =
(coeff(i,k)>0?1:-1)*std::atan2(-coeff(k,j), coeff(j,j));

2009/3/31 Rohit Garg <rpg.314@xxxxxxxxx>:
> This should satisfy your concerns.
> I fiddled around elsewhere w/o changing anything in the core ei_pasin
> function that I had written. I copied over stuff that I needed from
> eigen's files. The max error is reasonable.
> On a side note, I think that defining the sign_mask in PacketMath.h
> file and using the _mm_andnot_ps might be faster for calculating the
> absolute value.
> Cheers,
> --
> Rohit Garg
> Senior Undergraduate
> Department of Physics
> Indian Institute of Technology
> Bombay

Mail converted by MHonArc 2.6.19+