Function: qfbred
Section: number_theoretical
C-Name: qfbred0
Prototype: GD0,L,DGDGDG
Help: qfbred(x,{flag=0},{D},{isqrtD},{sqrtD}): reduction of the binary
 quadratic form x. All other args. are optional. D, isqrtD and sqrtD, if
 present, supply the values of the discriminant, floor(sqrt(D)) and sqrt(D)
 respectively. If D<0, its value is not used and all references to Shanks's
 distance hereafter are meaningless. flag can be any of 0: default, uses
 Shanks's distance function d; 1: use d, do a single reduction step; 2: do
 not use d; 3: do not use d, single reduction step.
Doc: reduces the binary quadratic form $x$ (updating Shanks's distance function
 if $x$ is indefinite). The binary digits of $\fl$ are toggles meaning

 \quad 1: perform a single \idx{reduction} step

 \quad 2: don't update \idx{Shanks}'s distance

 $D$, \var{isqrtD}, \var{sqrtD}, if present, supply the values of the
 discriminant, $\floor{\sqrt{D}}$, and $\sqrt{D}$ respectively
 (no checking is done of these facts). If $D<0$ these values are useless,
 and all references to Shanks's distance are irrelevant.
Variant: Also available are

 \fun{GEN}{redimag}{GEN x} (for definite $x$),

 \noindent and for indefinite forms:

 \fun{GEN}{redreal}{GEN x}

 \fun{GEN}{rhoreal}{GEN x} (= \kbd{qfbred(x,1)}),

 \fun{GEN}{redrealnod}{GEN x, GEN isqrtD} (= \kbd{qfbred(x,2,,isqrtD)}),

 \fun{GEN}{rhorealnod}{GEN x, GEN issqrtD} (= \kbd{qfbred(x,3,,isqrtD)}).
