| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
UnitFractionsDecomposition2
Synopsis
- threeDigitsK :: Double -> Double
- type ErrorImpact = Int
- absErr2Frac :: Double -> Double -> Double
- absErrUDecomp3 :: [Double] -> Double -> Double
- elemSolution2 :: Integral a => Int -> a -> Double -> Bool
- setOfSolutionsGmin :: ErrorImpact -> Double -> (Double, Double)
- suitable2 :: Double -> (Double, Double)
- suitable21G :: ErrorImpact -> Double -> Maybe ([Double], Double)
- suitable21 :: Double -> Maybe ([Double], Double)
- isRangeN :: Double -> Bool
- isRangeNPref :: Double -> Bool
- check1FracDecompG :: ErrorImpact -> Double -> Maybe ([Double], Double)
- check3FracDecompPartialG :: ErrorImpact -> Bool -> Double -> Maybe ([Double], Double)
- check3FracDecompPartialPG :: ErrorImpact -> Bool -> [Int] -> Double -> Maybe ([Double], Double)
- lessErrSimpleDecompPG :: ErrorImpact -> [Int] -> Double -> (Int, Maybe ([Double], Double), Double)
- lessErrDenomsPG :: ErrorImpact -> [Int] -> Double -> [Integer]
- check1FracDecomp :: Double -> Maybe ([Double], Double)
- check3FracDecompPartial :: Bool -> Double -> Maybe ([Double], Double)
- check3FracDecompPartialP :: Bool -> [Int] -> Double -> Maybe ([Double], Double)
- lessErrSimpleDecompP :: [Int] -> Double -> (Int, Maybe ([Double], Double), Double)
- lessErrDenomsP :: [Int] -> Double -> [Integer]
Documentation
threeDigitsK :: Double -> Double Source #
Rounding to thousandth.
type ErrorImpact = Int Source #
Characterizes the impact of the absolute error sign on the approximation.
absErr2Frac :: Double -> Double -> Double Source #
Absolute error with sign for the two unit fractions approximations and the first argument
(a in the related paper) being taken as the second parameter for the function.
The second argument here is expected to be fromIntegral a0 where elem a0 [2..] == True.
setOfSolutionsGmin :: ErrorImpact -> Double -> (Double, Double) Source #
Searches for the minimum absolute error solution to two unit fractions decomposition
(approximation) for the fraction in the isRangeN True values with taking into account
the sign of the absolute error.
If the ErrorImpact parameter is equal to 0 , then absolute error can be of any sign,
otherwise the sign of it is the same as the sign of the ErrorImpact argument.
suitable21G :: ErrorImpact -> Double -> Maybe ([Double], Double) Source #
Allows to take into account the sign of the absolute error of the aproximation. If the
ErrorImpact parameter is equal to 0 , then absolute error can be of any sign,
otherwise the sign of it is the same as the sign of the ErrorImpact argument.
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.
check1FracDecompG :: ErrorImpact -> Double -> Maybe ([Double], Double) Source #
Allows to take into account the sign of the absolute error of the aproximation. If the
ErrorImpact parameter is equal to 0 , then absolute error can be of any sign,
otherwise the sign of it is the same as the sign of the ErrorImpact argument.
check3FracDecompPartialG :: ErrorImpact -> Bool -> Double -> Maybe ([Double], Double) Source #
Allows to take into account the sign of the absolute error of the aproximation. If the
ErrorImpact parameter is equal to 0 , then absolute error can be of any sign,
otherwise the sign of it is the same as the sign of the ErrorImpact argument.
check3FracDecompPartialPG :: ErrorImpact -> Bool -> [Int] -> Double -> Maybe ([Double], Double) Source #
Allows to take into account the sign of the absolute error of the aproximation. If the
ErrorImpact parameter is equal to 0 , then absolute error can be of any sign,
otherwise the sign of it is the same as the sign of the ErrorImpact argument.
lessErrSimpleDecompPG :: ErrorImpact -> [Int] -> Double -> (Int, Maybe ([Double], Double), Double) Source #
Allows to take into account the sign of the absolute error of the aproximation. If the
ErrorImpact parameter is equal to 0 , then absolute error can be of any sign,
otherwise the sign of it is the same as the sign of the ErrorImpact argument.
lessErrDenomsPG :: ErrorImpact -> [Int] -> Double -> [Integer] Source #
Allows to take into account the sign of the absolute error of the aproximation. If the
ErrorImpact parameter is equal to 0 , then absolute error can be of any sign,
otherwise the sign of it is the same as the sign of the ErrorImpact argument.
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.
-