[ANN] cdecimal-2.3 released

S

Stefan Krah

Hi,

I'm pleased to announce the release of cdecimal-2.3. cdecimal is a fast
drop-in replacement for the decimal module in Python's standard library.


Blurb
=====

cdecimal is a complete implementation of IBM's General Decimal Arithmetic
Specification. With the appropriate context parameters, cdecimal will also
conform to the IEEE 754-2008 Standard for Floating-Point Arithmetic.

Typical performance gains over decimal.py are between 30x for I/O heavy
benchmarks and 80x for numerical programs. In a PostgreSQL database
benchmark, the speedup is 12x.


+---------+-------------+--------------+-------------+
| | decimal | cdecimal | speedup |
+=========+=============+==============+=============+
| pi | 42.75s | 0.58s | 74x |
+---------+-------------+--------------+-------------+
| telco | 172.19s | 5.68s | 30x |
+---------+-------------+--------------+-------------+
| psycopg | 3.57s | 0.29s | 12x |
+---------+-------------+--------------+-------------+


In the pi benchmark, cdecimal often performs better than Java's BigDecimal
running on Java HotSpot(TM) 64-Bit Server VM.


What's New
==========

o The underlying library - libmpdec - now has a very comprehensive
test suite against decNumber.

o libmpdec now has full support for compilers without uint64_t.

o Code coverage of cdecimal has been increased to 100%. Now both
libmpdec and cdecimal have 100% coverage.

o Improved code for conversion of small Python integers to Decimals
leads to a performance gain of around 15%.

o Added real(), imag(), conjugate(), __complex__() methods.

o Add Fraction and complex comparisons (enabled for Python 3.2).

o Support for DecimalTuple output.


Stability
=========

Both cdecimal and libmpdec have an extremely conservative release policy.
When new features are added, the complete test suite is run both with and
without Valgrind on many different platforms. With the added tests against
decNumber, this takes around 8 months on four cores.


Install
=======

Since cdecimal is listed on PyPI, it can be installed using pip:

pip install cdecimal


Windows installers are available at:

http://www.bytereef.org/mpdecimal/download.html


Links
=====

http://www.bytereef.org/mpdecimal/index.html
http://www.bytereef.org/mpdecimal/changelog.html
http://www.bytereef.org/mpdecimal/download.html

Checksums of the released packages
==================================

03f76f4acbb6e7f648c6efc6e424bbc1b4afb5632dac5196f840e71f603a2b4a mpdecimal-2.3.tar.gz
b0fd5bec2cc6a6035bc406339d020d2f4200a7dce8e8136a2850612a06508ed1 mpdecimal-2.3.zip
d737cbe43ed1f6ad9874fb86c3db1e9bbe20c0c750868fde5be3f379ade83d8b cdecimal-2.3.tar.gz

84afd94126549a3c67c3bab7437d085347f9d05c cdecimal-2.3.win-amd64-py2.6.msi
ba0fbb1f9314dcef29481414a5c3496ec159df2e cdecimal-2.3.win-amd64-py2.7.msi
d11bbd560e9cb9d34b0e7a068ac1c1eac5371428 cdecimal-2.3.win-amd64-py3.1.msi
d024148ea603dc8e82f8371ebdfaa0e65f5a9945 cdecimal-2.3.win-amd64-py3.2.msi
d196a9e0b44dcb75bbf4eda44078b766e6113f72 cdecimal-2.3.win32-py2.6.msi
e2b044da6c241df0911059216821c9865cb9e4f0 cdecimal-2.3.win32-py2.7.msi
7e8b47eb3a2f50191e76f981fbe55050f13495e8 cdecimal-2.3.win32-py3.1.msi
61be767b91aab0ba0d602fb2b23f6d882cafec05 cdecimal-2.3.win32-py3.2.msi

a2278910a5b447af963e1d427dbeb48f49e377be cdecimal-2.3-no-thread.win-amd64-py2.6.msi
8da96d2f1ab1a98062cd43cb4f381b47309d8c22 cdecimal-2.3-no-thread.win-amd64-py2.7.msi
85cd3ff4496aa7e0d0979d1695eef27cc7735c28 cdecimal-2.3-no-thread.win-amd64-py3.1.msi
6c179a1284aceb3a7bfc481daae1d7d60359d487 cdecimal-2.3-no-thread.win-amd64-py3.2.msi
40f245e907512c5d3602ba5993755a0b4b67ca80 cdecimal-2.3-no-thread.win32-py2.6.msi
960eb9bfd9fcf0faee6493506c1917d46536193a cdecimal-2.3-no-thread.win32-py2.7.msi
42b651ee1bf4c94611c43522d69f1965515949b8 cdecimal-2.3-no-thread.win32-py3.1.msi
ec26f14c35502d1d5488d440d7bc22ad41e9ac65 cdecimal-2.3-no-thread.win32-py3.2.msi
 
P

Paul Rubin

Stefan Krah said:
cdecimal is a complete implementation of IBM's General Decimal Arithmetic
Specification. With the appropriate context parameters, cdecimal will also
conform to the IEEE 754-2008 Standard for Floating-Point Arithmetic.

Cool. I wonder when we'll start seeing this in non-IBM hardware CPU's.
Both cdecimal and libmpdec have an extremely conservative release policy.
When new features are added, the complete test suite is run both with and
without Valgrind on many different platforms. With the added tests against
decNumber, this takes around 8 months on four cores.

Wow. I wonder whether it's worth looking into some formal verification
if the required level of confidence is that high.
 
S

Stefan Krah

Paul Rubin said:
Wow. I wonder whether it's worth looking into some formal verification
if the required level of confidence is that high.

Currently four of the main algorithms (newton-div, inv-sqrt, sqrt, log)
and a couple of auxiliary functions have proofs in ACL2. The results
are mechanically verified Lisp forms that are guaranteed to produce results
*within correct error bounds* in a conforming Lisp implementation.

Proving full conformance to the specification including all rounding
modes, Overflow etc. would be quite a bit of additional work.


For C, I think the why3 tool should be a good approach:

http://why3.lri.fr/


The verification of the L4 kernel allegedly took 30 man-years, so
it might take a while...


Stefan Krah
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top