Skip to content

Commit

Permalink
insucfficient precision in roots
Browse files Browse the repository at this point in the history
  • Loading branch information
fieker committed Oct 13, 2023
1 parent a8db55f commit e4dcefe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/LocalField/Poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ function Hensel_factorization(f::Generic.Poly{T}) where T <: Union{padic, qadic,
H = HenselCtxdr{T}(f, vlfp)
lift(H, precision(f))
for i = 1:H.n
D[ks[i]] = H.lf[i]
D[ks[i]] = setprecision(H.lf[i], precision(f))
end
return D
end
Expand Down
2 changes: 1 addition & 1 deletion src/LocalField/automorphisms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function _roots(f::Generic.Poly{T}) where T <: Union{padic, qadic, LocalFieldEle
g = f(pi*x+r)
g = divexact(g, _content(g))
rtg = roots(g)
rts = elem_type(K)[setprecision(r, precision(y)) + pi*y for y in rtg]
rts = elem_type(K)[setprecision(r, precision(y)+1) + pi*y for y in rtg]
return rts
end

Expand Down
9 changes: 9 additions & 0 deletions test/LocalField/Poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@
@test length(Hecke.slope_factorization(2*x+1)) == 1
end

@testset "Roots" begin
_, t = PadicField(3, 10)["t"]
f = ((t-1+81)*(t-1+2*81))
rt = roots(f)
@test length(rt) == 2
@test rt[1] != rt[2]
@test all(iszero, map(f, rt))
end

@testset "Resultant" begin
R, x = polynomial_ring(PadicField(853, 2), "x")
a = 4*x^5 + x^4 + 256*x^3 + 192*x^2 + 48*x + 4
Expand Down

0 comments on commit e4dcefe

Please sign in to comment.