\\check computed values against values computed with magma, and some integer values
\\Height of roots of unity must be zero (Kronecker's theorem)
f=polcyclo(23); K=nfinit(f); a=Mod(x, f);
nfweilheight(K, vector(8,i,x^random(22))) < 1.E-30

\\computed value
f = x^5 + 5*x^4 - 5*x^2 + 10*x - 9; K = nfinit(f);
b = x/23 + 1; c = 13; d = 2*x^2 + x/5 + 1/3; e = 1/13;
nfweilheight(K, [x, b, c, d, e])-11.2110562747564085637132907074 < 1.E-25
nfweilheight(K, [x, x, x, x]) < 1.E-28

\\ on coprime integers the height is equal to log(max(abs)), and is
\\ independent of the field
nfweilheight(K, [13, -101, 17, 2, 4, random(100)]) - log(101) < 1.E-28

\\another computed value
f = x^9 - 2083331363; K2 = nfinit(f);
b = x/23 +1; c = 13; d = 2*x^2+ x/5 + 1/3; e = 1/13;
nfweilheight(K2, [x, b, c, d, e])-13.8699151920009083492877110288 < 1.E-25

\\same testing as before, but on a different field
nfweilheight(K2, [x, x, x, x]) < 1.E-28
nfweilheight(K2, [13, -101, 17, 2, 4, random(100)]) - log(101) < 1.E-25

\\more computed values
f=x^7 - 8*x - 305; K=nfinit(f);
b = x+1; c = x^4 - 2/17; d = 2*x^2+ x/5 + 1/3; e = 0;
nfweilheight(K, [x, b, c, d, e]) - 8.58009410222389340649418534729 < 1.E-25

f = x^7 + 7 * x^6 - 7* x^5 + 3* x^4 + 8*x^3 - 9* x^2 - 2*x - 5; K=nfinit(f);
a=[1/75, -2/19, 1/17, 2/77, 1/26, 2/85, -1/72]~;
b=[-3/71, -1/2, 1/18, -1/32, 1/5, 1/67, -1/77]~;
c=[1/10, 1/9, -1/75, -1/51, -2/85, -1/69, 0]~;
d=[1/86, -2/11, 1/92, 1/17, -1/69, -2/7, -1/10]~;
nfweilheight(K, [a, b, c, d])-38.3423241063701442282800571406 < 1.E-25

\\more testing with integer entries
nfweilheight(K, [-1009, 2, 4*random(100), random(1000), random(1000)]) - log(1009) < 1.E-28
nfweilheight(K, [1997, 2, 4*random(100), random(1000), random(1000)]) - log(1997) < 1.E-28
nfweilheight(K, [1009, 2, 4*random(100), random(1000), random(1000)]) - log(1009) < 1.E-28
