| ||||||||||||||

| ||||||||||||||

Synopsis | ||||||||||||||

Documentation | ||||||||||||||

data Ball | ||||||||||||||

| ||||||||||||||

makeA | ||||||||||||||

| ||||||||||||||

make | ||||||||||||||

| ||||||||||||||

normalizeBall :: Precision -> Ball -> Ball | ||||||||||||||

Normalize the given ball's center to the specified precision. Resulting ball might be larger. | ||||||||||||||

lower :: Precision -> Ball -> Dyadic | ||||||||||||||

Lower endpoint of the ball rounded down to specified precision. | ||||||||||||||

upper :: Precision -> Ball -> Dyadic | ||||||||||||||

Upper endpoint of the ball rounded up to specified precision. | ||||||||||||||

lower_ :: Ball -> Dyadic | ||||||||||||||

Lower endpoint with precision of the center | ||||||||||||||

upper_ :: Ball -> Dyadic | ||||||||||||||

Upper endpoint with precision of the center | ||||||||||||||

sgnLower :: Ball -> Int | ||||||||||||||

Sign of lower endpoint of the ball. This should be faster than using signum (center b - radius b)
| ||||||||||||||

sgnUpper :: Ball -> Int | ||||||||||||||

Analogous to sgnLower. | ||||||||||||||

width :: Ball -> Dyadic | ||||||||||||||

Upper bound on the width of the ball. 2 * radius b rounded up.
| ||||||||||||||

compareB :: Ball -> Ball -> POrdering | ||||||||||||||

Compare two balls. - if upper a < lower b then Less
- if upper b < lower a then Greater
- otherwise balls are incomparable.
| ||||||||||||||

below :: Ball -> Ball -> Bool | ||||||||||||||

Check if second ball is included in the first | ||||||||||||||

contains :: Ball -> Dyadic -> Bool | ||||||||||||||

Check if dyadic is element of the ball. | ||||||||||||||

intersectA | ||||||||||||||

| ||||||||||||||

intersect :: Monad m => Ball -> Ball -> m Ball | ||||||||||||||

Intersection of two balls exactly (no precision is lost). | ||||||||||||||

add :: Precision -> Ball -> Ball -> Ball | ||||||||||||||

Addition of two balls. center = center a + center b radius = radius a + radius b
Rounding errors are added to the radius. | ||||||||||||||

sub :: Precision -> Ball -> Ball -> Ball | ||||||||||||||

Subtraction of two balls. center = center a - center b radius = radius a + radius b
Rounding errors are added to the radius. | ||||||||||||||

neg :: Precision -> Ball -> Ball | ||||||||||||||

Negation of the ball. - center = - center b rounded to specified precision.
- radius is only modified for the rounding error.
| ||||||||||||||

absB :: Precision -> Ball -> Ball | ||||||||||||||

mul :: Precision -> Ball -> Ball -> Ball | ||||||||||||||

Multiplication of two balls. (centers of both balls are assumed positive) - If none of the balls contains 0 then
center = center a * center b + radius a * radius b radius = center a * radius b + radius a * center b - If one of the operands (left) contains 0
center = center a * upper b radius = radius a * upper b - If both of the balls contain 0
lower = min ((lower a) * (upper b)) ((lower b) * (upper a)) upper = max ((lower a) * (lower b)) ((upper b) * (upper a)) Rounding errors are added to the radius. | ||||||||||||||

div :: Monad m => Precision -> Ball -> Ball -> m Ball | ||||||||||||||

Division of two balls - If radius is "large" then divide endpoints and makeA a ball from them.
- If radius is "small" then division can be optimized
center = center a / center b -
`(radius = radius a * center b + center a * radius b) / (center b * center b) + 2 * 2 ^ (e1 - e2 - p)`where`p`is precision of the result,`e1 = getExp c1, e2 = getExp c2`. This way the resulting interval is guaranteed to be correct.
Rounding errors are added to the radius. If divisor ball contains zero compuatation fails with fail. | ||||||||||||||

sqrt :: Monad m => Precision -> Ball -> m Ball | ||||||||||||||

Square root of a ball. If interval contains 0 then computation fails. | ||||||||||||||

exp :: Precision -> Ball -> Ball | ||||||||||||||

e ^ b | ||||||||||||||

log :: Monad m => Precision -> Ball -> m Ball | ||||||||||||||

Natural logarithm of a ball. If interval contains 0 then computation fails. | ||||||||||||||

maxB :: Precision -> Ball -> Ball -> Ball | ||||||||||||||

Maximum of two balls, meaning: - lower = max (lower a) (lower b) rounded down
- upper = max (upper a) (upper b) rounded up
| ||||||||||||||

minB :: Precision -> Ball -> Ball -> Ball | ||||||||||||||

Analogous to maxB. | ||||||||||||||

fromDyadic :: Precision -> Dyadic -> Ball | ||||||||||||||

MakeA a ball from dyadic. Radius is 0 if desired precision is not smaller than precision of dyadic. | ||||||||||||||

fromString :: Precision -> String -> Ball | ||||||||||||||

Similar to fromDyadic. | ||||||||||||||

fromInt :: Precision -> Int -> Ball | ||||||||||||||

Similar to fromDyadic. | ||||||||||||||

fromWord :: Precision -> Word -> Ball | ||||||||||||||

Similar to fromInt. | ||||||||||||||

Produced by Haddock version 2.2.2 |