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
14namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
15
16using LlvmLibcTanfExhaustiveTest =
17 LlvmLibcUnaryOpExhaustiveMathTest<float, mpfr::Operation::Tan,
18 LIBC_NAMESPACE::tanf>;
19
20// Range: [0, Inf];
21static constexpr uint32_t POS_START = 0x0000'0000U;
22static constexpr uint32_t POS_STOP = 0x7f80'0000U;
23
24TEST_F(LlvmLibcTanfExhaustiveTest, PostiveRange) {
25 test_full_range_all_roundings(start: POS_START, stop: POS_STOP);
26}
27
28// Range: [-Inf, 0];
29static constexpr uint32_t NEG_START = 0xb000'0000U;
30static constexpr uint32_t NEG_STOP = 0xff80'0000U;
31
32TEST_F(LlvmLibcTanfExhaustiveTest, NegativeRange) {
33 test_full_range_all_roundings(start: NEG_START, stop: NEG_STOP);
34}
35

source code of libc/test/src/math/exhaustive/tanf_test.cpp