File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
include/boost/decimal/detail/cmath Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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;
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments