//===-- Range reduction for double precision sin/cos/tan --------*- C++ -*-===// // // 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 // //===----------------------------------------------------------------------===// #ifndef LLVM_LIBC_SRC_MATH_GENERIC_RANGE_REDUCTION_DOUBLE_NOFMA_H #define LLVM_LIBC_SRC_MATH_GENERIC_RANGE_REDUCTION_DOUBLE_NOFMA_H #include "src/__support/FPUtil/FPBits.h" #include "src/__support/FPUtil/double_double.h" #include "src/__support/FPUtil/multiply_add.h" #include "src/__support/FPUtil/nearest_integer.h" #include "src/__support/common.h" #include "src/__support/macros/config.h" #include "src/__support/macros/optimization.h" #include "src/math/generic/range_reduction_double_common.h" namespace LIBC_NAMESPACE_DECL { DoubleDouble; LIBC_INLINE unsigned LargeRangeReduction::fast(double x, DoubleDouble &u) { … } // Lookup table for sin(k * pi / 128) with k = 0, ..., 255. // Table is generated with Sollya as follow: // > display = hexadecimal; // > for k from 0 to 255 do { // a = round(sin(k * pi/128), 51, RN); // b = round(sin(k * pi/128) - a, D, RN); // print("{", b, ",", a, "},"); // }; LIBC_INLINE constexpr DoubleDouble SIN_K_PI_OVER_128[256] = …; } // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_MATH_GENERIC_RANGE_REDUCTION_DOUBLE_NOFMA_H