1 //===-- Exhaustive test for tanf
2 //--------------------------------------std::cout----===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "exhaustive_test.h"
11 #include "src/math/tanf.h"
12 #include "utils/MPFRWrapper/MPFRUtils.h"
13
14 namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
15
16 using LlvmLibcTanfExhaustiveTest =
17 LlvmLibcUnaryOpExhaustiveMathTest<float, mpfr::Operation::Tan,
18 LIBC_NAMESPACE::tanf>;
19
20 // Range: [0, Inf];
21 static constexpr uint32_t POS_START = 0x0000'0000U;
22 static constexpr uint32_t POS_STOP = 0x7f80'0000U;
23
TEST_F(LlvmLibcTanfExhaustiveTest,PostiveRange)24 TEST_F(LlvmLibcTanfExhaustiveTest, PostiveRange) {
25 test_full_range_all_roundings(POS_START, POS_STOP);
26 }
27
28 // Range: [-Inf, 0];
29 static constexpr uint32_t NEG_START = 0xb000'0000U;
30 static constexpr uint32_t NEG_STOP = 0xff80'0000U;
31
TEST_F(LlvmLibcTanfExhaustiveTest,NegativeRange)32 TEST_F(LlvmLibcTanfExhaustiveTest, NegativeRange) {
33 test_full_range_all_roundings(NEG_START, NEG_STOP);
34 }
35