passagemath-repl 10.5.28__py3-none-any.whl → 10.5.30__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. passagemath_repl-10.5.30.data/data/share/jupyter/kernels/sagemath/kernel.json +1 -0
  2. passagemath_repl-10.5.30.data/data/share/jupyter/kernels/sagemath/logo-64x64.png +0 -0
  3. passagemath_repl-10.5.30.data/data/share/jupyter/kernels/sagemath/logo.svg +352 -0
  4. {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.30.dist-info}/METADATA +3 -3
  5. {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.30.dist-info}/RECORD +95 -24
  6. {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.30.dist-info}/top_level.txt +1 -0
  7. sage/ext_data/all__sagemath_repl.py +1 -0
  8. sage/interfaces/all__sagemath_repl.py +1 -0
  9. sage/repl/ipython_kernel/install.py +6 -8
  10. sage/tests/books/__init__.py +2 -0
  11. sage/tests/books/computational-mathematics-with-sagemath/__init__.py +1 -0
  12. sage/tests/books/computational-mathematics-with-sagemath/calculus_doctest.py +550 -0
  13. sage/tests/books/computational-mathematics-with-sagemath/combinat_doctest.py +1054 -0
  14. sage/tests/books/computational-mathematics-with-sagemath/domaines_doctest.py +444 -0
  15. sage/tests/books/computational-mathematics-with-sagemath/float_doctest.py +478 -0
  16. sage/tests/books/computational-mathematics-with-sagemath/graphique_doctest.py +255 -0
  17. sage/tests/books/computational-mathematics-with-sagemath/graphtheory_doctest.py +419 -0
  18. sage/tests/books/computational-mathematics-with-sagemath/integration_doctest.py +291 -0
  19. sage/tests/books/computational-mathematics-with-sagemath/linalg_doctest.py +455 -0
  20. sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py +422 -0
  21. sage/tests/books/computational-mathematics-with-sagemath/lp_doctest.py +235 -0
  22. sage/tests/books/computational-mathematics-with-sagemath/mpoly_doctest.py +561 -0
  23. sage/tests/books/computational-mathematics-with-sagemath/nonlinear_doctest.py +491 -0
  24. sage/tests/books/computational-mathematics-with-sagemath/numbertheory_doctest.py +156 -0
  25. sage/tests/books/computational-mathematics-with-sagemath/polynomes_doctest.py +406 -0
  26. sage/tests/books/computational-mathematics-with-sagemath/premierspas_doctest.py +181 -0
  27. sage/tests/books/computational-mathematics-with-sagemath/programmation_doctest.py +663 -0
  28. sage/tests/books/computational-mathematics-with-sagemath/recequadiff_doctest.py +393 -0
  29. sage/tests/books/computational-mathematics-with-sagemath/sol/__init__.py +1 -0
  30. sage/tests/books/computational-mathematics-with-sagemath/sol/calculus_doctest.py +265 -0
  31. sage/tests/books/computational-mathematics-with-sagemath/sol/combinat_doctest.py +218 -0
  32. sage/tests/books/computational-mathematics-with-sagemath/sol/domaines_doctest.py +60 -0
  33. sage/tests/books/computational-mathematics-with-sagemath/sol/float_doctest.py +142 -0
  34. sage/tests/books/computational-mathematics-with-sagemath/sol/graphique_doctest.py +106 -0
  35. sage/tests/books/computational-mathematics-with-sagemath/sol/graphtheory_doctest.py +54 -0
  36. sage/tests/books/computational-mathematics-with-sagemath/sol/integration_doctest.py +57 -0
  37. sage/tests/books/computational-mathematics-with-sagemath/sol/linalg_doctest.py +57 -0
  38. sage/tests/books/computational-mathematics-with-sagemath/sol/linsolve_doctest.py +26 -0
  39. sage/tests/books/computational-mathematics-with-sagemath/sol/lp_doctest.py +48 -0
  40. sage/tests/books/computational-mathematics-with-sagemath/sol/mpoly_doctest.py +116 -0
  41. sage/tests/books/computational-mathematics-with-sagemath/sol/nonlinear_doctest.py +112 -0
  42. sage/tests/books/computational-mathematics-with-sagemath/sol/numbertheory_doctest.py +168 -0
  43. sage/tests/books/computational-mathematics-with-sagemath/sol/polynomes_doctest.py +108 -0
  44. sage/tests/books/computational-mathematics-with-sagemath/sol/recequadiff_doctest.py +59 -0
  45. sage/tests/books/judson-abstract-algebra/__init__.py +1 -0
  46. sage/tests/books/judson-abstract-algebra/actions-sage-exercises.py +52 -0
  47. sage/tests/books/judson-abstract-algebra/actions-sage.py +174 -0
  48. sage/tests/books/judson-abstract-algebra/algcodes-sage.py +131 -0
  49. sage/tests/books/judson-abstract-algebra/boolean-sage.py +270 -0
  50. sage/tests/books/judson-abstract-algebra/cosets-sage-exercises.py +88 -0
  51. sage/tests/books/judson-abstract-algebra/cosets-sage.py +171 -0
  52. sage/tests/books/judson-abstract-algebra/crypt-sage.py +152 -0
  53. sage/tests/books/judson-abstract-algebra/cyclic-sage.py +451 -0
  54. sage/tests/books/judson-abstract-algebra/domains-sage.py +164 -0
  55. sage/tests/books/judson-abstract-algebra/fields-sage.py +300 -0
  56. sage/tests/books/judson-abstract-algebra/finite-sage.py +109 -0
  57. sage/tests/books/judson-abstract-algebra/galois-sage.py +485 -0
  58. sage/tests/books/judson-abstract-algebra/groups-sage.py +281 -0
  59. sage/tests/books/judson-abstract-algebra/homomorph-sage-exercises.py +66 -0
  60. sage/tests/books/judson-abstract-algebra/homomorph-sage.py +201 -0
  61. sage/tests/books/judson-abstract-algebra/integers-sage.py +198 -0
  62. sage/tests/books/judson-abstract-algebra/isomorph-sage.py +173 -0
  63. sage/tests/books/judson-abstract-algebra/normal-sage.py +134 -0
  64. sage/tests/books/judson-abstract-algebra/permute-sage.py +320 -0
  65. sage/tests/books/judson-abstract-algebra/poly-sage.py +301 -0
  66. sage/tests/books/judson-abstract-algebra/rings-sage.py +414 -0
  67. sage/tests/books/judson-abstract-algebra/sets-sage.py +164 -0
  68. sage/tests/books/judson-abstract-algebra/struct-sage.py +64 -0
  69. sage/tests/books/judson-abstract-algebra/sylow-sage.py +251 -0
  70. sage/tests/books/judson-abstract-algebra/vect-sage-exercises.py +49 -0
  71. sage/tests/books/judson-abstract-algebra/vect-sage.py +212 -0
  72. sage/tests/memcheck/__init__.py +1 -0
  73. sage/tests/memcheck/run_tests.py +25 -0
  74. sage/tests/memcheck/run_tests_in_valgrind.py +36 -0
  75. sage/tests/memcheck/symbolic_expression.py +12 -0
  76. sage/tests/memcheck/verify_no_leak.py +28 -0
  77. sage/tests/all.py +0 -0
  78. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-cachegrind +0 -0
  79. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-callgrind +0 -0
  80. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-cleaner +0 -0
  81. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-coverage +0 -0
  82. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-eval +0 -0
  83. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-fixdoctests +0 -0
  84. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-inline-fortran +0 -0
  85. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-ipynb2rst +0 -0
  86. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-ipython +0 -0
  87. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-massif +0 -0
  88. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-notebook +0 -0
  89. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-omega +0 -0
  90. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-preparse +0 -0
  91. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-run +0 -0
  92. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-run-cython +0 -0
  93. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-runtests +0 -0
  94. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-startuptime.py +0 -0
  95. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-valgrind +0 -0
  96. {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.30.dist-info}/WHEEL +0 -0
@@ -0,0 +1,478 @@
1
+ # sage_setup: distribution = sagemath-repl
2
+ # sage.doctest: needs sage.symbolic
3
+ """
4
+ This file (./float_doctest.sage) was *autogenerated* from ./float.tex,
5
+ with sagetex.sty version 2011/05/27 v2.3.1.
6
+ It contains the contents of all the sageexample environments from this file.
7
+ You should be able to doctest this file with:
8
+ sage -t ./float_doctest.sage
9
+ It is always safe to delete this file; it is not used in typesetting your
10
+ document.
11
+
12
+ Sage example in ./float.tex, line 251::
13
+
14
+ sage: xrdf = RDF(3.0)
15
+
16
+ Sage example in ./float.tex, line 276::
17
+
18
+ sage: R100 = RealField(100) # precision: 100 bits.
19
+ sage: x100 = R100(3/8); x100
20
+ 0.37500000000000000000000000000
21
+
22
+ Sage example in ./float.tex, line 300::
23
+
24
+ sage: Rdefault = RealField() # default precision of 53 bits
25
+ sage: xdefault = Rdefault(2/3)
26
+
27
+ Sage example in ./float.tex, line 319::
28
+
29
+ sage: xrdf.prec()
30
+ 53
31
+ sage: x100.prec()
32
+ 100
33
+ sage: xdefault.prec()
34
+ 53
35
+
36
+ Sage example in ./float.tex, line 347::
37
+
38
+ sage: x = 1.0; type(x)
39
+ <... 'sage.rings.real_mpfr.RealLiteral'>
40
+ sage: x.prec()
41
+ 53
42
+
43
+ Sage example in ./float.tex, line 384::
44
+
45
+ sage: x = 1.0 # x belongs to RealField()
46
+ sage: x = 0.1e+1 # idem: x belongs to RealField()
47
+ sage: x = 1 # x is an integer
48
+ sage: x = RDF(1) # x is a machine double-precision number
49
+ sage: x = RDF(1.) # idem: x is a machine double-precision number
50
+ sage: x = RDF(0.1e+1) # idem
51
+ sage: x = 4/3 # x is a rational number
52
+ sage: R = RealField(20)
53
+ sage: x = R(1) # x is a 20-bit floating-point number
54
+
55
+ Sage example in ./float.tex, line 400::
56
+
57
+ sage: RDF(8/3)
58
+ 2.6666666666666665
59
+ sage: R100 = RealField(100); R100(8/3)
60
+ 2.6666666666666666666666666667
61
+
62
+ Sage example in ./float.tex, line 412::
63
+
64
+ sage: x = R100(8/3)
65
+ sage: R = RealField(); R(x)
66
+ 2.66666666666667
67
+ sage: RDF(x)
68
+ 2.6666666666666665
69
+
70
+ Sage example in ./float.tex, line 431::
71
+
72
+ sage: 1.0/0.0
73
+ +infinity
74
+ sage: RDF(1)/RDF(0)
75
+ +infinity
76
+ sage: RDF(-1.0)/RDF(0.)
77
+ -infinity
78
+
79
+ Sage example in ./float.tex, line 441::
80
+
81
+ sage: 0.0/0.0
82
+ NaN
83
+ sage: RDF(0.0)/RDF(0.0)
84
+ NaN
85
+
86
+ Sage example in ./float.tex, line 496::
87
+
88
+ sage: R2 = RealField(2)
89
+
90
+ Sage example in ./float.tex, line 545::
91
+
92
+ sage: x2 = R2(1.); x2.ulp()
93
+ 0.50
94
+ sage: xr = 1.; xr.ulp()
95
+ 2.22044604925031e-16
96
+
97
+ Sage example in ./float.tex, line 655::
98
+
99
+ sage: a = 10000.0; b = 9999.5; c = 0.1; c
100
+ 0.100000000000000
101
+ sage: a1 = a+c # add a small perturbation to a.
102
+ sage: a1-b
103
+ 0.600000000000364
104
+
105
+ Sage example in ./float.tex, line 680::
106
+
107
+ sage: a = 1.0; b = 10.0^4; c = 1.0
108
+ sage: delta = b^2-4*a*c
109
+ sage: x = (-b-sqrt(delta))/(2*a); y = (-b+sqrt(delta))/(2*a)
110
+ sage: x, y
111
+ (-9999.99990000000, -0.000100000001111766)
112
+
113
+ Sage example in ./float.tex, line 692::
114
+
115
+ sage: x+y+b/a
116
+ 0.000000000000000
117
+ sage: x*y-c/a
118
+ 1.11766307320238e-9
119
+
120
+ Sage example in ./float.tex, line 713::
121
+
122
+ sage: y = (c/a)/x; y
123
+ -0.000100000001000000
124
+ sage: x+y+b/a
125
+ 0.000000000000000
126
+ sage: x*y-c/a
127
+ -1.11022302462516e-16
128
+
129
+ Sage example in ./float.tex, line 746::
130
+
131
+ sage: x1 = R2(1/2); x2 = R2(4); x3 = R2(-4)
132
+ sage: x1, x2, x3
133
+ (0.50, 4.0, -4.0)
134
+ sage: x1+(x2+x3)
135
+ 0.50
136
+ sage: (x1+x2)+x3
137
+ 0.00
138
+
139
+ Sage example in ./float.tex, line 781::
140
+
141
+ sage: x = RDF(1/3)
142
+ sage: for i in range(1,100): x = 4*x-1; print(x)
143
+ 0.33333333333333326
144
+ 0.33333333333333304
145
+ 0.33333333333333215
146
+ ...
147
+ -1.0
148
+ -5.0
149
+ -21.0
150
+ -85.0
151
+ -341.0
152
+ -1365.0
153
+ -5461.0
154
+ -21845.0
155
+ ...
156
+
157
+ Sage example in ./float.tex, line 824::
158
+
159
+ sage: x = RDF(1/2)
160
+ sage: for i in range(1,100): x = 3*x-1; print(x)
161
+ 0.5
162
+ 0.5
163
+ 0.5
164
+ ...
165
+ 0.5
166
+
167
+ Sage example in ./float.tex, line 863::
168
+
169
+ sage: x = RDF(1/3)
170
+
171
+ Sage example in ./float.tex, line 867::
172
+
173
+ sage: x = 1/3
174
+
175
+ Sage example in ./float.tex, line 990::
176
+
177
+ sage: def sumharmo(p):
178
+ ....: RFP = RealField(p)
179
+ ....: y = RFP(1.); x = RFP(0.); n = 1
180
+ ....: while x != y:
181
+ ....: y = x; x += 1/n; n += 1
182
+ ....: return p, n, x
183
+
184
+ Sage example in ./float.tex, line 1003::
185
+
186
+ sage: sumharmo(2)
187
+ (2, 5, 2.0)
188
+ sage: sumharmo(20)
189
+ (20, 131073, 12.631)
190
+
191
+ Sage example in ./float.tex, line 1072::
192
+
193
+ sage: def iter(y, delta, a, n):
194
+ ....: for i in range(0,n):
195
+ ....: y += delta
196
+ ....: delta *= a
197
+ ....: return y
198
+
199
+ Sage example in ./float.tex, line 1087::
200
+
201
+ sage: def exact(y, delta, a, n):
202
+ ....: return y+delta*(1-a^n)/(1-a)
203
+
204
+ Sage example in ./float.tex, line 1106::
205
+
206
+ sage: y0 = RDF(10^13); delta0 = RDF(1); a = RDF(1-10^(-8)); n = 100000
207
+ sage: ii = iter(y0,delta0,a,n)
208
+ sage: s = exact(10^13,1,1-10^(-8),n)
209
+ sage: print("exact - classical summation: %.1f" % (s-ii)) # abs tol 0.1
210
+ exact - classical summation: -45.6
211
+
212
+ Sage example in ./float.tex, line 1128::
213
+
214
+ sage: def sumcomp(y, delta, e, n, a):
215
+ ....: for i in range(0,n):
216
+ ....: b = y
217
+ ....: e += delta
218
+ ....: y = b+e
219
+ ....: e += (b-y)
220
+ ....: delta = a*delta # new value of delta
221
+ ....: return y
222
+
223
+ Sage example in ./float.tex, line 1194::
224
+
225
+ sage: c = sumcomp(y0,delta0,RDF(0.0),n,a)
226
+ sage: print("exact - compensated summation: %.5f" \
227
+ ....: % RDF(s-RR(c).exact_rational()))
228
+ exact - compensated summation: -0.00042
229
+
230
+ Sage example in ./float.tex, line 1242::
231
+
232
+ sage: x = CDF(2,1.); x
233
+ 2.0 + 1.0*I
234
+ sage: y = CDF(20,0); y
235
+ 20.0
236
+
237
+ Sage example in ./float.tex, line 1249::
238
+
239
+ sage: z = ComplexDoubleElement(2.,1.); z
240
+ 2.0 + 1.0*I
241
+
242
+ Sage example in ./float.tex, line 1269::
243
+
244
+ sage: C = ComplexField(); C(2,3)
245
+ 2.00000000000000 + 3.00000000000000*I
246
+ sage: C100 = ComplexField(100); C100(2,3)
247
+ 2.0000000000000000000000000000 + 3.0000000000000000000000000000*I
248
+
249
+ Sage example in ./float.tex, line 1297::
250
+
251
+ sage: R200 = RealField(200); R200.pi()
252
+ 3.1415926535897932384626433832795028841971693993751058209749
253
+ sage: R200.euler_constant()
254
+ 0.57721566490153286060651209008240243104215933593992359880577
255
+
256
+ Sage example in ./float.tex, line 1314::
257
+
258
+ sage: x = RDF.pi()/2; x.cos() # floating-point approximation of zero!
259
+ 6.123233995736757e-17
260
+ sage: x.cos().arccos() - x
261
+ 0.0
262
+
263
+ Sage example in ./float.tex, line 1564::
264
+
265
+ sage: r3 = RIF(sqrt(3)); r3
266
+ 1.732050807568877?
267
+ sage: print(r3.str(style='brackets'))
268
+ [1.7320508075688769 .. 1.7320508075688775]
269
+
270
+ Sage example in ./float.tex, line 1602::
271
+
272
+ sage: sage.rings.real_mpfi.printing_style = 'brackets'
273
+
274
+ Sage example in ./float.tex, line 1616::
275
+
276
+ sage: r2 = RIF(2); r2, r2.diameter()
277
+ ([2.0000000000000000 .. 2.0000000000000000], 0.000000000000000)
278
+
279
+ Sage example in ./float.tex, line 1628::
280
+
281
+ sage: rpi = RIF(sqrt(2),pi); rpi
282
+ [1.4142135623730949 .. 3.1415926535897936]
283
+ sage: RIF(0,+infinity)
284
+ [0.0000000000000000 .. +infinity]
285
+
286
+ Sage example in ./float.tex, line 1649::
287
+
288
+ sage: RBF(pi)
289
+ [3.141592653589793 +/- ...e-16]
290
+ sage: RealBallField(100)(pi)
291
+ [3.14159265358979323846264338328 +/- ...e-30]
292
+
293
+ Sage example in ./float.tex, line 1662::
294
+
295
+ sage: RBF(2).rad()
296
+ 0.00000000
297
+
298
+ Sage example in ./float.tex, line 1675::
299
+
300
+ sage: si = sin(RIF(pi))
301
+ sage: si.contains_zero()
302
+ True
303
+ sage: sb = sin(RBF(pi))
304
+ sage: sb.contains_zero()
305
+ True
306
+
307
+ Sage example in ./float.tex, line 1704::
308
+
309
+ sage: a = RealIntervalField(30)(1, RR(1).nextabove())
310
+ sage: a.bisection()
311
+ ([1.0000000000 .. 1.0000000000], [1.0000000000 .. 1.0000000019])
312
+
313
+ Sage example in ./float.tex, line 1713::
314
+
315
+ sage: b = RealIntervalField(2)(-1,6)
316
+ sage: b.center(), b.diameter()
317
+ (2.0, 8.0)
318
+
319
+ Sage example in ./float.tex, line 1725::
320
+
321
+ sage: s = RIF(1,2)
322
+ sage: b = RBF(s)
323
+ sage: bpi = RBF(pi)
324
+ sage: ipi = RIF(bpi)
325
+
326
+ Sage example in ./float.tex, line 1735::
327
+
328
+ sage: RIF(RBF(RIF(1,2))) == RIF(1,2)
329
+ False
330
+ sage: RBF(RIF(RBF(pi))) == RBF(pi)
331
+ False
332
+
333
+ Sage example in ./float.tex, line 1810::
334
+
335
+ sage: E = RIF(-pi/4,pi)
336
+ sage: sin(E)
337
+ [-0.70710678118654769 .. 1.0000000000000000]
338
+ sage: E = RIF(-1,2); exp(E)
339
+ [0.36787944117144227 .. 7.3890560989306505]
340
+ sage: E = RIF(0,1); log(E)
341
+ [-infinity .. -0.0000000000000000]
342
+
343
+ Sage example in ./float.tex, line 1838::
344
+
345
+ sage: E=RIF(-pi,pi)
346
+ sage: f = lambda x: sin(x)/x
347
+ sage: f(E)
348
+ [-infinity .. +infinity]
349
+
350
+ Sage example in ./float.tex, line 1913::
351
+
352
+ sage: x = RIF(-1,1)
353
+ sage: 1-x^2
354
+ [0.0000000000000000 .. 1.0000000000000000]
355
+ sage: 1-x*x
356
+ [0.0000000000000000 .. 2.0000000000000000]
357
+ sage: (1-x)*(1+x)
358
+ [0.0000000000000000 .. 4.0000000000000000]
359
+
360
+ Sage example in ./float.tex, line 1975::
361
+
362
+ sage: def bisect(funct, x, tol, zeros):
363
+ ....: if 0 in funct(x):
364
+ ....: if x.diameter()>tol:
365
+ ....: x1,x2 = x.bisection()
366
+ ....: bisect(funct,x1,tol,zeros)
367
+ ....: bisect(funct,x2,tol,zeros)
368
+ ....: else:
369
+ ....: zeros.append(x)
370
+ sage: sage.rings.real_mpfi.printing_style = 'question'
371
+ sage: fs = lambda x: sin(1/x)
372
+ sage: d = RealIntervalField(100)(1/64,1/32)
373
+ sage: zeros = []
374
+ sage: bisect(fs,d,10^(-25),zeros)
375
+ sage: for s in zeros:
376
+ ....: s
377
+ 0.015915494309189533576888377?
378
+ 0.01675315190441003534409303?
379
+ 0.01768388256576614841876487?
380
+ 0.018724110951987686561045148?
381
+ 0.01989436788648691697111047?
382
+ 0.021220659078919378102517835?
383
+ 0.02273642044169933368126911?
384
+ 0.024485375860291590118289809?
385
+ 0.026525823848649222628147293?
386
+ 0.02893726238034460650343342?
387
+ sage: dfs = lambda x: -cos(1/x)/x^2
388
+ sage: not any(dfs(z).contains_zero() for z in zeros)
389
+ True
390
+
391
+ Sage example in ./float.tex, line 2022::
392
+
393
+ sage: def NearlySingularMatrix(R, n):
394
+ ....: M=matrix(R,n,n)
395
+ ....: for i in range(0,n):
396
+ ....: for j in range(0,n):
397
+ ....: M[i,j]= (1+log(R(1+i)))/((i+1)^2+(j+1)^2)
398
+ ....: return M
399
+
400
+ Sage example in ./float.tex, line 2044::
401
+
402
+ sage: n=35
403
+ sage: NearlySingularMatrix(RDF,n).det() == 0.0
404
+ True
405
+
406
+ Sage example in ./float.tex, line 2053::
407
+
408
+ sage: NearlySingularMatrix(RBF,n).det().contains_zero()
409
+ True
410
+
411
+ Sage example in ./float.tex, line 2064::
412
+
413
+ sage: def tryDet(R, n):
414
+ ....: p = 53
415
+ ....: z = True
416
+ ....: while z:
417
+ ....: p += 100
418
+ ....: MRF=NearlySingularMatrix(R(p),n)
419
+ ....: d = MRF.det()
420
+ ....: z = d.contains_zero()
421
+ ....: return p,d
422
+ sage: tryDet(RealBallField,n) # long time
423
+ (1653, [9.552323592707808e-485 +/- 1.65e-501])
424
+
425
+ Sage example in ./float.tex, line 2095::
426
+
427
+ sage: tryDet(RealIntervalField,n) # long time
428
+ (1653, 9.552323592707808?e-485)
429
+
430
+ Sage example in ./float.tex, line 2135::
431
+
432
+ sage: CBF(sqrt(2),pi)
433
+ [1.414213562373095...] + [3.141592653589793...]*I
434
+ sage: CIF(sqrt(2),pi)
435
+ 1.414213562373095? + 3.141592653589794?*I
436
+ sage: CIF(sqrt(2)+pi*I)
437
+ 1.414213562373095? + 3.141592653589794?*I
438
+ sage: CBF(sqrt(2)+pi*I)
439
+ [1.414213562373095...] + [3.141592653589793...]*I
440
+
441
+ Sage example in ./float.tex, line 2146::
442
+
443
+ sage: sage.rings.real_mpfi.printing_style = 'brackets'
444
+
445
+ Sage example in ./float.tex, line 2149::
446
+
447
+ sage: c = CIF(RIF(1,2),RIF(-3,3))
448
+ sage: c.real()
449
+ [1.0000000000000000 .. 2.0000000000000000]
450
+ sage: c.imag()
451
+ [-3.0000000000000000 .. 3.0000000000000000]
452
+ sage: CBF(RIF(1,2),RIF(-3,3))
453
+ [+/- 2.01] + [+/- 3.01]*I
454
+
455
+ Sage example in ./float.tex, line 2164::
456
+
457
+ sage: sage.rings.real_mpfi.printing_style = 'question'
458
+
459
+ Sage example in ./float.tex, line 2167::
460
+
461
+ sage: ComplexIntervalField(100)(1+I*pi).arg()
462
+ 1.26262725567891168344432208361?
463
+ sage: ComplexBallField(100)(1+I*pi).arg()
464
+ [1.26262725567891168344432208360 +/- ...e-30]
465
+ sage: ComplexIntervalField(100)(1+I*pi).norm()
466
+ 10.8696044010893586188344909999?
467
+
468
+ Sage example in ./float.tex, line 2242::
469
+
470
+ sage: sage.rings.real_mpfi.printing_style = 'question'
471
+
472
+ Sage example in ./float.tex, line 2245::
473
+
474
+ sage: x=QQbar(sqrt(3)); x
475
+ 1.732050807568878?
476
+ sage: x.interval(RealIntervalField(100))
477
+ 1.73205080756887729352744634151?
478
+ """