aern2-mp-0.2.0.0: Multi-precision ball (interval) arithmetic
Copyright(c) Michal Konecny
LicenseBSD3
Maintainermikkonecny@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

AERN2.MP.Float.Tests

Description

Tests for operations on arbitrary precision floats.

To run the tests using stack, execute:

   stack test aern2-mp --test-arguments "-a 1000 -m MPFloat"
   
Synopsis

Documentation

tMPFloat :: T MPFloat Source #

A runtime representative of type MPFloat. Used for specialising polymorphic tests to concrete types.

enforceRangeMP :: (Maybe Integer, Maybe Integer) -> MPFloat -> MPFloat Source #

enforceRange (Just l, Just u) a where l < u returns an arbitrary value b with u < b < l. Moreover, the returned values are distributed roughly evenly if the input values a are distributed roughly evenly in a large neighbourhood of the interval [l,r]. In most cases, when l<a<u, then b=a.

approxEqual Source #

Arguments

:: Integer

p precision to guide tolerance

-> MPFloat

LHS of equation

-> MPFloat

RHS of equation

-> Bool 

Assert equality of two MPFloat's with tolerance 1/2^p.

approxEqualWithArgs Source #

Arguments

:: Integer

bits of extra precision loss allowed

-> [(MPFloat, String)]

intermediate values from which to determine tolerance, their names to report when the equality fails

-> MPFloat

LHS of equation

-> MPFloat

RHS of equation

-> Property 

Assert equality of two MPFloat's with tolerance derived from the size and precision of the given list of input and intermediate values. The result is expected to have at least as many significant digits as the (highest) nominal precision of the input and intermediate numbers minus the given precision loss parameter.

When the assertion fails, report the given values using the given names.

Orphan instances