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

inconsistent interval evaluation of pFq #24355

Open
mezzarobba opened this issue Dec 9, 2017 · 4 comments
Open

inconsistent interval evaluation of pFq #24355

mezzarobba opened this issue Dec 9, 2017 · 4 comments

Comments

@mezzarobba
Copy link
Member

Add support for conversion of the hypergeometric symbolic function to ball fields, e.g.

sage: foo = 1/4*hypergeometric((1, 1, 1, 1, 1), (3/2, 2, 2, 2), 1/8)
sage: RBF(foo)

CC: @deinst

Component: numerical

Issue created by migration from https://trac.sagemath.org/ticket/24355

@mezzarobba mezzarobba added this to the sage-8.2 milestone Dec 9, 2017
@fredrik-johansson
Copy link

comment:1

The balls are suspiciously precise. It looks like it's going through RealField:

sage: RealBallField(53)(RealField(53)(foo))
[0.2526850273732758 +/- 5.66e-18]
sage: RealBallField(100)(RealField(100)(foo))
[0.2526850273732758327317762593029 +/- 4.32e-32]

@deinst
Copy link
Contributor

deinst commented Aug 23, 2018

comment:2

The underlying problem here is in the RBF element_constructor the coercion attempts are something like

  1. Try to convert directly to a RealBall
  2. Try to convert to a pyobject, then to a RealBall
  3. Try to convert the operands of the object to RealBalls, then apply the operator to them to compute the RealBall
  4. Drop back and compute the value as an element of RealIntervalField then convert to a RealBall

In this case step 3 goes horribly wrong because the first operand of hypergeometric((1, 1, 1, 1, 1), (3/2, 2, 2, 2), 1/8) is a tuple and any attempt to convert it to a RealBall is doomed to failure. This coupled with the fact that the RealBall field does not implement the hypergeometric functions (connecting arb_hypgeom_pfq to RealBall seems straightforward, but connecting that somehow to symbolic.expression seems problematic).

Which basically means that this is all over my head.

The fact that step 4 succeeds but gives an incorrect answer suggests that there are similar problems with RIF.

@mezzarobba
Copy link
Member Author

Replying to @mezzarobba:

sage: foo = 1/4*hypergeometric((1, 1, 1, 1, 1), (3/2, 2, 2, 2), 1/8)
sage: a = RBF(foo); a
[0.2526850273732758 +/- 5.66e-18]
sage: b = RealBallField(100)(foo); b
[0.2526850273732758327317762593029 +/- 4.32e-32]
sage: a.overlaps(b)
False

This doesn't happen with python-flint and the last version of arb: it may either be a sage-specific issue or a bug in the version of arb that sage is using.

Now fixed by making the conversion raise an error, probably in #28517 or one of its dependencies. It may still be nice to implement the correct conversion.

@mezzarobba

This comment has been minimized.

@mezzarobba mezzarobba removed this from the sage-8.2 milestone Sep 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants