Comparison

Comparison matrix

Fixed-point libraries

Library

APyTypes

en_cl_fix

fixedpoint

fpbinary

fxpmath

numfi

pychop

pyfixp

spfpm

Custom fixed-point formats

Yes

Yes

Yes

Yes

Yes

Yes [2]

Yes

Yes

Yes

Custom floating-point formats

Yes

No

No

No

No

No

Yes

No

No

Maximum wordlength [6]

None

53/None [1]

None

None

None

64 [2]

53 [3]

53 [4]

None

Resizing of fixed-point results

Yes

Yes

Yes

Yes

Yes

Yes [2]

Yes [3]

Yes [4]

No

Arrays

Yes

Yes

No

No [5]

Yes

Yes

Yes [3]

Yes [4]

No

Matrix multiplication (@)

Yes

No

N/A

N/A

No

No

Yes [3]

Yes [4]

N/A

Written in

C++/Python

Python

Python

C/Python

Python

Python

Python [3]

Python [4]

Python

Footnotes

Floating-point libraries

Library

APyTypes

bigfloat [7]

gmpy2 [8]

mpmath

PyChop

PyMPF

gfloat

Custom fixed-point formats

Yes

No

No

No

Yes [9]

No

No

Custom floating-point formats

Yes

Yes

Yes

Yes

Yes [9]

Yes

Yes [10]

Binary representation of number [11]

Yes

No

No

No

No

Yes

Yes

Maximum wordlength

32 bits for exponent, 64 bits for mantissa [12]

None

None

None

Yes [9]

18 bits for exponent, none for mantissa

Yes [10]

Stochastic rounding

Yes

No

No

No

Yes

No

Yes [10]

Arrays

Yes

No

No

Yes

Yes [9]

No

Yes [10]

Matrix multiplication (@)

Yes

N/A

N/A

Yes

Yes [9]

N/A

Yes [10]

Written in

C++/Python

C/Python

C/Python

Python [13]

Python [9]

Python

Python [10]

Footnotes

Performance Comparison

This benchmark compares relevant fixed-point libraries from the list above. It is updated every documentation build and may vary over time as the code is further optimized.

Benchmark numbers for different fixed-point libraries. Benchmark relative to APyTypes for different fixed-point libraries.

Feature Comparison

Feature matrix for different fixed-point libraries.