Skip to main content

Python bindings for CRlibm, an efficient and proven correctly-rounded mathematical library.

CRlibm is a free mathematical library (libm) which provides:

  • implementations of the double-precision C99 standard elementary functions,

  • correctly rounded in the four IEEE-754 rounding modes,

  • with a comprehensive proof of both the algorithms used and their implementation,

  • sufficiently efficient in average time, worst-case time, and memory consumption to replace existing libms transparently.

Installation

At the command line:

$ pip install crlibm

On Microsoft Windows pip will try first to download a binary archive in wheel format, and if no such a wheel can be found for your Python version, pip will try to compile the library. In order to do so, it is strongly recommended to have MinGW-w64 installed under MSYS2, for instance by following the instructions in http://stackoverflow.com/a/30071634.

Usage

In Python:

>>> import crlibm
>>> crlibm.exp_ru(1)
2.7182818284590455

>>> crlibm.exp_rd(1)
2.718281828459045

Features

  • This project provides the bindings for the functions in the following table:

f(x)

Round to nearest

Round up (to +∞)

Round down (to -∞)

Round to 0

Exponentials and logarithms

exp(x)

exp_rn

exp_ru

exp_rd

exp_rz

exp(x)-1

expm1_rn

expm1_ru

expm1_rd

expm1_rz

log(x)

log_rn

log_ru

log_rd

log_rz

log(1+x)

log1p_rn

log1p_ru

log1p_rd

log1p_rz

log(x)/log(2)

log2_rn

log2_ru

log2_rd

log2_rz

log(x)/log(10)

log10_rn

log10_ru

log10_rd

log10_rz

sinh(x)

sinh_rn

sinh_ru

sinh_rd

sinh_rz

cosh(x)

cosh_rn

cosh_ru

cosh_rd

cosh_rz

Trigonometry

sin(x)

sin_rn

sin_ru

sin_rd

sin_rz

cos(x)

cos_rn

cos_ru

cos_rd

cos_rz

tan(x)

tan_rn

tan_ru

tan_rd

tan_rz

asin(x)

asin_rn

asin_ru

asin_rd

asin_rz

acos(x)

acos_rn

acos_ru

acos_rd

acos_rz

atan(x)

atan_rn

atan_ru

atan_rd

atan_rz

Trigonometry in multiples of π

sin(π * x)

sinpi_rn

sinpi_ru

sinpi_rd

sinpi_rz

cos(π * x)

cospi_rn

cospi_ru

cospi_rd

cospi_rz

tan(π * x)

tanpi_rn

tanpi_ru

tanpi_rd

tanpi_rz

asin(x)/π

asinpi_rn

asinpi_ru

asinpi_rd

asinpi_rz

acos(x)/π

acospi_rn

acospi_ru

acospi_rd

acospi_rz

atan(x)/π

atanpi_rn

atanpi_ru

atanpi_rd

atanpi_rz

  • The function pow in CRlibm is not exported.

License

Both the CRlibm library and the Python bindings are distributed under the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

Authors

David Defour, Catherine Daramy, Florent de Dinechin, Matthieu Gallet, Nicolas Gast, Christoph Lauter, Jean-Michel Muller.

Python bindings by Stefano Taschini.

History

1.0.3 (2016-06-09)

  • Fixed the compilation with Python 3.5 on Windows.

1.0.2 (2016-06-06)

  • Added support for Python 3.

1.0.1 (2015-11-15)

  • Improvements to the build process on MS Windows;

  • Automatic upload of release files to PyPI using Appveyor.

1.0.0 (2015-10-27)

  • Spun off these binding from PyInterval, a project for interval arithmetic in Python.

  • First release on PyPI.

Metadata

Release files for crlibm 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crlibm 1.0.3
File Size Uploaded
crlibm-1.0.3.tar.gz 1.6 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for crlibm 1.0.3
File
crlibm-1.0.3-cp35-cp35m-win_amd64.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-64 Details
crlibm-1.0.3-cp35-cp35m-win32.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-32 Details
crlibm-1.0.3-cp34-cp34m-win_amd64.whl CPython 3.4 CPython 3.4 pymalloc Windows x86-64 Details
crlibm-1.0.3-cp34-cp34m-win32.whl CPython 3.4 CPython 3.4 pymalloc Windows x86-32 Details
crlibm-1.0.3-cp33-none-win_amd64.whl CPython 3.3 none Windows x86-64 Details
crlibm-1.0.3-cp33-none-win32.whl CPython 3.3 none Windows x86-32 Details
crlibm-1.0.3-cp27-cp27m-win_amd64.whl CPython 2.7 CPython 2.7 pymalloc Windows x86-64 Details
crlibm-1.0.3-cp27-cp27m-win32.whl CPython 2.7 CPython 2.7 pymalloc Windows x86-32 Details

Total release size: 3.5 MB

Release files / crlibm-1.0.3.tar.gz

Download URL crlibm-1.0.3.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
48e17981f90d69c6bb0013f68bacbe7a157de864a533d15dd196ca7e98348a35
BLAKE2b-256 checksum
How to use checksums
8e0b1faf9944f83d9f64e939ee8e6638b9335a2a7166445e28450d237f193459
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / crlibm-1.0.3-cp35-cp35m-win_amd64.whl

Download URL crlibm-1.0.3-cp35-cp35m-win_amd64.whl
Size 231.0 kB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
13c31e207cf6ac19b9a27a38f8cf4b5ad19e5d7b2e06daaf111e7fc22d2f637e
BLAKE2b-256 checksum
How to use checksums
58a9ecf28c1a4a0fb6309584e4002ede3aa2bd45794ea06c49f53ba1130cc115
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / crlibm-1.0.3-cp35-cp35m-win32.whl

Download URL crlibm-1.0.3-cp35-cp35m-win32.whl
Size 227.4 kB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
f98c2d1a656104c8e47fb293cb29224c45a24eaad4a1096e2b14a935abe748d5
BLAKE2b-256 checksum
How to use checksums
51af81d4aec691f67735b8d5052cdbe389931c723d8d154eb6138b5eaef17266
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / crlibm-1.0.3-cp34-cp34m-win_amd64.whl

Download URL crlibm-1.0.3-cp34-cp34m-win_amd64.whl
Size 231.0 kB
Tags CPython 3.4 CPython 3.4 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
28044e908dec4d85b5eff8b22459687c4302460a56ac12baf6ec220ba1d693c2
BLAKE2b-256 checksum
How to use checksums
bbb2e9ffc09c8c853c49493c09e500801bb34f04f552311fb9f60e12d52a92d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / crlibm-1.0.3-cp34-cp34m-win32.whl

Download URL crlibm-1.0.3-cp34-cp34m-win32.whl
Size 227.4 kB
Tags CPython 3.4 CPython 3.4 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
420bca4a622152f74196b2e9af3fe3d38ac8b54dc8c228746fa9f46094f69b5e
BLAKE2b-256 checksum
How to use checksums
8f59c606276a1601807f8c37d2fd934b21255ac8683197b88747e5139c6f6ca5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / crlibm-1.0.3-cp33-none-win_amd64.whl

Download URL crlibm-1.0.3-cp33-none-win_amd64.whl
Size 231.0 kB
Tags CPython 3.3 Windows x86-64
SHA-256 checksum
How to use checksums
6fffdaa6c470826df1c892e358a6308b9c989ce15627146e945ab42dcb28eabe
BLAKE2b-256 checksum
How to use checksums
5fe4230e359f73d2d7178eda315d67b67d673dfbffc576a8f952d0b71b0077a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / crlibm-1.0.3-cp33-none-win32.whl

Download URL crlibm-1.0.3-cp33-none-win32.whl
Size 227.4 kB
Tags CPython 3.3 Windows x86-32
SHA-256 checksum
How to use checksums
d8b045de7187904833738092e334d17d4c53bd7ef88732635fb2b4e220a30bc6
BLAKE2b-256 checksum
How to use checksums
8bd8ae571a1156cd2f243f3c0746663f4063f4844b348f9fd123dede0487fa7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / crlibm-1.0.3-cp27-cp27m-win_amd64.whl

Download URL crlibm-1.0.3-cp27-cp27m-win_amd64.whl
Size 231.0 kB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
5ee43fcc10e1be0c3fa47503c452f34f83b3c86b274f1fb0f7872b7e53cef861
BLAKE2b-256 checksum
How to use checksums
5e4af28f4c6aee30e64359ddddc8a475588b1817c416ae2dcf89e7385431fdee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / crlibm-1.0.3-cp27-cp27m-win32.whl

Download URL crlibm-1.0.3-cp27-cp27m-win32.whl
Size 227.4 kB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
2592ceec4f7b26579049f63f637d8bdeef82a4465999c35d71124623b82c7a33
BLAKE2b-256 checksum
How to use checksums
aa7a9ba1211ef26fc0d447db8d04e8d601948ee3ae8139369760fee7722081ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.3 This release

9 release files

1.0.2

5 release files

1.0.1

3 release files

1.0.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page