xref: /llvm-project/libc/test/src/math/exhaustive/sinhf_test.cpp (revision b6bc9d72f65a5086f310f321e969d96e9a559e75)
1a7f55f08SKirill Okhotnikov //===-- Exhaustive test for sinhf -----------------------------------------===//
2a7f55f08SKirill Okhotnikov //
3a7f55f08SKirill Okhotnikov // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4a7f55f08SKirill Okhotnikov // See https://llvm.org/LICENSE.txt for license information.
5a7f55f08SKirill Okhotnikov // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6a7f55f08SKirill Okhotnikov //
7a7f55f08SKirill Okhotnikov //===----------------------------------------------------------------------===//
8a7f55f08SKirill Okhotnikov 
9a7f55f08SKirill Okhotnikov #include "exhaustive_test.h"
10a7f55f08SKirill Okhotnikov #include "src/math/sinhf.h"
11a7f55f08SKirill Okhotnikov #include "utils/MPFRWrapper/MPFRUtils.h"
12a7f55f08SKirill Okhotnikov 
13*b6bc9d72SGuillaume Chatelet namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
14a7f55f08SKirill Okhotnikov 
159532074aSTue Ly using LlvmLibcSinhfExhaustiveTest =
169532074aSTue Ly     LlvmLibcUnaryOpExhaustiveMathTest<float, mpfr::Operation::Sinh,
17*b6bc9d72SGuillaume Chatelet                                       LIBC_NAMESPACE::sinhf>;
18a7f55f08SKirill Okhotnikov 
199532074aSTue Ly // Range: [0, Inf];
20a7f55f08SKirill Okhotnikov static constexpr uint32_t POS_START = 0x0000'0000U;
219532074aSTue Ly static constexpr uint32_t POS_STOP = 0x7f80'0000U;
22a7f55f08SKirill Okhotnikov 
TEST_F(LlvmLibcSinhfExhaustiveTest,PostiveRange)239532074aSTue Ly TEST_F(LlvmLibcSinhfExhaustiveTest, PostiveRange) {
249532074aSTue Ly   test_full_range_all_roundings(POS_START, POS_STOP);
25a7f55f08SKirill Okhotnikov }
26a7f55f08SKirill Okhotnikov 
279532074aSTue Ly // Range: [-Inf, 0];
289532074aSTue Ly static constexpr uint32_t NEG_START = 0xb000'0000U;
299532074aSTue Ly static constexpr uint32_t NEG_STOP = 0xff80'0000U;
30a7f55f08SKirill Okhotnikov 
TEST_F(LlvmLibcSinhfExhaustiveTest,NegativeRange)319532074aSTue Ly TEST_F(LlvmLibcSinhfExhaustiveTest, NegativeRange) {
329532074aSTue Ly   test_full_range_all_roundings(NEG_START, NEG_STOP);
33a7f55f08SKirill Okhotnikov }
34