|
algebramix_doc 0.3
|
#include <p_adic.hpp>
Definition at line 134 of file p_adic.hpp.
| static series<M,V> binpow_no_tangent_normalized | ( | const series< M, V > & | x0, |
| const series< M, V > & | x1, | ||
| const integer & | r, | ||
| const integer & | p | ||
| ) | [inline, static] |
Definition at line 138 of file p_adic.hpp.
References mmx::coefficients(), default_p_expansion, mmx::lshiftz(), M, mmx::rshiftz(), Series, and mmx::square().
Referenced by ser_carry_pth_root_reg_op::def().
{
// ((x0 + p * x1)^r - r * p * x1 * x0^(r-1) - x0^r) / p^2
// x1 has valuation at least 1
ASSERT (p >= 3, "bug");
if (r <= 1) return Series (0);
Series x1_2= lshiftz (square (rshiftz (x1, 1)), 2);
if (r == 2) return x1_2;
Series s_p (coefficients (as<default_p_expansion(M)> (p)));
if ((r & 1) == 1) {
integer h= r - 1;
Series w= binpow_no_tangent_normalized (x0, x1, h, p);
Series s_h (coefficients (as<default_p_expansion(M)> (h)));
Series x0_h_1= binpow (x0, h - 1);
return lshiftz ((x0 + s_p * x1) * rshiftz (w, 1), 1)
+ s_h * x0_h_1 * x1_2;
}
integer h= r >> 1; // r is now even
Series s_h (coefficients (as<default_p_expansion(M)> (h)));
Series s_p_2 (coefficients (as<default_p_expansion(M)> (square (p))));
Series x0_h_1= binpow (x0, h - 1);
Series x0_h= x0 * x0_h_1;
Series d= binpow_no_tangent_normalized (x0, x1, h, p);
Series l= s_h * s_p * x0_h_1 * x1 + x0_h;
return lshiftz (rshiftz (d, 1) * (s_p_2 * d + l + l), 1)
+ square (s_h * x0_h_1) * x1_2;
}
| static series<M,V> def | ( | const series< M, V > & | me, |
| const series< M, V > & | a, | ||
| const pair< integer, integer > & | p_b0 | ||
| ) | [inline, static] |
Definition at line 194 of file p_adic.hpp.
References ser_carry_pth_root_reg_op::binpow_no_tangent_normalized(), mmx::coefficients(), default_p_expansion, mmx::lshiftz(), M, mmx::rshiftz(), Series, and mmx::square().
{
integer p= first (p_b0); integer b0= second (p_b0);
integer q= as<integer> (* M::get_modulus ());
Series ser_p (coefficients (as<default_p_expansion(M)> (p)));
if (p == 2)
return (a - me[0] - ser_p
* (square (Series (me[0]))
+ lshiftz (square (rshiftz (me, 1)), 2)))
/ (M(1) + square (ser_p) * me[0]);
Series tmp= binpow (Series (M(b0) + ser_p * me[0]), p)
- binpow (Series (M(b0)), p);
tmp= q == p ? rshiftz (tmp, 2): rshiftz (M (q / square (p)) * tmp, 1);
Series ap= a - tmp;
Series c= M (b0) + ser_p * me[0];
return (ap - binpow_no_tangent_normalized (c, me - me[0], p, p))
/ binpow (c, p - 1); }
| static generic name | ( | ) | [inline, static] |
Definition at line 171 of file p_adic.hpp.
{ return "pth_root"; }
| static nat nr_init | ( | ) | [inline, static] |
Definition at line 191 of file p_adic.hpp.
{ return 1; }
| static M op | ( | const M & | a, |
| const pair< integer, integer > & | p | ||
| ) | [inline, static] |
Definition at line 174 of file p_adic.hpp.
{
(void) p; return a; }
| static series<M,V> op | ( | const series< M, V > & | a, |
| const pair< integer, integer > & | p | ||
| ) | [inline, static] |
Definition at line 178 of file p_adic.hpp.
{
typedef implementation<series_pth_root_reg,V> Ser;
return Ser::unsep_root_reg (a, p); }
| static syntactic op | ( | const syntactic & | a, |
| const syntactic & | p | ||
| ) | [inline, static] |
Definition at line 188 of file p_adic.hpp.
{
return apply ("pth_root_reg", a, p); }
| static series<M,V> op_init | ( | const series< M, V > & | a, |
| const pair< integer, integer > & | p, | ||
| const M & | init | ||
| ) | [inline, static] |
Definition at line 183 of file p_adic.hpp.
{
typedef implementation<series_pth_root_reg,V> Ser;
return Ser::unsep_root_reg (a, p, init); }