:High level functional interface to standard linear algebra computations and other numerical algorithms based on the GNU Scientific Library and LAPACK. Includes numerical differentiation, integration, Fourier transforms, polynomial root-finding, and support for gnuplot. [[GSLHaskell on MacOS X|MacOS X]].

+

:A library that implements Matrix operations in pure Haskell using mutable arrays and the ST Monad. bed-and-breakfast does not need any additional software to be installed and can perform basic matrix operations like multiplication, finding the inverse, and calculating determinants efficiently.

+

+

;[https://github.com/patperry/hs-linear-algebra hs-linear-algebra]

+

:Patrick Perry's linear algebra library, built on BLAS. [https://github.com/cartazio/hs-cblas hs-cblas] seems to be a more up-to-date fork.

::''Vectors are represented by lists with type-encoded lengths. The constructor is :., which acts like a cons both at the value and type levels, with () taking the place of nil. So x:.y:.z:.() is a 3d vector. The library provides a set of common list-like functions (map, fold, etc) for working with vectors. Built up from these functions are a small but useful set of linear algebra operations: matrix multiplication, determinants, solving linear systems, inverting matrices.''

::''HLinear is a Haskell implementation of the PLE decomposition of matrices over division rings. It writes an arbitrary matrix as a product of a permutation matrix, a lower unitriangular matrix, and an echelon matrix.''

== See also ==

== See also ==

Line 48:

Line 64:

;[[CalDims]]

;[[CalDims]]

−

:This is not simply a library providing a new type of <hask>Num</hask> class, but stand-alone calculation tool that supports user defined functions and units (basic and derrived), so it can provide dimension-save calculation (not embedded but via shell). Calculations can be modified/saved via shell. It uses rational numbers to avoid rounding errors where possible.

+

:This is not simply a library providing a new type of <hask>Num</hask> class, but stand-alone calculation tool that supports user defined functions and units (basic and derived), so it can provide dimension-safe calculation (not embedded but via shell). Calculations can be modified/saved via shell. It uses rational numbers to avoid rounding errors where possible.

−

;[http://code.google.com/p/dimensional/ Dimensional]

+

;[https://github.com/bjornbm/dimensional Dimensional]

: Library providing data types for performing arithmetic with physical quantities and units. Information about the physical dimensions of the quantities/units is embedded in their types and the validity of operations is verified by the type checker at compile time. The boxing and unboxing of numerical values as quantities is done by multiplication and division of units.

: Library providing data types for performing arithmetic with physical quantities and units. Information about the physical dimensions of the quantities/units is embedded in their types and the validity of operations is verified by the type checker at compile time. The boxing and unboxing of numerical values as quantities is done by multiplication and division of units.

:contains arbitrary precision ''interval arithmetic'' for approximating exact real numbers in a style similar to Mueller's iRRAM and Lambov's RealLib

+

:contains type classes that form a foundation for ''rounded arithmetic'' and ''interval arithmetic'' with explicit control of rounding and the possibility to increase the rounding precision arbitrarily for types that support it. At the moment there are instances for Double floating point numbers where one can control the direction of rounding but cannot increase the rounding precision. In the near future instances for MPFR arbitrary precision numbers will be provided. Intervals can use as endpoints any type that supports directed rounding in the numerical order (such as Double or MPFR) and operations on intervals are rounded either outwards or inwards. Outwards rounding allows to safely approximate exact real arithmetic while a combination of both outwards and inwards rounding allows one to safely approximate exact interval arithmetic. Inverted intervals with Kaucher arithmetic are also supported.

:hmpfr is a purely functional haskell interface to the [http://www.mpfr.org/ MPFR] library

:hmpfr is a purely functional haskell interface to the [http://www.mpfr.org/ MPFR] library

+

+

;[http://hackage.haskell.org/package/numbers numbers]

+

:provides an up-to-date, easy-to-use BigFloat implementation that builds with a modern GHC, among other things.

===== Dynamic precision =====

===== Dynamic precision =====

−

* You tell the precision, an expression shall be computed to and the computer finds out, how precise to compute the input values.

+

* You tell the precision and an expression shall be computed to, and the computer finds out, how precisely to compute the input values

* Rounding errors do not accumulate

* Rounding errors do not accumulate

−

* Sharing of temporary results is difficult, that is in <hask>sqrt pi + sin pi</hask>, <hask>pi</hask> will certainly be computed twice, each time with the required precision.

+

* Sharing of temporary results is difficult, that is, in <hask>sqrt pi + sin pi</hask>, <hask>pi</hask> ''will'' be computed twice, each time with the required precision.

* Almost as fast as arbitrary precision computation

* Almost as fast as arbitrary precision computation

Line 112:

Line 131:

;[http://www2.arnes.si/~abizja4/hera/ Hera] is an implementation by Aleš Bizjak.

;[http://www2.arnes.si/~abizja4/hera/ Hera] is an implementation by Aleš Bizjak.

−

:It uses the [http://www.mpfr.org/ MPFR] library to implement dyadic rationals, on top of which are implemented intervals and real numbers. A real number is represented as a function <code>int -&gt;interval</code> which represents a sequence of intervals converging to the real.

+

:It uses the [http://www.mpfr.org/ MPFR] library to implement dyadic rationals, on top of which are implemented intervals and real numbers. A real number is represented as a function <hask>Int ->Interval</hask> which represents a sequence of intervals converging to the real.

:The HaskellMath library is a sandbox for experimenting with mathematics algorithms. So far I've implemented a few quantitative finance models (Black Scholes, Binomial Trees, etc) and basic linear algebra functions. Next I might work on either computer algebra or linear programming. All comments welcome!

:The HaskellMath library is a sandbox for experimenting with mathematics algorithms. So far I've implemented a few quantitative finance models (Black Scholes, Binomial Trees, etc) and basic linear algebra functions. Next I might work on either computer algebra or linear programming. All comments welcome!

:The PFP library is a collection of modules for Haskell that facilitates probabilistic functional programming, that is, programming with stochastic values. The probabilistic functional programming approach is based on a data type for representing distributions. A distribution represent the outcome of a probabilistic event as a collection of all possible values, tagged with their likelihood. A nice aspect of this system is that simulations can be specified independently from their method of execution. That is, we can either fully simulate or randomize any simulation without altering the code which defines it.

:The PFP library is a collection of modules for Haskell that facilitates probabilistic functional programming, that is, programming with stochastic values. The probabilistic functional programming approach is based on a data type for representing distributions. A distribution represent the outcome of a probabilistic event as a collection of all possible values, tagged with their likelihood. A nice aspect of this system is that simulations can be specified independently from their method of execution. That is, we can either fully simulate or randomize any simulation without altering the code which defines it.

:Hhydra is a tool to compute Goodstein successions and hydra puzzles described by Bernard Hodgson in his article 'Herculean or Sisyphean tasks?' published in No 51 March 2004 of the Newsletter of the European Mathematical Society.

:Hhydra is a tool to compute Goodstein successions and hydra puzzles described by Bernard Hodgson in his article 'Herculean or Sisyphean tasks?' published in No 51 March 2004 of the Newsletter of the European Mathematical Society.

Libraries

Linear algebra

A library that implements Matrix operations in pure Haskell using mutable arrays and the ST Monad. bed-and-breakfast does not need any additional software to be installed and can perform basic matrix operations like multiplication, finding the inverse, and calculating determinants efficiently.

Vectors are represented by lists with type-encoded lengths. The constructor is :., which acts like a cons both at the value and type levels, with () taking the place of nil. So x:.y:.z:.() is a 3d vector. The library provides a set of common list-like functions (map, fold, etc) for working with vectors. Built up from these functions are a small but useful set of linear algebra operations: matrix multiplication, determinants, solving linear systems, inverting matrices.

HLinear is a Haskell implementation of the PLE decomposition of matrices over division rings. It writes an arbitrary matrix as a product of a permutation matrix, a lower unitriangular matrix, and an echelon matrix.

This is not simply a library providing a new type of Num class, but stand-alone calculation tool that supports user defined functions and units (basic and derived), so it can provide dimension-safe calculation (not embedded but via shell). Calculations can be modified/saved via shell. It uses rational numbers to avoid rounding errors where possible.

Library providing data types for performing arithmetic with physical quantities and units. Information about the physical dimensions of the quantities/units is embedded in their types and the validity of operations is verified by the type checker at compile time. The boxing and unboxing of numerical values as quantities is done by multiplication and division of units.

contains type classes that form a foundation for rounded arithmetic and interval arithmetic with explicit control of rounding and the possibility to increase the rounding precision arbitrarily for types that support it. At the moment there are instances for Double floating point numbers where one can control the direction of rounding but cannot increase the rounding precision. In the near future instances for MPFR arbitrary precision numbers will be provided. Intervals can use as endpoints any type that supports directed rounding in the numerical order (such as Double or MPFR) and operations on intervals are rounded either outwards or inwards. Outwards rounding allows to safely approximate exact real arithmetic while a combination of both outwards and inwards rounding allows one to safely approximate exact interval arithmetic. Inverted intervals with Kaucher arithmetic are also supported.

This is a prototype of the implementation he intendeds to write in Coq. Once the Coq implementation is complete, the Haskell code could be extracted producing an implementation that would be proved correct.

COMP is an implementation by Yann Kieffer.

The work is in beta and relies on new primitive operations on Integers which will be implemented in GHC. The library isn't available yet.

It uses the MPFR library to implement dyadic rationals, on top of which are implemented intervals and real numbers. A real number is represented as a function Int->Interval which represents a sequence of intervals converging to the real.

Dynamic precision by lazy evaluation

The real numbers are represented by an infinite datastructure, which allows you to increase precision successively by evaluating the data structure successively. All of the implementations below use some kind of digit stream as number representation.
Sharing of results is simple.
The implementations are either fast on simple expressions, because they use large blocks/bases, or they are fast on complex expressions, because they consume as little as possible input digits in order to emit the required output digits.

It works with streams of decimal digits (strictly in the range from 0 to 9) and a separate sign. The produced digits are always correct. Output is postponed until the code is certain what the next digit is. This sometimes means that no more data is output.

Represents a real number as pair (exponent,[digit]), where the digits are Ints in the open range (-basis,basis). There is no need for an extra sign item in the number data structure. The basis can range from 10 to 1000. (Binary representations can be derived from the hexadecimal representation.) Showing the numbers in traditional format (non-negative digits) fails for fractions ending with a run of zeros. However the internal representation with negative digits can always be shown and is probably more useful for further processing. An interface for the numeric type hierarchy of the NumericPrelude project is provided.

pure haskell

Miscellaneous libraries

The HaskellMath library is a sandbox for experimenting with mathematics algorithms. So far I've implemented a few quantitative finance models (Black Scholes, Binomial Trees, etc) and basic linear algebra functions. Next I might work on either computer algebra or linear programming. All comments welcome!

The PFP library is a collection of modules for Haskell that facilitates probabilistic functional programming, that is, programming with stochastic values. The probabilistic functional programming approach is based on a data type for representing distributions. A distribution represent the outcome of a probabilistic event as a collection of all possible values, tagged with their likelihood. A nice aspect of this system is that simulations can be specified independently from their method of execution. That is, we can either fully simulate or randomize any simulation without altering the code which defines it.

A ranged set is a list of non-overlapping ranges. The ranges have upper and lower boundaries, and a boundary divides the base type into values above and below. No value can ever sit on a boundary. So you can have the set .

Hhydra is a tool to compute Goodstein successions and hydra puzzles described by Bernard Hodgson in his article 'Herculean or Sisyphean tasks?' published in No 51 March 2004 of the Newsletter of the European Mathematical Society.

This page contains a list of libraries and tools in a certain category. For a comprehensive list of such pages, see Applications and libraries.