Learn R Programming

⚠️There's a newer version (0.7) of this package.Take me there.

PreciseSums (version 0.1)

Accurate Floating Point Sums and Products

Description

Most of the time floating point arithmetic does approximately the right thing. When adding sums or having products of numbers that greatly differ in magnitude, the floating point arithmetic may be incorrect. This package implements the Kahan (1965) sum , Neumaier (1974) sum , pairwise-sum (adapted from 'NumPy', See Castaldo (2008) for a discussion of accuracy), and arbitrary precision sum (adapted from the fsum in 'Python' ; Shewchuk (1997) ). In addition, products are changed to long double precision for accuracy, or changed into a log-sum for accuracy.

Copy Link

Version

Install

install.packages('PreciseSums')

Monthly Downloads

1,341

Version

0.1

License

GPL (>= 2)

Maintainer

Matthew Fidler

Last Published

November 14th, 2017

Functions in PreciseSums (0.1)

neumaierSum

Using the Neumaier method, take a more accurate sum
psSetProd

Choose the type of product to use in PreciceSums. These are used in the PreciceSums prod blocks
pairwiseSum

Return an accurate floating point sum of values
fsum

Return an accurate floating point sum of values
kahanSum

Using the Kahan method, take a more accurate sum
psSetSum

Choose the type of sums to use for PreciceSums.
psSum

Using PreciceSums's default method, take a sum
psProd

Using PreciceSums's default method, take a product