Skip to main content

xprec precision numpy extension

Project description

Library for double-double arithmetic calculation

Extension module for numpy providing the ddouble data type.

Loading this module registers an additional scalar data type ddouble with numpy implementing double-double arithmetic. You can use use the data type by passing dtype=xprec.ddouble to numpy functions.

The xprec.linalg module provides some linear algebra subroutines, in particular QR, RRQR, SVD and truncated SVD.

Installation

$ pip install xprec

Quickstart

import numpy as np
x = np.linspace(0, np.pi)

# import double-double precision data type
from xprec import ddouble
x = x.astype(ddouble)
y = x * x + 1
z = np.sin(x)

# do some linalg
import xprec.linalg
A = np.vander(np.linspace(-1, 1, 80, dtype=ddouble), 150)
U, s, VT = xprec.linalg.svd(A)

Trouble shooting

  • icc
    You may suffer from a long runtime when xprec is built with icc. If you encounter this problem, please try the following:
CFLAGS="-fp-model=precise" pip install xprec

Licence

The xprec library is Copyright (C) 2021 Markus Wallerberger. Licensed under the MIT license (see LICENSE.txt).

Contains code from the QD library, which is Copyright (C) 2012 Yozo Hida, Xiaoye S. Li, David H. Bailey. Released under a modified BSD license (see QD-LICENSE.txt).

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

xprec-1.4.2.tar.gz (35.1 kB view details)

Uploaded Source

File details

Details for the file xprec-1.4.2.tar.gz.

File metadata

  • Download URL: xprec-1.4.2.tar.gz
  • Upload date:
  • Size: 35.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for xprec-1.4.2.tar.gz
Algorithm Hash digest
SHA256 35cd64afd0ee725622286113727d1b2724f2cbb27a2102e3016c1e897e08f8fe
MD5 5ae91379d9b737081bf564c95b2913f7
BLAKE2b-256 e30b27ce762fbbcc46fa0792889aa349298257f55d45d3a6a9369047a35d4839

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