git.iko.soy/typeable/nixpkgs
on master help sign in
sage, arb: update sage dependencies arb and pynac

Removes the version pinning for arb and pynac by backporting the upstream (sage) package upgrades. This necessitates a new patch for arb, which was however already proposed and accepted upstream.

commit398dad270a0f23fd6e96c26b5f13805e16fbb66f authorTimo Kaufmann <timokau@zoho.com> dateSat 30 Jun 2018, 17:05 (8 years ago) parent17e6b39
5 files changed+921−22
pkgs/applications/science/math/sage/default.nix+1−21 pkgs/applications/science/math/sage/patches/arb-2.13.0.patch+427 pkgs/applications/science/math/sage/patches/pynac-0.7.22.patch+479 pkgs/applications/science/math/sage/sage-src.nix+5 pkgs/development/libraries/arb/default.nix+9−1
pkgs/applications/science/math/sage/default.nix+1−21
@@ -39,18 +39,6 @@ let
3939 inherit flint ecl pari glpk eclib;
4040 inherit sage-src openblas-blas-pc openblas-cblas-pc openblas-lapack-pc pynac singular;
4141 linbox = nixpkgs.linbox.override { withSage = true; };
42− # tracking: https://trac.sagemath.org/ticket/24927
43− arb = nixpkgs.arb.overrideAttrs (attrs: rec {
44− name = "arb-${version}";
45− version = "2.12.0";
46− doCheck = false; # https://github.com/fredrik-johansson/arb/issues/194
47− src = fetchFromGitHub {
48− owner = "fredrik-johansson";
49− repo = attrs.pname;
50− rev = version;
51− sha256 = "18bwxlcbqb70cj7l9x6w1h4yghrqfhmbhdby373q8vdrdfx58niq";
52− };
53− });
5442 };
5543
5644 sagenb = self.callPackage ./sagenb.nix {
@@ -143,15 +131,7 @@ let
143131
144132 # *not* to confuse with the python package "pynac"
145133 # https://trac.sagemath.org/ticket/24838 (depends on arb update)
146− pynac = (nixpkgs.pynac.override { inherit singular; }).overrideAttrs (oldAttrs: rec {
147− name = "pynac-0.7.16";
148− src = fetchFromGitHub {
149− owner = "pynac";
150− repo = "pynac";
151− rev = name;
152− sha256 = "106an189sg4rpgzfrmy3699271vg4ddazw9wvh51wx7qnm1v86ik";
153− };
154− });
134+ pynac = nixpkgs.pynac.override { inherit singular; };
155135
156136 eclib = nixpkgs.eclib.override { inherit pari; };
157137
pkgs/applications/science/math/sage/patches/arb-2.13.0.patchnew file+427
@@ -0,0 +1,427 @@
1+commit c885927e25b29bd23869e02379c2918da430323e
2+Author: Timo Kaufmann <timokau@zoho.com>
3+Date: Sat Jun 30 02:26:15 2018 +0200
4+
5+diff --git a/build/pkgs/arb/checksums.ini b/build/pkgs/arb/checksums.ini
6+index 1924ee03c3..9323b97391 100644
7+--- a/build/pkgs/arb/checksums.ini
8++++ b/build/pkgs/arb/checksums.ini
9+@@ -1,4 +1,4 @@
10+ tarball=arb-VERSION.tar.gz
11+-sha1=27476d0529e48a07d92da90bd0fb80dd18f443e3
12+-md5=733285d9705d10b8024e551ffa81952f
13+-cksum=2391183744
14++sha1=44eda7bf8eaa666c45b1fc2c1b5bd08756d94b58
15++md5=fa24de9fffe4394fb6a7a6792e2ecc5f
16++cksum=3689220688
17+diff --git a/build/pkgs/arb/package-version.txt b/build/pkgs/arb/package-version.txt
18+index c8810e9bdb..fb2c0766b7 100644
19+--- a/build/pkgs/arb/package-version.txt
20++++ b/build/pkgs/arb/package-version.txt
21+@@ -1 +1 @@
22+-2.12.0.p0
23++2.13.0
24+diff --git a/build/pkgs/arb/patches/arb-pie-hardening-conflict.patch b/build/pkgs/arb/patches/arb-pie-hardening-conflict.patch
25+deleted file mode 100644
26+index 3e5c0e708b..0000000000
27+--- a/build/pkgs/arb/patches/arb-pie-hardening-conflict.patch
28++++ /dev/null
29+@@ -1,17 +0,0 @@
30+-In newer binutils, ld options -r and -pie conflict.
31+-Patch due to Jörg-Volker Peetz
32+-(source : https://groups.google.com/d/msg/sage-devel/TduebNoZuBE/sEULolL0BQAJ),
33+-packaged by Emmanuel Charpentier
34+-
35+-diff -ru arb-2.8.1-orig/Makefile.subdirs arb-2.8.1-new/Makefile.subdirs
36+---- arb-2.8.1-orig/Makefile.subdirs 2015-12-31 17:30:01.000000000 +0100
37+-+++ arb-2.8.1-new/Makefile.subdirs 2016-11-07 18:50:34.540051779 +0100
38+-@@ -52,7 +52,7 @@
39+- $(QUIET_CC) $(CC) $(CFLAGS) $(INCS) -c $< -o $@ -MMD -MP -MF "$(BUILD_DIR)/$(MOD_DIR)_$*.d" -MT "$(BUILD_DIR)/$(MOD_DIR)_$*.d" -MT "$@"
40+-
41+- $(MOD_LOBJ): $(LOBJS)
42+-- $(QUIET_CC) $(CC) $(ABI_FLAG) -Wl,-r $^ -o $@ -nostdlib
43+-+ $(QUIET_CC) $(CC) $(ABI_FLAG) -r $^ -o $@ -nostdlib
44+-
45+- -include $(LOBJS:.lo=.d)
46+-
47+diff --git a/src/sage/rings/complex_arb.pyx b/src/sage/rings/complex_arb.pyx
48+index 70d51e655a..00e7caea2c 100644
49+--- a/src/sage/rings/complex_arb.pyx
50++++ b/src/sage/rings/complex_arb.pyx
51+@@ -857,14 +857,14 @@ class ComplexBallField(UniqueRepresentation, Field):
52+ [0.500000000000000 +/- 2.09e-16]
53+
54+ sage: CBF.integral(lambda x, _: x.gamma(), 1 - CBF(i), 1 + CBF(i))
55+- [+/- 3.95e-15] + [1.5723926694981 +/- 4.53e-14]*I
56++ [+/- 4...e-15] + [1.5723926694981 +/- 4...e-14]*I
57+
58+ sage: C = ComplexBallField(100)
59+ sage: C.integral(lambda x, _: x.cos() * x.sin(), 0, 1)
60+ [0.35403670913678559674939205737 +/- 8.89e-30]
61+
62+ sage: CBF.integral(lambda x, _: (x + x.exp()).sin(), 0, 8)
63+- [0.34740017266 +/- 6.36e-12]
64++ [0.34740017266 +/- 6...e-12]
65+
66+ sage: C = ComplexBallField(2000)
67+ sage: C.integral(lambda x, _: (x + x.exp()).sin(), 0, 8) # long time
68+@@ -879,14 +879,14 @@ class ComplexBallField(UniqueRepresentation, Field):
69+ ....: else:
70+ ....: return z.sqrt()
71+ sage: CBF.integral(my_sqrt, -1 + CBF(i), -1 - CBF(i))
72+- [+/- 1.14e-14] + [-0.4752076627926 +/- 5.18e-14]*I
73++ [+/- 1.14e-14] + [-0.4752076627926 +/- 5...e-14]*I
74+
75+ Note, though, that proper handling of the ``analytic`` flag is required
76+ even when the path does not touch the branch cut::
77+
78+ sage: correct = CBF.integral(my_sqrt, 1, 2); correct
79+ [1.21895141649746 +/- 3.73e-15]
80+- sage: RBF(integral(sqrt(x), x, 1, 2))
81++ sage: RBF(integral(sqrt(x), x, 1, 2)) # long time
82+ [1.21895141649746 +/- 1.79e-15]
83+ sage: wrong = CBF.integral(lambda z, _: z.sqrt(), 1, 2) # WRONG!
84+ sage: correct - wrong
85+@@ -915,9 +915,9 @@ class ComplexBallField(UniqueRepresentation, Field):
86+ the integrand is unbounded::
87+
88+ sage: CBF.integral(lambda x, _: 1/x, -1, 1)
89+- [+/- inf] + [+/- inf]*I
90++ nan + nan*I
91+ sage: CBF.integral(lambda x, _: 1/x, 10^-1000, 1)
92+- [+/- inf] + [+/- inf]*I
93++ nan + nan*I
94+ sage: CBF.integral(lambda x, _: 1/x, 10^-1000, 1, abs_tol=1e-10)
95+ [2302.5850930 +/- 1.26e-8]
96+
97+@@ -928,14 +928,15 @@ class ComplexBallField(UniqueRepresentation, Field):
98+ sage: CBF.integral(lambda x, _: x.exp(), -1020, -1010, abs_tol=1e-450)
99+ [2.304377150950e-439 +/- 9.74e-452]
100+ sage: CBF.integral(lambda x, _: x.exp(), -1020, -1010, abs_tol=0)
101+- [2.304377150949e-439 +/- 7.53e-452]
102+- sage: CBF.integral(lambda x, _: x.exp(), -1020, -1010, rel_tol=1e-4, abs_tol=0)
103+- [2.30438e-439 +/- 3.90e-445]
104++ [2.304377150950e-439 +/- 7...e-452]
105++ sage: CBF.integral(lambda x, _: x.exp(), -1020, -1010, rel_tol=1e-2, abs_tol=0)
106++ [2.30438e-439 +/- 5.94e-445]
107+
108+- sage: CBF.integral(lambda x, _: x*(1/x).sin(), 0, 1)
109+- [+/- 0.644]
110+- sage: CBF.integral(lambda x, _: x*(1/x).sin(), 0, 1, use_heap=True)
111+- [0.3785300 +/- 4.32e-8]
112++ sage: epsi = CBF(1e-10)
113++ sage: CBF.integral(lambda x, _: x*(1/x).sin(), epsi, 1)
114++ [0.38 +/- 8.54e-3]
115++ sage: CBF.integral(lambda x, _: x*(1/x).sin(), epsi, 1, use_heap=True)
116++ [0.37853002 +/- 8.73e-9]
117+
118+ ALGORITHM:
119+
120+@@ -951,12 +952,12 @@ class ComplexBallField(UniqueRepresentation, Field):
121+
122+ sage: i = QuadraticField(-1).gen()
123+ sage: CBF.integral(lambda x, _: (1 + i*x).gamma(), -1, 1)
124+- [1.5723926694981 +/- 4.53e-14] + [+/- 3.95e-15]*I
125++ [1.5723926694981 +/- 4...e-14] + [+/- 4...e-15]*I
126+
127+- sage: ComplexBallField(10000).integral(lambda x, _: x.sin(), 0, 1, rel_tol=1e-400)
128+- [0.459... +/- ...e-4...]
129++ sage: ComplexBallField(10000).integral(lambda x, _: x.sin(), 0, 1, rel_tol=1e-300)
130++ [0.459... +/- ...e-3...]
131+ sage: CBF.integral(lambda x, _: x.sin(), 0, 100, rel_tol=10)
132+- [+/- 7.61]
133++ [0.138 +/- 5.53e-4]
134+
135+ sage: ComplexBallField(10000).integral(lambda x, _: x.sin(), 0, 1, abs_tol=1e-400)
136+ [0.459697... +/- ...e-4...]
137+@@ -2389,9 +2390,9 @@ cdef class ComplexBall(RingElement):
138+ sage: ~CBF(i/3)
139+ [-3.00000000000000 +/- 9.44e-16]*I
140+ sage: ~CBF(0)
141+- [+/- inf]
142++ nan
143+ sage: ~CBF(RIF(10,11))
144+- [0.1 +/- 9.53e-3]
145++ [0.1 +/- 9.10e-3]
146+ """
147+ cdef ComplexBall res = self._new()
148+ if _do_sig(prec(self)): sig_on()
149+@@ -2512,9 +2513,9 @@ cdef class ComplexBall(RingElement):
150+ sage: CBF(-2, 1)/CBF(1, 1/3)
151+ [-1.500000000000000 +/- 8.83e-16] + [1.500000000000000 +/- 5.64e-16]*I
152+ sage: CBF(2+I)/CBF(0)
153+- [+/- inf] + [+/- inf]*I
154++ nan + nan*I
155+ sage: CBF(1)/CBF(0)
156+- [+/- inf]
157++ nan
158+ sage: CBF(1)/CBF(RBF(0, 1.))
159+ nan
160+ """
161+@@ -2543,9 +2544,9 @@ cdef class ComplexBall(RingElement):
162+ sage: CBF(0)^(1/3)
163+ 0
164+ sage: CBF(0)^(-1)
165+- [+/- inf]
166++ nan
167+ sage: CBF(0)^(-2)
168+- [+/- inf] + [+/- inf]*I
169++ nan + nan*I
170+
171+ TESTS::
172+
173+@@ -2656,12 +2657,12 @@ cdef class ComplexBall(RingElement):
174+ sage: CBF(1).rising_factorial(5)
175+ 120.0000000000000
176+ sage: CBF(1/3, 1/2).rising_factorial(300)
177+- [-3.87949484514e+612 +/- 5.23e+600] + [-3.52042209763e+612 +/- 5.55e+600]*I
178++ [-3.87949484514e+612 +/- 5...e+600] + [-3.52042209763e+612 +/- 5...e+600]*I
179+
180+ sage: CBF(1).rising_factorial(-1)
181+ nan
182+ sage: CBF(1).rising_factorial(2**64)
183+- [+/- 2.30e+347382171305201370464]
184++ [+/- 2.30e+347382171326740403407]
185+ sage: ComplexBallField(128)(1).rising_factorial(2**64)
186+ [2.343691126796861348e+347382171305201285713 +/- 4.71e+347382171305201285694]
187+ sage: CBF(1/2).rising_factorial(CBF(2,3))
188+@@ -2700,7 +2701,7 @@ cdef class ComplexBall(RingElement):
189+ [1.000000000000000 +/- 2.83e-16] + [-0.441271200305303 +/- 2.82e-16]*I
190+
191+ sage: CBF('inf').log()
192+- nan + nan*I
193++ [+/- inf]
194+ sage: CBF(2).log(0)
195+ nan + nan*I
196+ """
197+@@ -2808,7 +2809,7 @@ cdef class ComplexBall(RingElement):
198+ sage: CBF(pi/2, 1/10).tan()
199+ [+/- 2.87e-14] + [10.0333111322540 +/- 2.36e-14]*I
200+ sage: CBF(pi/2).tan()
201+- [+/- inf]
202++ nan
203+ """
204+ cdef ComplexBall res = self._new()
205+ if _do_sig(prec(self)): sig_on()
206+@@ -2825,7 +2826,7 @@ cdef class ComplexBall(RingElement):
207+ sage: CBF(pi, 1/10).cot()
208+ [+/- 5.74e-14] + [-10.0333111322540 +/- 2.81e-14]*I
209+ sage: CBF(pi).cot()
210+- [+/- inf]
211++ nan
212+ """
213+ cdef ComplexBall res = self._new()
214+ if _do_sig(prec(self)): sig_on()
215+@@ -3211,9 +3212,9 @@ cdef class ComplexBall(RingElement):
216+ 1.000000000000000*I
217+
218+ sage: CBF(2+3*I).hypergeometric([1/4,1/3],[1/2])
219+- [0.7871684267473 +/- 7.34e-14] + [0.2749254173721 +/- 9.23e-14]*I
220++ [0.7871684267473 +/- 7...e-14] + [0.2749254173721 +/- 9...e-14]*I
221+ sage: CBF(2+3*I).hypergeometric([1/4,1/3],[1/2],regularized=True)
222+- [0.4441122268685 +/- 3.96e-14] + [0.1551100567338 +/- 5.75e-14]*I
223++ [0.4441122268685 +/- 3...e-14] + [0.1551100567338 +/- 5...e-14]*I
224+
225+ sage: CBF(5).hypergeometric([2,3], [-5])
226+ nan + nan*I
227+@@ -4041,9 +4042,9 @@ cdef class ComplexBall(RingElement):
228+
229+ sage: phi = CBF(1,1)
230+ sage: (CBF.pi()/2).elliptic_e_inc(phi)
231+- [1.283840957898 +/- 3.23e-13] + [-0.5317843366915 +/- 7.79e-14]*I
232++ [1.283840957898 +/- 3...e-13] + [-0.5317843366915 +/- 7...e-14]*I
233+ sage: phi.elliptic_e()
234+- [1.2838409578982 +/- 5.90e-14] + [-0.5317843366915 +/- 3.35e-14]*I
235++ [1.2838409578982 +/- 5...e-14] + [-0.5317843366915 +/- 3...e-14]*I
236+
237+ sage: phi = CBF(2, 3/7)
238+ sage: (CBF.pi()/2).elliptic_e_inc(phi)
239+@@ -4312,8 +4313,7 @@ cdef class ComplexBall(RingElement):
240+ sage: CBF(10).laguerre_L(3, 2)
241+ [-6.666666666667 +/- 4.15e-13]
242+ sage: CBF(5,7).laguerre_L(CBF(2,3), CBF(1,-2))
243+- [5515.315030271 +/- 4.37e-10] + [-12386.942845271 +/- 5.47e-10]*I
244+-
245++ [5515.315030271 +/- 4...e-10] + [-12386.942845271 +/- 5...e-10]*I
246+ """
247+ cdef ComplexBall my_n = self._parent.coerce(n)
248+ cdef ComplexBall my_m = self._parent.coerce(m)
249+@@ -4357,9 +4357,9 @@ cdef class ComplexBall(RingElement):
250+ EXAMPLES::
251+
252+ sage: CBF(1/2).legendre_P(5)
253+- [0.08984375000000000 +/- 4.5...e-18]
254++ [0.0898437500000000 +/- 7...e-17]
255+ sage: CBF(1,2).legendre_P(CBF(2,3), CBF(0,1))
256+- [0.10996180744364 +/- 7.45e-15] + [0.14312767804055 +/- 8.38e-15]*I
257++ [0.10996180744364 +/- 7.12e-15] + [0.14312767804055 +/- 8.07e-15]*I
258+ sage: CBF(-10).legendre_P(5, 325/100)
259+ [-22104403.487377 +/- 6.81e-7] + [53364750.687392 +/- 7.25e-7]*I
260+ sage: CBF(-10).legendre_P(5, 325/100, type=3)
261+@@ -4393,9 +4393,9 @@ cdef class ComplexBall(RingElement):
262+ sage: CBF(1/2).legendre_Q(5)
263+ [0.55508089057168 +/- 2.79e-15]
264+ sage: CBF(1,2).legendre_Q(CBF(2,3), CBF(0,1))
265+- [0.167678710 +/- 4.60e-10] + [-0.161558598 +/- 7.47e-10]*I
266++ [0.167678710 +/- 3.91e-10] + [-0.161558598 +/- 6.77e-10]*I
267+ sage: CBF(-10).legendre_Q(5, 325/100)
268+- [-83825154.36008 +/- 4.94e-6] + [-34721515.80396 +/- 5.40e-6]*I
269++ [-83825154.36008 +/- 5.02e-6] + [-34721515.80396 +/- 5.42e-6]*I
270+ sage: CBF(-10).legendre_Q(5, 325/100, type=3)
271+ [-4.797306921692e-6 +/- 6.82e-19] + [-4.797306921692e-6 +/- 6.57e-19]*I
272+
273+diff --git a/src/sage/rings/polynomial/polynomial_complex_arb.pyx b/src/sage/rings/polynomial/polynomial_complex_arb.pyx
274+index c436d4705b..ef611a566b 100644
275+--- a/src/sage/rings/polynomial/polynomial_complex_arb.pyx
276++++ b/src/sage/rings/polynomial/polynomial_complex_arb.pyx
277+@@ -543,7 +543,7 @@ cdef class Polynomial_complex_arb(Polynomial):
278+ sage: (1 - x/3).inverse_series_trunc(3)
279+ ([0.1111111111111111 +/- 5.99e-17])*x^2 + ([0.3333333333333333 +/- 7.04e-17])*x + 1.000000000000000
280+ sage: x.inverse_series_trunc(1)
281+- [+/- inf]
282++ nan
283+ sage: Pol(0).inverse_series_trunc(2)
284+ (nan + nan*I)*x + nan + nan*I
285+
286+@@ -671,7 +671,7 @@ cdef class Polynomial_complex_arb(Polynomial):
287+ sage: pol._sqrt_series(2)
288+ ([+/- 7.51e-3] + [+/- 0.501]*I)*x + [+/- 5.01e-3] + [+/- 1.01]*I
289+ sage: x._sqrt_series(2)
290+- ([+/- inf] + [+/- inf]*I)*x
291++ (nan + nan*I)*x
292+ """
293+ cdef Polynomial_complex_arb res = self._new()
294+ if n < 0:
295+diff --git a/src/sage/rings/real_arb.pyx b/src/sage/rings/real_arb.pyx
296+index c9f68e38d7..76e3037a9a 100644
297+--- a/src/sage/rings/real_arb.pyx
298++++ b/src/sage/rings/real_arb.pyx
299+@@ -161,7 +161,7 @@ values and should be preferred::
300+
301+ sage: RBF(NaN) < RBF(infinity)
302+ False
303+- sage: 1/RBF(0) <= RBF(infinity)
304++ sage: RBF(0).add_error(infinity) <= RBF(infinity)
305+ True
306+
307+ TESTS::
308+@@ -252,6 +252,8 @@ cdef void mpfi_to_arb(arb_t target, const mpfi_t source, const long precision):
309+ (+infinity, +infinity)
310+ sage: RBF(RIF(-infinity)).endpoints()
311+ (-infinity, -infinity)
312++ sage: RBF(RIF(-infinity, infinity)).endpoints()
313++ (-infinity, +infinity)
314+ sage: RIF(RBF(infinity)).endpoints()
315+ (+infinity, +infinity)
316+ sage: RIF(RBF(-infinity)).endpoints()
317+@@ -266,10 +268,11 @@ cdef void mpfi_to_arb(arb_t target, const mpfi_t source, const long precision):
318+ if _do_sig(precision): sig_on()
319+ mpfi_get_left(left, source)
320+ mpfi_get_right(right, source)
321+- arb_set_interval_mpfr(target, left, right, precision)
322+- # Work around weakness of arb_set_interval_mpfr(tgt, inf, inf)
323+- if mpfr_equal_p(left, right):
324+- mag_zero(arb_radref(target))
325++ if mpfr_inf_p(left) and mpfr_inf_p(right) and mpfr_sgn(left) < 0 < mpfr_sgn(right):
326++ # Work around a weakness of arb_set_interval_mpfr(tgt, -inf, inf)
327++ arb_zero_pm_inf(target)
328++ else:
329++ arb_set_interval_mpfr(target, left, right, precision)
330+ if _do_sig(precision): sig_off()
331+
332+ mpfr_clear(left)
333+@@ -649,17 +652,15 @@ class RealBallField(UniqueRepresentation, Field):
334+ EXAMPLES::
335+
336+ sage: RBF.some_elements()
337+- [1.000000000000000,
338+- [0.3333333333333333 +/- 7.04e-17],
339++ [0, 1.000000000000000, [0.3333333333333333 +/- 7.04e-17],
340+ [-4.733045976388941e+363922934236666733021124 +/- 3.46e+363922934236666733021108],
341+- [+/- inf],
342+- [+/- inf],
343+- nan]
344++ [+/- inf], [+/- inf], [+/- inf], nan]
345+ """
346+ import sage.symbolic.constants
347+- return [self(1), self(1)/3,
348++ inf = self(sage.rings.infinity.Infinity)
349++ return [self(0), self(1), self(1)/3,
350+ -self(2)**(Integer(2)**80),
351+- self(sage.rings.infinity.Infinity), ~self(0),
352++ inf, -inf, self.zero().add_error(inf),
353+ self.element_class(self, sage.symbolic.constants.NotANumber())]
354+
355+ def _sum_of_products(self, terms):
356+@@ -881,7 +882,7 @@ class RealBallField(UniqueRepresentation, Field):
357+ sage: RBF.gamma(5)
358+ 24.00000000000000
359+ sage: RBF.gamma(10**20)
360+- [+/- 5.92e+1956570551809674821757]
361++ [+/- 5.50e+1956570552410610660600]
362+ sage: RBF.gamma(1/3)
363+ [2.678938534707747 +/- 8.99e-16]
364+ sage: RBF.gamma(-5)
365+@@ -2247,7 +2248,7 @@ cdef class RealBall(RingElement):
366+ sage: inf = RBF(+infinity)
367+ sage: other_inf = RBF(+infinity, 42.r)
368+ sage: neg_inf = RBF(-infinity)
369+- sage: extended_line = 1/RBF(0)
370++ sage: extended_line = RBF(0).add_error(infinity)
371+ sage: exact_nan = inf - inf
372+ sage: exact_nan.mid(), exact_nan.rad()
373+ (NaN, 0.00000000)
374+@@ -2659,7 +2660,7 @@ cdef class RealBall(RingElement):
375+ sage: ~RBF(5)
376+ [0.2000000000000000 +/- 4.45e-17]
377+ sage: ~RBF(0)
378+- [+/- inf]
379++ nan
380+ sage: RBF(RIF(-0.1,0.1))
381+ [+/- 0.101]
382+
383+@@ -2739,7 +2740,7 @@ cdef class RealBall(RingElement):
384+ sage: RBF(pi)/RBF(e)
385+ [1.155727349790922 +/- 8.43e-16]
386+ sage: RBF(2)/RBF(0)
387+- [+/- inf]
388++ nan
389+ """
390+ cdef RealBall res = self._new()
391+ if _do_sig(prec(self)): sig_on()
392+@@ -2765,7 +2766,7 @@ cdef class RealBall(RingElement):
393+ sage: RBF(-1)^(1/3)
394+ nan
395+ sage: RBF(0)^(-1)
396+- [+/- inf]
397++ nan
398+ sage: RBF(-e)**RBF(pi)
399+ nan
400+
401+@@ -3129,7 +3130,7 @@ cdef class RealBall(RingElement):
402+ sage: RBF(1).tan()
403+ [1.557407724654902 +/- 3.26e-16]
404+ sage: RBF(pi/2).tan()
405+- [+/- inf]
406++ nan
407+ """
408+ cdef RealBall res = self._new()
409+ if _do_sig(prec(self)): sig_on()
410+@@ -3146,7 +3147,7 @@ cdef class RealBall(RingElement):
411+ sage: RBF(1).cot()
412+ [0.642092615934331 +/- 4.79e-16]
413+ sage: RBF(pi).cot()
414+- [+/- inf]
415++ nan
416+ """
417+ cdef RealBall res = self._new()
418+ if _do_sig(prec(self)): sig_on()
419+@@ -3257,7 +3258,7 @@ cdef class RealBall(RingElement):
420+ sage: RBF(1).coth()
421+ [1.313035285499331 +/- 4.97e-16]
422+ sage: RBF(0).coth()
423+- [+/- inf]
424++ nan
425+ """
426+ cdef RealBall res = self._new()
427+ if _do_sig(prec(self)): sig_on()
pkgs/applications/science/math/sage/patches/pynac-0.7.22.patchnew file+479
@@ -0,0 +1,479 @@
1+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
2+index 3a417d9d5c..fadaadbaf6 100644
3+--- a/src/sage/calculus/calculus.py
4++++ b/src/sage/calculus/calculus.py
5+@@ -231,7 +231,7 @@ Another example::
6+ sage: f(x=3)
7+ arcsinh(1)
8+ sage: f.derivative(x)
9+- 1/3/sqrt(1/9*x^2 + 1)
10++ 1/sqrt(x^2 + 9)
11+
12+ We compute the length of the parabola from 0 to 2::
13+
14+@@ -1509,8 +1509,8 @@ def laplace(ex, t, s, algorithm='maxima'):
15+ Testing SymPy::
16+
17+ sage: laplace(t^n, t, s, algorithm='sympy')
18+- (s^(-n)*gamma(n + 1)/s, 0, -re(n) < 1)
19+-
20++ (gamma(n + 1)/(s*s^n), 0, -re(n) < 1)
21++
22+ Testing Maxima::
23+
24+ sage: laplace(t^n, t, s, algorithm='maxima')
25+diff --git a/src/sage/functions/hypergeometric.py b/src/sage/functions/hypergeometric.py
26+index 1fc2db5c94..f3e49b9cdb 100644
27+--- a/src/sage/functions/hypergeometric.py
28++++ b/src/sage/functions/hypergeometric.py
29+@@ -34,7 +34,7 @@ Simplification (note that ``simplify_full`` does not yet call
30+ sage: a.simplify_hypergeometric()
31+ 1/((-e^x + 1)^e^x)
32+ sage: a.simplify_hypergeometric(algorithm='sage')
33+- (-e^x + 1)^(-e^x)
34++ 1/((-e^x + 1)^e^x)
35+
36+ Equality testing::
37+
38+@@ -145,7 +145,7 @@ Series expansions of confluent hypergeometric functions::
39+
40+ sage: hypergeometric_M(2, 2, x).series(x, 3)
41+ 1 + 1*x + 1/2*x^2 + Order(x^3)
42+- sage: hypergeometric_U(2, 2, x).series(x == 3, 100).subs(x=1).n()
43++ sage: hypergeometric_U(2, 2, x).series(x == 3, 100).subs(x=1).n() # known bug (see :trac:`25688`)
44+ 0.403652637676806
45+ sage: hypergeometric_U(2, 2, 1).n()
46+ 0.403652637676806
47+@@ -773,7 +773,7 @@ def closed_form(hyp):
48+ sage: closed_form(hypergeometric([], [], z))
49+ e^z
50+ sage: closed_form(hypergeometric([a], [], z))
51+- (-z + 1)^(-a)
52++ 1/((-z + 1)^a)
53+ sage: closed_form(hypergeometric([1, 1, 2], [1, 1], z))
54+ (z - 1)^(-2)
55+ sage: closed_form(hypergeometric([2, 3], [1], x))
56+@@ -1121,7 +1121,7 @@ class Hypergeometric_U(BuiltinFunction):
57+ sage: var('a b z')
58+ (a, b, z)
59+ sage: hypergeometric_U(a, b, z).generalized()
60+- z^(-a)*hypergeometric((a, a - b + 1), (), -1/z)
61++ hypergeometric((a, a - b + 1), (), -1/z)/z^a
62+ sage: hypergeometric_U(1, 3, 1/2).generalized()
63+ 2*hypergeometric((1, -1), (), -2)
64+ sage: hypergeometric_U(3, I, 2).generalized()
65+diff --git a/src/sage/functions/log.py b/src/sage/functions/log.py
66+index 75d1bf8060..61968582af 100644
67+--- a/src/sage/functions/log.py
68++++ b/src/sage/functions/log.py
69+@@ -518,17 +518,17 @@ class Function_polylog(GinacFunction):
70+
71+ sage: BF = RealBallField(100)
72+ sage: polylog(2, BF(1/3))
73+- [0.36621322997706348761674629766 +/- 4.51e-30]
74++ [0.36621322997706348761674629766... +/- ...]
75+ sage: polylog(2, BF(4/3))
76+- nan
77++ [2.27001825336107090380391448586 +/- 5.64e-30] + [-0.90377988538400159956755721265 +/- 8.39e-30]*I
78+ sage: parent(_)
79+- Real ball field with 100 bits of precision
80++ Complex ball field with 100 bits of precision
81+ sage: polylog(2, CBF(1/3))
82+- [0.366213229977063 +/- 5.85e-16]
83++ [0.366213229977063 +/- ...]
84+ sage: parent(_)
85+ Complex ball field with 53 bits of precision
86+ sage: polylog(2, CBF(1))
87+- [1.644934066848226 +/- 6.59e-16]
88++ [1.644934066848226 +/- ...]
89+ sage: parent(_)
90+ Complex ball field with 53 bits of precision
91+ """
92+diff --git a/src/sage/functions/trig.py b/src/sage/functions/trig.py
93+index e7e7a311cd..1f2926d6c9 100644
94+--- a/src/sage/functions/trig.py
95++++ b/src/sage/functions/trig.py
96+@@ -529,13 +529,8 @@ class Function_arcsin(GinacFunction):
97+ arcsin
98+ sage: asin(complex(1,1))
99+ (0.6662394324925152+1.0612750619050357j)
100+-
101+- Check that :trac:`22823` is fixed::
102+-
103+- sage: bool(asin(SR(2.1)) == NaN)
104+- True
105+- sage: asin(SR(2.1)).is_real()
106+- False
107++ sage: asin(SR(2.1))
108++ 1.57079632679490 - 1.37285914424258*I
109+ """
110+ GinacFunction.__init__(self, 'arcsin', latex_name=r"\arcsin",
111+ conversions=dict(maxima='asin', sympy='asin', fricas="asin", giac="asin"))
112+@@ -595,13 +590,8 @@ class Function_arccos(GinacFunction):
113+ arccos
114+ sage: acos(complex(1,1))
115+ (0.9045568943023814-1.0612750619050357j)
116+-
117+- Check that :trac:`22823` is fixed::
118+-
119+- sage: bool(acos(SR(2.1)) == NaN)
120+- True
121+- sage: acos(SR(2.1)).is_real()
122+- False
123++ sage: acos(SR(2.1))
124++ 1.37285914424258*I
125+ """
126+ GinacFunction.__init__(self, 'arccos', latex_name=r"\arccos",
127+ conversions=dict(maxima='acos', sympy='acos', fricas='acos', giac='acos'))
128+@@ -807,7 +797,7 @@ class Function_arcsec(GinacFunction):
129+ sage: arcsec(2).n(100)
130+ 1.0471975511965977461542144611
131+ sage: arcsec(1/2).n(100)
132+- NaN
133++ 1.3169578969248167086250463473*I
134+ sage: RDF(arcsec(2)) # abs tol 1e-15
135+ 1.0471975511965976
136+ sage: arcsec(1 + I)
137+@@ -958,7 +948,9 @@ class Function_arctan2(GinacFunction):
138+ sage: atan2(0,0,hold=True)
139+ arctan2(0, 0)
140+ sage: atan2(0,0,hold=True).n()
141+- NaN
142++ Traceback (most recent call last):
143++ ...
144++ RuntimeError: atan2(): division by zero
145+
146+ Check if :trac:`10062` is fixed, this was caused by
147+ ``(I*I).is_positive()`` returning ``True``::
148+diff --git a/src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py b/src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py
149+index 3b5c8d1729..1c6b73a16c 100644
150+--- a/src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py
151++++ b/src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py
152+@@ -1422,8 +1422,10 @@ class HyperbolicGeodesicUHP(HyperbolicGeodesic):
153+ expressions do not generate runtime errors. ::
154+
155+ sage: g=HyperbolicPlane().UHP().get_geodesic(-1+I,1+I)
156+- sage: g.midpoint()
157+- Point in UHP 1/2*(sqrt(2)*e^(1/2*arccosh(3)) - sqrt(2) + (I - 1)*e^(1/2*arccosh(3)) + I - 1)/((1/4*I - 1/4)*sqrt(2)*e^(1/2*arccosh(3)) - (1/4*I - 1/4)*sqrt(2) + 1/2*e^(1/2*arccosh(3)) + 1/2)
158++ sage: point = g.midpoint(); point
159++ Point in UHP -1/2*(sqrt(2)*...
160++ sage: QQbar(point.coordinates()).radical_expression()
161++ I*sqrt(2)
162+
163+ Check that floating points remain floating points
164+ in :meth:`midpoint` ::
165+diff --git a/src/sage/interfaces/fricas.py b/src/sage/interfaces/fricas.py
166+index 82aae78e37..8501ea2a18 100644
167+--- a/src/sage/interfaces/fricas.py
168++++ b/src/sage/interfaces/fricas.py
169+@@ -1084,14 +1084,14 @@ class FriCASElement(ExpectElement):
170+ 0.451026811796262,
171+ 0.732815101786507,
172+ 0.837981225008390,
173+- NaN,
174+- NaN,
175++ 1.57079632679490 - 0.467145308103262*I,
176++ 0.467145308103262*I,
177+ 1.11976951499863,
178+ 0.451026811796262,
179+ 0.732815101786507,
180+ 0.837981225008390,
181+- NaN,
182+- NaN]
183++ 1.57079632679490 - 0.467145308103262*I,
184++ 0.467145308103262*I]
185+ sage: l = [tanh, sinh, cosh, coth, sech, csch, asinh, acosh, atanh, acoth, asech, acsch, arcsinh, arccosh, arctanh, arccoth, arcsech, arccsch]
186+ sage: [f(x)._fricas_().sage().subs(x=0.9) for f in l] # optional - fricas
187+ [0.716297870199024,
188+diff --git a/src/sage/libs/pynac/pynac.pyx b/src/sage/libs/pynac/pynac.pyx
189+index 9e9d8f664b..e3406f007e 100644
190+--- a/src/sage/libs/pynac/pynac.pyx
191++++ b/src/sage/libs/pynac/pynac.pyx
192+@@ -1824,7 +1824,7 @@ cdef py_atan2(x, y):
193+ sage: atan2(CC(I), CC(I+1))
194+ 0.553574358897045 + 0.402359478108525*I
195+ sage: atan2(CBF(I), CBF(I+1))
196+- [0.55357435889705 +/- 5.58e-15] + [0.402359478108525 +/- 7.11e-16]*I
197++ [0.55357435889705 +/- ...] + [0.402359478108525 +/- ...]*I
198+
199+ Check that :trac:`23776` is fixed and RDF input gives real output::
200+
201+diff --git a/src/sage/matrix/matrix_symbolic_dense.pyx b/src/sage/matrix/matrix_symbolic_dense.pyx
202+index 46a15e53eb..7a0beb437b 100644
203+--- a/src/sage/matrix/matrix_symbolic_dense.pyx
204++++ b/src/sage/matrix/matrix_symbolic_dense.pyx
205+@@ -200,7 +200,7 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
206+ sage: eval, [evec], mult = es[0]
207+ sage: delta = eval*evec - evec*A
208+ sage: abs(abs(delta)) < 1e-10
209+- sqrt(9/25*((2*sqrt(6) - 3)*(sqrt(6) - 2) + 7*sqrt(6) - 18)^2 + 9/25*((sqrt(6) - 2)*(sqrt(6) - 4) + 6*sqrt(6) - 14)^2) < (1.00000000000000e-10)
210++ 3/5*sqrt(((2*sqrt(6) - 3)*(sqrt(6) - 2) + 7*sqrt(6) - 18)^2 + ((sqrt(6) - 2)*(sqrt(6) - 4) + 6*sqrt(6) - 14)^2) < (1.00000000000000e-10)
211+ sage: abs(abs(delta)).n() < 1e-10
212+ True
213+
214+diff --git a/src/sage/modules/matrix_morphism.py b/src/sage/modules/matrix_morphism.py
215+index 17a1d6e290..03892ceec0 100644
216+--- a/src/sage/modules/matrix_morphism.py
217++++ b/src/sage/modules/matrix_morphism.py
218+@@ -214,9 +214,9 @@ class MatrixMorphism_abstract(sage.categories.morphism.Morphism):
219+ sage: f((1, 0))
220+ Traceback (most recent call last):
221+ ...
222+- TypeError: Unable to coerce entries (=[1.00000000000000*I, 0.000000000000000]) to coefficients in Real Field with 53 bits of precision
223++ TypeError: Unable to coerce entries (=[1.00000000000000*I, 0]) to coefficients in Real Field with 53 bits of precision
224+ sage: f((1, 0), coerce=False)
225+- (1.00000000000000*I, 0.000000000000000)
226++ (1.00000000000000*I, 0)
227+
228+ """
229+ if self.domain().is_ambient():
230+diff --git a/src/sage/plot/plot.py b/src/sage/plot/plot.py
231+index 77cdeb8c46..e501e74036 100644
232+--- a/src/sage/plot/plot.py
233++++ b/src/sage/plot/plot.py
234+@@ -2061,7 +2061,7 @@ def _plot(funcs, xrange, parametric=False,
235+ plot properly (:trac:`13246`)::
236+
237+ sage: parametric_plot((x, arcsec(x)), (x, -2, 2))
238+- Graphics object consisting of 1 graphics primitive
239++ Graphics object consisting of 2 graphics primitives
240+
241+ """
242+ from sage.plot.colors import Color
243+diff --git a/src/sage/repl/display/formatter.py b/src/sage/repl/display/formatter.py
244+index 8ce2e839d7..948207c95e 100644
245+--- a/src/sage/repl/display/formatter.py
246++++ b/src/sage/repl/display/formatter.py
247+@@ -25,11 +25,11 @@ generally, all sage expression as an ASCII art object::
248+ sage: shell = get_test_shell()
249+ sage: shell.run_cell('%display ascii_art')
250+ sage: shell.run_cell('integral(x^2/pi^x, x)')
251+- / 2 2 \ -x*log(pi)
252+- -\x *log (pi) + 2*x*log(pi) + 2/*e
253+- ---------------------------------------------
254+- 3
255+- log (pi)
256++ -x / 2 2 \
257++ -pi *\x *log (pi) + 2*x*log(pi) + 2/
258++ --------------------------------------
259++ 3
260++ log (pi)
261+ sage: shell.run_cell("i = var('i')")
262+ sage: shell.run_cell('sum(i*x^i, i, 0, 10)')
263+ 10 9 8 7 6 5 4 3 2
264+diff --git a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
265+index d8ebbf4f76..8c60f65e99 100644
266+--- a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
267++++ b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
268+@@ -151,8 +151,8 @@ A multiple point example (Example 6.5 of [RaWi2012]_)::
269+ [(x + 2*y - 1, 1), (2*x + y - 1, 1)])
270+ sage: F1 = decomp[1]
271+ sage: F1.asymptotics(p, alpha, 2)
272+- (-3*((2*a^2 - 5*a*b + 2*b^2)*r^2 + (a + b)*r + 3)*((1/3)^(-a)*(1/3)^(-b))^r,
273+- (1/3)^(-a)*(1/3)^(-b), -3*(2*a^2 - 5*a*b + 2*b^2)*r^2 - 3*(a + b)*r - 9)
274++ (-3*((2*a^2 - 5*a*b + 2*b^2)*r^2 + (a + b)*r + 3)*(1/((1/3)^a*(1/3)^b))^r,
275++ 1/((1/3)^a*(1/3)^b), -3*(2*a^2 - 5*a*b + 2*b^2)*r^2 - 3*(a + b)*r - 9)
276+ sage: alpha = [4, 3]
277+ sage: decomp = F.asymptotic_decomposition(alpha)
278+ sage: F1 = decomp[1]
279+@@ -2159,7 +2159,7 @@ class FractionWithFactoredDenominator(RingElement):
280+ sage: p = {x: 1/3, y: 1/3}
281+ sage: alpha = (var('a'), var('b'))
282+ sage: F.asymptotics_multiple(p, alpha, 2, var('r')) # long time
283+- (3*((1/3)^(-a)*(1/3)^(-b))^r*e^(2/3), (1/3)^(-a)*(1/3)^(-b), 3*e^(2/3))
284++ (3*(1/((1/3)^a*(1/3)^b))^r*e^(2/3), 1/((1/3)^a*(1/3)^b), 3*e^(2/3))
285+ """
286+ from itertools import product
287+ from sage.calculus.functions import jacobian
288+diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
289+index 16a268a02c..5fd244e93b 100644
290+--- a/src/sage/stats/basic_stats.py
291++++ b/src/sage/stats/basic_stats.py
292+@@ -183,7 +183,7 @@ def std(v, bias=False):
293+ sage: std([])
294+ NaN
295+ sage: std([I, sqrt(2), 3/5])
296+- sqrt(1/450*(10*sqrt(2) - 5*I - 3)^2 + 1/450*(5*sqrt(2) - 10*I + 3)^2 + 1/450*(5*sqrt(2) + 5*I - 6)^2)
297++ 1/15*sqrt(1/2)*sqrt((10*sqrt(2) - 5*I - 3)^2 + (5*sqrt(2) - 10*I + 3)^2 + (5*sqrt(2) + 5*I - 6)^2)
298+ sage: std([RIF(1.0103, 1.0103), RIF(2)])
299+ 0.6998235813403261?
300+ sage: import numpy
301+diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx
302+index ab4c05de3a..60f0dc549a 100644
303+--- a/src/sage/symbolic/expression.pyx
304++++ b/src/sage/symbolic/expression.pyx
305+@@ -622,7 +622,7 @@ cdef class Expression(CommutativeRingElement):
306+ sage: x^(-5)
307+ x^(-5)
308+ sage: x^(-y)
309+- x^(-y)
310++ 1/(x^y)
311+ sage: 2*x^(-1)
312+ 2/x
313+ sage: i*x
314+@@ -3621,14 +3621,14 @@ cdef class Expression(CommutativeRingElement):
315+ sage: repl_dict = {b_0: b_0, b_3: b_1, b_2: b_3, b_1: b_2}
316+ sage: P = precomp.substitute(repl_dict)
317+ sage: P.expand()
318+- -2^(-b_0)*2^(-b_2)*2^b_3 - 2^b_0*2^(-b_2)*2^b_3 -
319+- 2^(-b_0)*2^b_2*2^b_3 + 2^b_0*2^b_2*2^b_3 - 2*2^(-b_0)*2^(-b_2)
320+- - 2*2^b_0*2^(-b_2) - 2*2^(-b_0)*2^b_2 + 2*2^b_0*2^b_2 +
321+- 2^(-b_0)*2^b_3 + 2^b_0*2^b_3 + 2^(-b_2)*2^b_3 + 2^b_2*2^b_3 +
322+- 2*2^(-b_0) + 2*2^b_0 + 2*2^(-b_2) + 2*2^b_2 - 9*2^b_3 -
323+- 2^(-b_0)*2^(-b_2)/2^b_3 - 2^b_0*2^(-b_2)/2^b_3 -
324+- 2^(-b_0)*2^b_2/2^b_3 + 2^b_0*2^b_2/2^b_3 + 2^(-b_0)/2^b_3 +
325+- 2^b_0/2^b_3 + 2^(-b_2)/2^b_3 + 2^b_2/2^b_3 - 9/2^b_3 - 18
326++ 2^b_0*2^b_2*2^b_3 + 2*2^b_0*2^b_2 + 2^b_0*2^b_3 + 2^b_2*2^b_3 +
327++ 2*2^b_0 + 2*2^b_2 - 9*2^b_3 + 2^b_0*2^b_2/2^b_3 -
328++ 2^b_0*2^b_3/2^b_2 - 2^b_2*2^b_3/2^b_0 - 2*2^b_0/2^b_2 -
329++ 2*2^b_2/2^b_0 + 2^b_0/2^b_3 + 2^b_2/2^b_3 + 2^b_3/2^b_0 +
330++ 2^b_3/2^b_2 + 2/2^b_0 + 2/2^b_2 - 2^b_0/(2^b_2*2^b_3) -
331++ 2^b_2/(2^b_0*2^b_3) - 9/2^b_3 - 2^b_3/(2^b_0*2^b_2) -
332++ 2/(2^b_0*2^b_2) + 1/(2^b_0*2^b_3) + 1/(2^b_2*2^b_3) -
333++ 1/(2^b_0*2^b_2*2^b_3) - 18
334+
335+ sage: _0,b_1,b_2=var('b_0,b_1,b_2')
336+ sage: f = 1/27*b_2^2/(2^b_2)^2 + 1/27*b_1^2/(2^b_1)^2 + \
337+@@ -3809,7 +3809,7 @@ cdef class Expression(CommutativeRingElement):
338+
339+ sage: x = SR.symbol('x', domain='real')
340+ sage: (x^3)^(1/3)
341+- (x^3)^(1/3)
342++ x
343+ sage: (x^4)^(1/4)
344+ abs(x)
345+ sage: (x^8)^(1/4)
346+@@ -3872,7 +3872,7 @@ cdef class Expression(CommutativeRingElement):
347+ sage: 2^(x/log(2))
348+ e^x
349+ sage: 2^(-x^2/2/log(2))
350+- e^(-1/2*x^2)
351++ 1/e^(1/2*x^2)
352+ sage: x^(x/log(x))
353+ x^(x/log(x))
354+ sage: assume(x > 0)
355+@@ -4816,18 +4816,24 @@ cdef class Expression(CommutativeRingElement):
356+ sage: ((x+y)^(x+y)).match(w0^w0)
357+ {$0: x + y}
358+ sage: t = ((a+b)*(a+c)).match((a+w0)*(a+w1))
359+- sage: t[w0], t[w1]
360+- (c, b)
361++ sage: set([t[w0], t[w1]]) == set([b, c])
362++ True
363+ sage: ((a+b)*(a+c)).match((w0+b)*(w0+c))
364+ {$0: a}
365+ sage: t = ((a+b)*(a+c)).match((w0+w1)*(w0+w2))
366+- sage: t[w0], t[w1], t[w2]
367+- (a, c, b)
368+- sage: print(((a+b)*(a+c)).match((w0+w1)*(w1+w2)))
369+- None
370++ sage: t[w0]
371++ a
372++ sage: set([t[w1], t[w2]]) == set([b, c])
373++ True
374++ sage: t = ((a+b)*(a+c)).match((w0+w1)*(w1+w2))
375++ sage: t[w1]
376++ a
377++ sage: set([t[w0], t[w2]]) == set([b, c])
378++ True
379+ sage: t = (a*(x+y)+a*z+b).match(a*w0+w1)
380+- sage: t[w0], t[w1]
381+- (x + y, a*z + b)
382++ sage: s = set([t[w0], t[w1]])
383++ sage: s == set([x+y, a*z+b]) or s == set([z, a*(x+y)+b])
384++ True
385+ sage: print((a+b+c+d+f+g).match(c))
386+ None
387+ sage: (a+b+c+d+f+g).has(c)
388+@@ -4836,7 +4842,7 @@ cdef class Expression(CommutativeRingElement):
389+ {$0: a + b + d + f + g}
390+ sage: (a+b+c+d+f+g).match(c+g+w0)
391+ {$0: a + b + d + f}
392+- sage: (a+b).match(a+b+w0)
393++ sage: (a+b).match(a+b+w0) # known bug
394+ {$0: 0}
395+ sage: print((a*b^2).match(a^w0*b^w1))
396+ None
397+@@ -5009,7 +5015,7 @@ cdef class Expression(CommutativeRingElement):
398+ a^3 + b^3 + (x + y)^3
399+
400+ sage: t.subs(w0 == w0^2)
401+- (x^2 + y^2)^18 + a^16 + b^16
402++ a^8 + b^8 + (x^2 + y^2)^6
403+
404+ sage: t.subs(a == b, b == c)
405+ (x + y)^3 + b^2 + c^2
406+@@ -8392,9 +8398,13 @@ cdef class Expression(CommutativeRingElement):
407+ sage: SR(I).arctan2(1)
408+ arctan2(I, 1)
409+ sage: SR(CDF(0,1)).arctan2(1)
410+- NaN + +infinity*I
411+- sage: SR(1).arctan2(CDF(0,1)) # known bug
412+- 0.7853981633974484 - 19.012501686914433*I
413++ Traceback (most recent call last):
414++ ...
415++ ValueError: power::eval(): division by zero
416++ sage: SR(1).arctan2(CDF(0,1))
417++ Traceback (most recent call last):
418++ ...
419++ ValueError: power::eval(): division by zero
420+
421+ sage: arctan2(0,oo)
422+ 0
423+@@ -8656,7 +8666,7 @@ cdef class Expression(CommutativeRingElement):
424+ 1/2*I*pi
425+ sage: SR(1/2).arccosh()
426+ arccosh(1/2)
427+- sage: SR(CDF(1/2)).arccosh() # rel tol 1e-15
428++ sage: SR(CDF(1/2)).arccosh() # rel tol 1e-15
429+ 1.0471975511965976*I
430+ sage: maxima('acosh(0.5)')
431+ 1.04719755119659...*%i
432+@@ -11687,7 +11697,7 @@ cdef class Expression(CommutativeRingElement):
433+ sage: a.solve(t)
434+ []
435+ sage: b = a.canonicalize_radical(); b
436+- -23040.0*(-2.0*e^(1800*t) + 25.0*e^(900*t) - 32.0)*e^(-2400*t)
437++ (46080.0*e^(1800*t) - 576000.0*e^(900*t) + 737280.0)*e^(-2400*t)
438+ sage: b.solve(t)
439+ []
440+ sage: b.solve(t, to_poly_solve=True)
441+@@ -12163,14 +12173,14 @@ cdef class Expression(CommutativeRingElement):
442+
443+ sage: (n,k,j)=var('n,k,j')
444+ sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
445+- -(-1)^(-j)*sum((-1)^k*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
446++ -(-1)^j*sum((-1)^k*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
447+ sage: assume(j>-1)
448+ sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
449+ 1
450+ sage: forget()
451+ sage: assume(n>=j)
452+ sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
453+- -(-1)^(-j)*sum((-1)^k*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
454++ -(-1)^j*sum((-1)^k*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
455+ sage: forget()
456+ sage: assume(j==-1)
457+ sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
458+@@ -12178,7 +12188,7 @@ cdef class Expression(CommutativeRingElement):
459+ sage: forget()
460+ sage: assume(j<-1)
461+ sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
462+- -(-1)^(-j)*sum((-1)^k*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
463++ -(-1)^j*sum((-1)^k*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
464+ sage: forget()
465+
466+ Check that :trac:`16176` is fixed::
467+diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
468+index da6f0eef42..4bd65ef572 100644
469+--- a/src/sage/symbolic/relation.py
470++++ b/src/sage/symbolic/relation.py
471+@@ -895,7 +895,7 @@ def solve(f, *args, **kwds):
472+ sage: (r[0][x], r[0][y])
473+ (2*lambert_w(1/2), 1)
474+ sage: solve(-2*x**3 + 4*x**2 - 2*x + 6 > 0, x, algorithm='sympy')
475+- [x < (1/6*sqrt(77) + 79/54)^(1/3) + 1/9/(1/6*sqrt(77) + 79/54)^(1/3) + 2/3]
476++ [x < 1/3*(1/2)^(1/3)*(9*sqrt(77) + 79)^(1/3) + 2/3*(1/2)^(2/3)/(9*sqrt(77) + 79)^(1/3) + 2/3]
477+ sage: solve(sqrt(2*x^2 - 7) - (3 - x),x,algorithm='sympy')
478+ [x == -8, x == 2]
479+ sage: solve(sqrt(2*x + 9) - sqrt(x + 1) - sqrt(x + 4),x,algorithm='sympy')
pkgs/applications/science/math/sage/sage-src.nix+5
@@ -169,6 +169,11 @@ stdenv.mkDerivation rec {
169169 stripLen = 1;
170170 })
171171
172+ # https://trac.sagemath.org/ticket/24927 rebased
173+ ./patches/arb-2.13.0.patch
174+
175+ # https://trac.sagemath.org/ticket/24838 rebased
176+ ./patches/pynac-0.7.22.patch
172177 ];
173178
174179 patches = nixPatches ++ packageUpgradePatches;
pkgs/development/libraries/arb/default.nix+9−1
@@ -1,4 +1,4 @@
1−{stdenv, fetchFromGitHub, mpir, gmp, mpfr, flint}:
1+{stdenv, fetchFromGitHub, fetchpatch, mpir, gmp, mpfr, flint}:
22stdenv.mkDerivation rec {
33 name = "${pname}-${version}";
44 pname = "arb";
@@ -17,6 +17,14 @@ stdenv.mkDerivation rec {
1717 "--with-flint=${flint}"
1818 ];
1919 doCheck = true;
20+ patches = [
21+ # https://github.com/fredrik-johansson/arb/pull/210, included in next release
22+ (fetchpatch {
23+ url = "https://patch-diff.githubusercontent.com/raw/fredrik-johansson/arb/pull/210.patch";
24+ name = "return-exact-zero-where-possible.patch";
25+ sha256 = "01j9npnpmwh4dla9i05qdn606hy34gy9bz7c9bbsqm7az3n7pxjg";
26+ })
27+ ];
2028 meta = {
2129 inherit version;
2230 description = ''A library for arbitrary-precision interval arithmetic'';