fractionizer-0.7.0.1: Allows to approximate the fractional numbers in the range [0.005, 1] with sum of 2 or 3 unit fractions of special types.
Safe HaskellSafe-Inferred
LanguageHaskell2010

UnitFractionsDecomposition2

Synopsis

Documentation

threeDigitsK :: Double -> Double Source #

Rounding to thousandth.

suitable2 :: Double -> (Double, Double) Source #

Partially defined function, if there is no solutions then returns a tuple of undefined. Beter to use suitable21

isRangeNPref :: Double -> Bool Source #

The preferable range of the argument for suitable2 and suitable21 functions. For arguments in this range the functions always have informative results.

check1FracDecomp :: Double -> Maybe ([Double], Double) Source #

Tries to approximate the fraction by just one unit fraction. Can be used for the numbers between 0.005 and 0.501.

check3FracDecompPartial :: Bool -> Double -> Maybe ([Double], Double) Source #

Function to find the less by absolute value error approximation. One of the denominators is taken from the range [2..10]. The two others are taken from the appropriate suitable21 applicattion.

check3FracDecompPartialP :: Bool -> [Int] -> Double -> Maybe ([Double], Double) Source #

Extended version of the check3FracDecompPartial with the first denominator being taken not - only from the [2..10], but also from the custom user provided list. -

lessErrDenomsP :: [Int] -> Double -> [Integer] Source #

Returns a list of denominators for fraction decomposition using also those ones from the the list provided as the first argument. Searches for the least error from the checked ones.