Function: bnfisintnorm
Section: number_fields
C-Name: bnfisintnorm0
Prototype: GGD0,L,
Help: bnfisintnorm(bnf,x,{flag=0}): compute a complete system of solutions (modulo
 units of positive norm) of the absolute norm equation N(a)=x, where a
 belongs to the maximal order of big number field bnf (if bnf is not
 certified, this depends on GRH). If (optional) flag is set, allow returning
 solutions in factored form.
Doc: computes a complete system of
 solutions (modulo units of positive norm) of the absolute norm equation
 $\Norm(a)=x$,
 where $a$ is an integer in $\var{bnf}$. If $\var{bnf}$ has not been certified,
 the correctness of the result depends on the validity of \idx{GRH}.
 If (optional) flag is set, allow returning solutions in factored form, which
 helps a lot when the fundamental units are large (equivalently, when \kbd{bnf.reg}
 is large); having an exact algebraic $\var{bnf}$ from \kbd{bnfinit(,1)} is
 necessary in this case, else setting the flag will mostly be a no-op.

 \bprog
 ? bnf = bnfinit(x^4-2, 1);
 ? bnfisintnorm(bnf,7)
 %2 = [-x^2 + x - 1, x^2 + x + 1]
 ? bnfisintnorm(bnf,-7)
 %3 = [-x^3 - 1, x^3 + 2*x^2 + 2*x + 1]

 ? bnf = bnfinit(x^2-2305843005992468481, 1);
 ? bnfisintnorm(bnf, 2305843008139952128)
   \\ stack overflow with 100GB parisize
 ? bnf.reg \\ fundamental unit is huge
 %6 = 14054016.227457155120413774802385952043

 ? v = bnfisintnorm(bnf, 2305843008139952128, 1); #v
 %7 = 31   \\ succeeds instantly
 ? s = v[1]; [type(s), matsize(s)]
 %8 = ["t_MAT", [165, 2]]   \\ solution 1 is a product of 165 factors
 ? exponent(s[,2])
 %9 = 105
 @eprog\noindent The \emph{exponents} have $105$ bits, so there is indeed little
 hope of writing down the solutions in expanded form.

 See also \tet{bnfisnorm}.
Variant: The function \fun{GEN}{bnfisintnormabs0}{GEN bnf, GEN a, long flag},
 where \kbd{bnf} is a true \var{bnf} structure,
 returns a complete system of solutions modulo units of the absolute norm
 equation $|\Norm(x)| = |a|$. As fast as \kbd{bnfisintnorm}, but solves
 the two equations $\Norm(x) = \pm a$ simultaneously. The functions
 \fun{GEN}{bnfisintnormabs}{GEN bnf, GEN a},
 \fun{GEN}{bnfisintnorm}{GEN bnf, GEN a} correspond to $\fl = 0$.
