Skip to main content

An arbitrary precision IEEE-754 implementation in Python

Project description

PyMPF

This is an arbitrary precision IEEE-754 floating point implementation.

The main motivation is correctness and test-case generation, so a number of things might seem a bit strange. This library has a bunch of limitations and should never be used if you want things to be fast. MPFR, SymFPU or Z3's MPF library are what you want.

Why "yet another" implementation?

  • This library supports RNA (MPFR does not)
  • This library supports subnormals and infinities (MPFR does, but only with tricks)
  • This library uses IEEE or SMTLIB terminology where possible (MPFR tends to stick to more "maths" terminology)
  • This library is implemented completely in Python unlike gmpy, mpmath, etc.
  • This library is an independent implementation so can be used to check Z3/SymFPU
  • This library uses a stupid but simple algorithm to do rounding

The main use of this library is random test-case generation for SMT-LIB. It has been used to validate the FP implementations of CVC4, Z3, MathSAT, SONOLAR, Alt-Ergo, Colibri, goSAT, and xsat; and has found bugs in all of them ;)

SMT-LIB random testcase generator

This will move to a new project. For now it is still available in the "python2" branch of PyMPF.

Requirements

Python 3.5 or later.

There is also a Python2 port, but I don't plan to maintain it (although do shout if you need it).

Documentation

This is very much work in progress and entirely incomplete (I just started adding this).

Installation

This package is available on PyPI. To install simply run:

$ pip3 install PyMPF

License and Copyright

Everything in this repository is licensed under the GNU GPL v3.

Key copyright holders that contributed to this library are:

  • Florian Schanda
  • Altran UK Limited
  • Zenuity AB

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pympf-1.0.4.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

pympf-1.0.4-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

Details for the file pympf-1.0.4.tar.gz.

File metadata

  • Download URL: pympf-1.0.4.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for pympf-1.0.4.tar.gz
Algorithm Hash digest
SHA256 cee5e3269c83ab087d1ea49327c0703674ce62ac0584446e97d19b925d97813c
MD5 0c4c82739091dabea4cc4d7c9f367319
BLAKE2b-256 c09d13c9bf2e93f559bc369807262454958118d4b8d2b64160231d1ce89b84f5

See more details on using hashes here.

File details

Details for the file pympf-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: pympf-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 32.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for pympf-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 08f78e5e71f6177b6267c8de68aaa8b1596a60b4a91b3401189d6d052adaa2ec
MD5 6583fb66053acfbc278c86faf059dc36
BLAKE2b-256 87a235005e4e4fda3c5dd38c1aa842aaa5dde146c9e70dcb024f2b7108a7f8b8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page