ELC in dev
ELC-lang
载入中...
搜索中...
未找到
elc::defs::base::magic_number::π_with_ε_impl_t< T > 模板结构体 参考

Public 成员函数

constexpr π_with_ε_impl_t () noexcept
 
constexprtake_value () noexcept
 
constexpr void do_base_iteration () noexcept
 
constexpr void do_sqrt_iteration () noexcept
 
constexpr void do_iteration () noexcept
 
constexpr void clean_up () noexcept
 
constexproperator() () noexcept
 
constexproperator() (ufloat_t new_ε) noexcept
 

详细描述

template<unsigned_big_float_type T>
struct elc::defs::base::magic_number::π_with_ε_impl_t< T >

在文件 all_defs.cpp5334 行定义.

构造及析构函数说明

◆ π_with_ε_impl_t()

template<unsigned_big_float_type T>
constexpr elc::defs::base::magic_number::π_with_ε_impl_t< T >::π_with_ε_impl_t ( )
inlineconstexprnoexcept

在文件 all_defs.cpp5358 行定义.

5358{}

成员函数说明

◆ clean_up()

template<unsigned_big_float_type T>
constexpr void elc::defs::base::magic_number::π_with_ε_impl_t< T >::clean_up ( )
inlineconstexprnoexcept

在文件 all_defs.cpp5387 行定义.

5387 {
5388 simplify(sqrt_640320);
5389 simplify(result);
5390 }
constexpr T down_cast(U a) noexcept
向下转型至
函数调用图:

◆ do_base_iteration()

template<unsigned_big_float_type T>
constexpr void elc::defs::base::magic_number::π_with_ε_impl_t< T >::do_base_iteration ( )
inlineconstexprnoexcept

在文件 all_defs.cpp5362 行定义.

5362 {
5363 sum = copy_as_negative(ufloat_t
5364 ( _545140134k_p13591409 * _6k_factorial )
5365 / //= --------------------------------------------------------
5366 ( _3k_factorial*k_factorial_pow_3 * _640320_pow_3kplus1 )
5367 ,sign);
5368 for times(3) _3k_factorial *= ++_3k;
5369 for times(6) _6k_factorial *= ++_6k;
5370 k_factorial_pow_3 *= pow<uint_t>(++k,3u);
5371 _545140134k_p13591409 += 545140134u;
5372 _640320_pow_3kplus1 *= _640320pow3;
5373 sign = !sign;
5374
5375 result += sum;
5376 base_accurate += 14;
5377 }
#define times(...)
Definition all_defs.cpp:544
constexpr auto copy_as_negative(Arg_t x, bool negative=1) noexcept
函数调用图:
这是这个函数的调用关系图:

◆ do_iteration()

template<unsigned_big_float_type T>
constexpr void elc::defs::base::magic_number::π_with_ε_impl_t< T >::do_iteration ( )
inlineconstexprnoexcept

在文件 all_defs.cpp5382 行定义.

5382 {
5384 if(base_accurate && (base_accurate-8) >> sqrt_accuracy_multiplier)
5386 }
函数调用图:

◆ do_sqrt_iteration()

template<unsigned_big_float_type T>
constexpr void elc::defs::base::magic_number::π_with_ε_impl_t< T >::do_sqrt_iteration ( )
inlineconstexprnoexcept

在文件 all_defs.cpp5378 行定义.

5378 {
5379 sqrt_640320=sqrt_iteration(sqrt_640320,640320u);
5380 sqrt_accuracy_multiplier++;
5381 }
constexpr T sqrt_iteration(const T &num, const U &v) noexcept
这是这个函数的调用关系图:

◆ operator()() [1/2]

template<unsigned_big_float_type T>
constexpr T elc::defs::base::magic_number::π_with_ε_impl_t< T >::operator() ( )
inlineconstexprnoexcept

在文件 all_defs.cpp5391 行定义.

5391 {
5392 if(!base_accurate)do_base_iteration();
5393 return take_value();
5394 }
函数调用图:

◆ operator()() [2/2]

template<unsigned_big_float_type T>
constexpr T elc::defs::base::magic_number::π_with_ε_impl_t< T >::operator() ( ufloat_t  new_ε)
inlineconstexprnoexcept

在文件 all_defs.cpp5395 行定义.

5395 {
5396 if(new_ε < ε){
5397 if(sqrt_640320_ε_saver>new_ε)//ε变小了,我们需要重新计算sqrt_640320
5398 sqrt_640320=sqrt_to_new_ε(sqrt_640320,640320u,new_ε,sqrt_640320_ε_saver);
5399 //更新ε.
5400 ε = move(new_ε);
5401 while (abs(sum) > ε)
5403 }
5404 return take_value();
5405 }
constexpr T sqrt_to_new_ε(T num, const U &v, const to_unsigned_t< T > &ε, to_unsigned_t< T > &ε_saver) noexcept
constexpr auto abs(const T &v) noexcept
constexpr struct elc::defs::memory::lifetime_n::move_t move
函数调用图:

◆ take_value()

template<unsigned_big_float_type T>
constexpr T elc::defs::base::magic_number::π_with_ε_impl_t< T >::take_value ( )
inlineconstexprnoexcept

在文件 all_defs.cpp5359 行定义.

5359 {
5360 return reciprocal(12u*abs(base_accurate?result:21u)/sqrt_640320);
5361 }
constexpr auto reciprocal(const T &x) noexcept
这是这个函数的调用关系图:

该结构体的文档由以下文件生成: