{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 0 10 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 257 "" 1 20 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 258 "" 0 10 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 259 "" 1 18 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 260 "" 1 18 0 0 0 0 1 1 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 261 "" 1 18 0 0 0 0 1 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 262 "" 0 10 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Cour ier" 1 10 0 0 255 1 0 0 0 0 0 1 3 0 3 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Warning" 2 7 1 {CSTYLE "" -1 -1 "" 0 1 0 0 255 1 0 0 0 0 0 0 1 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output " 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 11 12 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Normal" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "AC - Title" -1 257 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }3 1 0 0 12 12 1 0 1 0 1 2 258 1 }{PSTYLE "AC - Author" -1 258 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 1 2 2 2 2 2 1 1 1 1 }3 1 0 0 8 8 1 0 1 0 2 2 259 1 }} {SECT 0 {EXCHG {PARA 257 "" 0 "" {TEXT -1 0 "" }{TEXT 257 12 "intpakX \+ v1.0" }}{PARA 258 "" 0 "" {TEXT 256 234 "written by Grimmer, Markus, \+ Department of Mathematics, University of Wuppertal, Germany, http://ww w.math.uni-wuppertal.de/wrswt \n<\251 1999-2002 Scientific Computing/S oftware Engineering Research Group, University of Wuppertal, Germany> " }{TEXT 259 1 "\n" }{TEXT 260 8 "intpakX\n" }{TEXT 258 259 "by Kr\344 mer, Walter, Geulig, Ilse and Grimmer, Markus, Department of Mathemati cs, University of Wuppertal, Germany, http://www.math.uni-wuppertal.de /wrswt \n<\251 1999-2002 Scientific Computing/Software Engineering Res earch Group, University of Wuppertal, Germany>\n" }{TEXT 261 6 "intpak " }{TEXT 262 111 "\nby Corless, R. and Connell, A., University of West ern Ontario, Canada \n<\251 1992-1993 R. Corless and A. Connell>" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}{PARA 0 "" 0 "" {TEXT -1 75 "######################## ###################################################" }}{PARA 0 "" 0 " " {TEXT -1 173 "intpakX v1.0 - Interval Arithmetic in Maple \n\nThis i s a new, integrated version of the Maple package intpakX for interval \+ computations.\nIt integrates and updates the package" }}{PARA 0 "" 0 " " {TEXT -1 93 "- intpak by R. Corless and A. Connell\nand its extensio n\n- intpakX by I. Geulig and W. Kraemer" }}{PARA 0 "" 0 "" {TEXT -1 48 "intpakX v1.0 was written/updated by M. Grimmer.\n" }}{PARA 0 "" 0 "" {TEXT -1 357 "intpakX v1.0 provides basic data types and operations for interval arithmetic as well as additional \nfeatures for further \+ interval computation.\nThrough this package, the features of the above mentioned packages are available in a\ncombined version as a Maple 7 \+ module.\nA couple of updates have been made to provide a version worki ng with Maple 7 properly. \n" }}{PARA 0 "" 0 "" {TEXT -1 96 "For info rmation how to create a Maple package from this document, see the end \+ of this worksheet." }}{PARA 0 "" 0 "" {TEXT -1 135 "\nintpakX v1.0 (c) Scientific Computing/Software Engineering Research Group,\nDepartment of Mathematics, University of Wuppertal, Germany" }}{PARA 0 "" 0 "" {TEXT -1 117 "\nContact: \nkraemer@math.uni-wuppertal.de\nmarkus.grimm er@math.uni-wuppertal.de \nhttp://www.math.uni-wuppertal.de/wrswt" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 29 "Disclaime r: see end of module" }}{PARA 0 "" 0 "" {TEXT -1 76 "################# ##########################################################\n" }}{PARA 0 "" 0 "" {TEXT -1 166 "############################################## #############################\nModule header\n######################## ###################################################\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1622 "intpakX:=module()\nexport init,Evalf,min,intpa kX_min,max,intpakX_max,ilog10,intpakX_ilog10,\n Interval_ulp,ulp,\n \+ Interval_Round_Up,Interval_Round_Down,ru,rd,\n intpakX_greater,is_in, construct,expinfinity,\n Interval_exp,infinityln,`&exp`,`&ln`,\n Int erval_ln,addinfinity,Interval_add,`&+`,subtractinfinity,\n Interval_s ubtract,`&-`,timesinfinity,Interval_times,`&*`,\n Interval_reciprocal ,inv,Interval_divide,`&/`,sqrtinfinity,Interval_sqrt,`&sqrt`,\n sqrin finity,Interval_sqr,`&sqr`,\n Interval_option_zero,powerinfinity,Inte rval_Integerpower,`&intpower`,\n Interval_power,`&**`,Interval_midpoi nt,midpoint,\n Interval_width,width,Interval_intersect,`&intersect`, \n Interval_union,`&union`,Interval_trig_ru,Interval_trig_rd,\n Inte rval_scale,Interval_range_values,Interval_sin,Interval_cos,Interval_ta n,\n Interval_arcsin,Interval_arccos,Interval_arctan,Interval_hyp_rd, Interval_hyp_ru,\n Interval_cosh,Interval_sinh,Interval_tanh,`&sin`,` &cos`,`&tan`,`&arcsin`,\n `&arccos`,`&arctan`,`&sinh`,`&cosh`,`&tanh` ,\n ext_int_div,rel_diam,mid,compute_naive_interval_range,compute_mea n_value_range,\n compute_monotonic_range,compute_combined_range,compu te_taylor_form_range,`&Convex_Hull`,\n subdivide_equidistant,subdivid e_adaptive,interval_list_plot,compute_range,\n max_abs_error,cni_rang e3d,\n subdivide_equi3d,interval_list_plot3d,compute_range3d,newton,c ompute_all_zeros,newton_plot,\n newton_with_plot,compute_all_zeros_wi th_plot,\n `&cabs`,complex_disc_plot,complex_polynom_plot,`&cadd`,`&c sub`,`&cmult`,`&cdiv`,x0_start,\n `&cmult_opt`,`&cdiv_opt`,horner_eva l_cent,horner_eval_opt,centred_form_eval,cexp;\noption package;" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 75 "######### ##################################################################" }} {PARA 0 "" 0 "" {TEXT -1 65 "Name definitions (see below for body of c orresponding procedures)" }}{PARA 0 "" 0 "" {TEXT -1 76 "############# ##############################################################\n" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 725 "min:=intpakX_min;\nmax:=intpakX_ma x; \nilog10:=intpakX_ilog10;\nwidth:=Interval_width;\nulp:=Interval_ul p;\nru:=Interval_Round_Up;\nrd:=Interval_Round_Down;\n`&exp`:=Interval _exp;\n`&ln`:=Interval_ln;\n`&+`:=Interval_add;\n`&-`:=Interval_subtra ct;\n`&*`:=Interval_times;\ninv:=Interval_reciprocal;\n`&/`:=Interval_ divide;\n`&sqrt`:=Interval_sqrt;\n`&sqr`:=Interval_sqr;\n`&intpower`:= Interval_Integerpower;\n`&**`:=Interval_power;\nmidpoint:=Interval_mid point;\n`&intersect`:=Interval_intersect;\n`&union`:=Interval_union;\n `&sin`:=Interval_sin;\n`&cos`:=Interval_cos;\n`&tan`:=Interval_tan;\n` &arcsin`:=Interval_arcsin;\n`&arccos`:=Interval_arccos;\n`&arctan`:=In terval_arctan;\n`&cosh`:=Interval_cosh;\n`&sinh`:=Interval_sinh;\n`&ta nh`:=Interval_tanh;\n" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 75 "# ###################################################################### ####" }}{PARA 0 "" 0 "" {TEXT -1 15 "Initialization " }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 89 "The init procedure cont ains type definitions for the various (procedural) interval types." }} {PARA 0 "" 0 "" {TEXT -1 82 "In Maple, type defintions must be global; they seemingly cannot be module exports." }}{PARA 0 "" 0 "" {TEXT -1 75 "################################################################## #########" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "init:=proc()" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 158 "g lobal Interval_fnlist,`type/num_or_FAIL`,`type/interval_comp`,`type/in terval`,\n `type/complex_disc`,`type/complex_interval`,`convert/ interval`,inapply;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 77 " Interval_fnlist:=[sqrt=`&sqrt`,ln=`&ln`,e xp=`&exp`,sin=`&sin`,cos=`&cos`," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 79 " tan=`&tan`,arcsin=`&arcsin`,arccos=`&arccos`,arctan=`&arctan`,sin h=`&sinh`," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " cosh=`&cosh`];\n " }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 67 " - - in proc init \+ - - - - - - - - - - - - - - - " }}{PARA 0 "" 0 "" {TEXT -1 65 " This type is included for ease of writing and clarity \+ of code." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " `type/num_or_FAIL`: =proc(a)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " local bool,Constant s:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " Constants:=\{constants\}: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 64 " bool:=type(a,numeric) or a= -infinity or a=infinity or a=FAIL" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " or member(a,Constants):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " bool:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " end:" }}{PARA 0 "" 0 "" {TEXT -1 70 " - - in proc init - - - - - - - - - - \+ - - - - - \n " }}{PARA 0 "" 0 "" {TEXT -1 138 " Simplified ver sion of type interval_comp (cf. intpak/intpakX).\n Pi, gamma, Catala n, false, true are not allowed as interval borders.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " `type/interval_comp`:=proc(x)" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 20 " local bool;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 75 " bool:=type(x,float) or x=FAIL or x=-infinity or x=infinity or x=0;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " \+ bool;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " end:\n " }}{PARA 0 "" 0 "" {TEXT -1 96 " - - in proc init - - - - - - - - - - \+ - - - - - \n PROCEDURE - TYPE/INTERVAL" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 121 " This procedure define s the procedural type interval. \n It tests an argument to see if it is an interval. An interval" }}{PARA 0 "" 0 "" {TEXT -1 75 " is def ined here to be a list with either zero elements,+/- infinity,FAIL" }} {PARA 0 "" 0 "" {TEXT -1 45 " or a list with two floating point memb ers." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{MPLTEXT 1 0 28 " `type/interval`:=proc(x)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " local bool;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " bool:=false;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " i f type(x,list) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " if nops(x) = 2 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 74 " i f type(x[1],interval_comp) and type(x[2],interval_comp) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 61 " if intpakX_greater(x[2],x [1]) then bool:=true" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 63 " \+ elif x[1] = FAIL or x[2] = FAIL then bool:=true" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 61 " else ERROR(`enter the lowest end point first`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " fi " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " fi" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 41 " elif nops(x)=0 then bool:=true" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " fi;" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 11 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " \+ bool;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " end:" }}{PARA 0 "" 0 "" {TEXT -1 244 " - - in proc init - - - - - - - - - \+ - - - - - - \n PROCEDURE - TYPE/COMPLEX_DISC\n\n This proce dure implements (i.e. tests an argument to be of) the procedural type \+ complex disc\n for use in complex interval arithmetic.\n " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " `type/complex_disc`:=proc(z)" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " local bool;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " bool:=false;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " if type(z,list) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " if nops(z)=3 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " if type(z[3],numeric) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " if z[3] >= 0 then" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " bool:= type(z[ 1],numeric) and " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " \+ type(z[2],numeric);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " \+ fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " fi;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " bool;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " \+ end:\n" }}{PARA 0 "" 0 "" {TEXT -1 279 " - - in proc init - - \+ - - - - - - - - - - - - - \n PROCEDURE - TYPE/COMPLEX_ INTERVAL\n\n This procedure implements (i.e. tests an argument to be of) the procedural type complex interval\n (~rectangular interval) \n for use in complex interval arithmetic.\n " }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 36 " `type/complex_interval`:=proc(z)" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 18 " local bool;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " bool:=false;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " if type(z,list(interval)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " if nops(z)=2 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " if z[1]=[] then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 72 " ERROR(`First Element of List must be \+ a real interval.`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " \+ elif z[2]=[] then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 73 " \+ ERROR(`Second Element of List must be a real interval.`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 73 " bool:=type(z[1][1],numeric) and type( z[1][2],numeric) and" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 67 " \+ type(z[2][1],numeric) and type(z[2][2],numeric);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " \+ fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " bool;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " end:\n " }}{PARA 0 "" 0 "" {TEXT -1 100 " - - in proc init - - - - - - - - - - - - - - - \n PROCEDURE `CONVERT/INTERVAL`\n" }}{PARA 0 "" 0 "" {TEXT -1 138 " A utility program to convert Maple expressions to interval ari thmetic. \n convert(1+x + x^2,'interval') returns (1 &+ x) &+ (x &^ 2)," }}{PARA 0 "" 0 "" {TEXT -1 69 " whereas inapply(1+x+x^2,x) yie lds the operator x -> (1 &+ x) etc.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }{TEXT -1 0 "" }{MPLTEXT 1 0 30 " `convert/interval`:=proc(e) " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " local ope, mope, fn;" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " # option system:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 " if type(e,interval) or type(e,interval_comp) then e;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " elif type(e,`+`) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 61 " if type(op(2,e),`*`) and op(1,op (2,e)) = (-1) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 74 " \+ `convert/interval`(op(1,e)) &- `convert/interval`(op(1,e)-e);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " else" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 74 " `convert/interval`(op(1,e)) &+ `conver t/interval`(e-op(1,e));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " \+ fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " elif type(e,`*`) t hen " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " if op(1,e)=1.0 \+ then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 " `convert/int erval`(subs(op(1,e)=1,e));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " \+ else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " `conve rt/interval`(op(1,e)) &*" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " (`c onvert/interval`(e/op(1,e)));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " \+ fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 " ### WARNING: n ote that `I` is no longer of type `^`" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " elif type(e,`^`) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " if type(op(2,e),posint) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 61 " `convert/interval`(op(1,e)) &intpower \+ op(2,e);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " elif type(o p(2,e),integer) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 69 " \+ inv(`convert/interval`(op(1,e)) &intpower (-op(2,e)));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " elif op(2,e)=(1/2) then" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " &sqrt(`convert/inter val`(op(1,e)));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 78 " else (`convert/interval`(op(1,e)) &** `convert/interval`(op(2,e)))" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " fi;" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 33 " elif type(e,function) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " ope:=[op(e)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " mope:=op(map(`convert/interval`,ope));" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " fn:=subs(Interval_fnli st,op(0,e));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " fn(mope ):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " else e" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " \+ fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " end: " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 138 " - - in pro c init - - - - - - - - - - - - - - - \n PROCEDURE IN APPLY\n\n Converts the argument to an interval function." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 81 " inapply \+ := proc(); unapply(convert(args[1],'interval'),args[2..nargs]); end:\n " }}{PARA 0 "" 0 "" {TEXT -1 93 " - - end proc init global type def initions - - - - - - - - - - - - - - - \n" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 16 " with(plots):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " with(geometry):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "\nmacro(evalf=Evalf);\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "RET URN();" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "init();" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 23 "#### end initialization" }}{PARA 0 "" 0 "" {TEXT -1 75 "################################################################## #########" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "Evalf := proc(x)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " local e;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " \+ e := evalf(x); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 118 " \+ if e = -1.*infinity then -infinity\n elif e = 1.*infinity then infinity\n else e fi" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " end:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1 "\n" }} {PARA 0 "" 0 "" {TEXT -1 75 "######################################### ##################################" }}{PARA 0 "" 0 "" {TEXT -1 27 "BAS IC INTERVAL DEFINITIONS\n" }}{PARA 0 "" 0 "" {TEXT -1 77 "------------ -----------------------------------------------------------------" }} {PARA 0 "" 0 "" {TEXT -1 33 "Definition of `type/num_or_FAIL`:" }} {PARA 0 "" 0 "" {TEXT -1 22 "## see init procedure!" }}{PARA 0 "" 0 " " {TEXT -1 77 "------------------------------------------------------- ----------------------" }}{PARA 0 "" 0 "" {TEXT -1 35 "Definition of ` type/interval_comp`:" }}{PARA 0 "" 0 "" {TEXT -1 22 "## see init proce dure!" }}{PARA 0 "" 0 "" {TEXT -1 78 "-------------------------------- ---------------------------------------------\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "Interval_ulp := proc(x):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " if x=0 then (0) else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 " Float(1,length(op(1,x))+op(2,x)-Digits)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }}{PARA 0 "" 0 "" {TEXT -1 78 "--------------------------------------- --------------------------------------\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "Interval_Round_Up := proc(x):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " if x=-infinity then x" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " elif x=infinity then infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " elif x=FAIL then FAIL" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " else x + ulp(x)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " end:\n" }}{PARA 0 "" 0 "" {TEXT -1 78 "---------------------------------------------------- -------------------------\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "Inte rval_Round_Down := proc(x):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " i f x=-infinity then x" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " elif x=i nfinity then infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " elif x= FAIL then FAIL" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " else x - ulp(x )" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " end:\n" }}{PARA 0 "" 0 "" {TEXT -1 77 "------------ -----------------------------------------------------------------" }} {PARA 0 "" 0 "" {TEXT -1 30 "Definition of `type/interval`:" }}{PARA 0 "" 0 "" {TEXT -1 27 "## moved to init procedure!" }}{PARA 0 "" 0 "" {TEXT -1 77 "--------------------------------------------------------- --------------------" }}{PARA 0 "" 0 "" {TEXT -1 68 "OPERATOR &GREATER /INTERVAL_GREATER\n\nChecks if (Arg1>=Arg2) applies.\n" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 26 "intpakX_greater:=proc(a,b)" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 29 "local a_rational, b_rational;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "if (a=FAIL) or \+ (b=FAIL) then FAIL; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 64 "elif not(ty pe(a,numeric) or member(a,\{infinity,-infinity\})) then" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 63 " ERROR(`first argument must be a numeric, \+ FAIL, infinity or" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "-infinity`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 64 "elif not(type(b,numeric) or membe r(b,\{infinity,-infinity\})) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 62 " ERROR(`second argument must be a numeric, FAIL, infinity or" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "-infinity`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "elif (a=infinity) then true;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "elif (b=-infinity) then true;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "elif (a = -infinity) then false;" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 29 "elif (b=infinity) then false;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "elif a > b then true" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "elif type(a,rational) and type(b,rational) then " }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 39 " if a >= b then true else false fi;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "elif type(a,rational) and type(b,fl oat) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " b_rational:=op(1, b)*(10^(op(2,b)));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " if a >= \+ b_rational then true else false fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "elif type(a,float) and type(b,rational) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " a_rational:=op(1,a)*(10^(op(2,a)));" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 54 " if a_rational >= b then true else false fi; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "elif type(a,float) an d type(b,float) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " a_rati onal:=op(1,a)*(10^(op(2,a)));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " \+ b_rational:=op(1,b)*(10^(op(2,b)));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " if a_rational >= b_rational then true else false fi;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 77 "------------------------------------------------------------------ -----------" }}{PARA 0 "" 0 "" {TEXT -1 18 " PROCEDURE - IS_IN" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 74 "This proc edure takes two parameters. It tests to see whether the interval," }} {PARA 0 "" 0 "" {TEXT -1 65 "or numeric x is contained in the interval a. If a is a float then" }}{PARA 0 "" 0 "" {TEXT -1 45 "the procedure constructs an interval to test." }}{PARA 0 "" 0 "" {TEXT -1 52 "The o perator &greater/Interval_greater is used here." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "is_in:=proc(x,a)" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " if type(a,interval) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " if x=FAIL then FAIL" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " elif x=infinity then member(infinity,\{a[1],a[ 2]\})" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 58 " elif x=-infinity th en member(-infinity,\{a[1],a[2]\})" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 " elif not(type(x,\{numeric,interval\})) then " }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 68 " ERROR(`first argument must be a nu meric or an interval`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " el if a=[] and x<>[] then false" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " \+ elif a[1]=FAIL or a[2]=FAIL then FAIL " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " elif type(x,numeric) then " }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 63 " intpakX_greater(x,a[1]) and intpakX_grea ter(a[2],x) " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " elif type(x, interval) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " if x=[] then false #????????????" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " \+ elif x[1]=FAIL or x[2]=FAIL then FAIL" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 72 " else intpakX_greater(x[1],a[1]) and intpakX_ greater(a[2],x[2]) " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " fi; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " fi;" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 42 " elif a=infinity then evalb(x=infinity)" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " elif a=-infinity then evalb(x=- infinity) " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " elif a=FAIL then \+ FAIL" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " elif type(a,numeric) th en" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " if x=FAIL then FAIL \+ " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " elif x=infinity or x=- infinity then false" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " eli f type(x,numeric) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 60 " \+ intpakX_greater(a,x) and intpakX_greater(x,a);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " elif type(x,interval) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " if x=[] then false" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 71 " else intpakX_greater(x[1], a) and intpakX_greater(a,x[2])" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " \+ fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 70 " else E RROR(`first argument must be a numeric or an interval`)" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 12 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " else ERROR(`second argument must be an interval or a numeric `)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 77 "------------------------------------------------------- ----------------------" }}{PARA 0 "" 0 "" {TEXT -1 21 "PROCEDURE - CON STRUCT" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 70 "This procedure can accept a single argument, to construct a degenerat e" }}{PARA 0 "" 0 "" {TEXT -1 67 "interval, two arguments, to construc t an interval form the low/high" }}{PARA 0 "" 0 "" {TEXT -1 70 "endpoi nts. The option `rounded` can be entered as the last argument in" }} {PARA 0 "" 0 "" {TEXT -1 42 "each case to construct a rounded interval ." }}{PARA 0 "" 0 "" {TEXT -1 71 "Special type checking is performed t o find (Evalf(-infinity)). Where it" }}{PARA 0 "" 0 "" {TEXT -1 74 "oc curs as an argument, Evalf(-infinity) is always rounded to -infinity, \+ to" }}{PARA 0 "" 0 "" {TEXT -1 59 "eliminate Evalf(-infinity) from bei ng an interval endpoint." }}{PARA 0 "" 0 "" {TEXT -1 63 "Suitable argu ments are numeric, FAIL, +-infinity and constants." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "construct:=proc()" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "local p,q,Constants;" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 31 " if member(false,\{args\}) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 " ERROR(`false and true ar not accept ed as arguments`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " fi;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " if member(FAIL,\{args\}) then RETURN([FAIL,FAIL]) fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " Constants:=\{Pi,gamma,Catalan\};" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " if nargs = 3 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " i f args[3] = 'rounded' and " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " \+ type(args[1],num_or_FAIL) and" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " type(args[2],num_or_FAIL) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " p:=Evalf(args[1]);" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 32 " q:=Evalf(args[2]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " [rd(intpakX_min(p,q)),ru(intpakX_max (p,q))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 81 " else ERROR(`first, second args must be numeric,third arg must be \"rounded\"`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " fi" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " elif nargs=2 then" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " if args[2]=rounded and" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " type(args[1],num_or_FAIL) \+ then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " [rd(Evalf(args[1]) ),ru(Evalf(args[1]))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " elif type(args[1],num_or_FAIL) and" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " \+ type(args[2],num_or_FAIL) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " p:=(arg s[1]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " q:=(args[2]);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " if member(p,Constants) and \+ member(q,Constants)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " then construct(p,q,rounded);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " \+ elif member(p,Constants) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " \+ if Evalf(p) < q then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " if intpakX_greater(Evalf(q),q) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 " [rd(Evalf(p)),Evalf(q)]" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " else [rd(Evalf(p)), ru(Evalf(q))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " fi ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " elif Evalf(p) > q then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " if intpakX _greater(q,Evalf(q)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 " \+ [Evalf(q),ru(Evalf(p))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " else [rd(Evalf(q)),ru(Evalf(p))]" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 19 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " else construct(p,q,rounded);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " elif member(q,Constants) then" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 33 " if Evalf(q) < p then" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 51 " if intpakX_greater(Evalf(p), p) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 " [rd(E valf(q)),Evalf(p)]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " \+ else [rd(Evalf(q)),ru(Evalf(p))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " \+ elif Evalf(q) > p then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " \+ if intpakX_greater(p,Evalf(p)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 " [Evalf(p),ru(Evalf(q))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " else [rd(Evalf(p)),ru(Eva lf(q))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " fi;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " else construct(p,q,rou nded);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " fi;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " elif intpakX_greater(q,p) t hen" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " if intpakX_grea ter(Evalf(q),q) and " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " \+ intpakX_greater(p,Evalf(p)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " [Evalf(p),Evalf(q)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " elif intpakX_greater(Evalf(q),q) then" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " [rd(Evalf(p)),Eval f(q)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " elif intpakX _greater(p,Evalf(p)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " \+ [Evalf(p),ru(Evalf(q))];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " else [rd(Evalf(p)),ru(Evalf(q))];" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 16 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " else " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " i f intpakX_greater(Evalf(p),p) and " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " intpakX_greater(q,Evalf(q)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " [Evalf(q),Evalf(p)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " elif intpakX_greater(Evalf(p ),p) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " [rd(Ev alf(q)),Evalf(p)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " \+ elif intpakX_greater(q,Evalf(q)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " [Evalf(q),ru(Evalf(p))];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " else [rd(Evalf(q)),ru(Evalf(p))];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " fi" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " else ERROR(`incorrect argum ents entered`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " fi" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " \+ elif nargs=1 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " if type( args[1],num_or_FAIL) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " \+ p:=args[1];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " if membe r(p,Constants) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " [ rd(Evalf(p)),ru(Evalf(p))];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " \+ elif is_in(p,Evalf(p)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " [Evalf(p),Evalf(p)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " elif intpakX_greater(p,Evalf(p)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " [Evalf(p),ru(Evalf(p))];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " else [rd(Evalf(p)),Evalf(p)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " else ERROR(`incorrect arguments entered`)" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " fi" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 " else ERROR(`maximum of three arguments accepted`) " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "end: " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 75 "################################################## #########################" }}{PARA 0 "" 0 "" {TEXT -1 65 "Logarithm an d Exponential Functions:\n\nPROCEDURE &EXP/INTERVAL_EXP" }}{PARA 0 "" 0 "" {TEXT -1 76 "\n expinfinity is only called from &exp. It deals wi th FAIL and +/- infinity." }}{PARA 0 "" 0 "" {TEXT -1 71 " Like most o f the other subroutines &exp takes floating point intervals" }}{PARA 0 "" 0 "" {TEXT -1 51 " or numerics (which are converted into interval s).\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "expinfinity:=proc(x):" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " if x=FAIL then FAIL" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " elif x=infinity then infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " elif x=-infinity then 0" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 20 " else Evalf(exp(x))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "Interval_exp:= proc(x):" }{TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " if typ e(x,'interval') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " if x=[] then []" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " elif x[1]=FAIL or x [2]=FAIL then [FAIL,FAIL]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " el se [rd(expinfinity(x[1])),ru(expinfinity(x[2]))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " elif t ype(x,'num_or_FAIL') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " In terval_exp(construct(x))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " else \+ " }}{PARA 0 "" 0 "" {TEXT -1 28 " Return unevaluated." }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " 'Interval_exp(x)'" }}{PARA 0 " " 0 "" {TEXT -1 74 " ERROR(`floating point interval or scalar \+ arguments are required`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " fi: e nd:\n" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 75 " ---------------------------------------------------------------------- -----" }}{PARA 0 "" 0 "" {TEXT -1 16 " PROCEDURE &LN\n" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 19 "infinityln:=proc(x)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " if x=FAIL then FAIL" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " elif x=infinity then infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " elif x=0 then -infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " elif (min(x,0)=x ) then FAIL" }}{PARA 0 "" 0 "" {TEXT -1 76 "\n \+ The above line returns FAIL, as opposed to Maple`s ln function w hich" }}{PARA 0 "" 0 "" {TEXT -1 80 " returns an ERROR message s tating that a singularity has been encountered." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " else ln(x)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " f i:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "Interval_ln:=proc(x)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " i f type(x,'interval') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " if x=[] then []" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 " else [rd(infin ityln(x[1])),ru(infinityln(x[2]))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 " elif type(x,'num_or _FAIL') then Interval_ln(construct(x))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " else" }}{PARA 0 "" 0 "" {TEXT -1 26 " Return unevaluat ed" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " 'Interval_ln(x)' " }} {PARA 0 "" 0 "" {TEXT -1 62 " ERROR (`floating point intervals \+ or scalars required`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi:" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }}{PARA 0 "" 0 "" {TEXT -1 75 "------------------------------------------------------------------ ---------" }}{PARA 0 "" 0 "" {TEXT -1 75 "############################ ###############################################" }}{PARA 0 "" 0 "" {TEXT -1 37 "BASIC INTERVAL ARITHMETIC OPERATIONS\n" }}{PARA 0 "" 0 " " {TEXT -1 62 "All the interval arithmetic subroutines perform type ch ecking." }}{PARA 0 "" 0 "" {TEXT -1 68 "They accept scalars (of type n umeric) or intervals (floating point)." }}{PARA 0 "" 0 "" {TEXT -1 59 "Floating point and integer scalars are made into intervals." }}{PARA 0 "" 0 "" {TEXT -1 79 "----------------------------------------------- --------------------------------" }}{PARA 0 "" 0 "" {TEXT -1 68 "The * **infinity subroutines correct any problems that may occur with" }} {PARA 0 "" 0 "" {TEXT -1 25 "infinite and FAIL results" }}{PARA 0 "" 0 "" {TEXT -1 79 "---------------------------------------------------- ---------------------------" }}{PARA 0 "" 0 "" {TEXT -1 14 "PROCEDURE \+ &+\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "addinfinity:=proc(x,y)" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 " if (x=infinity and y=(-infinity)) or (x=(-infinity) and y=infinity)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " then FAIL" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " elif x=FAIL o r y=FAIL then FAIL" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " elif x=infi nity or y=infinity then infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " elif x=-infinity or y=-infinity then -infinity" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 10 " else x+y" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " f i:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " end:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "Interval_add:=proc(a,b)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " if type(a,'interval') and type(b,'interval') then" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " if a=[] or b=[] then []" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 64 " else [rd(addinfinity(a[1],b[1]) ),ru(addinfinity(a[2],b[2]))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " \+ fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 84 " elif type(a,'interval') an d type(b,'num_or_FAIL') then Interval_add(a,construct(b))" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 84 " elif type(a,'num_or_FAIL') and type(b,'inte rval') then Interval_add(construct(a),b)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 " elif type(a,'num_or_FAIL') and type(b,'num_or_FAIL') " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " then Interval_add(construct (a),construct(b))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " else " }} {PARA 0 "" 0 "" {TEXT -1 18 "Return unevaluated" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " 'Interval_add'(a,b)" }}{PARA 0 "" 0 "" {TEXT -1 62 "ERROR(`floating point interval and scalar arguments required`)" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }}{PARA 0 "" 0 "" {TEXT -1 79 "------------------------ -------------------------------------------------------" }}{PARA 0 "" 0 "" {TEXT -1 12 "PROCEDURE &-" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "s ubtractinfinity:=proc(x,y)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 71 " if \+ (x=infinity and y=(infinity)) or (x=(-infinity) and y=(-infinity))" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " then FAIL" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " elif x=FAIL or y=FAIL then FAIL" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 32 " elif x=infinity then infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " elif y=infinity then -infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " elif x=-infinity then -infinity" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 32 " elif y=-infinity then infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " else x-y" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " end:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "Interval_subtract := proc(a,b)" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 49 "if type(a,'interval') and type(b,'interval') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " if a=[] or b=[] then [] else" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 69 " [rd(subtractinfinity(a[1],b[2] )),ru(subtractinfinity(a[2],b[1]))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "elif type(a,'interval') and type(b,'num_or_FAIL')" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " th en Interval_subtract(a,construct(b))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "elif type(a,'num_or_FAIL') and type(b,'interval')" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 41 " then Interval_subtract(construct(a),b)" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "elif type(a,'num_or_FAIL') and type (b,'num_or_FAIL')" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 " then Interv al_subtract(construct(a),construct(b))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "else" }}{PARA 0 "" 0 "" {TEXT -1 18 "Return unevaluated" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " 'Interval_subtract(a,b)' " }} {PARA 0 "" 0 "" {TEXT -1 67 " ERROR(`floating point interval and scala r arguments are required`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }}{PARA 0 "" 0 "" {TEXT -1 79 "------------------------------------------------------------------ -------------" }}{PARA 0 "" 0 "" {TEXT -1 13 "PROCEDURE &*" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "timesinfinity:=proc(a,b)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "if a=0 or b=0 then 0" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "elif a=FAIL or b=FAIL then FAIL" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 79 "elif (a=-infinity and min(b,0)=0) or (b=-infinity and min(a,0)=0)then -infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 79 "elif \+ (a=-infinity and min(b,0)=b) or (b=-infinity and min(a,0)=a) then infi nity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 77 "elif (a=infinity and min(b, 0)=0) or (b=infinity and min(a,0)=0) then infinity" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 77 "elif (a=infinity and min(b,0)=b) or (b=infinity and min(a,0)=a)then -infinity" }}{PARA 0 "" 0 "" {TEXT -1 75 "the min fun ction is called so that infinity*(-infinity) will give -infinity" }} {PARA 0 "" 0 "" {TEXT -1 69 "if either of the arguments in Interval_ti mes are FAIL the result will" }}{PARA 0 "" 0 "" {TEXT -1 15 "be [FAIL, FAIL]." }}{PARA 0 "" 0 "" {TEXT -1 64 "The above code is long but take s into account every possibility." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "else a*b" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 4 "end:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "Interval_ times := proc(a,b)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " local xy,x Y,Xy,XY:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 " if type(a,'interval' ) and type(b,'interval') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " \+ if a=[] or b=[] then [] else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " xy := timesinfinity(a[1],b[1]):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " xY := timesinfinity(a[1],b[2]):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " Xy := timesinfinity(a[2],b[1]):" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 38 " XY := timesinfinity(a[2],b[2]):" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " [ rd(min(xy,xY,Xy,XY)),ru(ma x(xy,xY,Xy,XY))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " fi:" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " elif type(a,'interval') and type (b,'num_or_FAIL') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " In terval_times(a,construct(b))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " \+ elif type(a,'num_or_FAIL') and type(b,'interval') then" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 37 " Interval_times(construct(a),b)" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 60 " elif type(a,'num_or_FAIL') and t ype(b,'num_or_FAIL') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " \+ Interval_times(construct(a),construct(b))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " else" }}{PARA 0 "" 0 "" {TEXT -1 18 "Return unevalu ated" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " 'Interval_times(a,b)'" }}{PARA 0 "" 0 "" {TEXT -1 66 "ERROR(`floating point interval and scal ar arguments are required`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }}{PARA 0 "" 0 "" {TEXT -1 69 "--------------------------------------------------------------- ------" }}{PARA 0 "" 0 "" {TEXT -1 36 "PROCEDURE INV/INTERVAL_RECIPR OCAL\n" }}{PARA 0 "" 0 "" {TEXT -1 37 "This procedure returns 1/infini ty =0." }}{PARA 0 "" 0 "" {TEXT -1 71 "If zero is contained in the den ominator(interval) the procedure returns" }}{PARA 0 "" 0 "" {TEXT -1 20 "[-infinity,infinity]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "Interva l_reciprocal := proc(x):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "if type (x,'interval') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " if x=[] t hen []" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " elif x[1]=FAIL or x[2] =FAIL then [FAIL,FAIL]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " elif i s_in(0.0,x) then [-infinity,infinity]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 60 " elif abs(x[1])=infinity and abs(x[2])=infinity then [0,0]" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " elif abs(x[1])=infinity then [rd (1./x[2]),0]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " elif abs(x[2])=i nfinity then [0,ru(1./x[1])]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " \+ else [rd(1./x[2]),ru(1./x[1])]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " \+ fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "elif type(x,'num_or_FAIL') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " Interval_reciprocal(con struct(x))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "else" }}{PARA 0 "" 0 " " {TEXT -1 18 "Return unevaluated" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " 'Interval_reciprocal(x)' " }}{PARA 0 "" 0 "" {TEXT -1 65 "ERROR( `a floating point interval or scalar argument is required`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "e nd:\n" }}{PARA 0 "" 0 "" {TEXT -1 70 "-------------------------------- --------------------------------------" }}{PARA 0 "" 0 "" {TEXT -1 32 "PROCEDURE `&/`/INTERVAL_DIVIDE" }}{PARA 0 "" 0 "" {TEXT -1 65 "\nTh is procedure also performs type checking. A check is also done" }} {PARA 0 "" 0 "" {TEXT -1 70 "to see if 0.0 is contained in the denomin ator. [-infinity,infinity] is" }}{PARA 0 "" 0 "" {TEXT -1 9 "returned. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "Interval_divide := proc(a,b):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " \+ if type(a,'interval') and type(b,'interval') then" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 25 " if a=[] or b=[] then []" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " elif is_in(0.0,b) then [-infinity,infinity]" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 73 " elif (abs(b[1])=infinity or abs(b [2])=infinity) and (abs(a[1])=infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " or abs(a[2])=infinity) then [FAIL,FAIL]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " else a &* inv(b)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 " elif type (a,'interval') and type(b,'num_or_FAIL') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " Interval_divide(a,construct(b))" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 55 " elif type(a,'num_or_FAIL') and type(b,'interval') \+ then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " Interval_divide(construc t(a),b)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 " elif type(a,'num_or_FAI L') and type(b,'num_or_FAIL') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " Interval_divide(construct(a),construct(b))" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 5 " else" }}{PARA 0 "" 0 "" {TEXT -1 18 "Return unevalu ated" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " 'Interval_divide(a,b)'" }}{PARA 0 "" 0 "" {TEXT -1 66 "ERROR(`floating point interval and scal ar arguments are required`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " fi: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " end:\n" }}{PARA 0 "" 0 "" {TEXT -1 69 "--------------------------------------------------------- ------------" }}{PARA 0 "" 0 "" {TEXT -1 17 "PROCEDURE &SQRT\n" }} {PARA 0 "" 0 "" {TEXT -1 63 "An error message is returned if a negativ e argument is entered." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "sqrtinfin ity:=proc(x)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "if x=FAIL then FAIL " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "elif x=0 then 0" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 29 "elif x=infinity then infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 75 "elif min(x,0)=x then ERROR (`cannot compute the \+ sqrt of a negative number`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "else sqrt(x)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 4 "end:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "Interval_ sqrt := proc(x)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "if type(x,'inter val') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " if x=[] then [] e lse" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 " [rd(sqrtinfinity(x[1])) ,ru(sqrtinfinity(x[2]))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 "elif type(x,'num_or_FAIL') then Interval_sqrt(construct(x))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "else " }}{PARA 0 "" 0 "" {TEXT -1 18 "Return unevaluated" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " 'Interval_sqrt(x)'" }}{PARA 0 "" 0 "" {TEXT -1 63 "ERROR(`floating point interval or scalar argument is required`) " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }}{PARA 0 "" 0 "" {TEXT -1 70 "--------------- -------------------------------------------------------" }}{PARA 0 "" 0 "" {TEXT -1 15 "PROCEDURE &SQR\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "sqrinfinity:=proc(x)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "if x=FA IL then FAIL" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "elif abs(x)=infinit y then infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "else x**2" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "Interval_sqr:=proc(x) " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "local a,b:" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 26 "if type(x,'interval') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " if x=[] then [] " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " elif is_in(0,x) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " [0, ru(max(sqrinfinity(x[1]),sqrinfinity(x[2])))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " a := mi n(abs(x[1]),abs(x[2])):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " b := \+ max(abs(x[1]),abs(x[2])):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 " [rd (sqrinfinity(a)),ru(sqrinfinity(b))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " fi:" }{TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 58 "elif ty pe(x,'num_or_FAIL') then Interval_sqr(construct(x))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "else " }}{PARA 0 "" 0 "" {TEXT -1 18 "Return uneval uated" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " 'Interval_sqr(x)'" }} {PARA 0 "" 0 "" {TEXT -1 66 "ERROR (`a floating point interval or scal ar argument is required`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }}{PARA 0 "" 0 "" {TEXT -1 72 "------------------------------------------------------------------ ------" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "Interval_option_zero:=fal se:" }}{PARA 0 "" 0 "" {TEXT -1 35 "\nIf option zero is true then 0**0 =1" }}{PARA 0 "" 0 "" {TEXT -1 48 "If Interval_option_zero is false th en 0**0=FAIL." }}{PARA 0 "" 0 "" {TEXT -1 71 "This global variable can be changed by the user depending on which they" }}{PARA 0 "" 0 "" {TEXT -1 72 "prefer. The disadvantage with the false case is that even if only one of" }}{PARA 0 "" 0 "" {TEXT -1 65 "the endpoints is zero \+ raised to zero, the resulting interval will" }}{PARA 0 "" 0 "" {TEXT -1 15 "be [FAIL,FAIL]." }}{PARA 0 "" 0 "" {TEXT -1 72 "--------------- ---------------------------------------------------------" }}{PARA 0 " " 0 "" {TEXT -1 44 "PROCEDURE &INTPOWER / INTERVAL_INTEGERPOWER\n" }} {PARA 0 "" 0 "" {TEXT -1 73 "Integerpower: This takes interval or num_ or_FAIL arguments, x, and raises" }}{PARA 0 "" 0 "" {TEXT -1 25 "them \+ to an integer power." }}{PARA 0 "" 0 "" {TEXT -1 60 "Powerinfinity is \+ a subroutine used to evaluate such cases as" }}{PARA 0 "" 0 "" {TEXT -1 16 "infinity**2 etc." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 24 "powerinfinity:=proc(x,n)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "if n=0 then 1." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " elif n=infinity and min(x,0)=x then FAIL" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "elif n=infinity then infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "elif n=-infinity then 0" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "elif x=0 then 0" }}{PARA 0 "" 0 "" {TEXT -1 68 "This \+ is included to prevent error messages for such cases as 0**(-3)" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "elif x=infinity then if n>0 then in finity else 0 fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "elif x=-infini ty then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 65 " if type(n/2,integer) a nd n>0 then infinity else (-infinity) fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "elif x=FAIL then FAIL" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "else x**n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "Interval_Integerpower:=proc(x,n)" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "local a,b:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "if type (x,'interval') and type(n,integer) then" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " if x=[] then []" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " \+ a:=powerinfinity(x[1],n):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " b: =powerinfinity(x[2],n):" }}{PARA 0 "" 0 "" {TEXT -1 68 "The following \+ is a check for monotonicity. If n is even and n>0 then" }}{PARA 0 "" 0 "" {TEXT -1 67 "if zero is in the interval it represents the lowest \+ endpoint in the" }}{PARA 0 "" 0 "" {TEXT -1 71 "returned interval, and the the max endpoint is the max of x[1] and x[2]" }}{PARA 0 "" 0 "" {TEXT -1 15 "to the power n." }}{PARA 0 "" 0 "" {TEXT -1 72 "Otherwise the function is monotonic, n>0 and the endpoints are evaluated" }} {PARA 0 "" 0 "" {TEXT -1 70 "directly for the maximum, and minimum val ues the function takes on the" }}{PARA 0 "" 0 "" {TEXT -1 11 "interval ,x." }}{PARA 0 "" 0 "" {TEXT -1 71 "If n<0 and 0 is contained in the i nterval, x, then [-infinity,infinity]" }}{PARA 0 "" 0 "" {TEXT -1 76 " is returned. Otherwise the value of the two endpoints raised to the ne gative" }}{PARA 0 "" 0 "" {TEXT -1 21 "power n are returned." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 76 " if n<0 and type(n/2,integer) and is_i n(0,x) then [rd(min(a,b)),infinity]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 81 " elif n<0 and (not type(n/2,integer)) and is_in(0,x) then [-inf inity,infinity]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " elif (n<0) t hen [rd(min(a,b)),ru(max(a,b))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " elif n>0 and type(n/2,integer) and is_in(0,x) then" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 22 " [0,ru(max(a,b))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " else [rd(min(a,b)),ru(max(a,b))]" }}{PARA 0 "" 0 "" {TEXT -1 53 "The else case covers n=0, n>0 and odd (ie monotonic). " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "elif type( x,'num_or_FAIL') then Interval_Integerpower(construct(x),n)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "else " }}{PARA 0 "" 0 "" {TEXT -1 18 "Retu rn unevaluated" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " 'Interval_Integ erpower(x,n)'" }}{PARA 0 "" 0 "" {TEXT -1 5 "ERROR" }}{PARA 0 "" 0 "" {TEXT -1 73 "(`arg[1] must be a float interval or numeric, arg[2] must be an integer`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 5 "end:\n" }}{PARA 0 "" 0 "" {TEXT -1 77 "------ ---------------------------------------------------------------------- -" }}{PARA 0 "" 0 "" {TEXT -1 30 "PROCEDURE &** / INTERVAL_POWER" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 78 "This proc edure calculates an interval raised to the power of another interval. " }}{PARA 0 "" 0 "" {TEXT -1 44 "Digits is extended to reduce rounding error." }}{PARA 0 "" 0 "" {TEXT -1 70 "Note the conditions on the ops of x, that they be numeric, so that the" }}{PARA 0 "" 0 "" {TEXT -1 31 "ilog10 function can be applied." }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 80 "The procedure has been enhanced to accep t numbers of type fraction as exponents." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "Interval_power:=proc(x,n)" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "local logx,prod,result,oldDigits; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 102 " if type(x,interval) and (ty pe(n,interval) \n or type(n,interval_comp) or type(n,fraction)) t hen" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " oldDigits:=Digits;" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " if x = [] then []" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " elif n = [] then []" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 78 " elif not(type(x[1],numeric) and type(x[ 2],numeric)) then Digits:=Digits" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " elif not type(x[1],numeric) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " Digits:=Digits + 2 + intpakX_ilog10(x[2]) ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " elif not type(x[2],nume ric) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 " Digits:=Di gits + 2 + intpakX_ilog10(x[1])" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 84 " Digits:=int pakX_max(intpakX_ilog10(x[1]),intpakX_ilog10(x[2])) + Digits + 2" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 124 " if type(n,interval) and (abs(n[1])=infinity o r abs(n[2])=infinity) \n and (x[1]=0 or x[2]=0) then [FAIL,FA IL]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 106 " elif type(n,interval _comp) and abs(n)=infinity and (x[1]=0 or x[2]=0) then \n [ FAIL,FAIL]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 133 " elif type(n,i nterval) and (n[1]=0 or n[2]=0) and (x[1]=0 or x[2]=0) \n a nd not Interval_option_zero then [FAIL,FAIL]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 123 " elif type(n,interval_comp) and n=0 and (x[1]= 0 or x[2]=0) \n and not Interval_option_zero then [FAIL,FAI L]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " elif type(n,fraction) \+ then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " if n=(1/2) then &sqrt(x)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " else" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " logx:=&ln(x);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " prod:=construct(n,r ounded) &* logx;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " \+ result:=&exp(prod);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " \+ Digits:=oldDigits;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " \+ construct(result[1],result[2],rounded)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " fi" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " else " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " logx: =&ln(x);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " prod:=n &* logx;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " result:= &ex p(prod);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " Digits:=ol dDigits;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " construct( result[1],result[2],rounded)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " \+ fi" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 " elif type(x,num_or_ FAIL) then construct(x) &** n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 " \+ elif type(n,integer) then x &intpower n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " else 'x &** n'" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " fi" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 78 "------------------------------------------------------- -----------------------" }}{PARA 0 "" 0 "" {TEXT -1 39 "PROCEDURE MIDP OINT / INTERVAL_MIDPOINT\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "Inter val_midpoint:=proc(x):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "if type(x ,'interval') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " if x=[] then FAIL" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " elif x[1]=FAIL or x[2]=F AIL then FAIL" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " else (addinfinit y(x[1],x[2]))&/2.:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi:" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 64 "elif type (x,'num_or_FAIL') then In terval_midpoint(construct(x))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "els e" }}{PARA 0 "" 0 "" {TEXT -1 18 "Return unevaluated" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " 'Interval_midpoint(x)'" }}{PARA 0 "" 0 "" {TEXT -1 54 "ERROR(`floating interval or scalar argument required`)" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }}{PARA 0 "" 0 "" {TEXT -1 72 "------------------------ ------------------------------------------------" }}{PARA 0 "" 0 "" {TEXT -1 33 "PROCEDURE WIDTH / INTERVAL_WIDTH\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " Interval_width:=proc(x):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " if type(x,'interval') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " if x=[] then []" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " elif x[1]=FAIL or x[2]=FAIL then [FAIL,FAIL]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " else subtractinfinity(x[2],x[1])" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 6 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " e lif type(x,'num_or_FAIL') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " \+ if not (x=infinity or x=-infinity) then 0" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " else Interval_width(construct(x)) fi:" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 8 " else " }}{PARA 0 "" 0 "" {TEXT -1 18 "Retu rn unevaluated" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " 'Interval_wid th(x)'" }}{PARA 0 "" 0 "" {TEXT -1 54 "ERROR(`floating interval or sca lar argument required`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " fi:" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " end:\n" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 75 "################################## #########################################" }}{PARA 0 "" 0 "" {TEXT -1 20 "Union and Intersect\n" }}{PARA 0 "" 0 "" {TEXT -1 78 "------------ ------------------------------------------------------------------" }} {PARA 0 "" 0 "" {TEXT -1 42 "PROCEDURE &INTERSECT / INTERVAL_INTERSECT \n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "Interval_intersect:=proc(a,b) " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "if type(a,'interval') and type( b,'interval') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " if a=[] or \+ b=[] then []" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 72 " elif a[1]=FAIL or a[2]=FAIL or b[1]=FAIL or b[2]=FAIL then [FAIL,FAIL]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " elif (max(a[1],b[2])=a[1] and not a[1]=b[2])" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 " or (max(b[1],a[2])=b[1] and not b[1]=a[2]) then []" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 " else [(ma x(a[1],b[1])),(min(a[2],b[2]))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " \+ fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 "elif type(a,'num_or_FAIL') \+ and type(b,'interval') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " I nterval_intersect(construct(a),b)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 "elif type(a,'interval') and type(b,'num_or_FAIL') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " Interval_intersect(a,construct(b))" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "elif type(a,'num_or_FAIL') and type (b,'num_or_FAIL') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " Interv al_intersect(construct(a),construct(b))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "else " }}{PARA 0 "" 0 "" {TEXT -1 18 "Return unevaluated" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " 'Interval_intersect(a,b)'" }} {PARA 0 "" 0 "" {TEXT -1 61 "ERROR(`floating point interval or scalar \+ arguments required`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }}{PARA 0 "" 0 "" {TEXT -1 73 "------------------------------------------------------------------ -------" }}{PARA 0 "" 0 "" {TEXT -1 34 "PROCEDURE &UNION / INTERVAL_UN ION " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 77 "T his accepts floating point interval or scalar arguments. If the inters ection" }}{PARA 0 "" 0 "" {TEXT -1 78 "of the two arguments is the emp ty interval then the union of the two arguments" }}{PARA 0 "" 0 "" {TEXT -1 29 "are the arguments themselves." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "Interval_union:=proc(a,b)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "if type(a,'interval') and type(b,'interval') then" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " if a=[] then b" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " elif b=[] then a" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 72 " elif a[1]=FAIL or a[2]=FAIL or b[1]=FAIL or b[2]=FAIL then [ FAIL,FAIL]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 " elif &intersect(a,b )=[] then RETURN(a,b)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 " else [(m in(a[1],b[1])),(max(a[2],b[2]))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 "elif type(a,'num_or_FAIL') and type(b,'interval') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " \+ Interval_union(construct(a),b)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 "e lif type(a,'interval') and type(b,'num_or_FAIL') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " Interval_union(a, construct(b))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 58 "elif type(a, 'num_or_FAIL') and type(b,'num_o r_FAIL') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " Interval_union( construct(a), construct(b))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "else \+ " }}{PARA 0 "" 0 "" {TEXT -1 18 "Return unevaluated" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " 'Interval_union(a,b)'" }}{PARA 0 "" 0 "" {TEXT -1 61 "ERROR(`floating point interval or scalar arguments required`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }}{PARA 0 "" 0 "" {TEXT -1 79 "######################## #######################################################" }}{PARA 0 "" 0 "" {TEXT -1 87 "TRIGONOMETRIC FUNCTIONS\n(sin, cos, tan and correspo nding arc and hyperbolic procedures)" }}{PARA 0 "" 0 "" {TEXT -1 77 " \n-------------------------------------------------------------------- --------" }}{PARA 0 "" 0 "" {TEXT -1 89 "Auxiliary functions\n\nThe fo llowing two procedures are called from &cos and &sin to ensure" }} {PARA 0 "" 0 "" {TEXT -1 63 "that the maximum and minimum the result c an take are 1. and -1." }}{PARA 0 "" 0 "" {TEXT -1 38 "There is no rou nding out of 1. and -1." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "Interval _trig_ru:=proc(x) if x= 1. then 1. else ru(x) fi; end:" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 63 "Interval_trig_rd:=proc(x) if x=-1. then -1. el se rd(x) fi; end:" }}{PARA 0 "" 0 "" {TEXT -1 76 "-------------------- --------------------------------------------------------" }}{PARA 0 " " 0 "" {TEXT -1 42 "The following was written by Dr Dave Hare." }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 80 "intpakX_ilog10:=proc(x) if x=0 then 0 else length(op(1,x))+op(2,x)-1; fi; end:" }}{PARA 0 "" 0 "" {TEXT -1 76 "--------------------------------------------------------- -------------------" }}{PARA 0 "" 0 "" {TEXT -1 67 "The following code is similar to Dr Dave Hare's code for scaling in" }}{PARA 0 "" 0 "" {TEXT -1 58 "Maple's sin function, except the arguments are scaled dow n" }}{PARA 0 "" 0 "" {TEXT -1 11 "as follows:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 61 " k:=xx/2*Pi and \+ x:=xx-2*Pi*k , where x is returned." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 67 "In order that the shape of the interval be preserved, the arguments" }}{PARA 0 "" 0 "" {TEXT -1 20 "are divid ed by 2*Pi." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 65 "The two endpoints of the interval argument, xx, are scaled to t he" }}{PARA 0 "" 0 "" {TEXT -1 36 "same degree, to the minimum k value ." }}{PARA 0 "" 0 "" {TEXT -1 52 "After scaling the interval 'result' \+ is rounded out.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "Interval_scale :=proc(xx)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " local k,x,d,k1,k2, m ag_x1,mag_x2,mag_x,result:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " mag_ x1:=ilog10(xx[1]):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " mag_x2:=ilog 10(xx[2]):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " mag_x:=max(mag_x1,ma g_x2):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " if mag_x1 >=0 then" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " d:=max(Digits, 2+mag_x):" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " k1:=round(Evalf(xx[1]/(2*Pi),d) ):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " if mag_x2>=0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " d:=max(Digits,2+mag_x):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " k2:=round(Evalf(xx[2]/(2*Pi),d)):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " if mag_x1>=0 and m ag_x2>=0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " k:=min(k1,k2): " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " x[1]:=rd(Evalf((xx[1])-2*Pi *k,Digits+d+mag_x)):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " x[2]:=r u(Evalf((xx[2])-2*Pi*k,Digits+d+mag_x)):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " result:= [x[1],x[2]]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " else result:= [xx[1],xx[2]] fi:" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 7 " result" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " end:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 67 "------- -----------------------------------------------------------\n" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " Interval_range_values:=proc(x,y1, y2)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " local k1,k2,p1,p2,int:" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 68 "The follo wing code is used to test for maxima and minima in the &sin" }}{PARA 0 "" 0 "" {TEXT -1 21 "and &cos subroutines." }}{PARA 0 "" 0 "" {TEXT -1 76 "(In order for this testing to work for &cos, Pi/2 must first be added to the" }}{PARA 0 "" 0 "" {TEXT -1 33 "arguments. This is done \+ in &cos.)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 69 "First the number of the 2Pi interval, k, in which the endpoint occ urs" }}{PARA 0 "" 0 "" {TEXT -1 68 "is assigned. The 2Pi intervals eit her side of x=zero have value k=0." }}{PARA 0 "" 0 "" {TEXT -1 69 "In \+ the positive x axis k>=0 , in the negative x axis k<=0. It is then" }} {PARA 0 "" 0 "" {TEXT -1 70 "possible to compare the k1 and k2 values. Testing is done for both the" }}{PARA 0 "" 0 "" {TEXT -1 68 "positive and negative cases if abs(k2-k1)=1. If x[2]-x[1]>=2*Pi then" }}{PARA 0 "" 0 "" {TEXT -1 71 "obviously there is a maximum and a minimum in t he interval and [-1.,1.]" }}{PARA 0 "" 0 "" {TEXT -1 12 "is returned. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " k1:=trunc(Evalf(x[1]/(2.*Pi))):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " k2:=trunc(Evalf(x[2]/(2.*Pi))):" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 75 "The interval(x) is scaled down to `int`. Int is then tested for containment" }}{PARA 0 "" 0 "" {TEXT -1 76 "of 1/4 and 3/4, those fractions of the 2*Pi interval at w hich the maxima and" }}{PARA 0 "" 0 "" {TEXT -1 14 "minima occur.\n" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " p1:=frac(Evalf(x[1]/(2.*Pi)) ):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " p2:=frac(Evalf(x[2]/(2. *Pi))):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " int:=construct(p1, p2):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " if abs(x[1]-x[2])>=Ev alf(2*Pi) then [-1.,1.]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " el if abs(k2-k1)=1 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 " if \+ Evalf(x[1])>=0 and Evalf(x[2])>=0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " if p1<=(1/4) then [-1.,1.]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 65 " elif p1>=(1/4) and p1<=(3/4) and p2>=1/4 th en [-1.,1. ]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 90 " elif p1>= (1/4) and p1<=3/4 and p2<=(1/4) then [-1.,Interval_trig_ru(max(y1,y2)) ]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 85 " elif p1>=3/4 and p2> =1/4 and p2<=3/4 then [Interval_trig_rd(min(y1,y2)),1.]" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 48 " elif p1>=3/4 and p2>=3/4 then [-1.,1 .]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 71 " elif p1>=3/4 and p2 <=1/4 then [rd(min(y1,y2)),ru(max(y1,y2))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " fi:" }}{PARA 0 "" 0 "" {TEXT -1 35 "The cas e for all negative endpoints" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " \+ elif Evalf(x[1])<=0 and Evalf(x[2])<=0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " if p1<=-3/4 then [-1.,1.]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 62 " elif p1>-3/4 and p1<=-1/4 and p2>=-3/4 then [-1.,1.]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 74 " elif p1 >-3/4 and p1<=-1/4 and p2<=-3/4 then [-1.,ru(max(y1,y2))]" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 73 " elif p1>-1/4 and p2>=-3/4 and p2<= -1/4 then [rd(min(y1,y2)),1.]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 " \+ elif p1>-1/4 and p2>=-1/4 then [-1.,1.]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 72 " elif p1>-1/4 and p2<=-3/4 then [rd(min(y1,y 2)),ru(max(y1,y2))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " fi :" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " fi:" }}{PARA 0 "" 0 " " {TEXT -1 63 "This is the case for k values the same, on the positive x axis." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " elif x[1]>=0 and \+ x[2]>=0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 58 " if is_in(1/ 4,int) and is_in(3/4,int) then [-1.,1.]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " elif is_in(1/4,int) then [Interval_trig_rd(min(y1,y2)) ,1.]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 67 " elif is_in(3/4,int) then [-1.,Interval_trig_ru(max(y1,y2))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 72 " else [Interval_trig_rd(min(y1,y2)),Interval_t rig_ru(max(y1,y2))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " fi: " }}{PARA 0 "" 0 "" {TEXT -1 63 "This is the case for k values the sam e, on the negative x axis." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " \+ elif x[1]<=0 and x[2]<=0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 60 " \+ if is_in(-3/4,int) and is_in(-1/4,int) then [-1.,1.]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 67 " elif is_in(-3/4,int) then [Interv al_trig_rd(min(y1,y2)),1.]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 68 " \+ elif is_in(-1/4,int) then [-1.,Interval_trig_ru(max(y1,y2))]" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 72 " else [Interval_trig_rd(min( y1,y2)),Interval_trig_ru(max(y1,y2))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " fi:" }}{PARA 0 "" 0 "" {TEXT -1 62 "This is the case for k values the same, 0, either side of x=0." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " elif x[1]<=0 and x[2]>=0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 58 " if is_in(-3/4,int) or is_in(3/4,int) the n [-1.,1.]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 61 " elif is_in(-1 /4,int) and is_in(1/4,int) then [-1.,1.]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 68 " elif is_in(-1/4,int) then [-1.,Interval_trig_ ru(max(y1,y2))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " elif is_ in(1/4,int) then [Interval_trig_rd(min(y1,y2)),1.]" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 72 " else [Interval_trig_rd(min(y1,y2)),Interval _trig_ru(max(y1,y2))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " f i:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " fi:" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 10 " end:" }}{PARA 0 "" 0 "" {TEXT -1 74 "-------- ------------------------------------------------------------------" }} {PARA 0 "" 0 "" {TEXT -1 30 "PROCEDURE &SIN / INTERVAL_SIN\n" }}{PARA 0 "" 0 "" {TEXT -1 74 "This function accepts floating-point interval a rguments, or floating point" }}{PARA 0 "" 0 "" {TEXT -1 28 "or integer scalar arguments." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 21 "Interval_sin:=proc(s)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "local x,y1,y2:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " if type (s,'interval') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " if s=[] then []" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " elif s[1]=-infin ity or s[2]=-infinity or s[1]=infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " or s[2]=infinity then [-1.,1.]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " elif s[1]=FAIL or s[2]=FAIL then [FAIL,FAIL]" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 72 "The follo wing test ensures that if the argument entered at either of the" }} {PARA 0 "" 0 "" {TEXT -1 75 "endpoints has error in its last digit, th en if the ulp of the last digit is" }}{PARA 0 "" 0 "" {TEXT -1 40 "gre ater than 2*Pi, [-1.,1.] is returned." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 69 " elif (ulp(s[1])/10.>=Evalf(2*Pi) or ulp(s[2])/10.>=Evalf(2*Pi) ) and" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " not s[1]=s[2] then [ -1.,1.]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " x:=Interval_scale(s):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " y1:=Evalf(sin(x[1])):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " y2:=Evalf(sin(x[2])):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " Interval_range_values(x,y1,y2):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 58 "elif \+ type(s,'num_or_FAIL') then Interval_sin(construct(s))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "else " }}{PARA 0 "" 0 "" {TEXT -1 18 "Return unev aluated" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " 'Interval_sin(s)'" }} {PARA 0 "" 0 "" {TEXT -1 54 "ERROR(` floating point intervals or scala rs required`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 5 "end:\n" }}{PARA 0 "" 0 "" {TEXT -1 75 "-------- -------------------------------------------------------------------" } }{PARA 0 "" 0 "" {TEXT -1 29 "PROCEDURE &COS / INTERVAL_COS" }}{PARA 0 "" 0 "" {TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 71 "This function \+ uses identical testing code from &sin to test for maximas" }}{PARA 0 " " 0 "" {TEXT -1 63 "and minimas by adding Pi/2 to the argument of the \+ cos function." }}{PARA 0 "" 0 "" {TEXT -1 71 "This saves repetition of code that has already been written and tested." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 75 "The actual values of cos \+ at the endpoints are calculated before the Pi/2 is" }}{PARA 0 "" 0 "" {TEXT -1 7 "added. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 74 "This function accepts floating point interval arguments , or floating point" }}{PARA 0 "" 0 "" {TEXT -1 28 "or integer scalar \+ arguments." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "Interval_cos:=proc(s)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "local y1,y2,r,t,x:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "if ty pe (s,'interval') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " if s=[] then []" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " elif s[1]=-infinity o r s[2]=-infinity or s[1]=infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " or s[2]=infinity then [-1.,1.]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " elif s[1]=FAIL or s[2]=FAIL then [FAIL,FAIL]" }} {PARA 0 "" 0 "" {TEXT -1 37 "The same test as in &sin occurs here." }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 61 " elif (ulp(s[1])>=Evalf(2*Pi) or u lp(s[2])>=Evalf(2*Pi)) and" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " no t s[1]=s[2]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " then [-1.,1.]" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " r:=Interval_scale(s):" }}{PARA 0 "" 0 "" {TEXT -1 34 "Digits are increased for accuracy." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 61 " t:=[Evalf(s[1]+Evalf(.5*Pi,Digits+3),Digits+3),Ev alf(s[2]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " +Evalf(.5*P i,Digits+3),Digits+3)]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " x:=I nterval_scale(t):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " y1:=Evalf( cos(r[1])):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " y2:=Evalf(cos(r[ 2])):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " Interval_range_values( x,y1,y2):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 58 "elif type(s,'num_or_FAIL') then Interval_cos(con struct(s))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "else " }}{PARA 0 "" 0 "" {TEXT -1 18 "Return unevaluated" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " 'Interval_cos(s)'" }}{PARA 0 "" 0 "" {TEXT -1 54 "ERROR(` floati ng point intervals or scalars required`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }} {PARA 0 "" 0 "" {TEXT -1 74 "----------------------------------------- ---------------------------------" }}{PARA 0 "" 0 "" {TEXT -1 30 "PROC EDURE &TAN / INTERVAL_TAN\n" }}{PARA 0 "" 0 "" {TEXT -1 74 "This funct ion accepts floating-point interval arguments, or floating point" }} {PARA 0 "" 0 "" {TEXT -1 28 "or integer scalar arguments." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 69 "For ease of testin g, like &cos, Pi/2 is added, with increased Digits." }}{PARA 0 "" 0 " " {TEXT -1 75 "In the same way as for &cos and &sin, the interval is s caled down to a 2*Pi" }}{PARA 0 "" 0 "" {TEXT -1 49 "interval and the \+ k1 and k2 values are calculated." }}{PARA 0 "" 0 "" {TEXT -1 67 "The t esting for this function is simpler than the &sin and &cos due" }} {PARA 0 "" 0 "" {TEXT -1 67 "to the monotonicity of tan over the regio ns on which it is defined." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "Interval_tan:=proc(s)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "local int,k1,k2,p1,p2,y1,y2,r,t,x:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "if type (s,'interval') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " if s=[] then []" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " elif s[1]=-infinity or s[2]=-infinity or s[1]=infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " or s[2]=infinity then [-infinity ,infinity]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " elif s[1]=FAIL or s [2]=FAIL then [FAIL,FAIL]" }}{PARA 0 "" 0 "" {TEXT -1 72 "The followin g test ensures that if the argument entered at either of the" }}{PARA 0 "" 0 "" {TEXT -1 77 "two endpoints (providing it's not a degenerate \+ interval) has ulp greater than" }}{PARA 0 "" 0 "" {TEXT -1 41 "Pi then [-infinity,infinity] is returned." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " elif (ulp(s[1])>=Evalf(Pi) or ulp(s[2])>=Evalf(Pi)) and" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " not s[1]=s[2] then [-infinity ,infinity]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " else" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 25 " r:=Interval_scale(s):" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 52 " t:=[Evalf(s[1]+Evalf(.5*Pi),Digits+3),Evalf(s[2 ]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " +Evalf(.5*Pi),Digi ts+3)]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " x:=Interval_scale(t) :" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " y1:=Evalf(tan(r[1])):" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " y2:=Evalf(tan(r[2])):" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 49 "First the numbe r of the 2Pi interval, k, in which" }}{PARA 0 "" 0 "" {TEXT -1 72 "the endpoint occurs is assigned. The 2Pi intervals either side of x=zero " }}{PARA 0 "" 0 "" {TEXT -1 74 "have value k=0. In the positive x axi s k>=0 , in the negative x axis k<=0." }}{PARA 0 "" 0 "" {TEXT -1 52 " It is then possible to compare the k1 and k2 values." }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " k1:=trunc(Eva lf(x[1]/(2.*Pi))):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " k2:=trunc (Evalf(x[2]/(2.*Pi))):" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 51 "The fraction of the 2*Pi interval is then assigned. " }}{PARA 0 "" 0 "" {TEXT -1 75 "The interval(x) is scaled down to `in t`. Int is then tested for containment" }}{PARA 0 "" 0 "" {TEXT -1 70 "of 1/2, that fraction of the 2*Pi interval at which the singularity i s" }}{PARA 0 "" 0 "" {TEXT -1 13 "encountered. " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " p1:=frac(Evalf(x[1]/(2.*Pi))):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " p2:=frac(Evalf(x[2]/(2.*Pi))):" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 26 " int:=construct(p1,p2):" }}{PARA 0 "" 0 "" {TEXT -1 73 "If x[2]-x[1]>=Pi then obviously there is a singularity en countered in the" }}{PARA 0 "" 0 "" {TEXT -1 46 "interval and [-infini ty,infinity] is returned." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 58 " if abs(x[1]-x[2])>=Evalf(Pi) then [-infinity,infinity]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " elif abs(k2-k1)=1 then [-infinity,infinity] " }}{PARA 0 "" 0 "" {TEXT -1 36 "After scaling, x=0 is a singularity. " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 72 " elif k1=0 and k2=0 and x[1] <=0 and x[2]>=0 then [-infinity,infinity]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 " elif k1=k2 and x[1]>=0 and x[2]>=0 then" }}{PARA 0 "" 0 "" {TEXT -1 70 "If one of the endpoints is a singularity , for \+ example [-Pi/2,0], then" }}{PARA 0 "" 0 "" {TEXT -1 33 "[-infinity,inf inity] is returned." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " if is_ in(.5,int) or is_in (-.5,int) or is_in(0,int)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " then [-infinity,infinity]" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 70 " else [Interval_trig_rd(min(y1,y2)),Interval_t rig_ru(max(y1,y2))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " fi:" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 " elif k1=k2 and x[1]<=0 and x[2] <=0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 58 " if is_in(.5,int) \+ or is_in(-.5,int) or is_in (0,int)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " then [-infinity,infinity]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 71 " else [Interval_trig_rd(min(y1,y2)), Interval_trig_ru(max (y1,y2))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " \+ fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 58 "elif type(s,'num_or_FAIL') \+ then Interval_tan(construct(s))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "e lse " }}{PARA 0 "" 0 "" {TEXT -1 18 "Return unevaluated" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 19 " 'Interval_tan(s)'" }}{PARA 0 "" 0 "" {TEXT -1 54 "ERROR(` floating point intervals or scalars required`)" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }}{PARA 0 "" 0 "" {TEXT -1 79 "-------------------------- -----------------------------------------------------" }}{PARA 0 "" 0 "" {TEXT -1 35 "PROCEDURE &ARCSIN / INTERVAL_ARCSIN" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 65 "The following simple fu nction returns the rounded interval of the" }}{PARA 0 "" 0 "" {TEXT -1 74 "inverse sin function. The Maple V arcsin function carries one g uard digit." }}{PARA 0 "" 0 "" {TEXT -1 66 "Here simply rounding the i nterval out ensures that the solution(s)" }}{PARA 0 "" 0 "" {TEXT -1 40 "is/are always contained in the interval." }}{PARA 0 "" 0 "" {TEXT -1 55 "The results returned are in the interval [-Pi/2,Pi/2].\n" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "Interval_arcsin:=proc(x):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "if type (x,'interval') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " if x=[] then []" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " elif x[1]=FAIL or [2]=FAIL then [FAIL,FAIL]" }} {PARA 0 "" 0 "" {TEXT -1 75 "The testing for the correct argument rang e is complicated by the possiblity" }}{PARA 0 "" 0 "" {TEXT -1 22 "of \+ infinite arguments." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 73 " elif (ma x(abs(x[1]),abs(1.))=abs(x[1]) and not (x[1]=1. or x[1]=-1.))" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 79 " or (max(abs(x[2]), abs(1.))=a bs(x[2]) and not (x[2]=1. or x[2]=-1.)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 63 " ERROR ( `the arguments must be in the range \+ [-1.,1.]`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 " else [rd(Evalf(ar csin(x[1]))),ru(Evalf(arcsin(x[2])))]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "elif type(x,'num_ or_FAIL') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "Interval_arcsin(c onstruct(x))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "else " }}{PARA 0 "" 0 "" {TEXT -1 18 "Return unevaluated" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " 'Interval_arcsin(x)'" }}{PARA 0 "" 0 "" {TEXT -1 54 "ERROR(` f loating point intervals or scalars required`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }} {PARA 0 "" 0 "" {TEXT -1 76 "----------------------------------------- -----------------------------------" }}{PARA 0 "" 0 "" {TEXT -1 36 "PR OCEDURE &ARCCOS / INTERVAL_ARCCOS\n" }}{PARA 0 "" 0 "" {TEXT -1 65 "Th e following simple function returns the rounded interval of the" }} {PARA 0 "" 0 "" {TEXT -1 69 "arccos function. The Maple V arccos funct ion carries one guard digit." }}{PARA 0 "" 0 "" {TEXT -1 66 "Here simp ly rounding the interval out ensures that the solution(s)" }}{PARA 0 " " 0 "" {TEXT -1 40 "is/are always contained in the interval." }}{PARA 0 "" 0 "" {TEXT -1 50 "The results returned are in the interval [0, Pi ].\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "Interval_arccos:=proc(x):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "if type (x,'interval') then" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " if x=[] then []" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 47 " elif x[1]=FAIL or [2]=FAIL then [FAIL,FAIL ]" }}{PARA 0 "" 0 "" {TEXT -1 75 "The testing for the correct argument range is complicated by the possiblity" }}{PARA 0 "" 0 "" {TEXT -1 22 "of infinite arguments." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 73 " e lif (max(abs(x[1]),abs(1.))=abs(x[1]) and not (x[1]=1. or x[1]=-1.))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 79 " or (max(abs(x[2]), abs(1.)) =abs(x[2]) and not (x[2]=1. or x[2]=-1.)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 61 " ERROR ( `the arguments must be in the range [- 1.,1.]`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 " else [rd(Evalf(arcc os(x[2]))),ru(Evalf(arccos(x[1])))]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "elif type(x,'num_or _FAIL') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "Interval_arccos(con struct(x))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "else " }}{PARA 0 "" 0 "" {TEXT -1 18 "Return unevaluated" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " 'Interval_arccos(x)'" }}{PARA 0 "" 0 "" {TEXT -1 54 "ERROR(` flo ating point intervals or scalars required`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }} {PARA 0 "" 0 "" {TEXT -1 78 "----------------------------------------- -------------------------------------" }}{PARA 0 "" 0 "" {TEXT -1 37 " PROCEDURE &ARCTAN / INTERVAL_ARCTAN \n" }}{PARA 0 "" 0 "" {TEXT -1 68 "The following procedure calculates the range of the arctan function, " }}{PARA 0 "" 0 "" {TEXT -1 55 "given the x coordinate and the y coor dinate of a point." }}{PARA 0 "" 0 "" {TEXT -1 63 "The default value f or x is 1, and the answer returned is in the" }}{PARA 0 "" 0 "" {TEXT -1 70 "[-Pi/2,Pi/2] interval. The arctan of the high and low endpoints of the" }}{PARA 0 "" 0 "" {TEXT -1 72 "interval arguments are calcula ted. The rounded, widest possible interval" }}{PARA 0 "" 0 "" {TEXT -1 13 "is returned.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "Interval_a rctan:=proc(y,x)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "local a,b,c,d: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "if nargs=2 then" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 64 " if type(y,'interval') and (type(x,'interval' ) or x=[1,1]) then" }}{PARA 0 "" 0 "" {TEXT -1 73 "The integer interva l is needed for cases where only one argument is given" }}{PARA 0 "" 0 "" {TEXT -1 75 "and [1,1] is the default value for the second argume nt. It is important for" }}{PARA 0 "" 0 "" {TEXT -1 76 "cases involvin g infinity that the 1 be an integer as Maple's arctan function" }} {PARA 0 "" 0 "" {TEXT -1 63 "returns cannot calculate such examples as arctan(infinity,1.0)." }}{PARA 0 "" 0 "" {TEXT -1 77 "This may be ame nded in the next version of Maple, as a result of suggestions" }} {PARA 0 "" 0 "" {TEXT -1 24 "to the writers of maple." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 72 " if x[1]=FAIL or x[2]=FAIL or y[1]=FAIL or y[ 2]=FAIL then [FAIL,FAIL]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " else " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " a:=Evalf(arctan(y[1],x[1 ])):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " b:=Evalf(arctan(y[1] ,x[2])):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " c:=Evalf(arctan( y[2],x[1])):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " d:=Evalf(arc tan(y[2],x[2])):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 " [rd(min( a,b,c,d)),ru(max(a,b,c,d))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " f i:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " elif type(y,'interval') and type(x,'num_or_FAIL') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " \+ Interval_arctan(y,construct(x))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 69 " elif (type(x,'interval') or x=[1,1]) and type(y,'num_or_FAIL') then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " Interval_arctan(construct(y ),x)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 " elif type(x,'num_or_FAIL' ) and type(y,'num_or_FAIL') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " Interval_arctan(construct(y),construct(x))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "elif nargs =1 then Interval_arctan(y,[1,1])" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " else " }}{PARA 0 "" 0 "" {TEXT -1 18 "Return unevaluated" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " 'Interval_arctan(y,x)'" }}{PARA 0 "" 0 "" {TEXT -1 71 "ERROR(`up to two floating point interval or scalar argume nts accepted`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 5 "end:\n" }}{PARA 0 "" 0 "" {TEXT -1 79 "-------- ---------------------------------------------------------------------- -" }}{PARA 0 "" 0 "" {TEXT -1 42 "Auxiliary procedures for sinh, cosh, tanh\n" }}{PARA 0 "" 0 "" {TEXT -1 74 "The following rounding procedu re ensure that the results of the hyperbolic" }}{PARA 0 "" 0 "" {TEXT -1 66 "functions are always in the correct range. e.g. -1.<= tanh(x) < =1." }}{PARA 0 "" 0 "" {TEXT -1 13 "1.<=cosh(x).\n" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 61 "Interval_hyp_rd:=proc(x); if x=-1. then x else rd(x ) fi; end:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 61 "Interval_hyp_ru:=proc (x); if x= 1. then x else ru(x) fi; end:" }}{PARA 0 "" 0 "" {TEXT -1 78 "------------------------------------------------------------------ ------------" }}{PARA 0 "" 0 "" {TEXT -1 32 "PROCEDURE &COSH / INTERVA L_COSH " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 65 "The following simple function returns the rounded interval result " }}{PARA 0 "" 0 "" {TEXT -1 69 "of the cosh function over an interval range. Maple's cosh function is" }}{PARA 0 "" 0 "" {TEXT -1 59 "calle d. A check is done for the inclusion of 0, a minimum.\n" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 23 "Interval_cosh:=proc(x):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "if type(x,'interval') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " if x=[] then []" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " elif x[1]=FAIL or x[2]=FAIL then [FAIL,FAIL]" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 67 " elif is_in(0,x) then [1.,ru(Evalf(max(cosh (x[1]),cosh(x[2]))))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 67 " else [ Interval_hyp_rd(Evalf(cosh(x[1]))),ru(Evalf(cosh(x[2])))]" }}{PARA 0 " " 0 "" {TEXT -1 77 "The absolute minimum of the cosh function is 1., s o the lower endpoint is not" }}{PARA 0 "" 0 "" {TEXT -1 16 "rounded be low 1." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "elif type (x,'num_or_FAIL') then Interval_cosh(con struct(x))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "else " }}{PARA 0 "" 0 "" {TEXT -1 18 "Return unevaluated" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " 'Interval_cosh(x)'" }}{PARA 0 "" 0 "" {TEXT -1 61 "ERROR (`float ing point interval or scalar argument required`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }} {PARA 0 "" 0 "" {TEXT -1 78 "----------------------------------------- -------------------------------------" }}{PARA 0 "" 0 "" {TEXT -1 32 " PROCEDURE &SINH / INTERVAL_SINH\n" }}{PARA 0 "" 0 "" {TEXT -1 65 "The \+ following simple function returns the rounded interval result" }} {PARA 0 "" 0 "" {TEXT -1 66 "of the sinh function over an interval ran ge. Maple's sinh function" }}{PARA 0 "" 0 "" {TEXT -1 11 "is called.\n " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "Interval_sinh:=proc(x):" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "if type(x,'interval') then" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " if x=[] then []" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " elif x[1]=FAIL or x[2]=FAIL then [FAIL,FAIL] " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " else [rd(sinh(x[1])),ru(sinh (x[2]))]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "elif type(x,'num_or_FAIL') then Interval_sinh(c onstruct(x))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "else " }}{PARA 0 "" 0 "" {TEXT -1 18 "Return unevaluated" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " 'Interval_sinh(x)'" }}{PARA 0 "" 0 "" {TEXT -1 61 "ERROR (`flo ating point interval or scalar argument required`)" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 3 "fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }} {PARA 0 "" 0 "" {TEXT -1 78 "----------------------------------------- -------------------------------------" }}{PARA 0 "" 0 "" {TEXT -1 31 " PROCEDURE &TANH / INTERVAL_TANH" }}{PARA 0 "" 0 "" {TEXT -1 1 " " }} {PARA 0 "" 0 "" {TEXT -1 65 "The following simple function returns the rounded interval result" }}{PARA 0 "" 0 "" {TEXT -1 66 "of the tanh f unction over an interval range. Maple's tanh function" }}{PARA 0 "" 0 "" {TEXT -1 45 "is called. Results are in the range [-1.,1.]." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "Int erval_tanh:=proc(x):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "if type(x,' interval') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " if x=[] then \+ []" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " elif x[1]=FAIL or x[2]=FAI L then [FAIL,FAIL]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 79 " else [Inte rval_hyp_rd(Evalf(tanh(x[1]))),Interval_hyp_ru(Evalf(tanh(x[2])))]" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "elif type(x,'num_or_FAIL') then Interval_tanh(constr uct(x))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "else " }}{PARA 0 "" 0 "" {TEXT -1 18 "Return unevaluated" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " 'Interval_tanh(x)'" }}{PARA 0 "" 0 "" {TEXT -1 61 "ERROR (`floating \+ point interval or scalar argument required`)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }} {PARA 0 "" 0 "" {TEXT -1 79 "######################################### ######################################" }}{PARA 0 "" 0 "" {TEXT -1 41 "PROCEDURES `CONVERT/INTERVAL` AND INAPPLY" }}{PARA 0 "" 0 "" {TEXT -1 77 "--------------------------------------------------------------- --------------" }}{PARA 0 "" 0 "" {TEXT -1 46 "Definitions of `convert /interval` and inapply:" }}{PARA 0 "" 0 "" {TEXT -1 28 "--> moved to i nit procedure!" }}{PARA 0 "" 0 "" {TEXT -1 77 "----------------------- ------------------------------------------------------" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 79 "#################### ###########################################################" }}{PARA 0 "" 0 "" {TEXT -1 20 "Minimum and Maximum " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 77 "------------------------------- ----------------------------------------------" }}{PARA 0 "" 0 "" {TEXT -1 29 "PROCEDURE MIN / INTPAKXI_MIN\n" }}{PARA 0 "" 0 "" {TEXT -1 75 "This is called from &*, and numerous other procedures. It finds the minimum" }}{PARA 0 "" 0 "" {TEXT -1 45 "of n arguments, of type(n umeric) or infinity." }}{PARA 0 "" 0 "" {TEXT -1 64 "Note if one the n arguments given is FAIL then FAIL is returned\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "intpakX_min:=proc() local a,i,result:" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 29 " a:=\{args\} minus \{infinity\}:" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 36 " if nops(a)=0 then RETURN(infinity)" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " elif member(FAIL,a) then RETURN ( FAIL)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " elif member(-infinity,a) then RETURN (-infinity)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " result :=a[1];" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 30 " for i from 2 to nops(a) do" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 39 "\011if a[i] " 0 "" {MPLTEXT 1 0 7 " od:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " result" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }}{PARA 0 "" 0 "" {TEXT -1 77 "--------------------------------------------------------------- --------------" }}{PARA 0 "" 0 "" {TEXT -1 29 "PROCEDURE MAX / INTPAKX I_MAX\n" }}{PARA 0 "" 0 "" {TEXT -1 63 "Note if FAIL is one of the n a rguments given FAIL is returned.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "intpakX_max:=proc() local a,i,result:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " a:=\{args\} minus \{-infinity\}:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " if nops(a)=0 then RETURN(-infinity)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " elif member (FAIL,a) then RETURN(FAIL) " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 " elif member (infinity,a) the n RETURN(infinity)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " else" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " result:=a[1];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " for i from 2 to nops(a) do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " if a[i]>result then result:=a[i] fi:" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " od:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " result" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " fi :" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " end:\n" }}{PARA 0 "" 0 "" {TEXT -1 75 "######################################################### ##################" }}{PARA 0 "" 0 "" {TEXT -1 53 "EXTENSIONS (from in tpakX by I. Geulig and W. Kraemer)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 75 "######################################### ##################################" }}{PARA 0 "" 0 "" {TEXT -1 89 "03/ 2002: If there is any code or output in German left in this part, plea se contact me at" }}{PARA 0 "" 0 "" {TEXT -1 37 "markus.grimmer@math.u ni-wuppertal.de " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 77 "--------------------------------------------------------- --------------------" }}{PARA 0 "" 0 "" {TEXT -1 51 "PROCEDURE EXT_INT _DIV\n\nExtended Interval Division.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "ext_int_div:=proc(x,y)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " \+ " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " if (type(x,interval) and typ e(y,interval)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 61 " if not( type(x[1],numeric) and type(x[2],numeric) ) then" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 69 " ERROR(`first arg must be a finite interv al or a numeric`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " fi;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 61 " if not( type(y[1],numeric) and type(y[2],numeric) ) then" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 70 " ERROR(`second arg must b e a finite interval or a numeric`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 24 " if is_in(0,y) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " if is_in(0,x) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " [-infinity,infinity]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 " elif (y[1]=0) and (y[2]=0) then []" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " elif (x[2]<0) and (y[1] " 0 "" {MPLTEXT 1 0 35 " \+ [rd(x[2]/y[1]),infinity]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 " \+ elif (x[2]<0) and (y[1]<0) and (0 " 0 "" {MPLTEXT 1 0 68 " [-infinity,ru(x[2]/y[2])] &union [rd(x[2]/ y[1]),infinity]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 " elif (x[ 2]<0) and (0=y[1]) and (y[1] " 0 "" {MPLTEXT 1 0 36 " [-infinity,ru(x[2]/y[2])]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " elif (0 " 0 "" {MPLTEXT 1 0 36 " [-infinity,ru(x[1 ]/y[1])]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 " elif (0 " 0 "" {MPLTEXT 1 0 68 " \+ [-infinity,ru(x[1]/y[1])] &union [rd(x[1]/y[2]),infinity]" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 " elif (0 " 0 "" {MPLTEXT 1 0 36 " \+ [rd(x[1]/y[2]),infinity];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " \+ fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " else (x &/ y)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 52 " elif type(x,num_or_FAIL) and type(y,interval) the n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " ext_int_div(construct(x ),y);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 " elif type(x,interval) an d type(y,num_or_FAIL) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " \+ ext_int_div(x,construct(y));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 " \+ elif type(x,num_or_FAIL) and type(y,num_or_FAIL) then" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 46 " ext_int_div(construct(x),construct(y)); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " else (x &/ y)" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 5 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end: " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 77 "----- ---------------------------------------------------------------------- --" }}{PARA 0 "" 0 "" {TEXT -1 53 "PROCEDURE REL_DIAM\n\nRelative Diam eter of an interval." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "rel_diam:=proc(x::interval)" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 40 " if x[1]=FAIL or x[2]=FAIL then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " ERROR(`Interval must be real. `);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 60 " if (-infinity < x[1]) and (x[2] < infinity) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " i f is_in(0,x) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " \+ width(x);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " els e" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " width(x) / ( min(abs(x[1]),abs(x[2])));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " \+ fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " else \+ " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " ERROR(`Interval \+ must be real.`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " fi: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " end: " }}{PARA 0 "" 0 "" {TEXT -1 77 "-- ---------------------------------------------------------------------- -----" }}{PARA 0 "" 0 "" {TEXT -1 13 "PROCEDURE MID" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 109 "Midpoint of a real int erval. The procedure returns a number which is guaranteed to be in the input interval.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "mid:=proc(z) " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " local m;" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 27 " if type(z,interval) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 " if z=[] or z[1]=FAIL or z[2]=FAIL or " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " is_in(infinity,z) or is_in(-infini ty,z) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 " ERROR(` Param eter must be real Interval! `);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " \+ else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " if width(z)=0 t hen" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " m:=z[1];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " m:=z[1] + 0.5 * width(z);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " if not( (z[1] < m) and (m < z[2])) th en" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " m:=z[2];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " fi;" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 11 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " \+ fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " elif type(z,numeric) \+ then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " m:=z;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " else " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " RETURN('mid(z)');" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " fi; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " RETURN(m);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 75 "################################################## #########################" }}{PARA 0 "" 0 "" {TEXT -1 45 "RANGE ENCLOS URE WITH GRAPHICAL REPRESENTATION" }}{PARA 0 "" 0 "" {TEXT -1 76 "\n## ###################################################################### ###" }}{PARA 0 "" 0 "" {TEXT -1 30 "FUNCTIONS OF ONE REAL VARIABLE" } {MPLTEXT 1 0 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 77 "--------------------------------------------------------- --------------------" }}{PARA 0 "" 0 "" {TEXT -1 82 "PROCEDURE COMPUTE _NAIVE_INTERVAL_RANGE\n\nRange enclosure using interval evaluation." } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "co mpute_naive_interval_range:=proc(f,T)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " local F;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " F:=inap ply(f(t),t);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " RETURN(F(T)); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "" 0 "" {TEXT -1 1 "\n" }}{PARA 0 "" 0 "" {TEXT -1 77 "----------------------------- ------------------------------------------------" }}{PARA 0 "" 0 "" {TEXT -1 74 "PROCEDURE COMPUTE_MEAN_VALUE_RANGE\n\nRange enclosure usi ng mean value form." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }{MPLTEXT 1 0 39 "compute_mean_value_range:=proc(f,t_0 ,T)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " local dF, F_Bound, MeanVa lueForm;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " dF:=inapply(diff(f(t ),t),t);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " F_Bound:=dF(T);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 " MeanValueForm:=inapply(f(t),t)(t _0) &+ (F_Bound &* (T &- t_0));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " RETURN(MeanValueForm);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end :" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 77 "---- ---------------------------------------------------------------------- ---" }}{PARA 0 "" 0 "" {TEXT -1 161 "PROCEDURE COMPUTE_MONOTONIC_RANGE \n\nRange Enclodure of a monotone twice continuously differentiable fu nction.\nIf monotony cannot be proven, FAIL will be returned." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "com pute_monotonic_range:=proc(f,T::interval)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " local df,dfBound,fLeft,fRight,c;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " df:=D(f);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 " dfBound:=compute_naive_interval_range(df,T);" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 60 " fLeft:=compute_naive_interval_range(f,con struct(T[1]));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 61 " fRight:=comp ute_naive_interval_range(f,construct(T[2]));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " if dfBound [2] <= 0. then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " # Functio n is monotonously decreasing" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " \+ RETURN([fRight[1],fLeft[2]]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " elif 0. <= dfBound[1] then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " # Function is monotonously increasing" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " RETURN([fLeft[1],fRight[2]]);" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 8 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " c:=T[1] + 0.5 * (T[2]-T[1] );" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " dfBound:=dfBound &inters ect compute_mean_value_range(df,c,T);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " if dfBound[2] <= 0. t hen " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " # Function is monoto nously decreasing" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " RETUR N([fRight[1],fLeft[2]]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " el if 0. <= dfBound[1] then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " \+ # Function is monotonously increasing" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " RETURN([fLeft[1],fRight[2]]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "# Monotony couldn't be proven" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " RETURN(FAIL)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "" 0 "" {TEXT -1 77 "--- ---------------------------------------------------------------------- ----" }}{PARA 0 "" 0 "" {TEXT -1 75 "PROCEDURE COMBINED_RANGE\n\nRange enclosure combining the above three methods" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "compute_combined_range:=p roc(f,T)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " local fBound,c;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " fBound:=compute_monotonic_range( f,T);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " if not(fBound = FAIL) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " RETURN(fBound)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 29 " c:=T[1] + 0.5*(T[2]-T[1]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " fBound:=compute_naive_interval_range(f,T)" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 " &intersect compute_mean_value_ range(f,c,T); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 18 " RETURN(fBound);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "" 0 "" {TEXT -1 77 "------------------------------------------------- ----------------------------" }}{PARA 0 "" 0 "" {TEXT -1 84 "PROCEDURE COMPUTE_TAYLOR_FORM_RANGE\n\nRange enclosure using second order Taylo r form\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "compute_taylor_form_ran ge:=proc(f,t_0,T)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " local dF2, \+ tf_bound, taylor_form;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " dF2:=i napply(diff(f(t),t$2),t);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " tf_ bound:=dF2(T);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " taylor_form:=i napply(f(t),t)(t_0) &+" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 63 " \+ (inapply(diff(f(t),t),t)(t_0) &* (T &- t_0)) &+" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 62 " ((tf_bound &/ 2) &* ((T &- t_0 ) &intpower 2));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " RETURN(taylo r_form);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }}{PARA 0 "" 0 " " {TEXT -1 77 "------------------------------------------------------- ----------------------" }}{PARA 0 "" 0 "" {TEXT -1 65 "PROCEDURES &CON VEX_HULL \n\nComputes convex hull of two intervals.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "`&Convex_Hull`:=proc(x::interval,y::interval)" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 " RETURN([min(x[1],y[1]),max(x[2] ,y[2])]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 77 "----------------------- ------------------------------------------------------" }}{PARA 0 "" 0 "" {TEXT -1 129 "PROCEDURE SUBDIVIDE_EQUIDISTANT, SUBDIVIDE_ADAPTIVE \n\nMethods for interval subdivision during the computation of range e nclosures." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "subdivide_equidistant:=proc(f::\{function,procedure\} ," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 " li st_of_intervals::evaln," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " \+ list_of_ranges::evaln)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " local N, n, i, iter_counter, T, T1, T2, F1, F2, temp, t_mid," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " temp_l ist_of_intervals, temp_list_of_ranges;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " N:=3;" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " \+ if not(type(eval(list_of_intervals),listlist)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 63 " lprint(`Second Parameter must be list of \+ intervals!`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " T:=readst at(`Enter Start interval: `);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " \+ list_of_intervals:=[construct(T[1],T[2])];" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 9 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " n:=nops(eval(list_of_interv als));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " " }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 33 " temp_list_of_intervals:=[];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " temp_list_of_ranges:=[];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " \+ for i from 1 to n do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " T :=list_of_intervals[i];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " # Bisection of current interv al" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " t_mid:=T[1] + 0.5*(T[2]-T[1]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " T1:=construct(T[1],t_mid);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " T2:=construct(t_mid,T[2]); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 70 " \n # Optional 4th parameter: Iteration counter iter _counter\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 58 " if (nargs >= \+ 4) and (type(args[4],nonnegint)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " iter_counter:=args[4];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " \+ iter_counter:=1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " fi;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " if iter_counter <= N then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 " F1:=compute_naive_interval_range(f,T1);" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 49 " F2:=compute_naive_interval_range(f,T 2);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 " F1:=compute_combined_range(f,T1);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 " F2:=compute_combined_range (f,T2);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " \+ " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " temp_list_of_intervals: =[op(temp_list_of_intervals),T1,T2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 60 " temp_list_of_ranges:=[op(temp_list_of_ranges),F1,F2];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " od:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " list_of_i ntervals:=[op(temp_list_of_intervals)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " list_of_ranges:=[op(temp_list_of_ranges)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " \+ temp:=list_of_ranges[1];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " \+ for i from 2 to nops(eval(list_of_ranges)) do" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 53 " temp:=&Convex_Hull(temp,list_of_ranges[i] );" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " od;" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 6 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " R ETURN(temp);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 117 " - - - - - \+ - - - - - - - - - - - - - - - - - - - - - - - \+ - - - - - - - - - -" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "subdivide_adaptive:=proc(f::\{function,pr ocedure\}," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " \+ list_of_intervals::evaln," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " \+ list_of_ranges::evaln)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 64 " local N, n, iter_counter, temp_max, temp_min,i, T, T1, T2," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 68 " F1, F2, \+ temp, t_mid, temp_list_of_intervals, " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " temp_list_of_ranges, eps;" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " N: =3;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " if not(type(eval(list_of_intervals),listlist)) \+ then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 63 " lprint(`Second par ameter must be list of intervals!`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " T:=readstat(`Enter start interval: `);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " T:=construct(T[1],T[2]);" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 32 " list_of_intervals:=[T];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 61 " list_of_ranges:=[compute_naive_inter val_range(f,T)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " fi;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " n:=nops(eval(list_of_intervals));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " if nops(e val(list_of_ranges)) < n then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " \+ ERROR(`Second list is too short!`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " temp_min:=min(seq(list_of_ran ges[i][1],i=1..n));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " temp_m ax:=max(seq(list_of_ranges[i][2],i=1..n));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " \+ eps:=0.1*width(construct(temp_min,temp_max));" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 1 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " temp_l ist_of_intervals:=[];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " temp _list_of_ranges:=[];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " for i from 1 to n do" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " T:=list_of_intervals[i];" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 80 "\n # If T satisfies the select ion criterion, T will be subdivided into halves" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 " if (lis t_of_ranges[i][1] <= temp_min + eps) or " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " (list_of_ranges[i][2] >= temp_max -eps ) t hen" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 " # Bisection of current interval" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 " t_mid:=T[1] + 0.5*(T[2] - T[1]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " T1:=construct(T[1],t_mid);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " T2:=construct(t_mid,T[2] );" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 58 " if (nargs >= 4) and (type(args[4],nonnegint)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " iter_counter:=a rgs[4];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " iter_counter:=1;" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 11 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " if iter_counter < = N then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 " F1:=compu te_naive_interval_range(f,T1);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 " \+ F2:=compute_naive_interval_range(f,T2);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " F1:=compute_combined_range(f,T1);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " F2:=compute_combined_range(f,T2); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " fi; " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 63 " temp_list_of_intervals:=[op(temp_list_of_i ntervals)," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 " \+ T1,T2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 64 " \+ temp_list_of_ranges:=[op(temp_list_of_ranges),F1,F2];" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 12 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " temp_list_of_intervals:=[op(temp_list_of_intervals),T ];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " temp_list_of_range s:=[op(temp_list_of_ranges)," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " \+ list_of_ranges[i]];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " \+ fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " od:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " list _of_intervals:=[op(temp_list_of_intervals)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " list_of_ranges:=[op(temp_list_of_ranges)];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " temp:=list_of_ranges[1];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " for i from 2 to nops(eval(list_of_ranges)) do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 " temp:=&Convex_Hull(temp ,list_of_ranges[i]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " od;" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " RETURN(temp);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 77 "------------------------------------------------------------------ -----------" }}{PARA 0 "" 0 "" {TEXT -1 28 "PROCEDURE INTERVAL_LIST_PL OT" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "interval_list_plot:=proc(interval_list::list(list(numeric))," }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " range_list ::list(list(numeric)))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " loca l n, i, T, F, c, opts, p;" }}{PAR