Skip to content

Commit 49a5605

Browse files
committed
Tighten some tolreances and syntax
1 parent e544227 commit 49a5605

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

include/boost/decimal/detail/cmath/atan.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ constexpr auto atan_impl(T x) noexcept
5151

5252
if (x <= T { 48 })
5353
{
54-
const bool is_smallish { x <= T { 3 } };
54+
// Define small-ish argiments to be less than 39/16.
55+
const bool is_smallish { x <= T { 24375, -4 } };
5556

5657
// The portion of the algorithm for arc-tangent regarding scaling large-valued
5758
// argument is based on Chapter 11, page 194 of Cody and Waite, "Software Manual

include/boost/decimal/detail/cmath/impl/atan_impl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ constexpr auto atan_series<decimal128>(decimal128 x) noexcept
125125
+ x2 * (decimal128 { UINT64_C(5134145876036100) }
126126
+ x2 * (decimal128 { UINT64_C(463911017673180) }
127127
+ x2 * (decimal128 { UINT64_C(16016872057515) }
128-
+ decimal128 { UINT64_C(90194313216) } * x2))))))))
128+
+ x2 * decimal128 { UINT64_C(90194313216) }))))))))
129129
};
130130

131131
const decimal128
@@ -140,7 +140,7 @@ constexpr auto atan_series<decimal128>(decimal128 x) noexcept
140140
+ x2 * (decimal128 { UINT64_C(10819658401051500) }
141141
+ x2 * (decimal128 { UINT64_C(1298359008126180) }
142142
+ x2 * (decimal128 { UINT64_C(70562989572075) }
143-
+ decimal128 { UINT64_C(1120047453525) } * x2))))))))
143+
+ x2 * decimal128 { UINT64_C(1120047453525) }))))))))
144144
};
145145

146146
return (x * top) / bot;

test/test_atan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ int main()
380380
spot_test(0.181179F);
381381

382382
{
383-
const auto result_pos128_is_ok = local::test_atan_128(800'000);
383+
const auto result_pos128_is_ok = local::test_atan_128(600'000);
384384

385385
BOOST_TEST(result_pos128_is_ok);
386386
}

0 commit comments

Comments
 (0)