Opened 6 years ago

Closed 6 years ago

#17786 closed enhancement (fixed)

Make RealBallField useful

Reported by: mmezzarobba Owned by:
Priority: major Milestone: sage-6.5
Component: numerical Keywords:
Cc: Merged in:
Authors: Marc Mezzarobba Reviewers: Fredrik Johansson
Report Upstream: N/A Work issues:
Branch: 37bcb77 (Commits) Commit: 37bcb77a5b3400d59f57c2b4837bfb9bbdac1335
Dependencies: Stopgaps:

Description (last modified by mmezzarobba)

After #17194, implement more comprehensive Arb bindings as part of RealBallField/RealBall.

Change History (31)

comment:1 follow-up: Changed 6 years ago by fredrik.johansson

Regarding the "What is going on?!" comment: transcendental functions are not quite deterministic due to internal caches. In this case, doing something that results in an internal recomputation of log(2) to higher precision leads to a slightly more accurate value later on.

This is something that I could fix with a bit of effort.

In any case, output could also change slightly between versions due to changes in algorithms. That's an inherent drawback of doing doctests this way...

comment:2 in reply to: ↑ 1 Changed 6 years ago by mmezzarobba

Replying to fredrik.johansson:

Regarding the "What is going on?!" comment: transcendental functions are not quite deterministic due to internal caches. In this case, doing something that results in an internal recomputation of log(2) to higher precision leads to a slightly more accurate value later on.

Good to know, I wasn't aware of that.

This is something that I could fix with a bit of effort.

Unless you have other users that need it, I don't think it is worth the effort.

In any case, output could also change slightly between versions due to changes in algorithms. That's an inherent drawback of doing doctests this way...

Yes. But I thought I'd first go with a version that tested the exact output, and we could always make something more sophisticated later on if some of the outputs really changed.

Thanks for your comments!

comment:3 follow-up: Changed 6 years ago by cheuberg

Two remarks:

  • Shouldn't we use bint for those C functions returning an integer which is meant as a boolean? In that case, bool could be omitted in the Python methods.
  • Should we really expose a function is_nonzero? We have to implement __nonzero__ anyway.
Last edited 6 years ago by cheuberg (previous) (diff)

comment:4 in reply to: ↑ 3 ; follow-up: Changed 6 years ago by mmezzarobba

Replying to cheuberg:

Two remarks:

  • Shouldn't we use bint for those C functions returning an integer which is meant as a boolean? In that case, bool could be omitted in the Python methods.

Yes, indeed, thanks. I just copied the C prototypes without thinking...

  • Should we really expose a function is_nonzero? We have to implement nonzero anyway.

RIF intervals implement __nonzero__ with the meaning of "not exactly zero". So I think we need both if we want to stay compatible with them. But then I'm not sure doing things that way in RIF was the wisest choice in the first place...

comment:5 in reply to: ↑ 4 Changed 6 years ago by cheuberg

Replying to mmezzarobba:

Replying to cheuberg:

  • Should we really expose a function is_nonzero? We have to implement __nonzero__ anyway.

RIF intervals implement __nonzero__ with the meaning of "not exactly zero". So I think we need both if we want to stay compatible with them. But then I'm not sure doing things that way in RIF was the wisest choice in the first place...

I think we should not have methods __nonzero__ and is_nonzero with different behaviour.

comment:6 Changed 6 years ago by cheuberg

  • Work issues set to Merge 17194, 17811 and rewrite doctest

#17194 needs to be merged. It would be good to merge #17811 and to replace its doctest by a simpler variant using the arithmetic operations introduced here.

Last edited 6 years ago by cheuberg (previous) (diff)

comment:7 Changed 6 years ago by git

  • Commit changed from 21bee7d9121ad93cf16c83a579e0b72e8b094c8f to 2eec53af0d5d150d8094d69f9a7b4622536dddd2

Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:

760e2e2RBF: separate conversions from initialization of elements
464c601RealBall: def accuracy
e3453cerst syntax fixes
624a609RBF: more conversions
26d4130RealBall: better error handling
ef6d130RealBall: simple predicates
dd15270RealBall: more comparisons
d1c6169RealBall: contains()
b54dd6cRealBall: sqrt and friends
2eec53aRealBall: elementary functions

comment:8 Changed 6 years ago by git

  • Commit changed from 2eec53af0d5d150d8094d69f9a7b4622536dddd2 to 0b34a7acf6ede56b2a8651ff028a383189fdafdb

Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:

fae4e89RBF: separate conversions from initialization of elements
01af6a9RealBall: def accuracy
b1d45darst syntax fixes
0101f43RBF: more conversions
cd8b230RealBall: better error handling
6ff081aRealBall: simple predicates
1af1a53RealBall: more comparisons
5e00b8dRealBall: contains()
b76df7fRealBall: sqrt and friends
0b34a7aRealBall: elementary functions

comment:9 Changed 6 years ago by git

  • Commit changed from 0b34a7acf6ede56b2a8651ff028a383189fdafdb to 1c8de124aea47b28f8008b635b67bd1be6e6e8da

Branch pushed to git repo; I updated commit sha1. New commits:

2f2e95eRealBall: "return nonzero" → "return True" (for consistency)
d65e84eRealBall: rename arc-trig functions
ca2f5f9RealBall: adapt tests do deal with nondeterministic output
1c8de12RealBall: minor changes to docstrings and comments

comment:10 Changed 6 years ago by fredrik.johansson

  • Branch changed from u/mmezzarobba/arb to u/fredrik.johansson/arb

comment:11 Changed 6 years ago by mmezzarobba

  • Branch changed from u/fredrik.johansson/arb to u/mmezzarobba/arb
  • Commit changed from 1c8de124aea47b28f8008b635b67bd1be6e6e8da to 54340f04edb578d912d334e282dad3fee764b0df

Last 10 new commits:

b518474RealBall: contains()
d28e6c2RealBall: sqrt and friends
8ea7a07RealBall: elementary functions
39c7c96RealBall: "return nonzero" → "return True" (for consistency)
17bf841RealBall: rename arc-trig functions
f8e2db9RealBall: adapt tests do deal with nondeterministic output
71a82e7RealBall: minor changes to docstrings and comments
9732629RealBall: fix comparisons involving special values
91591bfRealBall: some special functions
54340f0RealBallField: some ball function of non-ball arguments

comment:12 Changed 6 years ago by git

  • Commit changed from 54340f04edb578d912d334e282dad3fee764b0df to 9ab0759673e0045ef177094738181923c004d0e2

Branch pushed to git repo; I updated commit sha1. New commits:

9ab0759RealBall: polylogs

comment:13 Changed 6 years ago by git

  • Commit changed from 9ab0759673e0045ef177094738181923c004d0e2 to 6d44ccb8cc6c69f367a81abc299d5911c7775fff

Branch pushed to git repo; I updated commit sha1. New commits:

6d44ccbRealBall: more functions

comment:14 Changed 6 years ago by git

  • Commit changed from 6d44ccb8cc6c69f367a81abc299d5911c7775fff to 5a14202e18c28f83f5e53c84b43177df9f709d28

Branch pushed to git repo; I updated commit sha1. New commits:

5a14202RealBall: changing my mind about nan1 == nan2 when nan1 is nan2

comment:15 Changed 6 years ago by git

  • Commit changed from 5a14202e18c28f83f5e53c84b43177df9f709d28 to 5d130269266ab1b5a34dd7d367db43fef79266ba

Branch pushed to git repo; I updated commit sha1. New commits:

f5ed6b1RealBallField: misc Parent stuff
5d13026RealBall: TODO

comment:16 Changed 6 years ago by git

  • Commit changed from 5d130269266ab1b5a34dd7d367db43fef79266ba to 528fcdac02477616d131901093904b9a09fbd8cf

Branch pushed to git repo; I updated commit sha1. New commits:

528fcdaRealBall: mid, rad as balls

comment:17 Changed 6 years ago by git

  • Commit changed from 528fcdac02477616d131901093904b9a09fbd8cf to 6808761e9f1a8c8102e4c056962b2ad1e6f62e7d

Branch pushed to git repo; I updated commit sha1. New commits:

6808761RealBall: fix an incorrect statement copied from the arb documentation

comment:18 Changed 6 years ago by git

  • Commit changed from 6808761e9f1a8c8102e4c056962b2ad1e6f62e7d to 7f24576daa5c11054628a48524a1706c2b9c47f3

Branch pushed to git repo; I updated commit sha1. New commits:

7f24576RealBall: remove duplicate methods introduced by mistake

comment:19 Changed 6 years ago by git

  • Commit changed from 7f24576daa5c11054628a48524a1706c2b9c47f3 to 4eed560a6ed5a94ba0c1af2121f3700fe41f5641

Branch pushed to git repo; I updated commit sha1. New commits:

b952f49RealBall: comparisons with symbolic ±∞
4eed560RealBall: floor(), ceil()

comment:20 Changed 6 years ago by git

  • Commit changed from 4eed560a6ed5a94ba0c1af2121f3700fe41f5641 to 28d63d8ae38d4fecc3a0a9494c52845e1de888e9

Branch pushed to git repo; I updated commit sha1. New commits:

28d63d8RealBall: allow RealNumbers as radii

comment:21 Changed 6 years ago by git

  • Commit changed from 28d63d8ae38d4fecc3a0a9494c52845e1de888e9 to 19aee15d61e55cfbf83f2de57b15e5b85c0f9d6b

Branch pushed to git repo; I updated commit sha1. New commits:

b8036f2real_arb: let's no longer call the bindings elementary :-)
19aee15Fix coercion RBF → InfinityRing when arb is not installed

comment:22 Changed 6 years ago by git

  • Commit changed from 19aee15d61e55cfbf83f2de57b15e5b85c0f9d6b to 88d770d73009a73c581d59bc0393e11cae82d7fe

Branch pushed to git repo; I updated commit sha1. New commits:

88d770dreal_arb: rst syntax fixes

comment:23 Changed 6 years ago by git

  • Commit changed from 88d770d73009a73c581d59bc0393e11cae82d7fe to 0f675137a1116ae7d9901332e0e54fc0837c332f

Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:

edf95abRealBall: mid, rad as balls
9469ce3RealBall: fix an incorrect statement copied from the arb documentation
5183126RealBall: remove duplicate methods introduced by mistake
8c1df6bRealBall: comparisons with symbolic ±∞
be93dbaRealBall: floor(), ceil()
36801c6RealBall: allow RealNumbers as radii
9e06ccereal_arb: let's no longer call the bindings elementary :-)
a6d68c6Fix coercion RBF → InfinityRing when arb is not installed
4046200real_arb: rst syntax fixes
0f67513real_arb: mark all tests as optional

comment:24 Changed 6 years ago by git

  • Commit changed from 0f675137a1116ae7d9901332e0e54fc0837c332f to 2dd40b7a5aea1a4b035fad857cf54486e3eb7911

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

1c6aa0cRealBall: improve conversion to MPFI intervals
2dd40b7real_arb: mark all tests as optional

comment:25 Changed 6 years ago by mmezzarobba

  • Authors set to Marc Mezzarobba
  • Component changed from basic arithmetic to numerical
  • Description modified (diff)
  • Status changed from new to needs_review
  • Work issues Merge 17194, 17811 and rewrite doctest deleted

comment:26 Changed 6 years ago by git

  • Commit changed from 2dd40b7a5aea1a4b035fad857cf54486e3eb7911 to 37bcb77a5b3400d59f57c2b4837bfb9bbdac1335

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

760c2d5real_arb: let's no longer call the bindings rudimentary :-)
91dddf9Fix coercion RBF → InfinityRing when arb is not installed
b4f922breal_arb: rst syntax fixes
1134261RealBall: improve conversion to MPFI intervals
441f1c4RealBall: remove superfluous bool() added back by mistake
37bcb77real_arb: mark all tests as optional

comment:27 Changed 6 years ago by fredrik.johansson

  • Reviewers set to fredrik.johansson
  • Status changed from needs_review to positive_review

Looks good to me.

Btw, I'm unable to build the reference manual, but this is presumably some problem with my Sage install and unrelated to this ticket.

comment:28 Changed 6 years ago by mmezzarobba

Thanks for the review!

comment:29 Changed 6 years ago by vbraun

  • Status changed from positive_review to needs_work

Reviewer name is supposed to be the real name, not the trac account name

comment:30 Changed 6 years ago by fredrik.johansson

  • Reviewers changed from fredrik.johansson to Fredrik Johansson
  • Status changed from needs_work to positive_review

comment:31 Changed 6 years ago by vbraun

  • Branch changed from u/mmezzarobba/arb to 37bcb77a5b3400d59f57c2b4837bfb9bbdac1335
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.