Re: [eigen] sse asin implementation |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] sse asin implementation
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Tue, 31 Mar 2009 16:48:13 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=7FM2uSyQX2Oa4LvmfIrUnlOdV2U7avC/TkDYQANpch0=; b=kKEmopaNyWQX1pJyH2ZA2LO1Ut55ni7g0Gn3bdzIy1sEoYi7mAr5fNoFGMIcUmtonr 0n0hq+xPIh28lbP1YQzSQoYBRoo2BauLfE0mXeZ4eLTE/wPBYgyd88qJagXvGZDAJx2g KotUsAcvIH0jGdam7aod69Jqv3ijZyYU8yYzY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Dn2xAiOOwkjqe6c2No5GiLK1zKkksIl85amjo761iEuM+/vms7v8nIaYConssA1Iwh D8CdsmJtsOooZPaXK0KdBre8k9TyO0zyOw50TrI8Mxmz/Zoa7YAlVNnSE6LHacE3yaXu 8Owp4pJ+3xswW5vfWQjvhmAVAuQ35lxSIdV80=
Hi,
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
this?
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),
mat.coeff(0,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
>
> http://rpg-314.blogspot.com/
>
> Senior Undergraduate
> Department of Physics
> Indian Institute of Technology
> Bombay
>