<#-      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH I J K L 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. how many initial lines to use how many final lines to use     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 ';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. *+,-./0 '()*+,-./0 )(*'+,-./0 '()*+,-./0class abstracting floats portable experimentalmik@konecny.aow.cz19This class is an abstraction of a subset of real numbers & with upwards rounded operations. 234567if a is rounded to ao then |a-ao| <= getBaseMaxRounding ao 89:;<=>?@A"number of decimal digits to show whether to show granularity $whether to show internal structure '()*+,-./0123456789:;<=>?@A123456789:;<=>?@A123456789:;<=>?@A23456789:;<=>?@A!rational numbers with infinities portable experimentalmik@konecny.aow.czBCDEBCDEBEDCBEDCCDEenabling Double's as interval endpoints non-portable (requires fenv.h) experimentalmik@konecny.aow.czFASet 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. FFF+arbitrary precision floating point numbers portable experimentalmik@konecny.aow.czGPA 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 GGG )auto-switching hardware-software floats non-portable (requires fenv.h) experimentalmik@konecny.aow.cz Hthis has to be between 1 and I HIHIH  classes abstracting exact reals portable experimentalmik@konecny.aow.cz)J6A 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. KLMNpoint to split at interval to split +left and right, overlapping on a singleton OP<returns thin approximations of endpoints, in natural order QImeet, 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. R6A type whose elements represent sets that can be used J to approximate a single extended real number with arbitrary precision. S(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). T9the lower the granularity the bigger the rounding errors U(increase or safely decrease granularity V.ensure granularity is not below the first arg W.true if this represents a computational error X"true if this holds no information Ytrue if this is a singleton Z[\,true if the approximation excludes infinity ] the bottom element - any number ^the top element - error _(first arg is a subset of the second arg `6join; combining two approximations of the same number a,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. b*nothing if overlapping and not singletons c*nothing if overlapping and not singletons d:nothing if overlapping on interior or by a wrong endpoint esyntactic comparison fsyntactic linear ordering gh%number of relevant decimals to show should show granularity -should show internal representation details the approximation to show 8For a finite sequence of real approximations, determine ( whether it is a shrinking sequence. i Inverse of P. j>Assuming the arguments are singletons, equality is decidable. k'Assuming the arguments are singletons, <= is decidable. l'Assuming the arguments are singletons, < is decidable. mCReturn true if and only if the two intervals have equal endpoints. nThis function converts 4 an effort index to a real number approximation. 1Useful when an effort index is used in a formula & mixed with real approximations. o@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 pE 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. qDThis 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 its ' 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 (JKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopq(RSTUVWXYZ[\]^_`abcdefghJKLMNOPQinojklmpq(JKLMNOPQKLMNOPQRSTUVWXYZ[\]^_`abcdefghSTUVWXYZ[\]^_`abcdefghijklmnopq %exact reals via convergent sequences portable experimentalmik@konecny.aow.cz r5A converging sequence of real number approximations. 8 Every finite subsequence has a non-empty intersection. " The limit should be a singleton. stu2Using 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. v%The same as above, where f is binary w4Turn 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, ...] x Show function for ConvergRealSeq's with full arguments. y 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 rstuvwxyrswuvtxyrsstuvwxy  implementation of Taylor series portable experimentalmik@konecny.aow.czz"coefficients of the Taylor series function to estimate the n'th derivative between a and x centre of the Taylor Expansion {"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 |(A Taylor series for exponentiation. }A Taylor series for sine. ~ A Taylor series for cosine. z{|}~z{|}~z{|}~ interval Newton method portablealphamik@konecny.aow.cza 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.cz Ilog 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). <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 G. !!! to be safe, one has to run F 5Limited granularity, but sometimes up to 100x faster  than ERFloat! !!! to be safe, one has to run F FFsimple 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 (portions of many-dimensional domains portable experimentalmik@konecny.aow.cz):A class abstracting a type of many-dimensional intervals. /Check whether the two domains specify the same 4 interval for each variable that they share. 3Assuming that two domains are compatible, take the < most information from both of the domains about the  ranges of variables. <identification of caller location to use in error messages ,Find the variable with the largest interval @ and return it together with the default splitting point  in its domain. domain d1 domain d2 1Answers to these (mutually exclusive) questions:  is d1 outside and not touching d2?  is d1 outside and touching d2?  is d1 intersecting and not inside d2?  is d1 inside d2? 4A class linking two domain box types that share the 5 index type so that boxes of the two types can be  converted etc. AA class abstracting a type of many-dimensional points, intervals 3 or anything indexed by a subset of dimensions. -More generally, this class abstracts most of  Data.Map.Map. constructor using  -for all variables that appear in both boxes, ; apply the function and add the result to the list :For all variables that appear in either of the two boxes, ; apply the function and add the result to the list. HSupply the default value when the variable is missing from either box. 0For all variables that appear in the first box, ; apply the function and add the result to the list. LSupply the default value when the variable is missing from the second box. 7Pick the extents of a single variable in a domain box. A If there is no information for this variable, assume the 2 variable ranges over the whole real line. <identification of caller location to use in error messages 4A class abstracting a type of variable identifiers 3 for axes in function domains, polynomials etc. )))=arbitrary precision piece-wise something function enclosures portable experimentalmik@konecny.aow.czthe equations; < each equation has coefficients of linear terms  + constant term the domain of the variables :an upper bound on the size of an acceptable solution box ;A box containing at least one solution within the domain; . Nothing if there is no solution. 4implementation of DomainBox based on Data.IntMap portable experimentalmik@konecny.aow.czoverview of AERN-Real non-portable (requires fenv.h) experimentalmik@konecny.aow.czX'()*+,-./0FJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~&top level of the exactreals framework non-portable (requires fenv.h) experimentalmik@konecny.aow.czX'()*+,-./0FJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ:[\]^ _ ` a b c d e f g h i j L N M k l m n o p q r s t u v w x y z { | } ~    ^                !"#$%&'()*+,-./AERN-Real-0.9.6Data.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.Approx.Elementary#Data.Number.ER.Real.Approx.IntervalData.Number.ER.Real.DefaultRepr*Data.Number.ER.Real.Arithmetic.IntegrationData.Number.ER.Real.DomainBox+Data.Number.ER.Real.Arithmetic.LinearSolver$Data.Number.ER.Real.DomainBox.IntMapData.Number.ER.RealData.Number.ER PlusMinusPlusMinuscompareComposecompareComposeMany compareLexmapFstmapSndmapPair mapPairHomogunpair bool2maybedropLast concatWithreplicateSeveralcountDuplicatesallCombinationsallPairsCombinationsallPairsCombinationsEvenOddintLogplusUpplusDownsumUpsumDowntimesUp timesDown productUp productDown readMaybeshowFirstLastLines listUpdate listHasMatchExtendedInteger PlusInfinityFinite MinusInfinity isInfinite binaryLogtake EffortIndex Granularity Precision prec2gran effIx2gran effIx2prec effIx2int int2effIx prec2effIx gran2effIx ERRealBasedefaultGranularitygetApproxBinaryLoggetGranularitysetMinGranularitysetGranularitygetMaxRoundingisERNaNerNaNisPlusInfinity plusInfinity minusInfinity fromDoubletoDouble fromFloattoFloat showDiGrCmpExtendedRationalInfinityNaNinitMachineDoubleERFloat ERMachineAP doubleDigits ERIntApprox doubleBounds floatBounds integerBounds bisectDomaindefaultBisectPtbounds\/ERApprox getPrecisionisEmptyisBottomisExact isDisjointisInteriorDisjoint isBounded bottomApprox emptyApproxrefines/\intersectMeasureImprovement equalReals compareRealsleqReals equalApprox compareApprox double2ra showApprox bounds2ira eqSingletons leqSingletons ltSingletonsequalIntervalseffIx2rasplitIRA 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_RERApproxElementaryabsminmaxexplog**pisincostanatan ERInterval erintv_left erintv_right ERIntervalAnyERIntervalEmptynormaliseERIntervalIRARABBRBMAPBMBAP integrateContintegrateCont_RintegrateContAdapt_R DomainIntBox compatibleunify bestSplitsplitclassifyPositionDomainBoxMappablemap mapWithKeyintersectionWith difference DomainBoxnoinfoisNoinfounary singletontoListfromList toAscList fromAscListinsert insertWithdeletemember notMemberunion unionWithkeyselemsfilterfold foldWithKeyzipWithzipWithDefaultzipWithDefaultSecondfindWithDefaultlookup VariableIDnewVarID defaultVarshowVar linearSolverBoxVarIDsignNegsignMult signToNum unsafePrint intLogDownintLogUperatSignliftToERational1liftToERational2 fesetround fegetroundFP_RND_Tghc-prim GHC.TypesDouble apfltMantapfltExp ERFloatZero ERFloatInfty apfltSign ERFloatNaN apfltGrannormaliseERFloatapFloatExponentsetERFloatGranularitysetERFloatMinGranularityapfltGetMaxRoundingapfloatFromRational ERMachineAPB machapfltBERMachineAPMachineDoublemachapfltDoubleGranularitymachapfltDoublelift1ERMachineAPop1ERMachineAPlift2ERMachineAPop2ERMachineAPcheckShrinking binGeomSeries iterateRA_AmidPoint erNewton_mdfderSqrtContFr_RerSqrtNewton_RerRootNewton_RlogDivSeries_R erSine_Tay_R sine_coefSeq atanEuler_RerTan_RpiAtan_R piBellard_RerintvPrecisionerintvGranularityerintvEqualApproxerintvCompareApproxerintvEqualRealserintvCompareRealserintvLeqRealserintvDefaultBisectPt erintvBisect testIntegr1 integrateDiffintegrateDiffAdapt_RA