factory-0.2.0.5: Rational arithmetic in an irrational world.

Safe HaskellSafe-Inferred

Factory.Math.Implementations.Pi.Spigot.Series

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
Defines the parameters of a series used in a Spigot-table to generate Pi.

Synopsis

Types

Data-types

data Series i Source

  • Defines a series composed from a sum of terms, each one of which is the product of a coefficient and a base.
  • The coefficents and bases of the series are described in Horner form; Pi = c1 + (b1 * (c2 + b2 * (c3 + b3 * (...)))).

Constructors

MkSeries 

Fields

coefficients :: [i]
 
baseNumerators :: [i]
 
baseDenominators :: [i]
 
nTerms :: DecimalDigits -> Int

The width of the spigot-table, required to accurately generate the requested number of digits.

Functions

bases :: Integral i => Series i -> [Ratio i]Source

Combines baseNumerators and baseDenominators, and as a side-effect, expresses the ratio in lowest terms.