Lines Matching refs:tan
284 TEST(Ieee754, Tan) {
286 EXPECT_THAT(tan(std::numeric_limits<double>::quiet_NaN()), IsNaN());
287 EXPECT_THAT(tan(std::numeric_limits<double>::signaling_NaN()), IsNaN());
288 EXPECT_THAT(tan(std::numeric_limits<double>::infinity()), IsNaN());
289 EXPECT_THAT(tan(-std::numeric_limits<double>::infinity()), IsNaN());
291 // Tests for tan for |x| < pi/4
292 EXPECT_EQ(std::numeric_limits<double>::infinity(), 1 / tan(0.0));
293 EXPECT_EQ(-std::numeric_limits<double>::infinity(), 1 / tan(-0.0));
294 // tan(x) = x for |x| < 2^-28
295 EXPECT_EQ(2.3283064365386963e-10, tan(2.3283064365386963e-10));
296 EXPECT_EQ(-2.3283064365386963e-10, tan(-2.3283064365386963e-10));
298 EXPECT_EQ(0.8211418015898941, tan(11.0 / 16.0));
299 EXPECT_EQ(-0.8211418015898941, tan(-11.0 / 16.0));
300 EXPECT_EQ(0.41421356237309503, tan(0.39269908169872414));
302 EXPECT_EQ(0.7993357819992383, tan(0.6743358));
304 // Tests for tan.
305 EXPECT_EQ(3.725290298461914e-9, tan(3.725290298461914e-9));
306 // Test that tan(PI/2) != Infinity since PI is not exact.
307 EXPECT_EQ(1.633123935319537e16, tan(kPI / 2));
309 EXPECT_EQ(0.5463024898437905, tan(0.5));
310 EXPECT_EQ(2.0000000000000027, tan(1.107148717794091));
311 EXPECT_EQ(-1.0000000000000004, tan(7.0 / 4.0 * kPI));
312 EXPECT_EQ(0.9999999999999994, tan(9.0 / 4.0 * kPI));
313 EXPECT_EQ(-6.420676210313675e-11, tan(1048576.0 / 2.0 * kPI));
314 EXPECT_EQ(2.910566692924059e11, tan(1048575.0 / 2.0 * kPI));
317 EXPECT_EQ(-0.40806638884180424e0, tan(kTwo120));
318 EXPECT_EQ(0.40806638884180424e0, tan(-kTwo120));