All Projects → nschloe → pyfma

nschloe / pyfma

Licence: MIT license
Fused multiply-add (with a single rounding) for Python.

Programming Languages

python
139335 projects - #7 most used programming language
C++
36643 projects - #6 most used programming language
CMake
9771 projects

Labels

Projects that are alternatives of or similar to pyfma

Bandersnatch
A PyPI mirror client according to PEP 381 http://www.python.org/dev/peps/pep-0381/
Stars: ✭ 221 (+1127.78%)
Mutual labels:  pypi
MyJWT
A cli for cracking, testing vulnerabilities on Json Web Token(JWT)
Stars: ✭ 92 (+411.11%)
Mutual labels:  pypi
mkdocs-rss-plugin
MkDocs plugin to generate a RSS feeds for created and updated pages, using git log and YAML frontmatter (page.meta).
Stars: ✭ 43 (+138.89%)
Mutual labels:  pypi
Cognitive Face Python
Python SDK for the Microsoft Face API, part of Cognitive Services
Stars: ✭ 226 (+1155.56%)
Mutual labels:  pypi
Nbdev
Create delightful python projects using Jupyter Notebooks
Stars: ✭ 3,061 (+16905.56%)
Mutual labels:  pypi
py-mon
Simple package to automatically restart application when file changes are detected!
Stars: ✭ 33 (+83.33%)
Mutual labels:  pypi
Alyn
Detect and fix skew in images containing text
Stars: ✭ 202 (+1022.22%)
Mutual labels:  pypi
django-freeze
🧊 convert your dynamic django site to a static one with one line of code.
Stars: ✭ 81 (+350%)
Mutual labels:  pypi
Cn2an
📦 快速转化「中文数字」和「阿拉伯数字」~ (最新特性:分数,日期、温度等转化)
Stars: ✭ 249 (+1283.33%)
Mutual labels:  pypi
Random-Plex-Movie
Python App which chooses a random movie from your Plex Library.
Stars: ✭ 17 (-5.56%)
Mutual labels:  pypi
Rules python
Experimental Bazel Python Rules
Stars: ✭ 233 (+1194.44%)
Mutual labels:  pypi
See
Python's dir() for humans. (GitHub mirror)
Stars: ✭ 240 (+1233.33%)
Mutual labels:  pypi
gagar
Standalone graphical agar.io Python client/bot using GTK and agarnet
Stars: ✭ 21 (+16.67%)
Mutual labels:  pypi
Mailer
A light-weight, modular, message representation and mail delivery framework for Python.
Stars: ✭ 225 (+1150%)
Mutual labels:  pypi
vfxwindow
Python Qt Window class for compatibility between VFX programs
Stars: ✭ 80 (+344.44%)
Mutual labels:  pypi
Search Engine Parser
Lightweight package to query popular search engines and scrape for result titles, links and descriptions
Stars: ✭ 216 (+1100%)
Mutual labels:  pypi
yavdb
Yet Another Vulnerability Database
Stars: ✭ 14 (-22.22%)
Mutual labels:  pypi
pmm
PyPi Mirror Manager
Stars: ✭ 29 (+61.11%)
Mutual labels:  pypi
distfit
distfit is a python library for probability density fitting.
Stars: ✭ 250 (+1288.89%)
Mutual labels:  pypi
PyGLM
Fast OpenGL Mathematics (GLM) for Python
Stars: ✭ 167 (+827.78%)
Mutual labels:  pypi

pyfma

Fused multiply-add for Python.

PyPi Version PyPI pyversions GitHub stars PyPi downloads

Discord

gh-actions codecov Code style: black

Fused multiply-add computes (x*y) + z with a single rounding. Useful for dot products, matrix multiplications, polynomial evaluations (e.g., with Horner's rule), Newton's method for evaluating functions, convolutions, artificial neural networks etc.

Use as

import pyfma

out = pyfma.fma(3.0, 2.0, 1.0)  # 3.0*2.0 + 1.0 = 7.0

Also works with NumPy inputs:

import numpy
import pyfma

x = numpy.random.rand(3, 4, 5)
y = numpy.random.rand(3, 4, 5)
z = numpy.random.rand(3, 4, 5)

out = pyfma.fma(x, y, z)

Built with pybind11.

Caution The C/C++ implementation of FMA in MS Windows is reportedly broken. Use with care.

Installation

pyfma can be installed from the Python Package Index, so with

pip install pyfma

you can install/upgrade.

Manual installation

For manual installation (if you're a developer or just really keen on getting the bleeding edge version of pyfma), there are two possibilities:

  • Get the sources, do pip install .. This does the trick most the time.
  • As a fallback, there's a CMake-based installation. Simply go cmake /path/to/sources/ and make.

Testing

To run the pyfma unit tests, check out this repository and type

tox
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].