ALIAS_FSIMPLIFY:=proc(fid,expr) local aux: if type(expr,string) then fprintf(fid,"INTERVAL SS,CC;\n"): fprintf(fid,"SS=Sin(v_IS(1));\n"): fprintf(fid,"CC=Cos(v_IS(1));\n"): RETURN(0): fi: aux:=expr: aux:=subs(sin(x)=SS,cos(x)=CC,aux): RETURN(aux): end:This procedure will be first called with a string for expr and a consequence is that at the beginning of the evaluation file fid the interval variable SS,CC will be defined and then assigned to the value of . Then the procedure will be called for each expression that will be assigned to expr: each occurrence of the sine and cosine of in the expression will be substituted by SS, CC.
The procedure Math_Func, see section 9.4, may be used to identify mathematical functions occurring in an expression and the list provided by this function may be used to write a generic ALIAS_FSIMPLIFY procedure that will automatically compute only once the more complex components of an expression. The procedure Auto_Diff, see section 2.3.2, may also be used to speed up the interval evaluation of an expression. Note also that a similar mechanism exists for expression involving determinants of matrices.