Skip to main content

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, SoftFloat, or SymFPU is 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, CVC5, Z3, MathSAT, BitWuzla, SONOLAR, Alt-Ergo, Colibri, goSAT, and xsat; and has found bugs in all of them ;)

SMT-LIB random testcase generator

See https://github.com/florianschanda/smtlib_schanda

Requirements

Python 3.8 or later.

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

Metadata

Release files for pympf 1.0.5

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

Source distribution (sdist)

Source distribution for pympf 1.0.5
File Size Uploaded
pympf-1.0.5.tar.gz 30.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pympf 1.0.5
File Interpreter ABI Platform
pympf-1.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 62.9 kB

Release files / pympf-1.0.5.tar.gz

Download URL pympf-1.0.5.tar.gz
Size 30.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fdca47bbdedad4e28079f072b9caea461f870af25a10bf6532f6a61481d11eab
BLAKE2b-256 checksum
How to use checksums
092f9d4727192e5d6e187b086f51d8e9c79855a5d01a0b9954e405cc848289c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / pympf-1.0.5-py3-none-any.whl

Download URL pympf-1.0.5-py3-none-any.whl
Size 32.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6355318d61f2c63e3242c49ffa829d6047dd72927b9a4c1213a6c26502fcd74e
BLAKE2b-256 checksum
How to use checksums
28db1d4a50c40568411b6974efd3bd5411af6df84b040d7365ce3ba15e2173d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

1.0.5 This release

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 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