182d6e770STue Ly //===-- Exhaustive test for tanf
282d6e770STue Ly //--------------------------------------std::cout----===//
382d6e770STue Ly //
482d6e770STue Ly // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
582d6e770STue Ly // See https://llvm.org/LICENSE.txt for license information.
682d6e770STue Ly // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
782d6e770STue Ly //
882d6e770STue Ly //===----------------------------------------------------------------------===//
982d6e770STue Ly
1082d6e770STue Ly #include "exhaustive_test.h"
1182d6e770STue Ly #include "src/math/tanf.h"
1282d6e770STue Ly #include "utils/MPFRWrapper/MPFRUtils.h"
1382d6e770STue Ly
14*b6bc9d72SGuillaume Chatelet namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
1582d6e770STue Ly
169532074aSTue Ly using LlvmLibcTanfExhaustiveTest =
179532074aSTue Ly LlvmLibcUnaryOpExhaustiveMathTest<float, mpfr::Operation::Tan,
18*b6bc9d72SGuillaume Chatelet LIBC_NAMESPACE::tanf>;
1982d6e770STue Ly
209532074aSTue Ly // Range: [0, Inf];
2182d6e770STue Ly static constexpr uint32_t POS_START = 0x0000'0000U;
2282d6e770STue Ly static constexpr uint32_t POS_STOP = 0x7f80'0000U;
2382d6e770STue Ly
TEST_F(LlvmLibcTanfExhaustiveTest,PostiveRange)249532074aSTue Ly TEST_F(LlvmLibcTanfExhaustiveTest, PostiveRange) {
259532074aSTue Ly test_full_range_all_roundings(POS_START, POS_STOP);
2682d6e770STue Ly }
2782d6e770STue Ly
289532074aSTue Ly // Range: [-Inf, 0];
299532074aSTue Ly static constexpr uint32_t NEG_START = 0xb000'0000U;
3082d6e770STue Ly static constexpr uint32_t NEG_STOP = 0xff80'0000U;
3182d6e770STue Ly
TEST_F(LlvmLibcTanfExhaustiveTest,NegativeRange)329532074aSTue Ly TEST_F(LlvmLibcTanfExhaustiveTest, NegativeRange) {
339532074aSTue Ly test_full_range_all_roundings(NEG_START, NEG_STOP);
3482d6e770STue Ly }
35