Skip to content

Commit 743625d

Browse files
committed
update pr, test branch against bot
1 parent a543283 commit 743625d

File tree

5 files changed

+16
-18
lines changed

5 files changed

+16
-18
lines changed

libc/config/linux/x86_64/entrypoints.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ if(LIBC_TYPES_HAS_FLOAT16)
667667
libc.src.math.scalblnf16
668668
libc.src.math.scalbnf16
669669
libc.src.math.setpayloadf16
670-
libc.src.math.setpayloadsigf16
670+
libc.src.math.setpayloadsigf16
671671
libc.src.math.sinpif16
672672
libc.src.math.totalorderf16
673673
libc.src.math.totalordermagf16

libc/src/math/generic/sinpif16.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ LLVM_LIBC_FUNCTION(float16, sinpif16, (float16 x)) {
110110
float ysq = y * y;
111111

112112
// Degree-6 minimax even polynomial for sin(y*pi/32)/y generated by Sollya
113-
// with:
114-
// > Q = fpminimax(sin(y*pi/32)/y, [|0, 2, 4, 6|], [|SG...|], [0, 0.5]);
113+
// with: > Q = fpminimax(sin(y*pi/32)/y, [|0, 2, 4, 6|], [|SG...|], [0, 0.5]);
115114
float sin_y = y * fputil::polyeval(ysq, 0x1.921fb6p-4f, -0x1.4aeabcp-13f,
116115
0x1.a03354p-21f, -0x1.ad02d2p-20f);
117116

@@ -120,8 +119,7 @@ LLVM_LIBC_FUNCTION(float16, sinpif16, (float16 x)) {
120119
// sin(x * pi) = sin((k + y) * pi/32)
121120
// = sin_y * cos_k + cos_y * sin_k
122121
// = cos_k * sin_y + sin_k * (1 + cos_y - 1)
123-
// Degree-6 minimax even polynomial for cos(y*pi/32)
124-
// generated by Sollya with:
122+
// Degree-6 minimax even polynomial for cos(y*pi/32) generated by Sollya with:
125123
// > P = fpminimax(cos(y*pi/32), [|0, 2, 4, 6|],[|1, SG...|], [0, 0.5]);
126124
float cosm1_y = ysq * fputil::polyeval(ysq, -0x1.3bd3ccp-8f, 0x1.03a61ap-18f,
127125
0x1.a6f7a2p-29f);

libc/test/src/math/sinpif16_test.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
//===-- Exhaustive test for sinpif16---------------------------------------===//
1+
//===-- Exhaustive test for sinpif16
2+
//---------------------------------------===//
23
//
34
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
45
// See https://llvm.org/LICENSE.txt for license information.
@@ -27,14 +28,14 @@ TEST_F(LlvmLibcSinpif16Test, PositiveRange) {
2728
for (uint16_t v = POS_START; v <= POS_STOP; ++v) {
2829
float16 x = FPBits(v).get_val();
2930
EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Sinpi, x,
30-
LIBC_NAMESPACE::sinpif16(x), 1);
31+
LIBC_NAMESPACE::sinpif16(x), 0.5);
3132
}
3233
}
3334

3435
TEST_F(LlvmLibcSinpif16Test, NegativeRange) {
3536
for (uint16_t v = NEG_START; v <= NEG_STOP; ++v) {
3637
float16 x = FPBits(v).get_val();
3738
EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Sinpi, x,
38-
LIBC_NAMESPACE::sinpif16(x), 1);
39+
LIBC_NAMESPACE::sinpif16(x), 0.5);
3940
}
4041
}

libc/test/src/math/smoke/sinpif16_test.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
7-
//
87
// ===----------------------------------------------------------------------==//
98

109
#include "src/errno/libc_errno.h"
@@ -20,10 +19,10 @@ TEST_F(LlvmLibcSinpif16Test, SpecialNumbers) {
2019
EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::sinpif16(aNaN));
2120
EXPECT_MATH_ERRNO(0);
2221

23-
EXPECT_FP_EQ(0.0f, LIBC_NAMESPACE::sinpif16(0.0f));
22+
EXPECT_FP_EQ(zero, LIBC_NAMESPACE::sinpif16(0.0f));
2423
EXPECT_MATH_ERRNO(0);
2524

26-
EXPECT_FP_EQ(-0.0f, LIBC_NAMESPACE::sinpif16(-0.0f));
25+
EXPECT_FP_EQ(neg_zero, LIBC_NAMESPACE::sinpif16(-0.0f));
2726
EXPECT_MATH_ERRNO(0);
2827

2928
EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::sinpif16(inf));
@@ -34,10 +33,10 @@ TEST_F(LlvmLibcSinpif16Test, SpecialNumbers) {
3433
}
3534

3635
TEST_F(LlvmLibcSinpif16Test, Integers) {
37-
EXPECT_FP_EQ(-0.0, LIBC_NAMESPACE::sinpif16(-0x420));
38-
EXPECT_FP_EQ(-0.0, LIBC_NAMESPACE::sinpif16(-0x1p+10));
39-
EXPECT_FP_EQ(-0.0, LIBC_NAMESPACE::sinpif16(-0x1.4p+14));
40-
EXPECT_FP_EQ(0.0, LIBC_NAMESPACE::sinpif16(0x420));
41-
EXPECT_FP_EQ(0.0, LIBC_NAMESPACE::sinpif16(0x1.cp+15));
42-
EXPECT_FP_EQ(0.0, LIBC_NAMESPACE::sinpif16(0x1.cp+7));
36+
EXPECT_FP_EQ(neg_zero, LIBC_NAMESPACE::sinpif16(-0x420));
37+
EXPECT_FP_EQ(neg_zero, LIBC_NAMESPACE::sinpif16(-0x1p+10));
38+
EXPECT_FP_EQ(neg_zero, LIBC_NAMESPACE::sinpif16(-0x1.4p+14));
39+
EXPECT_FP_EQ(zero, LIBC_NAMESPACE::sinpif16(0x420));
40+
EXPECT_FP_EQ(zero, LIBC_NAMESPACE::sinpif16(0x1.cp+15));
41+
EXPECT_FP_EQ(zero, LIBC_NAMESPACE::sinpif16(0x1.cp+7));
4342
}

libc/utils/MPFRWrapper/MPFRUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ class MPFRNumber {
498498
MPFRNumber value_mul_two(*this);
499499
mpfr_mul_si(value_mul_two.value, value, 2, MPFR_RNDN);
500500

501-
if (mpfr_integer_p(value_mul_two.value) != 0) {
501+
if (mpfr_integer_p(value_mul_two.value)) {
502502
auto d = mpfr_get_si(value, MPFR_RNDD);
503503
mpfr_set_si(result.value, (d & 1) ? -1 : 1, mpfr_rounding);
504504
return result;

0 commit comments

Comments
 (0)