Opened 4 years ago
Last modified 4 years ago
#24838 closed defect
Upgrade to pynac0.7.22 — at Version 40
Reported by:  rws  Owned by:  

Priority:  major  Milestone:  sage8.3 
Component:  symbolics  Keywords:  
Cc:  fbissey, ghtimokau  Merged in:  
Authors:  Ralf Stephan  Reviewers:  
Report Upstream:  N/A  Work issues:  
Branch:  Commit:  
Dependencies:  #24927  Stopgaps: 
Description (last modified by )
In the new version:
 fix matching
 fast and working versons of quo_rem and rational decomposition
 fix power inconsistency
 internal fix of another power inconsistency (Sage 25639)
(x^a)^b > x^(ab)
IF x real, a odd integer, ab integer add ex::treesize() as complexity metric
 information for packagers
 implement commutative matching; fix GiNaC's matching deficiencies (#25168)
 substitute patternless if no wildcards present
 remove some compiler warnings
 update AX_CXX_COMPILE_STDCXX.m4
 fix
exp(c*f(x))
simplification  fix
cases(...).subs(...)
function::info
formin/max_symbolic
(#21945) performance and readability improvements
 correct
sinh/cosh/tanh
return type (#24299) atan2
fixes potential memleaks fixed
 fixes in Giac interface
subs
can now substitute numeric terms (#23964)
 fix memleak in inplace PyObject numerics (#24745)
 fix endless computation (#24883)
 Python interface / Py3 fixes and improvements (thx Erik Bray, #24561, #24752, #24522)
 fix internal
asin
/acos
of complex balls  draw factors out of
add^rational
(#24768, #25251, #25252) exp(f(x))
,exp(c*f(x))
, f inv. hyperbolic simplifications (#24841) always extend trig/hyperbolic functions to complex domain (#24428)
 extensive code readability improvements
https://github.com/pynac/pynac/releases/download/pynac0.7.22/pynac0.7.22.tar.bz2
Change History (40)
comment:1 Changed 4 years ago by
 Branch set to u/rws/upgrade_to_pynac_0_7_17
comment:2 Changed 4 years ago by
 Commit set to d3511ce1cbd35b9d625b0f4215ee014e6cc99931
 Description modified (diff)
 Status changed from new to needs_review
comment:3 Changed 4 years ago by
 Cc fbissey added
comment:4 Changed 4 years ago by
 Description modified (diff)
comment:5 Changed 4 years ago by
Just a question: is this supposed to fix #24522 too?
comment:6 followup: ↓ 7 Changed 4 years ago by
 Description modified (diff)
Yes, that PR is merged. I'll probably add a hotfix for #24883 here as patch, too.
comment:7 in reply to: ↑ 6 Changed 4 years ago by
comment:8 Changed 4 years ago by
The issue is no longer there. Please review.
comment:9 Changed 4 years ago by
 Status changed from needs_review to needs_work
This used to return a purely imaginary number, now there is a small real part:
sage: arccosh(x).subs(x=0.9) 9.66146955461936e22 + 0.451026811796262*I
comment:10 Changed 4 years ago by
This is an artifact of conversion to CC:
sage: CC(ComplexBallField(68)(0.9).arccosh()) 9.66146955461936e22 + 0.451026811796262*I
We use arb with precision+15 and convert back to parent, all to make up for missing or limited (in the calculus sense, not the algebraic, note recent discussion) member functions of parent (RR in this case). Before this pynac version we had specific logic to zero the real part but this was errorprone. IMHO CC conversion of complex balls should be fixed.
comment:11 Changed 4 years ago by
comment:12 followup: ↓ 15 Changed 4 years ago by
You may also want to know why I'm using arb and not mpfr:
sage: r=srange(2.5,2.5,.01) sage: rr = [CC(i) for i in r] sage: %timeit for x in rr: _=x.arccosh() 100 loops, best of 3: 11.9 ms per loop sage: rr = [CBF(i) for i in r] sage: %timeit for x in rr: _=x.arccosh() 1000 loops, best of 3: 649 µs per loop
comment:13 Changed 4 years ago by
What do you prefer, patching arb or the arb interface?
comment:14 followup: ↓ 17 Changed 4 years ago by
comment:15 in reply to: ↑ 12 Changed 4 years ago by
Replying to rws:
You may also want to know why I'm using arb and not mpfr:
Despite what you think, you are not using mpfr, but PARI:
def arccosh(self): """ Return the hyperbolic arccosine of ``self``. EXAMPLES:: sage: (1+CC(I)).arccosh() 1.06127506190504 + 0.904556894302381*I """ return self._parent(self.__pari__().acosh())
If you want to compare with something, it should be mpc (in Sage: CC = MPComplexField(53)
)
comment:16 Changed 4 years ago by
Interestingly,
sage: arccosh(x).subs(x=MPComplexField(53)(0.9)) ... TypeError: no canonical coercion from Complex Field with 53 bits of precision to Symbolic Ring
comment:17 in reply to: ↑ 14 Changed 4 years ago by
comment:18 Changed 4 years ago by
 Status changed from needs_work to needs_review
comment:19 Changed 4 years ago by
 Commit changed from d3511ce1cbd35b9d625b0f4215ee014e6cc99931 to 9f86eb7b725b44939f22df4cb7f5a6b05935a6c8
comment:20 Changed 4 years ago by
 Status changed from needs_review to needs_work
New release incoming.
comment:21 Changed 4 years ago by
 Description modified (diff)
 Summary changed from Upgrade to pynac0.7.17 to Upgrade to pynac0.7.18
comment:22 Changed 4 years ago by
 Commit changed from 9f86eb7b725b44939f22df4cb7f5a6b05935a6c8 to ae5eac77131fca0266d63ee7c9b9f2b8ecf72ee8
Branch pushed to git repo; I updated commit sha1. New commits:
ae5eac7  24838: version/chksum

comment:23 Changed 4 years ago by
 Status changed from needs_work to needs_review
comment:24 Changed 4 years ago by
 Description modified (diff)
comment:25 Changed 4 years ago by
 Status changed from needs_review to needs_work
0.7.17 introduced a bug in exp(ex*log(x))
simplification, and we need a new release, anyway.
comment:26 Changed 4 years ago by
 Description modified (diff)
 Summary changed from Upgrade to pynac0.7.18 to Upgrade to pynac0.7.19
comment:27 Changed 4 years ago by
 Commit changed from ae5eac77131fca0266d63ee7c9b9f2b8ecf72ee8 to 88782837071d956743e49fb64ef972c1ee163db1
comment:28 Changed 4 years ago by
 Status changed from needs_work to needs_review
comment:29 Changed 4 years ago by
This looks fishy:
 sage: SR(CDF(1/2)).arccosh() # rel tol 1e15 + sage: SR(CDF(1/2)).arccosh() # abs tol 1e15
comment:30 followup: ↓ 32 Changed 4 years ago by
 Status changed from needs_review to needs_work
comment:31 Changed 4 years ago by
 Description modified (diff)
comment:32 in reply to: ↑ 30 Changed 4 years ago by
Replying to jdemeyer:
The analogous thing as 9 should be fixed for pure imaginary results:
sage: CDF(1/2).arccosh() 1.0471975511965979*I sage: SR(CDF(1/2)).arccosh() 6.372599439108525e21 + 1.0471975511965979*I
As explained in 10 missing FP functionality is gained using arb. But there was that bug in arb which is now fixed. Consequentially we need that fix or a recent arb to get the right result, see 14.
Then you also revert 29
Will rerevert.
comment:33 Changed 4 years ago by
 Dependencies set to #24927
comment:34 Changed 4 years ago by
I confirm that this works with https://github.com/fredrikjohansson/arb/commit/7afd3bfaf1697739751d96d3665ef83e78c76820 applied, which is in arb2.13.0 (#24927).
comment:35 Changed 4 years ago by
 Commit changed from 88782837071d956743e49fb64ef972c1ee163db1 to 3efba1a6f9dd67401716dfdc56eb9bafa61e8963
comment:36 Changed 4 years ago by
Some recent Sage commit makes doctests (involving powers of I
) fail together with pynac0.7.17 so we'll need a fix in 0.7.20.
comment:37 Changed 4 years ago by
Actually it's not our fault: #25458.
comment:38 Changed 4 years ago by
 Description modified (diff)
 Summary changed from Upgrade to pynac0.7.19 to Upgrade to pynac0.7.20
comment:39 Changed 4 years ago by
 Commit changed from 3efba1a6f9dd67401716dfdc56eb9bafa61e8963 to ad07cd5c0b8789b768d23b93db4a4004467ed5df
Branch pushed to git repo; I updated commit sha1. New commits:
ed36070  Merge branch 'develop' into t/24838/upgrade_to_pynac_0_7_17

3278103  Merge branch 'develop' into t/24838/upgrade_to_pynac_0_7_17

ca69aef  Merge branch 'develop' into t/24838/upgrade_to_pynac_0_7_17

97bf3b7  24838: doctest fixes

e6b01df  doctest fix

fdb4210  Merge branch 'develop' into t/24838/upgrade_to_pynac_0_7_17

ad07cd5  24838: 0.7.20 version/chksum

comment:40 Changed 4 years ago by
 Branch u/rws/upgrade_to_pynac_0_7_17 deleted
 Commit ad07cd5c0b8789b768d23b93db4a4004467ed5df deleted
 Description modified (diff)
 Milestone changed from sage8.2 to sage8.3
 Summary changed from Upgrade to pynac0.7.20 to Upgrade to pynac0.7.22
New commits:
version / chkum / rm patch
24838: doctest fixes