blob: 23420edcd0ca1ab47b55f75c9569f8c7523bf3df [file] [log] [blame]
//===-- Unittests for supfuncf --------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "in_float_range_test_helper.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/math/generic/inv_trigf_utils.h"
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
#include <math.h>
using LlvmLibcAtanfTest = LIBC_NAMESPACE::testing::FPTest<float>;
namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
constexpr int def_count = 100003;
constexpr float def_prec = 0.500001f;
auto f_normal = [](float x) -> bool { return !(isnan(x) || isinf(x)); };
TEST_F(LlvmLibcAtanfTest, InPositiveRange) {
CHECK_DATA(0.0f, inf, mpfr::Operation::Atan, LIBC_NAMESPACE::atan_eval,
f_normal, def_count, def_prec);
}
TEST_F(LlvmLibcAtanfTest, InNegativeRange) {
CHECK_DATA(-0.0f, neg_inf, mpfr::Operation::Atan, LIBC_NAMESPACE::atan_eval,
f_normal, def_count, def_prec);
}