Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precision fixes for some code dealing with ArbField/AcbField #1707

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

fingolfin
Copy link
Member

Fixes #1580 reported by @fredrik-johansson which was introduced by PR #1367 resp. commit eefcf5b.

I am not quite sure if the test I added is "right" to verify we get the desired precision, if someone can suggest a better methods, I'd be obliged. (I don't quite understand why radius(y) suggest a precision of about 1e-113 while the printing says ... +/- 1.79e-101 -- I wanted to check the latter, which nicely patches $\log_{10}(2^{333})$ but couldn't find a good way).

I also fixed a few other things in the same PR but did not add any tests for them.

Moreover, a few of the changed functions should probably get variants for RealField and ComplexField..

@thofma
Copy link
Member

thofma commented Apr 5, 2024

In Hecke we wrapped

function radiuslttwopower(x::ArbFieldElem, e::Int)
  GC.@preserve x begin
    t = ccall((:arb_rad_ptr, libarb), Ptr{Nemo.mag_struct}, (Ref{ArbFieldElem}, ), x)
    b = ccall((:mag_cmp_2exp_si, libarb), Cint,
            (Ptr{Nemo.mag_struct}, Int), t, e) <= 0
  end
  return b
end

which tests whether the radius is less than $2^e$.

@fingolfin

This comment was marked as resolved.

@fingolfin

This comment was marked as resolved.

@fingolfin

This comment was marked as resolved.

Copy link

codecov bot commented Apr 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.75%. Comparing base (f033978) to head (9602602).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1707   +/-   ##
=======================================
  Coverage   84.74%   84.75%           
=======================================
  Files          94       94           
  Lines       37205    37204    -1     
=======================================
+ Hits        31530    31531    +1     
+ Misses       5675     5673    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fingolfin
Copy link
Member Author

Yay, all green

@thofma thofma merged commit 928e06a into Nemocas:master Apr 9, 2024
26 checks passed
@fingolfin fingolfin deleted the mh/fix-arb-precision-bugs branch April 10, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CalciumField -> ArbField ignores precision
2 participants