forked from mpmath/mpmath
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CHANGES
1046 lines (914 loc) · 44.2 KB
/
CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--1.3.0--
Released March 7, 2023
Security issues:
* Fixed ReDOS vulnerability in mpmathify() (CVE-2021-29063) (Vinzent Steinberg)
Features:
* Added quadsubdiv() for numerical integration with adaptive path splitting
(Fredrik Johansson)
* Added the Cohen algorithm for inverse Laplace transforms
(Guillermo Navas-Palencia)
* Some speedup of matrix multiplication (Fredrik Johansson)
* Optimizations to Carlson elliptic integrals (Paul Masson)
* Added signal functions (squarew(), trianglew(), sawtoothw(), unit_triangle()
sigmoidw()) (Nike Dattani, Deyan Mihaylov, Tina Yu)
Bug fixes:
* Correct mpf initialization from tuple for finf and fninf (Sergey B Kirpichev)
* Support QR decomposition for matrices of width 0 and 1 (Clemens Hofreither)
* Fixed some cases where elliprj() gave inaccurate results (Fredrik Johansson)
* Fixed cases where digamma() hangs for complex input (Fredrik Johansson)
* Fixed cases of polylog() with integer-valued parameter with complex type
(Fredrik Johansson)
* Fixed fp.nsum() with Euler-Maclaurin algorithm (Fredrik Johansson)
Maintenance:
* Dropped support for Python 3.4 (Sergey B Kirpichev)
* Documentation cleanup (Sergey B Kirpichev)
* Removed obsolete files (Sergey B Kirpichev)
* Added options to runtests.py to skip tests and exit on failure
(Jonathan Warner)
--1.2.0--
Released February 1, 2021
Features and optimizations:
* Support @ operator for matrix multiplication (Max Gaukler)
* Add eta() implementing the Dedekind eta function
* Optimized the python_trailing function (adhoc-king)
* Implement unary plus for matrices (Max Gaukler)
* Improved calculation of gram_index (p15-git-acc)
Compatibility:
* Enable sage backend by default only if SAGE_ROOT is set (Pauli Virtanen)
* Fix syntax warnings on CPython 3.8 (Sergey B Kirpichev)
* Changed version requirements to Python 2.7 and 3.4 or later
(Sergey B Kirpichev)
* Improvements to the setup and test code (Sergey B Kirpichev)
* Fix sys.version comparisons for compatibility with Python 3.10 (Jakub Wilk)
* Fixes to Python2/3 compatibility for printing (Christian Clauss)
Bug fixes:
* Fix a possible division by zero in shanks() (Pascal Hebbeker)
* Fixed indexing errors in deHoog, Knight & Stokes inverse laplace
transform algorithm (Kris Kuhlman)
* Corrected branch cuts of the elliprj() function in some cases
* Fix initialization of iv.matrix from non-interval matrix (Max Gaukler)
* Preserve function signatures in PrecisionManager (Viet Tran)
* Implemented float and complex conversions for ivmpf
(Jonathan Warner)
* Fixed issue with scalar-matrix multiplication for interval matrices
(Jonathan Warner)
* Fix estimation of quadrature error with multiple subintervals (Tom Minka)
* Fixed a problem with the defun decorators (Sergey B Kirpichev)
* Fix eigenvalue sorting by absolute value (Georg Ostrovski)
Cleanup:
* Documentation corrections (Paul Masson, S.Y. Lee)
* Remove inaccessible logic in fsum/fdot (Sergey B Kirpichev)
* Remove broken force_type option for matrix constructor (Max Gaukler)
* Fix text of the BSD license in LICENSE (Sergey B Kirpichev)
* Minor code cleanup (Frédéric Chapoton)
* Removed old, unused code
--1.1.0--
Released December 11, 2018
Bugs:
* Fixed severe bug in householder() for complex matrices
(Michael Kagalenko)
* Fixed frequently-reported bug where findroot() mysteriously raised
UnboundLocalError (Sergey B Kirpichev)
* Corrected rounding in binary-to-decimal conversion above 500 digits
* Fixed minor loss of accuracy affecting rf(), ff(), binomial(), beta()
* Fixed incorrect computation of the Hurwitz zeta function in some cases
* Fixed accuracy of digamma function near 0
* Fixed RuntimeError in qfac() in Python 3.7 caused by raising
StopIteration (Zbigniew Jędrzejewski-Szmek)
* Fix to allow NumPy arrays in fdot() (Nico Schlömer)
Features and improvements:
* Added more automatic conversions from Fraction, Decimal, NumPy types
(Jonathan Warner)
* Support creating mpf from a long literal (ylemkimon)
* Implemented log1p()
* Slight speedup of eig()
* Implement polylog() for general complex s and z by using Hurwitz zeta
algorithm as a fallback
Library:
* Test more CPython and PyPy versions (Sergey B Kirpichev, Aaron Meurer)
* Drop support for Python 2.6 and 3.2 (Sergey B Kirpichev)
* Use py.test for test code; lots of code cleanup (Sergey B Kirpichev)
* Corrections to the documentation (Paul Masson, Connor Behan,
Warren Weckesser, Aaron Meurer)
--1.0.0--
Released September 27, 2017
* Bumped to major version number for 10 year anniversary
* Added module for inverse Laplace transforms, including the top level
function invertlaplace() as well as several different algorithms
(Talbot, Gaver-Stehfest and de Hoog) implemented in
mpmath.calculus.inverselaplace (Kris Kuhlman)
* Fixed bugs in elliprg() giving incorrect values for certain input
* Fixed wrong degree 1 nodes for Gaussian quadrature
* Made make acot(0) and acoth(0) return a finite result
* Fixed sieved zeta sum not being used in Python 3, and added cutoff
for sieved zeta sum on 32-bit systems when too much memory would be used
* Fixed zeta(0,0.5) to return correct value instead of raising
NoConvergence exception
* Added detection of exact zeros in gammainc(), in particular fixing
NoConvergence error for gammainc(3,-1+1j)
* Fixed wrong values from besseli() due to improper internal precision
* Fixed bessely(0,1j) to return complex nan instead of raising NameError
(Paul Masson)
* Changed float() and complex() applied to an mpf or mpc to use rounding
to nearest (or the context rounding mode) instead truncating
* Fix imaginary part of gammainc(n,x), n negative odd int, x < 0
* Added alternative "phase" color scheme to cplot()
* Better error message for int(inf) or int(nan) (Aaron Meurer)
* Fixed polyroots() with error=True
* Added support to pass optional initial values to polyroots()
(Michael Kagalenko)
* Rewrote the Python major version selection to make it work if something
else has redefined xrange (Arne Brys)
* Switched documentation formula rendering to MathJax (Sergey B Kirpichev)
* Fixed documentation TeX build (Sergey B Kirpichev)
* Added PEP8 conformity testing (Sergey B Kirpichev)
* Various fixes for the test code and test infrastructure on different
platforms and Python versions (Sergey B Kirpichev)
* Fixed module paths in setup.py (Aaron Meurer)
* Documented more options for methods such as nstr() and hyper()
* Miscellaneous corrections to the documentation (various)
--0.19--
Released June 10, 2014
* Moved issue tracking to github and the main website to mpmath.org.
Several URLs and issue numbers were updated in the documentation
(Sergey B Kirpichev)
* Enabled automatic testing with Travis CI (Sergey B Kirpichev)
* Fixed many doctest issues (Sergey B Kirpichev)
* Converted line endings to LF (Ondrej Certik)
* Made polyroots() more robust (Ondrej Certik)
--0.18--
Released December 31, 2013
Linear algebra:
* added qr() for matrix QR factorization (contributed by Ken Allen)
* added functions eigsy(), eighe(), eig() to compute matrix
eigenvalues (contributed by Timo Hartmann)
* added functions svd(), svd_r(), svd_c() for singular value
decomposition of matrices (contributed by Timo Hartmann)
* added calculation of Gaussian quadrature rules for various weight
functions (contributed by Timo Hartmann)
* improved precision selection in exp_pade() (contributed by
Mario Pernici)
Special functions:
* fixed ellippi() to return an inf instead of raising an exception
* fixed a crash in zeta() with huge arguments
* added functions for computing Stirling numbers
(stirling1(), stirling2())
* improved the computation of zeros of zeta at high precision
(contributed by Juan Arias de Reyna)
* fixed zeta(-x) raising an exception for tiny x
* recognize when lerchphi() can call zeta() or polylog(),
handling those cases faster
Compatibility:
* fixed gmpy2 compatibility issues (contributed by Case Van Horsen)
* better solutions for python 2/3 compatibility,
using Benjamin Peterson's six.py
* fixes to allow mpmath to run in non-sage mode when sage is available
* support abstract base classes (contributed by Stefan Krastanov)
* use new-style classes to improve pypy performance
Other:
* added Levin, Sidi-S and Cohen/Villegas/Zagier series
transformations (contributed by Timo Hartmann)
* added isfinite() utility function
* fixed a problem with bisection root-finding
* fixed several documentation errors
* corrected number of coefficients returned by diffs() with
method='quad'
* fixed repr(constant) being slow at high precision
* made intervals hashable
--0.17--
Released February 1, 2011
Compatibility:
* Python 3 is now supported
* Dropped Python 2.4 compatibility
* Fixed Python 2.5 compatibility in matrix slicing code
* Implemented Python 3.2-compatible hashing, making mpmath numbers
hash compatible with extremely large integers and with fractions
in Python versions >= 3.2 (contributed by Case Vanhorsen)
Special functions:
* Implemented the von Mangoldt function (mangoldt())
* Implemented the "secondary zeta function" (secondzeta()) (contributed
by Juan Arias de Reyna).
* Implemented zeta zero counting (nzeros()) and the Backlund S function
(backlunds()) (contributed by Juan Arias de Reyna)
* Implemented derivatives of order 1-4 for siegelz() and siegeltheta()
(contributed by Juan Arias de Reyna)
* Improved Euler-Maclaurin summation for zeta() to give more accurate
results in the right half-plane when the reflection formula
cannot be used
* Implemented the Lerch transcendent (lerchphi())
* Fixed polygamma function to return a complex NaN at complex
infinity or NaN, instead of raising an unrelated exception.
--0.16--
Released September 24, 2010
Backends and distribution:
* Added Sage hooks for Cython versions of exp, ln, cos, sin,
hypergeometric series, and some related functions
* Fixed imports for gmpy2 compatibility (contributed by Case Van Horsen)
* Removed documentation from main mpmath package to save space (a separate
tar.gz file is now provided for the documentation sources)
* Fixed matplotlib version detection
* Converted files to Unix line endings
Special functions:
* Started adding plots of special functions to the documentation
* Added Anger and Weber functions (angerj(), webere())
* Added Lommel functions (lommels1(), lommels2())
* Added interval versions of gamma(), loggamma(), rgamma() and
factorial()
* Rewritten Airy functions to improve speed and accuracy
* Support for arbitrary-order derivatives of airyai(), airybi()
* Added Airy function zeros (airyaizero(), airybizero())
* Added Scorer functions (scorergi(), scorerhi())
* Added computation of Bessel function zeros and Bessel function
derivative zeros (besseljzero(), besselyzero())
* Fixed besselj(mpc(n), z)
* Rewritten lambertw() to fix various subtle bugs and robustly handle
numerical difficulties near branch cuts and branch points.
* Fixed fp.lambertw() to behave the same on branch cuts on systems with
and without signed-zero floats
* Added Carlson symmetric incomplete elliptic integrals
(elliprf(), elliprc(), elliprj(), elliprd(), elliprg())
* Added Legendre incomplete elliptic integrals (ellipf(), ellippi(),
ellipe() with two arguments)
* Implemented Parabolic cylinder functions (pcfd(), pcfu(), pcfv(),
pcfw())
* Implemented Euler-Maclaurin summation for hypergeometric functions
of order (p,p-1) to support evaluation with z close to 1 in remaining cases
* Fixed a bug in hypergeometric series summation, causing occasional
inaccurate results and incorrect detection of zeros
* Fixed qfrom(m=...)
Calculus:
* Implemented generators diffs_exp(), diffs_prod() for composing
derivatives
* Implemented Abel-Plana summation for infinite series (sumap())
Basic arithmetic and functions:
* Implemented matrix slice indexing, supporting submatrix
extraction and assignment (contributed by Ioannis Tziakos)
* Added missing constant fp.glaisher
* Fixed a bug preventing internal rational numbers from being
hashable
* Fixed bug in isnpint()
* Fixed a bug in cos_sin() for pure imaginary argument
* Slightly improved performance for elementary functions of pure
real or pure imaginary mpc inputs
* Fixed plot() with real-valued mpc instances
* Fixed cplot() to work with endpoints of other type than float/int
--0.15--
Released June 6, 2010
Basic transcendental functions:
* Reimplemented all elementary functions except log, reducing
overhead and giving asymptotic speedups at high precision
* Reimplemented gamma() and loggamma(), improving speed and
fixing accuracy in corner cases
* Added rgamma() (reciprocal gamma function)
* Added a stress test suite for the gamma function
* Provided top-level functions cos_sin() and cospi_sinpi() for fast
simultaneous computation
Riemann zeta function:
* New zetazeros() implementation, supporting arbitrarily large indices
(contributed by Juan Arias de Reyna)
* Tuned algorithm selection in zeta() for complex arguments
(contributed by Juan Arias de Reyna)
* Accelerated computation of zeta function series using sieving
Special functions:
* Added qfrom(), qbarfrom(), mfrom(), kfrom(), taufrom() for elliptic
argument conversion
* Merged jsn(), jcn(), jdn() -> ellipfun() and generalized it to compute
all 12 Jacobi elliptic functions
* Implemented the Klein j-invariant (kleinj())
* Implemented the q-Pochhammer symbol (qp())
* Implemented q-factorial (qfac()) and q--gamma (qgamma())
* Implemented q-hypergeometric series (qhyper())
* Implemented bilateral hypergeometric series (bihyper())
* Implemented Appell 2D hypergeometric series F2-F4 (appellf2()-appellf4())
* Implemented generalized 2D hypergeometric series (hyper2d())
* Fixed gammainc() for integer-valued complex argument (contributed by
Juan Arias de Reyna)
* Fixed asymptotic expansion of hyp1f1() (contributed by Juan Arias de Reyna)
Numerical calculus:
* Added support for multidimensional series in nsum()
* Made nprod() faster by default by extrapolating directly instead of
calling nsum()
* Changed some options for diff()/diffs()
* Made taylor() chop tiny coefficients by default
* Added support for partial derivatives in diff()
Interval arithmetic:
* All interval arithmetic functionality moved to a separate context
namespace (iv)
* Preliminary support for complex intervals (iv.mpc)
* Fixed interval cos/sin to support intervals overlapping zeros/extreme points
* Implemented interval atan2
* Implemented exp/log/cos/sin for complex intervals
* Some other interface changes to interval code
Utility functions:
* Made chop() use relative rather than absolute tolerance for
real/imaginary parts
* Optimized floor(), ceil(), isinf(), isnan(), isint()
* Implemented nint(), frac(), isnormal()
* Fixed and documented semantics for isinf(), isin(), isnan()
* Added utility functions autoprec(), maxcalls(), memoize()
Miscellaneous tweaks and fixes:
* Support complex conjugation in fdot()
* Added support for Cholesky decomposition of complex matrices
* Fixed a small precision bug in linear algebra functions
* Suppress NoConvergence exception when plotting
* Removed some dirty code to improve PyPy compatibility
* Fixed plotting to work with mpmath numbers in the interval specification
* Fixed fp arithmetic on systems where math.log and math.sqrt return NaN
instead of raising an exception
* Fixed fp.conj for Python 2.4 and 2.5
* Fixed quadrature to work with reversed infinite intervals such as [0,-inf]
* Renamed modf() -> fmod() for consistency
--0.14--
Released February 5, 2010
General changes:
* Fully separated the code into "low-level" and "high-level", permitting the
use of alternative contexts (the mpmath.mp object provides the default
implementation)
* Implemented a context for fast double-precision arithmetic using Python
types (mpmath.fp)
* Implemented hooks for importing a faster version of mp arithmetic from Sage
* Implemented optimized fp versions of certain functions (including erf, erfc,
gamma, digamma, ei, e1)
* Renamed and reorganized various internal modules and methods (including
merging low-level modules into mpmath.libmp). This should not affect most
external code using top-level imports.
Plotting:
* Implemented splot() for 3D surface plots (contributed by Jorn Baayen)
* Permit calling plot functions with custom axes (contributed by Jorn Baayen)
Matrices:
* Fixed lu_solve for overdetermined systems (contributed by Vinzent Steinberg)
* Added conjugate matrix transpose (contributed by Vinzent Steinberg)
* Implemented matrix functions (expm, cosm, sinm, sqrtm, logm, powm)
Miscellaneous:
* Prettier printing of numbers with leading zeros at small precisions
* Made nstr pass on kwargs, permitting more formatting options
* Fixed wrong directed rounding of addition of numbers with large magnitude
differences
* Fixed several docstring typos (contributed by Chris Smith)
* Fixed a bug that prevented caching of quadrature nodes to work optimally.
Special functions:
* Implemented fast evaluation for large imaginary heights of the Riemann zeta
function, Z function and derived functions using the Riemann-Siegel
(contributed by Juan Arias de Reyna)
* Unified the zeta() and hurwitz() functions, automatically selecting a fast
algorithm
* Improved altzeta() to fall back to zeta() for large arguments
* Fixed accuracy of zeta(s) for s ~= 1
* Implemented exact evaluation of Euler numbers (contributed by Juan Arias
de Reyna)
* Implemented numerical evaluation of Euler numbers and Euler polynomials
(eulernum(), eulerpoly())
* Fixed bernpoly() and eulerpoly() to compute accurate values for large
parameters
* Fixed accuracy problems for hypergeometric functions with large parameters
* Faster evaluation of hypergeometric series using on-the-fly code generation
* Optimized hypercomb to detect certain zero terms symbolically
* Removed the djtheta function (jtheta() accepts a derivative parameter)
* Implemented li(x, offset=True) to compute the offset logarithmic integral
* Fixed wrong branch in Lambert W function for certain complex inputs
* Implemented the reflection formula for the Barnes G-function,
superfactorials, hyperfactorials, permitting large arguments in the left
half-plane
* Implemented analytic continuation to |z| >= 1 for hypergeometric functions
pFq with p=q+1; added hyp3f2()
* Implemented Borel summation of divergent pFq functions with p > q+1
* Implemented automatic degree reduction of hypergeometric functions with
repeated parameters
* Added convenience functions expj(), expjpi()
* Use Mathematica's convention for the continuation of the Meijer G-function
* Added phase(), polar(), rect() functions for compatibility with the
Python 2.6 cmath module
* Implemented spherical harmonics (spherharm())
* Optimized ci(), si(), chi(), shi() for complex arguments by evaluating
them in terms of ei()
* Optimized hyp2f1 for z ~= -1
--0.13--
Released August 13, 2009
New special functions:
* The generalized exponential integral E_n (expint(), e1() for E_1)
* The generalized incomplete beta function (betainc())
* Whittaker functions (whitm(), whitw())
* Struve functions (struveh(), struvel())
* Kelvin functions (ber(), bei(), ker(), kei())
* Cyclotomic polynomials (cyclotomic())
* The Meijer G-function (meijerg())
* Clausen functions (clsin(), clcos())
* The Appell F1 hypergeometric function of two variables (appellf1())
* The Hurwitz zeta function, with nth order derivatives (hurwitz())
* Dirichlet L-series (dirichlet())
* Coulomb wave functions (coulombf(), coulombg(), coulombc())
* Associated Legendre functions of 1st and 2nd kind (legenp(), legenq())
* Hermite polynomials (hermite())
* Gegenbauer polynomials (gegenbauer())
* Associated Laguerre polynomials (laguerre())
* Hypergeometric functions hyp1f2(), hyp2f2(), hyp2f3(), hyp2f0(), hyperu()
Evaluation of hypergeometric functions:
* Added the function hypercomb() for evaluating expressions containing
hypergeometric series, with automatic handling of limits
* The available hypergeometric series (of orders up to and including 2F3)
implement asymptotic expansions with respect to the last argument z, allowing
fast and accurate evaluation anywhere in the complex plane. A massive number
of functions, including Bessel functions, error functions, etc., have been
updated to take advantage of this to support fast and accurate evaluation
anywhere in the complex plane.
* Fixed hyp2f1 to handle z close to and on the unit circle (supporting
evaluation anywhere in the complex plane)
* hyper() handles the 0F0 and 1F0 cases exactly
* hyper() eventually raises NoConvergence instead of getting stuck in
an infinite loop if given a divergent or extremely slowly convergent series
Other improvements and bug fixes to special functions:
* gammainc is much faster for large arguments and avoids catastrophic
cancellation
* Implemented specialized code for ei(x), e1(x), expint(n,x) and gammainc(n,x)
for small integers n, making evaluation much faster
* Extended the domain of polylog
* Fixed accuracy for asin(x) near x = 1
* Fast evaluation of Bernoulli polynomials for large z
* Fixed Jacobi polynomials to handle some poles
* Some Bessel functions support computing nth order derivatives
* A set of "torture tests" for special functions is available as
tests/torture.py
Other:
* Implemented the differint() function for fractional differentiaton / iterated
integration
* Added functions fadd, fsub, fneg, fmul, fdiv for high-level arithmetic with
controllable precision and rounding
* Added the function mag() for quick order-of-magnitude estimates of numbers
* Implemented powm1() for accurate calculation of x^y-1
* Improved speed and accuracy for raising a pure imaginary number to
an integer power
* nthroot() renamed to root(); root() optionally computes any of
the non-principal roots of a number
* Implemented unitroots() for generating all (primitive) roots of unity
* Added the mp.pretty option for nicer repr output
--0.12--
Released June 9, 2009
General
* It is now possible to create multiple context objects and use context-local
methods instead of global state/functions (e.g. mp2=mp.clone(); mp2.dps=50;
mp2.cos(3)). Not all functions have been converted to context methods, and
there are some bugs, so this feature is currently experimental.
* If mpmath is installed in Sage 4.0 or later, mpmath will now use sage.Integer
instead of Python long internally.
* Removed instances of old-style integer division from the codebase.
* runtests.py can be run with -coverage to generate coverage statistics.
Types and basic arithmetic
* Fixed comparison with -inf.
* Changed repr format of the mpi interval type to make eval(repr(x)) == x.
* Improved printing of intervals, with configurable output format (contributed
by Vinzent Steinberg based on code by Don Peterson).
* Intervals supported by mpmathify() and nstr() (contributed by Vinzent
Steinberg).
* mpc is now hashable.
* Added more formatting options to the internal function to_str.
* Faster pure-Python square root.
* Fix trailing whitespace giving wrong values in str->mpf conversion.
Calculus
* Fixed nsum() with Euler-Maclaurin summation which would previously
ignore the starting index and sum from n=1.
* Implemented Newton's method for findroot() (contributed by Vinzent
Steinberg).
Linear algebra
* Fixed LU_decomp() to recognize singular matrices (contributed by Jorn Baayen).
* The various norm functions were replaced by the generic vector norm
function norm(x,p) and the generic matrix norm function mnorm(x,p).
Special functions:
* Some internal caches were changed to always slightly overallocate
precision. This fixes worst-case behavior where previously the cached
value had to be recomputed on every function call.
* Fixed log(tiny number) returning nonsense at high precision.
* Fixed gamma() and derivative functions such as binomial() returning
wrong results at integer inputs being divisible by a large power of 2.
* Fixed asin() not to raise an exception at high precision (contributed
by Vinzent Steinberg).
* Optimized the AGM code for the natural logarithm, making the previously
used Newton method at intermediate precisions obsolete.
* The arithmetic-geometric mean function agm() is now an order of magnitude
faster at low precision.
* Faster implementations of ellipk() and ellipe().
* Analytic continuation of ellipe() to |x| >= 1 implemented.
* Implemented the log gamma function (loggamma()) with correct branch
cuts (slow, placeholder implementation).
* Fixed branch cuts of hyperfac().
* Implemented the Riemann-Siegel Z-function (siegelz()).
* Implemented the Riemann-Siegel theta function (siegeltheta()).
* Implemented calculation of Gram points (grampoint()).
* Implemented calculation of Riemann zeta function zeros (zetazero()).
* Implemented the prime counting function: a slow, exact version (primepi()).
and a fast approximate version (primepi2()) that gives a bounding interval.
* Implemented the Riemann R prime counting function (riemannr()).
* Implemented Bell numbers and polynomials (bell()).
* Implemented the expm1() function.
* Implemented the 'polyexponential function' (polyexp()).
* Implemented the twin prime constant (twinprime) and Mertens' constant
(mertens).
* Implemented the prime zeta function (primezeta()).
--0.11--
Released January 26, 2009
General:
* Most of the documentation is now generated from docstrings
using Sphinx' autodoc feature, and proper LaTeX is used
for mathematical formulas. A large amount of new documentation
has been written.
* Improved gmpy backend. Using gmpy-1.04 gives a ~30% unit tests
speedup over 1.03, with speedups in the range of 2-3x for
specific operations (contributed by Case van Horsen and
Mario Pernici).
* Mpmath imports slightly faster due to not trying to
load the 'random' library
Numerical calculus, etc:
* Implemented a fast high-precision ODE solver (to replace the slow
and low-accuracy RK4 algorithm) (odefun())
* Created an intelligent function nsum() to replace sumrich/sumsh
* Implemented nprod() for computing infinite products
* Rewrote limit() to use the same adaptive extrapolation algorithm
as nsum()
* Multidimensional nonlinear solving with Newton's method
implemented in findroot() (contributed by Vinzent Steinberg)
* Simplified the implementation and interface of sumem()
* Reimplemented Shanks transformation for nsum using Wynn's epsilon
algorithm (shanks())
* Reimplemented Richardson extrapolation slightly more simply and
efficiently (richardson())
* Prevent shanks() from exiting prematurely by adding
random noise to zeros
* Removed the obsolete secant() function (see findroot())
* Implemented high-order derivatives (diff(), diffs())
* Implemented calculation of Taylor series (taylor())
* Implemented calculation of Fourier series (fourier(), fourierval())
* Implemented Pade approximation (pade()) (contributed by
Mario Pernici)
* Better cancel condition for findroot() (contributed by
Vinzent Steinberg)
* Some refactoring of numerical integration code
* Fix erroneous nodes for 0-th order Gauss-Legendre quadrature,
which was causing unnecessary slowness
* Quadrature nodes are cached for arbitrary intervals, giving a
30% speedup for repeated integrations
* Unified interface and added more options for identify(), pslq(), findpoly()
New special functions:
* Implemented polylogarithms (polylog())
* Implemented Bernoulli polynomials (bernpoly())
* Implemented the Barnes G-function (barnesg())
* Implemented double factorials (fac2())
* Implemented superfactorials (superfac())
* Implemented hyperfactorials (hyperfac())
* Replaced lower_gamma and upper_gamma with a more versatile
function gammainc() for computing the generalized (and optionally
regularized) incomplete gamma function
* Implemented sinc() and sincpi()
* Implemented Fibonacci numbers (fib())
* Implemented the Dirichlet eta function (altzeta())
* Implemented the inverse error function (erfinv())
* Jacobi theta functions and elliptic functions were essentially
rewritten from scratch, making them much faster and more
general. Renamed Jacobi theta functions: jacobi_theta -> jtheta,
etc. (contributed by Mario Pernici)
* Implemented derivatives of jtheta (djtheta) (contributed by
Mario Pernici)
* Implemented Bessel Y, I, K functions (bessely, besseli,
besselk; Bessel J functions were also renamed to besselj)
also renamed)
* Generalized Stieltjes constants can now be computed,
with stieltjes(n,a)
* Implemented Hankel functions (hankel1, hankel2)
Speed improvements and bugfixes to special functions:
* Fast logarithm at very high precision using the formula by
Sasaki and Kanada (contributed by Mario Pernici)
* Slightly faster logarithm at low precision (contributed by
Mario Pernici)
* Faster exponential function at high precision, using
Newton's method (contributed by Mario Pernici)
* Faster computation of ln2 and ln10 by means of binary splitting
(contributed by Mario Pernici)
* Fixed accuracy problems in sinpi() and cospi()
* Correct evaluation of beta() at limits
* Much faster evaluation of stieltjes(n), using an improved integral
formula
* Fixed bernoulli() being inaccurate for large n and low precision,
and being needlessly slow for small n and huge precision
* Fixed accuracy of zeta(s) for large negative re(s)
* Fixed accuracy problems for asinh, atanh and tanh
* Fixed accuracy of airyai() for large x.real
* Fixed bug in nthroot() for very large arguments (contributed by
Mario Pernici)
* Fixed accuracy of log(x) for complex |x| ~= 1
* Fixed accuracy of exp(n), n a huge integer and prec >= 600
* Slightly faster hypergeometric functions with rational parameters
(contributed by Mario Pernici)
* Faster and more accurate calculation of ci(x), si(x)
* Faster and more accurate calculation of ei(x) for large x,
using an asymptotic expansion (contributed by Mario Pernici)
* Fixed accuracy bugs in theta functions (contributed by
Mario Pernici)
* The Lambert W function returns more appropriate values at infinities
Arithmetic and basic interface:
* Square roots are now rounded correctly
* Made float(huge) -> inf and float(1/huge) -> 0 instead of
raising OverflowError
* Renamed convert_lossless -> mpmathify
* mpmathify() accepts strings representing fractions or complex
numbers (contributed by Vinzent Steinberg)
* Fixed a bug in interval multiplication giving wrong signs
* Added monitor() to monitor function evaluation
* Implemented a chop() utility function for deletion of numerical noise
* Added re(), im(), conj(), fabs(), mpf.conjugate()
* Fixed the != operator for intervals
* Added functions fsum, fprod, fdot for efficient computation of
sums, products and dot products of lists of mpf:s or mpc:s
Matrices:
* Generation of Hilbert matrices (hilbert()) (contributed by
Vinzent Steinberg)
* Added lu_solve_mat() to solve a*x=b where a and b are matrices (contributed
by Mario Pernici)
* Implemented computation of matrix exponentials (exp_pade()) (contributed
by Mario Pernici)
* Prettier repr of complex matrices (contributed by Vinzent Steinberg)
* Speedups by using fdot and fsum (contributed by Vinzent Steinberg)
--0.10--
Released October 15, 2008
Interface / general:
* Mpmath now works with Python 2.6
* Implemented function plotting via 'plot' and 'cplot' (requires
matplotlib)
* Removed global rounding mode (always rounding to nearest by default)
* Instead added 'prec', 'dps', 'rounding' keyword arguments to
standard functions, for optional fine-grained control over precision
and rounding
* Implemented isinf, isnan, isint, utility functions
* A large number of internal functions were moved and/or renamed to
improve consistency. This particularly affects low-level mpf
functions (lib.fadd -> libmpf.mpf_add, etc).
* Syntax for some operations was changed (see details below)
* The test runner (runtests.py) was updated to support running
isolated tests and to allow a local import of mpmath
* Unit tests can now be run with import mpmath; mpmath.runtests()
* Implicit imports are no longer used internally in the main codebase.
(This will hopefully make the source easier to read, and can catch
installation problems more cleanly.)
Added linear algebra functions (contributed by Vinzent Steinberg):
* Provided a matrix class
* Computation of powers, inverses, determinants
* Linear system solving using LU, QR and Cholesky
* Vector and matrix norms
* Calculation of condition numbers
Improvements to interval arithmetic:
* Fixed rounding direction for negative numbers and related
spurious bugs
* Fix interval exponentiation (all cases should work now)
* Basic interval arithmetic is up to 10x faster
* sqrt, exp, log, sin, cos and a few other functions
accept interval arguments
* Intervals supported in matrices
Changes to root-finding code:
* secant renamed to findroot
* findroot was made more general; many useful alternative root-finding
algorithms were implemented (contributed by Vinzent Steinberg)
Improvements to special functions:
* Implemented polygamma functions
* Implemented harmonic numbers
* Implemented Stieltjes constants
* Made gamma more accurate for huge arguments and/or precision
* Made zeta more accurate in various cases
* Made zeta typically 2-5x faster
* Much more efficient computation of zeta for huge s (zeta(s) ~= 1)
* Optimized numerical calculation of Bernoulli numbers
* Fast exact calculation of huge Bernoulli numbers via zeta and the
von Staudt-Clausen theorem
* Using AGM to compute ellipk, which is much faster and works
in the entire complex plane
* Allow single-argument form agm(x) = agm(1,x)
* Faster and more accurate computation of erf
* Added fast and accurate implementation of erfc
* Normal probability functions npdf, ncdf
* Fixed directed rounding in corner cases for various functions
Improvements to numerical integration:
* Changed syntax for integration (quad(f, [a, b], options))
* Implemented Gauss-Legendre quadrature
* Direct support for triple integrals (quad(f, X, Y, Z))
* Interval can be a list of several points, to split integration
into subintervals
* Oscillatory quadrature uses Gauss-Legendre instead of tanh-sinh,
since this is typically faster
* Fixed minor rounding bug in tanh-sinh quadrature not giving
complete symmetry in the nodes
* Implemented quadrature rules in classes for improved extensibility
Various speed improvements:
* Up to 3x faster computation of log(x) at low precision, due to using
Taylor series with argument reduction and partial caching
* About 2x faster log(x) at very high precision due to more efficient
computation of exp in the Newton iteration
* Up to 10x faster computation of atan(x) at low to medium precision,
due to using Taylor series with argument reduction and partial caching
* Faster pickling due to using hex() instead of long()
* Optimized code for Khinchin's constant (2.5x faster at 1000 digits)
* Optimized code for Glaisher's constant (1.5x faster at 1000 digits)
* Faster algorithm for Euler's constant (10x faster at 10000 digits)
* Rewrote PSLQ to use fixed-point arithmetic, giving a ~7x speedup
in pslq, findpoly and identify
Miscellaneous bugfixes:
* Fixed nthroot for n = -1, 0, 1
* Fixed inf/2**n and nan/2**n returning zero
--0.9--
Released August 23, 2008
* gmpy mpzs are used instead of python ints when available, for
huge speedups at high precision (contributed by Case Van Horsen)
* using binary splitting to compute pi and e near-optimally
* mpmath includes __version__ information
* arange behaves more like range (contributed by Vinzent Steinberg)
* asymptotically faster trigonometric functions via Brent's trick
(contributed by Mario Pernici)
* asymptotically faster inverse trigonometric functions via Newton's
method (contributed by Mario Pernici)
* added Jacobi elliptic functions 1-4, sn, cn, dn (contributed by Mike
Taschuk)
* polyval, polyroots and related functions now use the same order
for coefficients as scipy and matlab (i.e. the reverse order of what
was used previously in mpmath)
* fixed polyroots for degree-0 polynomials (contributed by Nimish Telang)
* added convenience functions (log10, degrees, radians, frexp, modf, ln,
arg, sign)
* added fast cbrt and nthroot functions for computing nth roots
(contributed by (Mario Pernici)
* added various exponential integrals (ei, li, si, ci, shi, chi, erfi)
* added airy functions (airyai, airybi)
* more __op__ and __rop__ methods return NotImplemented where
appropriate
* external classes can define a special method _mpmath_ to interact
with mpmath numbers and functions
* fixed some corner cases in atan2
* faster rand()
--0.8--
Released April 20, 2008
New features:
* the full set of reciprocal trigonometric and hyperbolic functions
and their inverses (cotangent, secant, etc) is available
* oscillatory quadrature algorithm
* the PSLQ algorithm and constant recognition functions
* Richardson and Shanks transformations for computing limits and series
* Euler-Maclaurin summation of series
* basic ODE solvers (contributed by Ondrej Certik)
* the Lambert W function
* arithmetic-geometric mean function
* generic hypergeometric series and some special hypergeometric
functions (elliptic integrals, orthogonal polynomials)
* several more mathematical constants
* fast sequential computation of integer logarithms and Bernoulli
numbers
* Bessel function jv works for complex arguments and noninteger v
* support for trapping complex results
* using Sphinx to generate HTML documentation
Bugfixes, speed enhancements, and other improvements:
* compatibility tests should now pass on systems where Python is
compiled to use 80-bit registers for floating-point operations
* fixed mpmath to work with some versions of Python 2.4 where a
list indexing bug is present in the Python core
* better algorithms for various complex elementary functions
(tan and tanh by Fredrik; sqrt, acos, asin, acosh and asinh
improved by Mario Pernici)
* multiplication and integer powers for complex numbers is faster
and more accurate
* miscellaneous speed improvements to complex arithmetic (contributed
by Mario Pernici)
* faster computation of cos and sin when only one of them is needed
(contributed by Mario Pernici)
* slightly faster square roots at low precision (contributed by
Mario Pernici)
* fixed computation of exp(n) for negative integers and x**y for
negative half integers y
* mpf ** complex now works
* faster generation of quadrature nodes (contributed by Mario Pernici)
* faster change of variables for quadrature
* comparisons and conversions have been optimized slightly.
comparisons with float(nan) also work as intended.
* str() is several times faster at very high precision
* implementations of most elementary functions moved to the lib
and libmpc modules for cleaner separation of functionality
* the rounding argument for lib and libmpc functions, and for
some functions also the the prec argument, are now optional,
resulting in cleaner and slightly faster lib code
* gamma and factorial are about 2x faster
* polyroots returns nicer results
* pickling now works for mpf and mpc instances
--0.7--
Released March 12, 2008
* the interface for switching precision and rounding modes has been
changed. instead of changing mpf.prec, there is a new object mp
which holds the precision as mp.prec. this change improves
flexibility in the implementation. it will unfortunately break
any existing code written for mpmath, but the broken code should
be trivial to update.
* the functions workprec, workdps, extraprec, extradps have been
introduced for switching precision in a more safe manner,
ensuring that the precision gets reset when finished. they can
be used with the 'with' statement available in python 2.5
* improved documentation (manual.html)
* the round-half-down and round-half-up modes have been deprecated,
since they added complexity without being particularly useful.
round-half-even has been renamed to round-nearest.
* implemented the functions nstr, nprint for printing numbers with
a small or custom number of digits
* accuracy of cos and sin near roots has been fixed. computing
sin(x) or cos(x) where x is huge is also much faster
* implemented a magical constant eps that gives the "machine"
epsilon
* additional mathematical functions: implemented Catalan's constant
and Bessel functions J_n(x) for integer n and real x
* new functions diff and diffc for numerical differentiation
* implemented the ldexp function for fast multiplication by 2**n
* mpf uses rich comparison methods (contributed by Pearu Peterson)
* epydoc-friendly docstrings (contributed by Pearu Peterson)
* support creating mpf from float nan or inf
* fixed printing of complex numbers with negative imaginary part
* flattened package structure to simplify inclusion of mpmath in other
packages
* external classes can interoperate with mpf and mpc instances
by defining _mpf_ or _mpc_ properties
* renamed lib.fpow -> lib.fpowi and implemented lib.fpow for general
real powers. <mpf> ** <mpf> should now be slightly faster and more
robust
* the internal number representation has been changed to include
an explicit sign bit. as a result of this change and other small
tweaks, arithmetic is up to 20% faster and the total running
time for mpmath's unit tests has dropped 10%.
* miscellaneous speed improvements:
* <mpf> ** <int> is 2-3 times faster (contributed by Mario Pernici)
* <mpf> * <int> and <int> * <mpf> is roughly twice as fast
* <int> / <mpf> is roughly twice as fast (contributed by Mario
Pernici)
* exp and log are about 10% faster
* fast computation of e and exp(n) when precision is extremely high
--0.6--
Released January 13, 2008
* added the mpi type for interval arithmetic
* powers with integer exponents are computed with directed rounding
all the way through to preserve interval bounds more robustly
(however, the code is not fully tested and may have some bugs)
* string input to mpf.__new__() can now be unicode
* mpf.__eq__ now works in pypy
* infs and nans are now implemented in mpmath.lib, resulting in
considerable simplification of the mpf class implementation
* partial support for infs and nans in functions, e.g.
exp(inf) -> inf and exp(-inf) -> 0 now work.
* renamed several files. created mpmath.apps and moved tests into
the main mpmath directory
* wrote script to permit running unit tests without py.test available
* improved bit counting code in fadd, fmul and fdiv, plus other
small performance tweaks, resulting in a 20-30% speedup for
arithmetic
--0.5--
Released November 24, 2007
* added the quad module for arbitrary-precision numerical integration
* floor and ceil functions available
* implemented __mod__ and __rmod__ for the mpf class
* partial support for the special numbers +inf, -inf and nan
* faster multiplication and division (up to 40% faster with psyco)
* simplified syntax for conversion function (from_int instead of
from_int_exact, etc)
* renamed cgamma to euler
* more documentation strings
--0.4--
Released November 3, 2007
* new string conversion code (much faster; unlimited exponents)
* fixed bug in factorial (it gave the wrong value, though gamma worked)
* division now uses a rigorous algorithm for directed rounding