{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;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " if nops(interval_list) > nops( range_list) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 " ERROR(`S econd list is too short!`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " \+ fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " opts:=[args[3..nargs]];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " n:=nops(interval_list);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " for i from 1 to n do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " T:=interval_list[i];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " F:=range_list[i];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " c:=plottools[rectangle]([T[1],F[2]],[T[2],F[1 ]]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " p[i]:=display(c,op( opts));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " RE TURN(display([seq(p[i],i=1..n)]));" }}{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 23 "PROCEDURE COMPUTE_RANGE" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 77 "co mpute_range:=proc(f::\{function,procedure\},xstart,iterationsteps::non negint)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 67 " global list_of_inter vals, list_of_ranges, max_iter_counter, q, " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " r, iter_counter;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 62 " local T, F, S, xrange, i, m, nx, h, arg_list, con v_linear," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 " conv_quadrat ic, div_adaptive, c_list, j,x;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " # Initialization of global va riables" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " x:='x';" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " \+ " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 72 " if type(simplify(f(x)),numeric) or (simplify(diff (f(x),x)) = 0) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " lprin t(`Function is constant = `, simplify(f(x)));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " RETURN();" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 " if type(xstart,\{interval,numeric..numeric\}) the n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " T:=construct(op(1,xstar t),op(2,xstart));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 88 " elif type( xstart,\{identical('X'),identical('x')\} = \{interval,numeric..numeric \}) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " T:=construct(op( 1,rhs(xstart)),op(2,rhs(xstart)));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 64 " ERROR(`Second argument must be an interval or a range.`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " if not(type(compute_naive_inter val_range(f,T),interval)) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 87 " ERROR(`First argument must be function in one real variable wit h real values.`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " list_of_intervals:=[T];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " \+ " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " max_iter_counter:=ite rationsteps; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " nx:=1;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " conv_linear:=false;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " conv_quadratic:=false;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " div_adaptive:=false;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " arg_lis t:=[args[4..nargs]];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " for i from 1 to nops(arg_list) do" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 60 " if type(arg_list[i],identical ('Nx') = nonnegint) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " \+ nx:=rhs(arg_list[i]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " e lif arg_list[i] = 'linear' then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " conv_linear:=true;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 76 " \+ elif (arg_list[i] = 'quadratic') or (arg_list[i] = 'quadratisch') th en" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " conv_quadratic:=true ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 71 " elif (arg_list[i] = 'ada ptive') or (arg_list[i] = 'adaptiv') then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " div_adaptive:=true;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 63 " elif type(arg_list[i],identical('colorlist') = \+ list) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " c_list:=rhs( arg_list[i]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " if conv_quadratic the n " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " F:=compute_combined_ra nge(f,T);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " lprint(`Start r ange enclosure = `,F);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " l ist_of_ranges:=[F];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " r[0]: =F;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " else" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 45 " F:=compute_naive_interval_range(f,T);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " lprint(`Start range enclosu re = `,F);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " list_of_rang es:=[F];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " r[0]:=F;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "# Subdivision o f Start interval in Nx subparts," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "# given the optional parameter Nx" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " if nx > 1 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " h:=width(T)/nx;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 70 " list_of_intervals:=[seq([T[1] + (i-1)*h, T[ 1] + i*h],i=1..nx)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " if conv_quadratic then" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 80 " list_of_ranges:=[seq(compu te_combined_range(f,S),S=list_of_intervals)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 86 " \+ list_of_ranges:=[seq(compute_naive_interval_range(f,S),S=list_of _intervals)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " fi;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 67 " r[0]:=[min(seq(list_of_ranges[i][1],i=1..nx)), \+ " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " max(seq(list_of_ ranges[i][2],i=1..nx))];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " \+ printf(`%s %d %s = \\n[%.10g,%.10g]\\n`," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 " `Range enclosure after subdivision into `,nx," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " ` intervals `,r[0][1],r[0][2]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 7 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " xrange:=T[1]..T[2];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " # Colour list for graphical representation" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " if c_list = 'c_list' then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " c_list:= [blue,red];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 2 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 78 " q [0]:=interval_list_plot(list_of_intervals,list_of_ranges,color=c_list[ 1]," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " style=line,thickn ess=2);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " x:='x';" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 58 " q[max_iter_counter+1]:=plot(f(x),x=xrang e,color=black," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 " \+ numpoints=500,linestyle=1);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " # Iteration " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " iter_counter:=0;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " for i from 1 to max_iter_count er do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " iter_counter:=iter _counter + 1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " if conv_linear then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " if div_adaptive then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 74 " r[i]:=subdivide_adaptive(f,list_ of_intervals,list_of_ranges);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " \+ else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 77 " r[i]: =subdivide_equidistant(f,list_of_intervals,list_of_ranges);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " elif conv_quadratic then" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 32 " if div_adaptive then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 78 " r[i]:=subdivide_adaptive(f,list_of_in tervals,list_of_ranges,100);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " \+ else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 81 " r[i]:= subdivide_equidistant(f,list_of_intervals,list_of_ranges,100);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " fi;" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 13 " else " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " if div_adaptive then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 76 " r[i]:=subdivide_adaptive(f,list_of_intervals,list_of_ ranges,i);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " else " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 79 " r[i]:=subdivide_equidi stant(f,list_of_intervals,list_of_ranges,i);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 37 " j:= (i mod nops(c_list)) + 1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " if i < max_iter_counter then" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 84 " q[i]:=interval_list_plot( list_of_intervals,list_of_ranges,color=c_list[j]," }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 46 " style=line,thickness=2);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " else " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 94 " q[i]:=interval_list_plot(list_of_intervals, list_of_ranges,color=yellow,style=patch);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " \+ od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " m:=max_iter_counter;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " printf(`%s %s %s %d = %s[%.10g,%.10g]\\n`," }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 58 " Range_enclosure ,after,step, m,` `,r[m][1],r[m][2]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 67 "# Graphical representation of the l ast three steps of the iteration" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " if m <= 1 then" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 127 " display([seq(q[i],i=0..(m+1))],axes=f ramed,\n title=`Iterative range enclosure of f`,titlefont=[T IMES,BOLD,12]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " else" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 134 " display([seq(q[i],i=(m-2)..m ),q[m+1]],axes=framed,\n title=`Iterative range enclosure of f`,titlefont=[TIMES,BOLD,12]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " \+ fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "end:\n " }}{PARA 0 "" 0 " " {TEXT -1 77 "------------------------------------------------------- ----------------------" }}{PARA 0 "" 0 "" {TEXT -1 24 "PROCEDURE MAX_A BS_ERROR\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "max_abs_error:=proc(l ist_of_ranges::list(interval))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 69 " \+ local index_of_max, index_of_min,temp_max,temp_min, n, i, new_list;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " index_of_max:=1;" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 18 " index_of_min:=1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " n:=nops(list_of_ranges);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " if n=0 or (n=1 and list_of_ranges[1]=[]) then" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 72 " ERROR(`Input parameter must co ntain at least one real interval. `);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " temp_max:=list_of_ranges[1][2];" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 33 " temp_min:=list_of_ranges[1][1];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " for i fr om 1 to n do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " if list_of_ran ges[i][2] > temp_max then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " \+ temp_max:=list_of_ranges[i][2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " index_of_max:=i;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " \+ fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " if list_of_ranges[i][1 ] < temp_min then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " temp_m in:=list_of_ranges[i][1];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " \+ index_of_min:=i;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " fi;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " temp_max:=list_of_ranges[index_of_max][1];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " temp_min:=list_of_ranges[index_o f_min][2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " if temp_min > temp_max then" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 55 " RETURN(max(seq(width(list_of_ranges[i]),i=1..n )));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " else" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 18 " new_list:=[];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " for i from 1 to n do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 60 " if is_in(list_of_ranges[i],[temp_min,temp_max]) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " next;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " \+ new_list:=[op(new_list),list_of_ranges[i]];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " n:=nops(new_lis t);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " lprint(`Number of inte rvals: `,n);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 63 " RETURN(max(se q(width(new_list[i]),i=1..nops(new_list))));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "end: " } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "" 0 "" {TEXT -1 75 "## ###################################################################### ###" }}{PARA 0 "" 0 "" {TEXT -1 32 "FUNCTIONS OF TWO REAL VARIABLES" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 77 "------- ---------------------------------------------------------------------- " }}{PARA 0 "" 0 "" {TEXT -1 21 "PROCEDURE CNI_RANGE3D" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 47 "Interval evaluation \+ of a function f: R^2 -> R.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "cni _range3d:=proc(f,T,S)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " local F; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " F:=inapply(f(t,s),t,s);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " RETURN(F(T,S));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 283 "The procedure subdivide_equi3d computes a range e nclosure for a function of two real variables by \nsubdivision of the \+ intervals in list_of_intervals2d in two intervals each. If k is odd, s ubdivision is \nperformed in x direction, if k is even, subdivision is performed in y direction." }}{PARA 0 "" 0 "" {TEXT -1 275 "An element of the global variable list_of_intervals2d should be a two dimensiona l interval, defined as\na list of two intervals, i.e. XY:=[[x1,x2],[y1 ,y2]].\nThe variable list_of_ranges contains the range enclosures\nfor the corresponding (sub-)intervals in list_of_intervals2d." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "subdivide_e qui3d:=proc(f," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " \+ list_of_intervals2d::evaln, " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " list_of_ranges::evaln," }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 36 " k::nonnegint)" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 68 " local n, i, temp_loi, temp_lor, TS, T, S, T 1, T2, S1, S2, F1, F2," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " \+ F3, F4, t_mid, s_mid, temp;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " if not(type(eval(list_of_interval s2d),listlist)) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 76 " TS:=re adstat(`Enter two-dimensional start interval [[x1,x2],[y1,y2]]:`);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " T:=construct(TS[1][1],TS[1][2]) ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " S:=construct(TS[2][1],TS[2 ][2]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " list_of_intervals2d:= [[T,S]];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " list_of_ranges:=[cn i_range3d(f,T,S)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " n:=nops(eval(list_of_ranges));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " temp_loi:=[];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " temp_lor :=[];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " for i from 1 to n do" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " TS:=list_of_intervals2d[i];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " T:=TS[1];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " S:=TS[2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " \+ if type(k,odd) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " t_m id:=T[1] + 0.5*(T[2] - T[1]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " \+ T1:=construct(T[1],t_mid);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " \+ T2:=construct(t_mid,T[2]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " F1:=cni_range3d(f,T1,S);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " \+ F2:=cni_range3d(f,T2,S);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " \+ temp_loi:=[op(temp_loi),[T1,S],[T2,S]];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " temp_lor:=[op(temp_lor),F1,F2];" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 8 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " s_mid:=S[1] + 0.5*(S[2] - S[1]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " S1:=construct(S[1],s_mid);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " S2:=construct(s_mid,S[2]);" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 30 " F1:=cni_range3d(f,T,S1);" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 30 " F2:=cni_range3d(f,T,S2);" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 45 " temp_loi:=[op(temp_loi),[T,S1],[T,S2]];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " temp_lor:=[op(temp_lor),F1,F2 ];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " list_of_intervals2d:=[op(temp_loi)];" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " list_of_ranges:=[op(temp_lor)]; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " temp:=list_of_ranges[1];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " for i from 2 to nops(eval(list_of_ranges)) do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 " temp:=&Convex_Hull(temp,list_of_ranges[i]); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " RETURN(temp); " }}{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 30 "PROCEDURE INTERVAL_LIST_PLOT3D" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 52 "Graphical representation \+ of a single iteration step\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "int erval_list_plot3d:=proc(interval_list,range_list)" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 59 " local n, i, j, TS, T, S, F, c, c_list, p, opts , c_out;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " opts:=[args[3..nargs]];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " for i from 1 t o nops(opts) do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 " if type(opt s[i],identical('colorlist') = list) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " c_list:=rhs(opts[i]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 58 " elif type(opts[i],identical('cutout') = rational) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " c_out:=rhs(opts[i ]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " if c_list = 'c_list' then " }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 34 " c_list:=[blue,red,green,magenta];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " if c_out = 'c_out' then" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " c_out := 8/10;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " n:=nops(range_list);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " for i \+ from 1 to n do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " TS:=int erval_list[i];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " T:=TS[1 ];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " S:=TS[2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " \+ F:=range_list[i];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " \+ c:=plottools[cuboid]([T[1],S[1],F[1]],[T[2],S[2],F[2]]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " \+ # Different colours are applied for individual intervals " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " p[i]:=display(plottools[c utout](c,c_out)," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " c olor=c_list[(i mod nops(c_list)) + 1]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 68 " # p[i]:=display([c],color=c_list[(i mod nops(c_list)) \+ + 1]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " \+ RETURN(display([seq(p[i],i=1..n)]));" }}{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 25 "PROCEDURE COMPUTE _RANGE3D" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 76 "compute_range3d:=proc(f::\{function,procedure\},X,Y,i terationsteps::nonnegint)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " globa l list_of_intervals2d,list_of_ranges,q, r;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 69 " local TS, T, S, iter_counter, max_iter_counter, i, j , m, nx, ny, hx," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "hy, lx, ly, opt s, c_list,c_out,n,opts_new,x,y;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " x:='x';" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " y:='y';" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " if type(simplify(f(x,y)),numeric) \+ then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 60 " lprint(`Funktion ist konstant = `, simplify(f(x,y)));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " RETURN();" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " fi;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " if type(X,\{interval,numeric..numeric\}) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " T:=construct(op(1,X),op(2,X));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " elif type(X,\{identical('X'),identical('x') \} =" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "\{interval,numeric..numeric \}) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " T:=construct(op (1,rhs(X)),op(2,rhs(X)));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 62 " else \+ ERROR(`Second argument must be an interval or a range`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " if type(Y,\{interval,numeric..nume ric\}) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " S:=construct( op(1,Y),op(2,Y));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " elif type(Y, \{identical('Y'),identical('y')\} =" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "\{interval,numeric..numeric\}) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " S:=construct(op(1,rhs(Y)),op(2,rhs(Y)));" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 61 " else ERROR(`Third argument must be an interval or a range`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " if not(type(cni_range3d(f,T,S),interval)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 73 " ERROR(`First argument must be real function \+ of two real variables!`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " fi;" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 " lprint(`Start range enclosure = `,cni_range3d(f,T,S));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " # \+ Initialization of global variables" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " max_iter_counter:=iteration steps;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " nx:=1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " ny:=1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1 " " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " opts:=[args[5..nargs]];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " n: =nops(opts);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " opts_new:=[];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " for i from 1 to n do" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 54 " if type(opts[i],identical('Nx') = nonneg int) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " nx:=rhs(opts [i]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " elif type(opts[i],iden tical('Ny') = nonnegint) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " \+ ny:=rhs(opts[i]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " el if type(opts[i],identical('colorlist') = list) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " c_list:=rhs(opts[i]);" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 57 " elif type(opts[i],identical('cutout') = numeric ) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " c_out:=rhs(opts[ i]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " else opts_new:=[op(opts _new),opts[i]]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 64 "q[max_iter_counter+1]:=plot3d( f(x,y),x=T[1]..T[2],y=S[1]..S[2]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 60 " # Subdivision of the start \+ interval into in nx*ny subparts," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " # given an optional parameter [nx, ny]." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " if nx > 1 then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " hx:=width(T)/nx;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " lx:=[seq([T[1] + (i-1)*hx, T[1] + i*h x],i=1..nx)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " else " }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 12 " lx:=[T];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " if ny > 1 then" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " hy:=width(S)/ny;" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 54 " ly:=[seq([S[1] + (i-1)*hy, S[1] + i*hy],i= 1..ny)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " ly:=[S];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 67 " list_of_intervals2d :=[seq(seq([lx[i],ly[j]],j=1..ny),i=1..nx)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 73 "list_of_rang es:=[seq(cni_range3d(f,TS[1],TS[2]),TS=list_of_intervals2d)];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 " r[0]:=[min(seq(list_of_ranges[i][1],i=1..(nx*ny)))," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " max(seq(list_of_ranges[i][2],i =1..(nx*ny)))];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "if nx >1 or ny > 1 then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 119 " printf(`%s %d %s \+ = \\n[%.10g,%.10g]\\n`, `Range enclosure after subdivision into`,nx*ny , `intervals`,r[0][1],r[0][2]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " fi; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "if c_list = 'c_list' then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " c_list:=[blue,red,green,magenta];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 67 "if c_out = 'c_out' or not(type(c_ou t,rational) and (0 <= c_out) and" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "(c_out <= 1)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " c_out:=8/ 10;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 93 "q[0]:=interval_ list_plot3d(list_of_intervals2d,list_of_ranges,colorlist=c_list,cutout =c_out);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 18 " iter_counter:=0;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " for i from 1 to max_iter_ counter do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " iter_counter:=ite r_counter + 1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 74 "r[i]:=subdivide_equi3d(f,list_of_intervals2d,l ist_of_ranges,iter_counter);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 116 " \+ # lprint(`Range enclosure after Iteration step`,i,` = `,r[i]);\n\n \+ printf(`%s %s %s %s %d = %s[%.10g,%.10g]\\n`," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " Range,enclosure,after,step,i,` `,r[i][1],r[i][ 2]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 95 "\n q[i]:=interval_list_plot 3d(list_of_intervals2d,list_of_ranges,colorlist=c_list,cutout=c_out); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " m:=max_iter_c ounter;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " display([q[m],q[m+1]], op(opts_new),axes=framed);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "end: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "" 0 "" {TEXT -1 75 "######################################################### ##################" }}{PARA 0 "" 0 "" {TEXT -1 31 "EXTENDED INTERVAL N EWTON METHOD" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "" 0 "" {TEXT -1 77 "--------------------------------------------------------- --------------------" }}{PARA 0 "" 0 "" {TEXT -1 35 "PROCEDURE NEWTON \n\nNewton-Iteration\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 61 "newton:=p roc(f,df,xold::interval,eps::float,xunique::boolean)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " global zeros,infos,N,iter_counter; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " local c,ynew,xnew,i,unique,j,insert;" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 64 " if not(type(xold[1],numeric) and type(xold[2],num eric)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " RETURN(`Start _interval_must_be_real!`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi :" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 58 " # Cancel Iteration if no zero exists in start interval" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " if not(is_in(0.,f(xold))) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " RETURN();" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " \+ fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " # Increase number of iteration steps by 1" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " iter_counter:=iter_counter + 1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " # Extended interval \+ Newton step" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 22 " c:=midpoint(xold);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " # c:=mid(xo ld);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " ynew:=ext_int_div(f(c),df(xold));" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " if ( nops([ynew]) >= 2) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 " x new[1]:=(c &- op(1,[ynew])) &intersect xold;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 " xnew[2]:=(c &- op(2,[ynew])) &intersect xold; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " unique:=false;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " else " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " ynew:=(c &- ynew);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " xnew[1]:=ynew &intersect xold;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " if xnew[1] = [] then RETURN() fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " # Strict inclusion implies existence and uniqueness" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " # of zero i n xold" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " unique:=xunique or " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 67 " ((xold[1] < xnew[1][1]) and (xnew[1][2 ] < xold[2]));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " xnew[2]:=[ ]; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " # Bisection, if no reduction of interva l is achieved" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " if (xnew[1] = xold) or (xnew[2] = xold) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " c:=c[2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " \+ if (xold[1] < c) and (c < xold[2]) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " xnew[1]:=[xold[1],c];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " xnew[2]:=[c,xold[2]];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " \+ N:=N+1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " zeros[N]: =xold;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " infos[N]:=unique ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " RETURN();" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 62 " # Output of computed enclosures or further iteration steps" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " for i from \+ 1 to 2 do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " if (xnew[i] <> \+ []) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 " if (rel_diam( xnew[i]) < eps) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 " \+ if (is_in(0.,f(xnew[i]))) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " if unique=false then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " insert:=true;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 " # Combine enclosure \+ intervals with equal end points" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " for j from 1 to N do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " i f ((xnew[i] &intersect zeros[j]) <> []) and" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " (infos[j] = false) then" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 61 " zeros[j] :=zeros[j] &union xnew[i];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " \+ insert:=false;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " break;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " if insert then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " N:=N + 1; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " zeros[N]: =xnew[i];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " \+ infos[N]:=unique;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " \+ fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " else \+ " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " N:=N + \+ 1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " zeros[N]:= xnew[i];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " info s[N]:=unique;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " fi ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " newton(f,df,xnew[i],eps,unique);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " od:" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " RETURN(); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 105 "------------------------------------------------- ----------------------------\nPROCEDURE COMPUTE_ALL_ZEROS" }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 69 "compute_all_zeros:=proc(g::\{function,proced ure\},xstart::interval,eps)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " \+ global zeros,infos,N,iter_counter;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " local f,df,xold,unique,i,x,x1,x2,n;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " # Convert g and g' to interval functions" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " x:='x';" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 72 " if type (simplify(g(x)),numeric) or (simplify(diff(g(x),x)) = 0) then" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " lprint(`Function is constant = `, simplify(g(x)));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " RE TURN();" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " f:=ina pply(g(x),x);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " df:=inapply(di ff(g(x),x),x);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " if not(type(f(xstart),interval)) then" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 74 " ERROR(`First argument must be real function of one real variable.`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " fi; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 68 " if not(type(xstart[1],numeric) and ty pe(xstart[2],numeric)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " \+ ERROR(`Start_interval_must_be_real.`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " x1:=xstart[1];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " x2:=xstart[2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 40 " # Determine precision of computation" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " if (nargs > 3) and type(args[4],nonnegint) then" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 38 " Digits:=max(args[4],10,Digits);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 " while not( is_in(Evalf(x1),x1) and is_in(Evalf(x2),x2)) " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " and (Digits <= 100) do" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 32 " Digits:=eval(Digits) + 5;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " \+ " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " Digits:= max(ceil(abs(Eval f(log10(eps)))) + 5," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " \+ Digits);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " \+ lprint(`Digits = `,Digits);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " lprint(` `);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " \+ if width(xstart)=0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " \+ xold:=[rd(x1),ru(x2)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " \+ Digits:=Digits+2;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " else xold: =xstart;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 2 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " # In itialization" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 19 " zeros:=table();" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " infos:=table();" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " N :=0;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " iter_counter:=0;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " unique:=false;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " # Perf orm Iteration" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " newton(f,df,xold,Evalf(eps),unique);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " \+ # Output" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " if N = 0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " lprint(`No zero contained in start interval.`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " RETURN();" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " for i from 1 to N do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " print(eval(zeros[i]));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " if infos[i]=true then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " print(`contains exactly one zero .`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " else" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 48 " print(`potential enclosure of zero` );" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " \+ lprint(` `);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " lprint( `Number of enclosures of zeros: `,N);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " lprint(`Number of Iterations steps: `,iter_counter);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1 "\n" }}{PARA 0 "" 0 "" {TEXT -1 77 "--------------------------------------------------------- --------------------" }}{PARA 0 "" 0 "" {TEXT -1 21 "PROCEDURE NEWTON_ PLOT" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 53 "G raphical representation of one interval newton step." }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 "newton_plot:=proc (g,f,xold::interval,ynew::list,xnew::list)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " local" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 79 "xrange, yrange,p,hy,h1,h2,i,intxold,intxnew,n,punkt,punkt1,punkt2,punkt3,cx,x, c;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " lprint(`xold=`,xold);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " lprint(`xnew1=`,xnew[1]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " if (xnew[2] \+ <> []) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " lprint(`xnew2= `,xnew[2]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " fi;" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 68 " xrange:=(xold[1]-(width(xold)/10 .))..(xold[2]+(width(xold)/10.));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 2 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 73 "yrange:=(f(xold)[1]-width(f(xold))/10.)..(f(xold)[2]+ width(f(xold))/10.);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " x:='x';" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 " p[1]:=plot(g(x),x=xrange,color=black,numpoints=200):" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " hy:=width(f(xold));" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 14 " h1:=hy/25.;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " h2:=hy/50.;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "# Representation of old interva l - yellow" }}{PARA 0 "" 0 "" {TEXT -1 22 " " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 58 "intxold:=plottools[rectangle]([xold [1],0.],[xold[2],-h2]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " \+ p[2]:=PLOT(intxold,COLOR(RGB,1,1,0));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " # Boundaries of old interval" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "p[3]:=plot([[xold[1],-h1],[xold[1], h1]],color=black,thickness=4):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "p[4]:=plot([[xold[2],-h1],[xold[2],h1]],color=black,t hickness=4):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 37 " # Labelling for old interval" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 68 " \+ p[5]:=textplot([midpoint(xold)[1],-h1,'xold'],align=BELOW);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " # Representation of computed new intervals" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " n:=6;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " for i from 1 to 2 do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " if xnew[i] <> [] then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " " }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 63 "intxnew:=plottools[rectangle]([xnew[i][1],h2],[xnew [i][2],0.]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " p[n]:= PLOT(intxnew,COLOR(RGB,0,1,0));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " n:=n+1:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " \+ " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 "p[n]:=plot([[xnew[i][1],-h1],[ xnew[i][1],h1]],thickness=4):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " \+ n:=n+1:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " \+ " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 "p[n]:=plot([[xnew[i][2],-h1],[x new[i][2],h1]],thickness=4):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " \+ n:=n+1:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " i f i=1 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "p[n]:=textplot([midpoint(xnew[i])[1 ],h1,'xnew1'],align=ABOVE);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " \+ elif i=2 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " \+ " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "p[n]:=textplot([midpoint(x new[i])[1],h1,'xnew2'],align=ABOVE);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " \+ n:=n+1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " fi:" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " od: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " # representati on of tangent - red." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 2 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " c:=midpoint(xold)[2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " punkt[1]:=[c,g(c)];" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 9 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " # Determination of intersection points" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " if \+ nops(ynew)=2 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 " if \+ is_in(-infinity,ynew[1]) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " \+ punkt[2]:=[ynew[1][2],0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " punkt[3]:=[ynew[2][1],0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " else " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " punkt[2]:=[ynew[1][1],0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " punkt[3]:=[ynew[2][2],0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " else " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 " \+ if ynew[1] = [-infinity,infinity] then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "p :=display([seq(p[i],i=1..n-1)],axes=framed,xtickmarks=5," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 70 "view=[xrange,yrange],font=[TIMES,ITALIC,10],axesfont= [TIMES,ROMAN,10]," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " \+ scaling=unconstrained);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " \+ " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " RETURN(p);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " elif is_in(-infinity,ynew[1]) then" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 39 " punkt[2]:=[ynew[1][2],0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " punkt[3]:=[0.,g(c)];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " elif is_in(infinity,ynew [1]) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " punkt[2] :=[ynew[1][1],0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " \+ punkt[3]:=[0.,g(c)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " \+ else " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " punkt[2]:=[y new[1][1],0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " punk t[3]:=[ynew[1][2],0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " \+ fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " fi;" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 9 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " point(punkt1,punkt[1]): " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " point(punkt2,punkt[2]):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " point(punkt3,punkt[3]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " line(g1,[punkt1,punkt2]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " line(g2,[punkt1,punkt3]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 69 " \+ p[n]:=draw([g1],view=[xrange,yrange],color=red,linestyle=3);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " n:=n+1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 69 " p[n]:=draw([g2],view=[xrange,yrang e],color=red,linestyle=3);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " \+ " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 " # Representation of all g raphical elements" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 76 "p:=display([seq(p[i],i=1..n)],axes=framed,xti ckmarks=5,view=[xrange,yrange]," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 73 " font=[TIMES,ITALIC,10],axesfont=[TIMES,ROMAN,10],scaling=unconstraine d);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " " }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 15 " RETURN(p);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "" 0 "" {TEXT -1 77 "--------------------- --------------------------------------------------------" }}{PARA 0 " " 0 "" {TEXT -1 26 "PROCEDURE NEWTON_WITH_PLOT" }}{PARA 0 "" 0 "" {TEXT -1 48 "\nNewton-Iteration with graphical representation\n" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 73 "newton_with_plot:=proc(g,f,df,xold: :interval,eps::float,xunique::boolean)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " local c,ynew,xnew,i,j,insert,unique;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 60 " global zeros,infos,N,iter_counter,max_iter_counte r,p,dx;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 64 " if not(type(xold[1],numeric) and type(xold[2],num eric)) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " RETURN(`Start interval_must_be_real.`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi :" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " if not(is_in(0.,f(xold))) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " RETURN();" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " # Increase number of iteration \+ steps by 1" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " iter_counter:=iter_counter + 1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " # \+ Extended interval Newton Step" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " c:=midpoint(xold);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " \+ ynew:=[ext_int_div(f(c),df(xold))];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " if (nops(ynew) >= 2) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " ynew[1]:=c &- ynew[1];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " xnew[1]:=ynew[1] &intersect xold;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " ynew[2]: =c &- ynew[2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " xnew[2]:=y new[2] &intersect xold;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " unique:=false;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " else " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " ynew[1]:=c &- ynew[1];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " xnew[1]:=ynew[1] &intersect xold;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " if xnew[ 1] = [] then RETURN() fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " \+ " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " # Strict inclusion implies existence and uniqueness" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " # of zero in xold" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "\n unique :=xunique or " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 70 " ((x old[1] < xnew[1][1]) and (xnew[1][1] < xold[2])); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " \+ xnew[2]:=[]; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " \+ # Bisection, if no reduction of interval is achieved\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " if (xnew[1] = xold) or (xnew[2] = xold) t hen" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " c:=c[2];" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 46 " if (xold[1] < c) and (c < xold[2]) th en" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " xnew[1]:=[xold[1],c] ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " xnew[2]:=[c,xold[2]]; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " else" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 16 " N:=N+1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " zeros[N]:=xold;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " \+ infos[N]:=unique;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " \+ RETURN();" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " fi;" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " # Representation of Newton step" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " xnew:= [xnew[1],xnew[2]];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " lprint(`Iteration step `, iter_counter); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 " p[iter_counter]:=newton_plo t(g,f,xold,ynew,xnew);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " print (p[iter_counter]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 62 " # Output of computed enclosures or furthe r iteration steps" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 24 " for i from 1 to 2 do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " if (xnew[i] <> []) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 78 " if (rel_diam(xnew[i]) < eps) or (iter_count er=max_iter_counter) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 " \+ if (is_in(0.,f(xnew[i]))) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " if unique=false then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " insert:=true;" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 " # Comb ine enclosure intervals with equal end points " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " \+ for j from 1 to N do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " \+ if ((xnew[i] &intersect zeros[j]) <> []) and" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " (infos[j] = fals e) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 61 " \+ zeros[j]:=zeros[j] &union xnew[i];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " insert:=false;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " break;" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 25 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " \+ if insert then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " \+ N:=N + 1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " \+ zeros[N]:=xnew[i];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " \+ infos[N]:=unique;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " \+ else " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " \+ N:=N + 1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " \+ zeros[N]:=xnew[i];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " \+ infos[N]:=unique;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " \+ fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " else" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " newton_with_plot(g,f,d f,xnew[i],eps,unique);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " \+ fi:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " fi:" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 8 " od:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " RETURN(); " }}{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 38 "PROCEDURE COMPUTE_ALL_ZEROS_WITH_PLOT\n" }}{PARA 0 "" 0 "" {TEXT -1 96 "Enclosure of the zeros of a continuousl y differentiable function g with graphical representation" }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 79 "compute_all_ zeros_with_plot:=proc(g::\{function,procedure\},xstart::interval,eps) " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 " global zeros,infos,N,iter_c ounter,max_iter_counter;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " loc al f,df,xold,unique,i,x,x1,x2;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " x:='x';" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 72 " if type(sim plify(g(x)),numeric) or (simplify(diff(g(x),x)) = 0) then" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 57 " lprint(`Function is constant = `, sim plify(g(x)));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " RETURN();" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 " # Conversio n of g and g' into interval functions" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 " if (nargs > 4) and typ e(args[5],nonnegint) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " \+ max_iter_counter:=args[5];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " e lse" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 78 " max_iter_counter:=read stat(\"Enter maximal number of iteration steps: \");" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " f:=inapply(g(x),x);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " \+ df:=inapply(diff(g(x),x),x);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " if not(type(f(xstart),interval) ) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 74 " ERROR(`First argume nt must be real function in one real variable.`);" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 8 " fi; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1 " " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " x1:=xstart[1];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " x2:=xstart[2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " # Determine precsion of computation" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " if (nargs > 3) and type(args[4] ,nonnegint) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " Digits:= max(args[4],10,Digits);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 " while not(is_in(Evalf(x1),x1) and is_in(Evalf(x2),x2)) " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " and (Digits <= 100) do" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " Digits:=eval(Digits) + 5;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 58 " Digits:= ma x(ceil(abs(Evalf(log10(eps)))) + 5,Digits);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " lprint(`Dig its = `,Digits);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " lprint(` \+ `);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " if width(xstart)=0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " xold:=[rd(x1),ru(x2)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " Digits:=Digits+2;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " else xold:=xstart;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " # Initialization" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " zeros:=tabl e();" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " infos:=table();" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " N:=0;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " iter_counter:=0;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " unique:=false;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " # Perform iteration" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 " \+ newton_with_plot(g,f,df,xold,Evalf(eps),unique);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " # Output" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " if N = 0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " lpr int(`No zero contained in start interval.`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " RETURN();" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " for i from 1 to N do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " print(eval(zeros[i]));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " if infos[i]=true then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " print(` contains exactly one zero.`);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 " print(` potential enclosure of zero`);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " lpri nt(` `);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " lprint(`Num ber of enclosures of zeros: `,N);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 " lprint(`Number of iteration steps: `,iter_counter);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}{PARA 0 "" 0 "" {TEXT -1 75 "##################################### ######################################" }}{PARA 0 "" 0 "" {TEXT -1 24 "COMPLEX DISC ARITHMETIC " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 75 "################################################## #########################" }}{PARA 0 "" 0 "" {TEXT -1 42 "Type definit ions and aouxiliary procedures" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 39 "Type definitions --> see init procedure" }}{PARA 0 "" 0 "" {TEXT -1 77 "--------------------------------------- --------------------------------------" }}{PARA 0 "" 0 "" {TEXT -1 34 "Definition of `type/complex_disc`:" }}{PARA 0 "" 0 "" {TEXT -1 28 "-- > moved to init procedure!" }}{PARA 0 "" 0 "" {TEXT -1 77 "----------- ------------------------------------------------------------------" }} {PARA 0 "" 0 "" {TEXT -1 38 "Definition of `type/complex_interval`:" } }{PARA 0 "" 0 "" {TEXT -1 28 "--> moved to init procedure!" }}{PARA 0 "" 0 "" {TEXT -1 77 "------------------------------------------------- ----------------------------" }}{PARA 0 "" 0 "" {TEXT -1 17 "PROCEDURE `&CABS`" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 123 "This procedure computes a real interval enclosing the abolute val ue of a complex number \nor a complex rectangular interval." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "`&cabs`:= proc(z)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " local w;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " if type(z,complex_interval) \+ then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " w:=&sqrt( (&sqr(z [1])) &+ (&sqr(z[2])) );" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " \+ elif type(z,complex) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 " \+ w:=&sqrt( (&sqr(Re(z))) &+ (&sqr(Im(z))) );" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " \+ '&cabs(z)';" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " fi;" } }{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 27 "PROCEDURE COMPLEX_DISC_PLOT" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 42 "Graphical representation of a comp lex disc" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "complex_disc_plot:=proc(z::complex_disc)" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 23 " local opts, x, y, r;" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 26 " opts:=[args[2..nargs]];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " x:=z[1];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " \+ y:=z[2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " r:=z[3];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " plot([x + r*cos(t), y +r*sin(t), t=0..2* Pi],op(opts));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "end:\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "complex_polynom_plot:=proc(p::polynom(compl ex,z),u::complex_disc)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " local o pts, x, y, r;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " opts:=[args[3..nargs]];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " x:=u[1];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " y: =u[2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " r:=u[3];" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 78 " complexplot(subs(z=x + I*y + r * (cos(t) + I *sin(t)),p),t=0..2*Pi,op(opts));" }}{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 75 "############################### ############################################" }}{PARA 0 "" 0 "" {TEXT -1 27 "BASIC ARITHMETIC OPERATIONS" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 77 "----------------------------------------- ------------------------------------" }}{PARA 0 "" 0 "" {TEXT -1 17 "P ROCEDURE `&CADD`" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 38 "Centered addition of two Complex discs" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 "`&cadd`:=proc(u:: \{complex,complex_disc\},v::\{complex,complex_disc\})" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " local cx, cy, c, r;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " if type(u ,complex_disc) and type(v,complex_disc) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " cx:= u[1] &+ v[1];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " cy:= u[2] &+ v[2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " c:=[mid(cx),mid(cy)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " if u[3]=0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " r:=v[3];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " el if v[3]=0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " r:=u[3]; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " else" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 26 " r:= u[3] &+ v[3];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " r:=r[2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " r:= ru(Evalf(r) + width(cx));" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 35 " r:= ru(Evalf(r) + width(cy));" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " RETURN([op(c),r]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 " elif type(u,complex) and type(v,comple x_disc) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " [Re(u),Im(u ),0] &cadd v;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 " elif type(u,com plex_disc) and type(v,complex) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " u &cadd [Re(v),Im(v),0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " [Re(u),Im(u ),0] &cadd [Re(v),Im(v),0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " fi ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{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 17 "PROCEDURE `&CSUB` " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 42 "Cente red subtraction of two Complex discs\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 "`&csub`:=proc(u::\{complex,complex_disc\},v::\{complex,complex _disc\})" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " local cx, cy, c, r; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " if type(u,complex_disc) and \+ type(v,complex_disc) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " \+ cx:=u[1] &- v[1];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " cy:=u[2] &- v[2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " c:=[mid(cx),mid( cy)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " if u[3] = 0 then" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " r:=v[3];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " elif v[3]=0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " r:=u[3];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " r:= u[3] &+ v[3];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " r:=r[2];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " r:= ru (Evalf(r) + width(cx));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " r: = ru(Evalf(r) + width(cy));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " \+ RETURN([op(c),r]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 " elif typ e(u,complex) and type(v,complex_disc) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " [Re(u),Im(u),0] &csub v;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 " elif type(u,complex_disc) and type(v,complex) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " u &csub [Re(v),Im(v),0]; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " [Re(u),Im(u),0] &csub [Re(v),Im(v),0];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " 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 `&CMU LT`" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 44 "Ce ntered multiplication of two Complex discs" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 67 "`&cmult`:=proc(u::\{compl ex,complex_disc\},v::\{complex,complex_disc\})" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " local cx, cy, c, r, r1, r2, r3;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " if typ e(u,complex_disc) and type(v,complex_disc) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 " cx:=(u[1] &* v[1]) &- (u[2] &* v[2]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 " cy:=(u[1] &* v[2]) &+ (u[2] &* v[1] );" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " c:=[mid(cx),mid(cy)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " if u[3]=0 then" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 41 " r:=(&cabs(u[1]+I*u[2])) &* v[3];" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " elif v[3]=0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " r:=(&cabs(v[1]+I*v[2])) &* u[3];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 " r1:= (&cabs(u[1]+I*u[2])) &* v[3];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 " r2:= (&cabs(v[1]+I*v[2])) &* u[3 ];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " r3:= u[3] &* v[3];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " r:= r1 &+ r2 &+ r3;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " r:=r[2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " r:= ru(Evalf(r) + width(cx));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " r:= ru(Evalf(r) + width(cy));" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 27 " RETURN([op(c),r]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " elif type(u,complex) and type(v,complex_disc) \+ then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " [Re(u),Im(u),0] &c mult v;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " elif type(u,complex_ disc) and type(v,complex) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " \+ u &cmult [Re(v),Im(v),0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " [Re(u),Im(u), 0] &cmult [Re(v),Im(v),0];" }}{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 17 "PROCEDURE `&CDIV`" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 38 "Centered division of two Complex discs" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 "`& cdiv`:=proc(u::\{complex,complex_disc\},v::\{complex,complex_disc\})" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " local c, cx, cy, r, nenner, a ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " if type(u,complex_disc) and type(v,complex_disc) \+ then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " a:=&cabs(v[1]+I*v[2] );" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " if (a[1] <= v[3]) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " ERROR(`Denominator co ntains zero! `):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 " elif (u[ 1] = 1) and (u[2]=0) and (u[3]=0) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " nenner:= (&sqr(&cabs((v[1]+I*v[2])))) &- (&sqr(v[3 ]));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " if is_in(0,nenn er) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 60 " ERROR(` Formula denominator contains zero! `):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " else " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " cx:=v[1] &/ nenner;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " cy:=((-1)*v[2]) &/ nenner;" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 33 " r:=v[3] &/ nenner;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " c:=[mid(cx),mid(cy)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " else " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 " \+ RETURN( u &cmult ( [1,0,0] &cdiv v));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " \+ fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " r:=r[2];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " r:= ru(Evalf(r) + width(cx)) ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " r:= ru(Evalf(r) + width (cy));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " RETURN([op(c),r]); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " elif type(u,complex) and ty pe(v,complex_disc) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " \+ [Re(u),Im(u),0] &cdiv v;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " el if type(u,complex_disc) and type(v,complex) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " u &cdiv [Re(v),Im(v),0];" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 49 " elif type(u,complex) and type(v,complex) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " [Re(u),Im(u),0] &cdiv [R e(v),Im(v),0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "" 0 "" {TEXT -1 78 "\n--- ---------------------------------------------------------------------- ----" }}{PARA 0 "" 0 "" {TEXT -1 18 "PROCEDURE X0_START" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{MPLTEXT 1 0 41 "x 0_start:=proc(s1::interval,s2::interval)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " local f, F, xu, xo, s3, s, t;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " s:='s';" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " t:='t';" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 72 " f:=(s,t)->(sqrt((1+s^2)*(1+t^2))*s*t - s^2*t^2) / (1+s^2 +t^2);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " F:=inapply(f(s, t),s,t);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " xu:=F(s1,s2); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " xu:=xu[1];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " s3:=s1 &* s2;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " xo:=min(s1[2],s2[2],s3[2]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " if xu <= xo then" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 28 " RETURN([xu,xo]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 58 " ERROR(`Kann Startintervall nicht bestimmen`);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "end:\n\n" }} {PARA 0 "" 0 "" {TEXT -1 77 "----------------------------------------- ------------------------------------" }}{PARA 0 "" 0 "" {TEXT -1 22 "P ROCEDURE `&CMULT_OPT`" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 52 "Surface optimal multiplication of two complex discs." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 71 "` &cmult_opt`:=proc(u::\{complex,complex_disc\},v::\{complex,complex_dis c\})" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 69 " local c,cx, cy, r, x 0, s1, s2, r1, r2, r3, z1, z2, z1z2, r1r2," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "r1z2, r2z1, P, dP,t, i, xold, m;" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 6 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " if t ype(u,complex_disc) and type(v,complex_disc) then" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 42 " if (u[1]=0 and u[2]=0 and u[3]=0) or" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " (v[1]=0 and v[2]=0 and v[3 ]=0) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " RETURN([0,0 ,0]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " # if one of the d iscs is zero, zero is returned " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 70 " \n # u and/or w are circles with radius 0 (\"a point \") " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " elif u[3]=0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " # Determine midpoint\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " cx:=(u[1] &* v[1]) &- (u[2] &* v[2]);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " cy:=(u[1] &* v[2]) &+ (u [2] &* v[1]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " c:=[mid (cx),mid(cy)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " # Determine radius" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " i f v[3]=0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " r:=[ 0,0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " r:= (&cabs(u[1]+I*u[2])) &* v[3];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " r:=r[2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " r:=ru(Evalf(r) + width(cx));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " r:=ru(Evalf(r) + width(cy));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " RETURN([op(c),r]); " }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 22 " elif v[3]=0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " # Determine midpoint\n" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 48 " cx:=(u[1] &* v[1]) &- (u[2] &* v[2]);" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 " cy:=(u[1] &* v[2]) &+ ( u[2] &* v[1]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " c:=[mi d(cx),mid(cy)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " # Determine radius\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 " r:=(&cabs(v[1]+I*v[2])) &* u[3];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " r:=r[2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " \+ r:=ru(Evalf(r) + width(cx));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " r:=ru(Evalf(r) + width(cy));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " RETURN([op(c),r]); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 45 " # One factor is circle with midpoint 0. " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " elif (u[1]=0) and (u[2]=0) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " c:=[0,0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " if (v[1]=0) and (v[2]=0) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " r:= u[3] &* v[3];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " r:= u[3] &* ((&cabs(v[1]+I*v[2])) &+ v[3]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " \+ r:=r[2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " RETU RN([0,0,r]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " elif (v[1]=0 ) and (v[2]=0) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " \+ c:=[0,0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " r:=v[3] &* ((&cabs(u[1]+I*u[2])) &+ u[3]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " r:=r[2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " \+ RETURN([0,0,r]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " else \+ " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " s1:= u[3] &/ (&cabs(u[1]+I*u[2]));" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 46 " s2:= v[3] &/ (&cabs(v[1]+I*v[2])); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " z1:=u[1] + I*u[2]; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " z2:=v[1] + I*v[2]; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " x0:=x0_start(s1,s2);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " #lprint(x0);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 67 " z1z2:=&intpower(&cabs(z1),2) &* &intpower (&cabs(z2),2);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " r1r2: =&intpower(u[3],2) &* &intpower(v[3],2);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 62 " r1z 2:=&intpower(u[3],2) &* &intpower(&cabs(z2),2);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 62 " r2z1:=&intpower(v[3],2) &* &intpower(&cab s(z1),2);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " # Determine x0 using Newton method, " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " # start interval = x0star t" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " t:='t';" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " \+ P:=(2 &* z1z2 &* (&intpower(t,3))) &+ " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 64 " ((z1z2 &+ r1z2 &+ r2z1) &* (&intpower(t,2) )) &- r1r2;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " #lprint( eval(subs(t=x0,P)));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 86 " \+ dP:=(6 &* z1z2 &* (&intpower(t,2))) &+ (2 &* (z1z2 &+ r1z2 &+ r2z1) & * t);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 " #lprint(`dP=`, eval(subs(t=x0,dP)));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " for i from 1 to 10 do " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " #lprint(x0);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " xold:=x0;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " m:=midpoint(xold);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " x0:=(m &- " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " (eval(subs(t=m,P)) &/ eval(su bs(t=xold,dP))) );" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " \+ x0:=x0 &intersect xold;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " \+ if x0=xold then break; fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " \+ #lprint(`x0=`,x0);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " \+ " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " # Determine midpoin t\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 64 " cx:=((u[1] &* v[ 1]) &- (u[2] &* v[2])) &* (1 &+ x0);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 64 " cy:=((u[1] &* v[2]) &+ (u[2] &* v[1])) &* (1 &+ x0); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " c:=[mid(cx),mid(cy) ];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " #lprint(`c=`,c); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " # Determine radius" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " r 1:=3 &* z1z2 &* &intpower(x0,2);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " r2:=2 &* (z1z2 &+ r1z2 &+ r2z1) &* x0;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " r3:=r1z2 &+ r2z1 &+ r1r2;" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 37 " r:=&sqrt(r1 &+ r2 &+ r3);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " r:=r[2];" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 40 " r:=ru(Evalf(r) + width(cx));" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " r:=ru(Evalf(r) + width( cy));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " RETURN([op(c), r]); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " fi;" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 53 " elif type(u,complex) and type(v,complex_d isc) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " [Re(u),Im(u),0 ] &cmult_opt v;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 " elif type(u,c omplex_disc) and type(v,complex) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " u &cmult_opt [Re(v),Im(v),0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " else " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " \+ [Re(u),Im(u),0] &cmult_opt [Re(v),Im(v),0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "end: " }}{PARA 0 "" 0 "" {TEXT -1 77 "--------------------------------------- --------------------------------------" }}{PARA 0 "" 0 "" {TEXT -1 21 "PROCEDURE `&CDIV_OPT`" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 46 "Surface optimal division of two complex discs." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 70 "`&c div_opt`:=proc(u::\{complex,complex_disc\},v::\{complex,complex_disc\} )" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 " if type(u,complex_disc) \+ and type(v,complex_disc) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 " \+ RETURN( u &cmult_opt ([1,0,0] &cdiv v));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " elif type(u,complex) and type(v,complex_disc) t hen" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " [Re(u),Im(u),0] &cd iv_opt v;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " elif type(u,comp lex_disc) and type(v,complex) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " u &cdiv_opt [Re(v),Im(v),0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " \+ [Re(u),Im(u),0] &cdiv_opt [Re(v),Im(v),0]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " fi; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " end: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 75 "##################################### ######################################" }}{PARA 0 "" 0 "" {TEXT -1 41 "RANGE ENCLOSURES FOR COMPLEX POLYNOMIALS\n" }}{PARA 0 "" 0 "" {TEXT -1 77 "--------------------------------------------------------------- --------------" }}{PARA 0 "" 0 "" {TEXT -1 27 "PROCEDURE HORNER_EVAL_C ENT\n" }}{PARA 0 "" 0 "" {TEXT -1 42 "Horner-Scheme with centered mult iplication" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 71 "horner_eval_cent:=proc(p::polynom(complex,z),u::\{com plex,complex_disc\})" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " lo cal n, Z, s, i, koeff, sx, sy;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "# ## WARNING: degree(0,x) now returns -infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " n:=degree(p,z);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " # p ist constant polynomia l" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " if n=0 or n=-infinity then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " RETURN(p);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " if type(u,complex) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " Z:=[Re(u),Im(u),0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " Z:=u;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " koeff: =coeff(p,z^n);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " s:=[Re(k oeff),Im(koeff),0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 39 " for i from (n-1) to 0 by -1 do" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " if i>0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " koeff:=coeff(p,z^i);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " if koeff=0 then" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " s:=s &cmult Z;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 63 " s:=(s &cmult Z) &cadd [Re(koeff ),Im(koeff),0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " fi ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " elif (i=0) then" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "### WARNING: ldegree(0,x) now retu rns infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " if ldegree(p,z) = 0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 75 " \+ s:= (s &cmult Z) &cadd [Re(tcoeff(p)),Im(tcoeff(p)),0];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " else " }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 35 " s:= s &cmult Z;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " fi;" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 15 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " od ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " RETURN(s);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "" 0 "" {TEXT -1 78 "\n-------------------------- ---------------------------------------------------" }}{PARA 0 "" 0 " " {TEXT -1 25 "PROCEDURE HORNER_EVAL_OPT" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 49 "Horner-Scheme with surface optimal multiplication" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 70 "horner_eval_opt:=proc(p::polynom(complex,z),u::\{comp lex,complex_disc\})" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " loc al n, Z, s, i, koeff;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "### WARNIN G: degree(0,x) now returns -infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " n:=degree(p,z);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " if n=0 or n=-infinity th en " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " RETURN(p);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " \+ if type(u,complex) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " \+ Z:=[Re(u),Im(u),0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " \+ else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " Z:=u;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " koeff: =coeff(p,z^n);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " s:=[Re(k oeff),Im(koeff),0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " for i from (n-1) to 0 by -1 do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " \+ if i>0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " \+ koeff:=coeff(p,z^i);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " \+ if koeff=0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " \+ s:=s &cmult_opt Z;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " \+ else" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 67 " s:= (s &cmult_opt Z) &cadd [Re(koeff),Im(koeff),0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " elif (i=0) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " ### WARNING: ldegree(0,x) now returns infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " if ldegree(p,z) = 0 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 79 " s:= (s &cmult_opt Z) &c add [Re(tcoeff(p)),Im(tcoeff(p)),0];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " else " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " \+ s:= s &cmult_opt Z;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " \+ fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " RETURN(s);" }}{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 27 "PROCEDURE CENTRED_FORM_EVA L" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 43 "Cent ered form using centered multiplication" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "centred_form_eval:=proc(p::pol ynom(complex,z)," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "u::\{complex_di sc,complex\})" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 62 " local c, cx, cy, r, r1, r2, cu, pc, pcx, pcy, i, poly, n, Z;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " if type (u,complex) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " Z:=[R e(u),Im(u),0]; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " cu:=u; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " else" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 15 " Z:=u;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " cu:=u[1]+I*u[2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " \+ fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "### WARNING: degree(0, x) now returns -infinity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " \+ n:=degree(p);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " if n=0 or n=-infinity then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " RETURN(p);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " # Determine midpont of p(Z) " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " pc:=horner_eval_cent(p,cu); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 " cx:=[op(1,pc[1] &- pc[3]),op(2,pc[1] &+ pc[3]) ];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 " cy:=[op(1,pc[2] &- pc[ 3]),op(2,pc[2] &+ pc[3])];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " \+ c:=[mid(cx),mid(cy)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " # Determine radius of p(Z)" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " r:=0; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " for i from 1 to n do" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " poly:=diff(p,z$i);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " pc:=horner_eval_cent(poly ,cu);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " if type(pc,complex_disc) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 62 " pcx:=[op(1,pc[1] &- \+ pc[3]),op(2,pc[1] &+ pc[3])];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 62 " \+ pcy:=[op(1,pc[2] &- pc[3]),op(2,pc[2] &+ pc[3])];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " r1:= &cabs( [pcx,pcy] );" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " else" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 28 " r1:=&cabs( pc);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " fi; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " if i >1 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " r2:= (&intp ower(Z[3],i));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " else " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " r2:= Z[3];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " r:= r &+ ((r1 &* r2) &/ (i!));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " \+ od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " r:=r[2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " r:=ru(Evalf(r) + width(cx));" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " r:= ru(Evalf(r) + width(cy)) ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " RETURN([op(c),r]);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "" 0 "" {TEXT -1 75 "############################## #############################################" }}{PARA 0 "" 0 "" {TEXT -1 38 "EXPONENTIAL FUNCTION FOR COMPLEX DISCS" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 92 "----------------------- ------------------------------------------------------\nPROCEDURE CEXP " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }{TEXT -1 0 "" }{MPLTEXT 1 0 37 "cexp:=proc(u::\{complex,complex_dis c\})" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " local cx, cy, c, r, r1, \+ r2;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " if type(u,complex_disc) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " # B estimmung des Mittelpunktes" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " cx:=(&exp(u[1])) &* (&cos(u[2 ]));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " cy:=(&exp(u[1])) &* ( &sin(u[2]));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " c:=[mid(cx),m id(cy)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " # Bestimmung des Radius" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " " } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " r1:=&cabs( [cx,cy] );" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " r2:=(&exp(u[3])) &- 1;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " r:=r1 &* r2;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " r:=r [2];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " r:=ru(Evalf(r) + widt h(cx));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " r:=ru(Evalf(r) + w idth(cy));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " RETURN([op(c),r]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " else " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 " c exp([Re(u),Im(u),0]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 " fi;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "end" }{TEXT -1 0 "" }{MPLTEXT 1 0 2 ":\n" }}{PARA 0 "" 0 "" {TEXT -1 75 "################################# ##########################################" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "end module:" }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 75 "################## #########################################################" }}{PARA 0 " " 0 "" {TEXT -1 19 "end package intpakX" }}{PARA 0 "" 0 "" {TEXT -1 75 "################################################################## #########" }}{PARA 0 "" 0 "" {TEXT -1 134 "intpakX v1.0 (c) Scientific Computing/Software Engineering Research Group,\nDepartment of Mathema tics, University of Wuppertal, Germany" }}{PARA 0 "" 0 "" {TEXT -1 116 "Contact: \nkraemer@math.uni-wuppertal.de\nmarkus.grimmer@math.uni -wuppertal.de \nhttp://www.math.uni-wuppertal.de/wrswt" }}{PARA 0 "" 0 "" {TEXT -1 75 "#################################################### #######################" }}{PARA 0 "" 0 "" {TEXT -1 11 "Disclaimer:" } }{PARA 256 "" 0 "" {TEXT -1 75 "While every effort has been made to va lidate the solutions in this package," }}{PARA 256 "" 0 "" {TEXT -1 75 "Waterloo Maple Inc. and the contributors are not responsible for a ny errors" }}{PARA 256 "" 0 "" {TEXT -1 75 "contained and are not liab le for any damages resulting from the use of this" }}{PARA 256 "" 0 " " {TEXT -1 9 "material." }}{PARA 256 "" 0 "" {TEXT -1 75 "############ ###############################################################" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 7 "" 1 "" {TEXT -1 50 "Warning, \+ the name changecoords has been redefined\n" }}}{EXCHG {PARA 256 "" 0 " " {TEXT -1 75 "####################################################### ####################" }}{PARA 0 "" 0 "" {TEXT -1 59 "You can create a \+ Maple library with the following commands:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 39 "i) Tell Maple where to put the \+ library:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "libname:=\"C:/mylib/int erval\", libname;\n" }{TEXT -1 99 "You can use the directory name of y our choice in the above line. An empty directory is recommended." }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%(libnameG6&Q2C:/mylib/interval6\"Q0c :\\MapleNet\\libF'Q@C:/Program~Files/Maple~8/lib/LAF'Q=C:\\Program~Fil es\\Maple~8/libF'" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 27 "ii) Create t he new library:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "march('create',l ibname[1],100);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 21 "iii) Save the \+ library" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "savelib('intpakX');" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 116 "# ###################################################################### ####\nNow you can load the library as follows:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "libname:=\"C:/mylib/interval\", lib name;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%(libnameG6&Q2C:/mylib/inter val6\"Q0c:\\MapleNet\\libF'Q@C:/Program~Files/Maple~8/lib/LAF'Q=C:\\Pr ogram~Files\\Maple~8/libF'" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with(intpakX);" }}{PARA 7 "" 1 "" {TEXT -1 50 "Warning, the name c hangecoords has been redefined\n" }}{PARA 7 "" 1 "" {TEXT -1 61 "Warni ng, the assigned name midpoint now has a global binding\n" }}{PARA 7 " " 1 "" {TEXT -1 85 "Warning, the protected names ilog10, max and min h ave been redefined and unprotected\n" }}{PARA 12 "" 1 "" {XPPMATH 20 " 6#7ar%#&*G%$&**G%#&+G%#&-G%#&/G%-&Convex_HullG%(&arccosG%(&arcsinG%(&a rctanG%&&cabsG%&&caddG%&&cdivG%*&cdiv_optG%'&cmultG%+&cmult_optG%%&cos G%&&coshG%&&csubG%%&expG%+&intersectG%*&intpowerG%$&lnG%%&sinG%&&sinhG %%&sqrG%&&sqrtG%%&tanG%&&tanhG%'&unionG%&EvalfG%6Interval_Integerpower G%4Interval_Round_DownG%2Interval_Round_UpG%-Interval_addG%0Interval_a rccosG%0Interval_arcsinG%0Interval_arctanG%-Interval_cosG%.Interval_co shG%0Interval_divideG%-Interval_expG%0Interval_hyp_rdG%0Interval_hyp_r uG%3Interval_intersectG%,Interval_lnG%2Interval_midpointG%5Interval_op tion_zeroG%/Interval_powerG%6Interval_range_valuesG%4Interval_reciproc alG%/Interval_scaleG%-Interval_sinG%.Interval_sinhG%-Interval_sqrG%.In terval_sqrtG%2Interval_subtractG%-Interval_tanG%.Interval_tanhG%/Inter val_timesG%1Interval_trig_rdG%1Interval_trig_ruG%-Interval_ulpG%/Inter val_unionG%/Interval_widthG%,addinfinityG%2centred_form_evalG%%cexpG%, cni_range3dG%2complex_disc_plotG%5complex_polynom_plotG%2compute_all_z erosG% " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 " " 0 "" {TEXT -1 0 "" }}}{MARK "0 0 1" 12 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }