Extend the magnitude range of tested numbers in packet math unit tests

This commit is contained in:
Gael Guennebaud 2013-06-13 18:12:58 +02:00
parent d541765e85
commit 3352b8d873

View File

@ -218,8 +218,8 @@ template<typename Scalar> void packetmath_real()
for (int i=0; i<size; ++i)
{
data1[i] = internal::random<Scalar>(-1e3,1e3);
data2[i] = internal::random<Scalar>(-1e3,1e3);
data1[i] = internal::random<Scalar>(-1,1) * std::pow(Scalar(10), internal::random<Scalar>(-3,3));
data2[i] = internal::random<Scalar>(-1,1) * std::pow(Scalar(10), internal::random<Scalar>(-3,3));
}
CHECK_CWISE1_IF(internal::packet_traits<Scalar>::HasSin, std::sin, internal::psin);
CHECK_CWISE1_IF(internal::packet_traits<Scalar>::HasCos, std::cos, internal::pcos);
@ -242,8 +242,8 @@ template<typename Scalar> void packetmath_real()
for (int i=0; i<size; ++i)
{
data1[i] = internal::random<Scalar>(0,1e6);
data2[i] = internal::random<Scalar>(0,1e6);
data1[i] = internal::random<Scalar>(0,1) * std::pow(Scalar(10), internal::random<Scalar>(-6,6));
data2[i] = internal::random<Scalar>(0,1) * std::pow(Scalar(10), internal::random<Scalar>(-6,6));
}
if(internal::random<float>(0,1)<0.1)
data1[internal::random<int>(0, PacketSize)] = 0;