|
LMMP 4.3.0
Lamina High-Precision Arithmetic Library
|
#include "impl/inlines.h"#include "impl/longlong.h"#include "numth/log2_exp2.h"#include "impl/mul_hard.h"#include "lmmp/numth.h"#include "lmmp/lmmpn.h"宏定义 | |
| #define | CBRT_DIVIDE_MIN (0x6000000000000000ull) |
| Copyright (C) 2026 HJimmyK (Jericho Knox) | |
函数 | |
| mp_limb_t | lmmp_cbrt_3_ (mp_limb_t a0, mp_limb_t a1, mp_limb_t a2) |
| 计算算数立方根 floor(cbrt(a0+a1*B+a2*B^2)) | |
| void | lmmp_cbrt_6_ (mp_ptr dst, mp_srcptr numa, mp_size_t na) |
| 计算算术立方根 floor(cbrt([numa,na])) | |
| static void | lmmp_cbrt_6_est_ (mp_ptr r, mp_srcptr numa, mp_size_t n) |
| void | lmmp_cbrt_6_fast_ (mp_ptr restrict dst, mp_ptr restrict numa, mp_ptr restrict tp) |
| static void | lmmp_cbrt_6_fix_ (mp_ptr r, mp_srcptr a, mp_ptr t) |
| static void | lmmp_cube_3_ (mp_ptr restrict dst, mp_limb_t a) |
| static void | lmmp_cube_6_ (mp_ptr restrict t, mp_srcptr restrict r) |
| 计算 [t,6]=[r,2]^3 | |
| static mp_limb_t | lmmp_div3_ (mp_ptr q, mp_srcptr a, mp_size_t n) |
| static mp_limb_t | lmmp_shr64_ (mp_srcptr p, mp_size_t n, uint64_t s) |
| #define CBRT_DIVIDE_MIN (0x6000000000000000ull) |
Copyright (C) 2026 HJimmyK (Jericho Knox)
This file is part of LMMP.
LMMP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library. If not, see https://www.gnu.org/licenses/.
SPDX-License-Identifier: LGPL-3.0-or-later
计算算数立方根 floor(cbrt(a0+a1*B+a2*B^2))
| a0 | 低位 limb |
| a1 | 中位 limb |
| a2 | 高位 limb |
引用了 a0, a1, a2, exp2_fixed_64(), LIMB_BITS, LIMB_MAX, lmmp_cbrt_3_(), lmmp_cmp_(), lmmp_cube_3_(), lmmp_debug_assert, lmmp_div3_(), lmmp_inc, lmmp_limb_bits_, lmmp_param_assert, log2_fixed_64() , 以及 t.
被这些函数引用 lmmp_cbrt_(), lmmp_cbrt_3_(), lmmp_cbrt_6_fast_(), lmmp_cbrt_divide_(), lmmp_invsqrt_newton_() , 以及 TEST_CASE().
计算算术立方根 floor(cbrt([numa,na]))
| dst | 结果指针(2个limb) |
| numa | 被开方数指针 |
| na | 被开方数的 limb 长度 |
引用了 CBRT_DIVIDE_MIN, lmmp_cbrt_6_(), lmmp_cbrt_6_est_(), lmmp_cbrt_6_fast_(), lmmp_cbrt_6_fix_(), lmmp_param_assert, t , 以及 tp.
被这些函数引用 lmmp_cbrt_(), lmmp_cbrt_6_(), lmmp_invcbrt_newton_(), lmmp_invsqrt_newton_() , 以及 TEST_CASE().
引用了 exp2_fixed_128(), LIMB_BITS, LIMB_MAX, lmmp_cbrt_6_est_(), lmmp_div3_(), lmmp_inc, lmmp_limb_bits_, lmmp_shr64_(), log2_fixed_128(), n , 以及 s.
被这些函数引用 lmmp_cbrt_6_() , 以及 lmmp_cbrt_6_est_().
引用了 CBRT_DIVIDE_MIN, lmmp_add_n_(), lmmp_cbrt_3_(), lmmp_cbrt_6_fast_(), lmmp_copy, lmmp_cube_3_(), lmmp_debug_assert, lmmp_dec, lmmp_div3_(), lmmp_div_s_(), lmmp_inc_1, lmmp_mul_1_(), lmmp_mul_basecase_(), lmmp_mullh_, lmmp_param_assert, lmmp_sqr_hard_2_(), lmmp_sub_(), lmmp_sub_n_(), restrict , 以及 tp.
引用了 LIMB_MAX, lmmp_cbrt_6_fix_(), lmmp_cmp_(), lmmp_copy, lmmp_cube_6_(), lmmp_dec , 以及 t.
被这些函数引用 lmmp_cbrt_6_() , 以及 lmmp_cbrt_6_fix_().
计算 [t,6]=[r,2]^3
引用了 lmmp_cube_6_(), lmmp_mul_basecase_(), lmmp_sqr_hard_2_(), restrict , 以及 t.
引用了 _udiv_qrnnd_preinv, lmmp_div3_() , 以及 n.
被这些函数引用 lmmp_cbrt_3_(), lmmp_cbrt_6_est_(), lmmp_cbrt_6_fast_() , 以及 lmmp_div3_().
引用了 lmmp_shr64_(), lo, n , 以及 s.
被这些函数引用 lmmp_cbrt_6_est_(), lmmp_nthroot_(), lmmp_shr64_() , 以及 lmmp_shr64_().