!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ mini sign datatype portable experimentalmik@konecny.aow.czgeneral purpose extras portable experimentalmik@konecny.aow.cz7Compose as when defining the lexicographical ordering. 7Compose as when defining the lexicographical ordering. The lexicographical ordering.  eg % concatWith "," ["a","b"] = "a,b" a connective eg / replicateSeveral [(2,"a"),(1,"b")] = "aab" eg 7 countDuplicates "aaba" = [(2,"a"),(1,"b"),(1,"a")] eg  allCombinations  [  (1,['a']),  (2,['b','c']),  (3,['d','e','f'])  ] =  [ ) [(1,'a'),(2,'b'),(3,'d')], ( [(1,'a'),(2,'b'),(3,'e')], ( [(1,'a'),(2,'b'),(3,'f')], ) [(1,'a'),(2,'c'),(3,'d')], ( [(1,'a'),(2,'c'),(3,'e')], ' [(1,'a'),(2,'c'),(3,'f')]  ] eg ! allPairsCombinationsEvenOdd  [  (1,('a0','a1'),  (2,('b0','b1'),  (3,('c0','c1')  ] =  ([ , [(1,'a0'),(2,'b0'),(3,'c0')], , [(1,'a0'),(2,'b1'),(3,'c1')], , [(1,'a1'),(2,'b1'),(3,'c0')], + [(1,'a1'),(2,'b0'),(3,'c1')]  ]  ,[ , [(1,'a0'),(2,'b0'),(3,'c1')], , [(1,'a0'),(2,'b1'),(3,'c0')], , [(1,'a1'),(2,'b0'),(3,'c0')], + [(1,'a1'),(2,'b1'),(3,'c1')]  ]  ) )the first value is even, the second odd base x "Directionally rounded versions of  +,*,sum,prod.    integer with infinities portable experimentalmik@konecny.aow.cz !"#$%the smallest integer i for which 2^i < = abs n % !"#$%"! #$%"! !"#$%0generic types for exact real number processing portable experimentalmik@konecny.aow.cz&&A many-dimensional point or interval. 'EA variable identifier for axes in function domains, polynomials etc. (;This type synonym should be used for funciton parameter(s) . that guide the convergence of the function' s result to  a perfect (exact) result. The name should remind us < that there is no universally valid relationship between < this integer the quality (precision) of the result. < The only condition usually assumed is that in the limit 9 when the effort index rises to infinity, the result  should be exact. )8The bit size of the floating point numbers (or similar) > used internally in real number and function approximations. *7Precision represents an upper bound on the measure of & an approximation viewed as a set; . not to be confused with the precision of  an &Data.Number.ER.Real.Base.Float.ERFloat and similar. +In an approximation comprising a number of  instances of #Data.Number.ER.Real.Base.ERRealBase, @ we will refer to the bit-precision of these base components  as the ) of the approximation. +,-./0123using 2 4&'()*+,-./01234*)+(,-./01'2&34&'()*+,-./01234class abstracting floats portable experimentalmik@konecny.aow.cz59This class is an abstraction of a subset of real numbers & with upwards rounded operations. 6789:;if a is rounded to ao then |a-ao| <= getBaseMaxRounding ao <=>?@ABCDE"number of decimal digits to show whether to show granularity $whether to show internal structure &'()*+,-./0123456789:;<=>?@ABCDE56789:;<=>?@ABCDE56789:;<=>?@ABCDE6789:;<=>?@ABCDE!rational numbers with infinities portable experimentalmik@konecny.aow.czFGHIFGHIFIHGFIHGGHIenabling Double's as interval endpoints non-portable (requires fenv.h) experimentalmik@konecny.aow.czJASet machine floating point unit to the upwards-directed rounding  mode. /This procedure has to be executed before using  O as a basis for interval and polynomial arithmetic defined in this package. JJJ+arbitrary precision floating point numbers portable experimentalmik@konecny.aow.czKPA floating point number with a given but arbitrary precision represented by its ).  base: 2. O granularity specifies the bit-size of both the significand and the exponent 6 special values: NaN, signed Infinity and signed Zero  no denormalised numbers C operations unify the granularity of their operands to the maximum ) ) Rounding is always towards +Infinity. \ For field operations, the rounded result is as close as possible to the exact result. normalisation 6 ensures that the components are within their regions 5 possibly turning the number into a zero or infinity see the documentation of ERRealBase.getBaseMaxRounding KKK )auto-switching hardware-software floats non-portable (requires fenv.h) experimentalmik@konecny.aow.cz Lthis has to be between 1 and M LMLML  classes abstracting exact reals portable experimentalmik@konecny.aow.cz'N6A type whose elements represent sets that can be used L to approximate a recursive set of closed extended real number intervals  with arbitrary precision. BA type whose elements represent real *intervals* that can be used J to approximate a single extended real number with arbitrary precision. 3Sometimes, these types can be used to approximate D a closed extended real number interval with arbitrary precision. ( Nevetheless, this is not guaranteed. OPQRpoint to split at interval to split +left and right, overlapping on a singleton ST<returns thin approximations of endpoints, in natural order UImeet, usually constructing interval from approximations of its endpoints 9This does not need to be the meet of the real intervals > but it has to be a maximal element in the set of all 9 ira elements that are below the two parameters. V6A type whose elements represent sets that can be used J to approximate a single extended real number with arbitrary precision. W(Precision is a measure of the set size. The default interpretation: 5 If the diameter of the set is d, then the precision - should be near floor(- log_2 d). X9the lower the granularity the bigger the rounding errors Y(increase or safely decrease granularity Z.ensure granularity is not below the first arg [.true if this represents a computational error \"true if this holds no information ]true if this is a singleton ^_,true if the approximation excludes infinity ` the bottom element - any number athe top element - error b(first arg is a subset of the second arg c6join; combining two approximations of the same number d,Like intersection but the second component: Z measures improvement of the intersection relative to the first of the two approximations P is a positive number: 1 means no improvement, 2 means doubled precision, etc. e*nothing if overlapping and not singletons f*nothing if overlapping and not singletons g:nothing if overlapping on interior or by a wrong endpoint hsyntactic comparison isyntactic linear ordering jk%number of relevant decimals to show should show granularity -should show internal representation details the approximation to show >Assuming the arguments are singletons, equality is decidable. 'Assuming the arguments are singletons, <= is decidable. 'Assuming the arguments are singletons, < is decidable. 8For a finite sequence of real approximations, determine ( whether it is a shrinking sequence. lmn@Split an interval to a sequence of intervals whose union is the < original interval using a given sequence of cut points. H The cut points are expected to be in increasing order and contained C in the given interval. Violations of this rule are tolerated. an interval to be split 6approximations of the cut points in increasing order oE Return the endpoints of the interval as well as the exact midpoint. E To be able to do this, there may be a need to increase granularity. D All three singleton intervals are set to the same new granularity. pDThis produces a function that computes the maximal extension of the D given function. A maximal extension function has the property: F f(I) = { f(x) | x in I }. Here we get this property only for the / limit function for ix tending to infinity. Areturns a safe approximation of all extrema within the interval Aa function behaving well on sequences that intersect to a point Na function behaving well on sequences that intersect to a non-empty interval #NOPQRSTUVWXYZ[\]^_`abcdefghijklmnop#VWXYZ[\]^_`abcdefghijkNOPQRSTUlmnop#NOPQRSTUOPQRSTUVWXYZ[\]^_`abcdefghijkWXYZ[\]^_`abcdefghijklmnop %exact reals via convergent sequences portable experimentalmik@konecny.aow.cz q5A converging sequence of real number approximations. 8 Every finite subsequence has a non-empty intersection. " The limit should be a singleton. rs2Using this operator, a unary funtion working over 6 approximations can be converted to one that works 6 over exact numbers represented through a sequence  of approximations. t%The same as above, where f is binary u4Turn an arbitrary convergent sequence into one with > a guaranteed convergence rate - the precision (as defined  by RA.ERApprox.RA.getPrecision) of x_ix is at least ix. (binGeomSeries n is the geometric series  [ n, 2n, 4n, 8n, ...] v Show function for ConvergRealSeq's with full arguments. w Show function for ConvergRealSeq's with all parameters fixed  except for number of digits ETake a converging sequence of partial functions F_i that operate on ^ real approximations and turn it into a function F that operates on converging sequences. B F looks for some members of the real approximation sequences B and an i so that F_i is defined for the chosen approximations  and returns its result. 8a sequence of partial functions based on approximations 1a starting index to use when searching sequences $a total function based on sequences qrstuvwqustrvwqrstuvw  implementation of Taylor series portable experimentalmik@konecny.aow.czx"coefficients of the Taylor series function to estimate the n'th derivative between a and x centre of the Taylor Expansion y"coefficients of the Taylor series function to estimate the n'th derivative between a and x Iuse this many elements of the series (+ account for error appropriately) centre of the Taylor Expansion Kmake all constants have this granularity, thus influencing rounding errors z(A Taylor series for exponentiation. {A Taylor series for sine. | A Taylor series for cosine. xyz{|xyz{|xyz{| interval Newton method portablealphamik@konecny.aow.cz}a function and its derivative a starting point Pa lower bound of the absolute value of the derivative over the working interval number of iterations Bthe initial index to use for argument function and its derivative  the result 5This auxiliary function returns the average of two ra's ~Modified Newton Method  Notes: D It has a cubic convergence speed, as opposed to the original Newton's & square convergence speed. ' It does not deal with multiple roots. D Per iteration, it makes two queries on the derivative, so it best N suits the cases where computation of the derivative is at most as . expensive as the function itself. a function and its derivative a starting point FThe minimum of absolute value of derivative over the working interval number of iterations XIt triggers the initial index to be called by the argument function and its derivative.  the result a function and its derivative a starting point FThe minimum of absolute value of derivative over the working interval XIt triggers the initial index to be called by the argument function and its derivative.  the result }~}~}~some elementary functions portable experimentalmik@konecny.aow.czIlog using a fast converging series, designed to be used with singletons pi using Bellard' s formula Convergence properties:  shrinking sequence  rate at least 2^(-i). pi using atan pi using Bellard' s formula  (see  (http://en.wikipedia.org/wiki/Computing_) Convergence properties:  shrinking sequence  rate at least 2^(-i). simple integration methods portable experimentalmik@konecny.aow.czInaive integration, using a partition of 2 * prec equally sized intervals ;integration using divide and conquer adaptive partitioning ;integration using divide and conquer adaptive partitioning < making use of the derivative of the integrated function <abstraction of exact reals capable of elementary operations portable experimentalmik@konecny.aow.cz 7A class defining various common real number operations E in a approximation-aware fashion, ie introducing effort indices. :All operations here have default implementations based on  )Data.Number.ER.Real.Arithmetic.Elementary. safe interval arithmetic portable experimentalmik@konecny.aow.cz2Type for arbitrary precision interval arithmetic. Krepresents no knowledge of result (bottom element in the interval domain) Jusually represents computation error (top element in the interval domain) convert to a normal form, ie:  no NaNs as endpoints l <= r no (-Infty, +Infty) HerintvPrecision returns an approximation of the number of bits required D to represent the mantissa of a normalised size of the interval:  , - log_2 ((r - l) / (1 + abs(r) + abs(l))) =Notice that this is +Infty for singleton and empty intervals ( and -Infty for the whole real line. a syntactic equality test a syntactic linear order ECompare for equality two intervals interpreted as approximations for ? 2 single real numbers. When equality or inequality cannot 0 be established, return Nothing (ie bottom). ICompare in natural order two intervals interpreted as approximations for ? 2 single real numbers. When equality or inequality cannot 0 be established, return Nothing (ie bottom). ICompare in natural order two intervals interpreted as approximations for 9 2 single real numbers. When relaxed equality cannot > be established nor disproved, return Nothing (ie bottom). Default splitting:  , [-Infty,+Infty] |-> [-Infty,0] [0,+Infty]  3 [-Infty,x] |-> [-Infty,2*x-1] [2*x-1, x] (x <= 0)  * [-Infty,x] |-> [-Infty,0] [0, x] (x > 0)  3 [x,+Infty] |-> [x,2*x+1] [2*x+1,+Infty] (x => 0)  * [x,+Infty] |-> [x,0] [0,+Infty] (x < 0)  % [x,y] |-> [x, (x+y)/2] [(x+y)/2, y]  empty |-> empty empty /concise names for default real representations non-portable (requires fenv.h) experimentalmik@konecny.aow.czthe default instance of &Data.Number.ER.Real.Approx.ERIntApprox the default instance of #Data.Number.ER.Real.Approx.ERApprox the default base type very inefficient  Use machine ; while the granularity is up to its significant bit length 8 and when the granularity grows beyond that, use K. !!! to be safe, one has to run J 5Limited granularity, but sometimes up to 100x faster  than ERFloat! !!! to be safe, one has to run J JJoverview of AERN-Real non-portable (requires fenv.h) experimentalmik@konecny.aow.cz,&'()*+,-./012345JNVqrstuvwxyz{|}~5VN&top level of the exactreals framework non-portable (requires fenv.h) experimentalmik@konecny.aow.cz,&'()*+,-./012345JNVqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[6\]^_ ` a b c d e f g h i j k M O N l m n o p q r s t u v w x y z { | } ~   _    AERN-Real-0.9.2Data.Number.ER.PlusMinusData.Number.ER.MiscData.Number.ER.ExtendedIntegerData.Number.ER.BasicTypesData.Number.ER.Real.Base!Data.Number.ER.Real.Base.Rational&Data.Number.ER.Real.Base.MachineDoubleData.Number.ER.Real.Base.Float*Data.Number.ER.Real.Base.CombinedMachineAPData.Number.ER.Real.Approx#Data.Number.ER.Real.Approx.Sequence%Data.Number.ER.Real.Arithmetic.Taylor%Data.Number.ER.Real.Arithmetic.Newton)Data.Number.ER.Real.Arithmetic.Elementary*Data.Number.ER.Real.Arithmetic.Integration%Data.Number.ER.Real.Approx.Elementary#Data.Number.ER.Real.Approx.IntervalData.Number.ER.Real.DefaultReprData.Number.ER.RealData.Number.ER PlusMinusPlusMinuscompareComposecompareComposeMany compareLexmapFstmapSndmapPair mapPairHomogunpair bool2maybedropLast concatWithreplicateSeveralcountDuplicatesallCombinationsallPairsCombinationsallPairsCombinationsEvenOddintLogplusUpplusDownsumUpsumDowntimesUp timesDown productUp productDown readMaybe listUpdate listHasMatchExtendedInteger PlusInfinityFinite MinusInfinity isInfinite binaryLogtakeBoxVarID EffortIndex Granularity Precision prec2gran effIx2gran effIx2prec effIx2int int2effIx prec2effIx gran2effIx defaultVarunaryDom noinfoDom ERRealBasedefaultGranularitygetApproxBinaryLoggetGranularitysetMinGranularitysetGranularitygetMaxRoundingisERNaNerNaNisPlusInfinity plusInfinity minusInfinity fromDoubletoDouble fromFloattoFloat showDiGrCmpExtendedRationalInfinityNaNinitMachineDoubleERFloat ERMachineAP doubleDigits ERIntApprox doubleBounds floatBounds integerBounds bisectDomaindefaultBisectPtbounds\/ERApprox getPrecisionisEmptyisBottomisExact isDisjoint isBounded bottomApprox emptyApproxrefines/\intersectMeasureImprovement equalReals compareRealsleqReals equalApprox compareApprox double2ra showApprox bounds2iraeffIx2rasplitIRA exactMiddlemaxExtensionR2RConvergRealSeqconvergRealSeqElemconvertFuncRA2SeqconvertBinFuncRA2SeqmakeFastConvergRealSeqshowConvergRealSeqshowConvergRealSeqAuto erTaylor_RerTaylor_R_FullArgserExp_Tay_Opt_RerSine_Tay_Opt_RerCosine_Tay_Opt_RerNewton_FullArgserNewton_mdfd_FullArgserSqr_IRerSqr_RerPow_IRerPow_RerSqrt_R erSqrt_IRerRoot_R erRoot_IRerExp_RerExp_IRerLog_RerLog_IRerSine_R erCosine_R erSine_IR erCosine_IRerATan_R erATan_IRerPi_R integrateContintegrateCont_RintegrateContAdapt_RERApproxElementaryabsminmaxexplog**pisincostanatan ERInterval erintv_left erintv_right ERIntervalAnyERIntervalEmptynormaliseERIntervalIRARABBRBMAPBMBAPsignNegsignMult signToNum unsafePrinteratSignliftToERational1liftToERational2 fesetround fegetroundFP_RND_Tghc-prim GHC.TypesDouble apfltMantapfltExp ERFloatZero ERFloatInfty apfltSign ERFloatNaN apfltGrannormaliseERFloatapFloatExponentsetERFloatGranularitysetERFloatMinGranularityapfltGetMaxRoundingapfloatFromRational ERMachineAPB machapfltBERMachineAPMachineDoublemachapfltDoubleGranularitymachapfltDoublelift1ERMachineAPop1ERMachineAPlift2ERMachineAPop2ERMachineAP eqSingletons leqSingletons ltSingletonscheckShrinking binGeomSeries iterateRA_AmidPoint erNewton_mdfderSqrtContFr_RerSqrtNewton_RerRootNewton_RlogDivSeries_R erSine_Tay_R sine_coefSeq atanEuler_RerTan_RpiAtan_R piBellard_R testIntegr1 integrateDiffintegrateDiffAdapt_RAerintvPrecisionerintvGranularityerintvEqualApproxerintvCompareApproxerintvEqualRealserintvCompareRealserintvLeqRealserintvDefaultBisectPt erintvBisect