Opened 6 years ago
Closed 6 years ago
#17786 closed enhancement (fixed)
Make RealBallField useful
Reported by:  mmezzarobba  Owned by:  

Priority:  major  Milestone:  sage6.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 )
After #17194, implement more comprehensive Arb bindings as part of RealBallField
/RealBall
.
Change History (31)
comment:1 followup: ↓ 2 Changed 6 years ago by
comment:2 in reply to: ↑ 1 Changed 6 years ago by
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 followup: ↓ 4 Changed 6 years ago by
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.
comment:4 in reply to: ↑ 3 ; followup: ↓ 5 Changed 6 years ago by
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 implementnonzero
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
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 inRIF
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
 Work issues set to Merge 17194, 17811 and rewrite doctest
comment:7 Changed 6 years ago by
 Commit changed from 21bee7d9121ad93cf16c83a579e0b72e8b094c8f to 2eec53af0d5d150d8094d69f9a7b4622536dddd2
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
760e2e2  RBF: separate conversions from initialization of elements

464c601  RealBall: def accuracy

e3453ce  rst syntax fixes

624a609  RBF: more conversions

26d4130  RealBall: better error handling

ef6d130  RealBall: simple predicates

dd15270  RealBall: more comparisons

d1c6169  RealBall: contains()

b54dd6c  RealBall: sqrt and friends

2eec53a  RealBall: elementary functions

comment:8 Changed 6 years ago by
 Commit changed from 2eec53af0d5d150d8094d69f9a7b4622536dddd2 to 0b34a7acf6ede56b2a8651ff028a383189fdafdb
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
fae4e89  RBF: separate conversions from initialization of elements

01af6a9  RealBall: def accuracy

b1d45da  rst syntax fixes

0101f43  RBF: more conversions

cd8b230  RealBall: better error handling

6ff081a  RealBall: simple predicates

1af1a53  RealBall: more comparisons

5e00b8d  RealBall: contains()

b76df7f  RealBall: sqrt and friends

0b34a7a  RealBall: elementary functions

comment:9 Changed 6 years ago by
 Commit changed from 0b34a7acf6ede56b2a8651ff028a383189fdafdb to 1c8de124aea47b28f8008b635b67bd1be6e6e8da
Branch pushed to git repo; I updated commit sha1. New commits:
2f2e95e  RealBall: "return nonzero" → "return True" (for consistency)

d65e84e  RealBall: rename arctrig functions

ca2f5f9  RealBall: adapt tests do deal with nondeterministic output

1c8de12  RealBall: minor changes to docstrings and comments

comment:10 Changed 6 years ago by
 Branch changed from u/mmezzarobba/arb to u/fredrik.johansson/arb
comment:11 Changed 6 years ago by
 Branch changed from u/fredrik.johansson/arb to u/mmezzarobba/arb
 Commit changed from 1c8de124aea47b28f8008b635b67bd1be6e6e8da to 54340f04edb578d912d334e282dad3fee764b0df
Last 10 new commits:
b518474  RealBall: contains()

d28e6c2  RealBall: sqrt and friends

8ea7a07  RealBall: elementary functions

39c7c96  RealBall: "return nonzero" → "return True" (for consistency)

17bf841  RealBall: rename arctrig functions

f8e2db9  RealBall: adapt tests do deal with nondeterministic output

71a82e7  RealBall: minor changes to docstrings and comments

9732629  RealBall: fix comparisons involving special values

91591bf  RealBall: some special functions

54340f0  RealBallField: some ball function of nonball arguments

comment:12 Changed 6 years ago by
 Commit changed from 54340f04edb578d912d334e282dad3fee764b0df to 9ab0759673e0045ef177094738181923c004d0e2
Branch pushed to git repo; I updated commit sha1. New commits:
9ab0759  RealBall: polylogs

comment:13 Changed 6 years ago by
 Commit changed from 9ab0759673e0045ef177094738181923c004d0e2 to 6d44ccb8cc6c69f367a81abc299d5911c7775fff
Branch pushed to git repo; I updated commit sha1. New commits:
6d44ccb  RealBall: more functions

comment:14 Changed 6 years ago by
 Commit changed from 6d44ccb8cc6c69f367a81abc299d5911c7775fff to 5a14202e18c28f83f5e53c84b43177df9f709d28
Branch pushed to git repo; I updated commit sha1. New commits:
5a14202  RealBall: changing my mind about nan1 == nan2 when nan1 is nan2

comment:15 Changed 6 years ago by
 Commit changed from 5a14202e18c28f83f5e53c84b43177df9f709d28 to 5d130269266ab1b5a34dd7d367db43fef79266ba
comment:16 Changed 6 years ago by
 Commit changed from 5d130269266ab1b5a34dd7d367db43fef79266ba to 528fcdac02477616d131901093904b9a09fbd8cf
Branch pushed to git repo; I updated commit sha1. New commits:
528fcda  RealBall: mid, rad as balls

comment:17 Changed 6 years ago by
 Commit changed from 528fcdac02477616d131901093904b9a09fbd8cf to 6808761e9f1a8c8102e4c056962b2ad1e6f62e7d
Branch pushed to git repo; I updated commit sha1. New commits:
6808761  RealBall: fix an incorrect statement copied from the arb documentation

comment:18 Changed 6 years ago by
 Commit changed from 6808761e9f1a8c8102e4c056962b2ad1e6f62e7d to 7f24576daa5c11054628a48524a1706c2b9c47f3
Branch pushed to git repo; I updated commit sha1. New commits:
7f24576  RealBall: remove duplicate methods introduced by mistake

comment:19 Changed 6 years ago by
 Commit changed from 7f24576daa5c11054628a48524a1706c2b9c47f3 to 4eed560a6ed5a94ba0c1af2121f3700fe41f5641
comment:20 Changed 6 years ago by
 Commit changed from 4eed560a6ed5a94ba0c1af2121f3700fe41f5641 to 28d63d8ae38d4fecc3a0a9494c52845e1de888e9
Branch pushed to git repo; I updated commit sha1. New commits:
28d63d8  RealBall: allow RealNumbers as radii

comment:21 Changed 6 years ago by
 Commit changed from 28d63d8ae38d4fecc3a0a9494c52845e1de888e9 to 19aee15d61e55cfbf83f2de57b15e5b85c0f9d6b
comment:22 Changed 6 years ago by
 Commit changed from 19aee15d61e55cfbf83f2de57b15e5b85c0f9d6b to 88d770d73009a73c581d59bc0393e11cae82d7fe
Branch pushed to git repo; I updated commit sha1. New commits:
88d770d  real_arb: rst syntax fixes

comment:23 Changed 6 years ago by
 Commit changed from 88d770d73009a73c581d59bc0393e11cae82d7fe to 0f675137a1116ae7d9901332e0e54fc0837c332f
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
edf95ab  RealBall: mid, rad as balls

9469ce3  RealBall: fix an incorrect statement copied from the arb documentation

5183126  RealBall: remove duplicate methods introduced by mistake

8c1df6b  RealBall: comparisons with symbolic ±∞

be93dba  RealBall: floor(), ceil()

36801c6  RealBall: allow RealNumbers as radii

9e06cce  real_arb: let's no longer call the bindings elementary :)

a6d68c6  Fix coercion RBF → InfinityRing when arb is not installed

4046200  real_arb: rst syntax fixes

0f67513  real_arb: mark all tests as optional

comment:24 Changed 6 years ago by
 Commit changed from 0f675137a1116ae7d9901332e0e54fc0837c332f to 2dd40b7a5aea1a4b035fad857cf54486e3eb7911
comment:25 Changed 6 years ago by
 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
 Commit changed from 2dd40b7a5aea1a4b035fad857cf54486e3eb7911 to 37bcb77a5b3400d59f57c2b4837bfb9bbdac1335
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
760c2d5  real_arb: let's no longer call the bindings rudimentary :)

91dddf9  Fix coercion RBF → InfinityRing when arb is not installed

b4f922b  real_arb: rst syntax fixes

1134261  RealBall: improve conversion to MPFI intervals

441f1c4  RealBall: remove superfluous bool() added back by mistake

37bcb77  real_arb: mark all tests as optional

comment:27 Changed 6 years ago by
 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
Thanks for the review!
comment:29 Changed 6 years ago by
 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
 Reviewers changed from fredrik.johansson to Fredrik Johansson
 Status changed from needs_work to positive_review
comment:31 Changed 6 years ago by
 Branch changed from u/mmezzarobba/arb to 37bcb77a5b3400d59f57c2b4837bfb9bbdac1335
 Resolution set to fixed
 Status changed from positive_review to closed
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...