|\^/| Maple 12 (IBM INTEL LINUX) ._|\| |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2008 \ MAPLE / All rights reserved. Maple is a trademark of <____ ____> Waterloo Maple Inc. | Type ? for help. > #BEGIN OUTFILE1 > > # Begin Function number 3 > reached_interval := proc() > global > glob_iolevel, > DEBUGL, > INFO, > DEBUGMASSIVE, > ALWAYS, > glob_max_terms, > #Top Generate Globals Decl > glob_max_sec, > glob_max_iter, > glob_initial_pass, > days_in_year, > glob_current_iter, > glob_optimal_clock_start_sec, > glob_abserr, > glob_reached_optimal_h, > djd_debug2, > glob_subiter_method, > glob_curr_iter_when_opt, > glob_start, > glob_max_hours, > glob_log10_abserr, > glob_display_interval, > glob_optimal_expect_sec, > glob_max_minutes, > glob_orig_start_sec, > glob_look_poles, > glob_last_good_h, > glob_disp_incr, > glob_optimal_done, > djd_debug, > glob_max_opt_iter, > glob_log10relerr, > glob_small_float, > glob_dump_analytic, > glob_h, > glob_iter, > glob_warned2, > glob_max_trunc_err, > glob_max_rel_trunc_err, > glob_hmin, > min_in_hour, > glob_html_log, > glob_normmax, > glob_smallish_float, > glob_large_float, > glob_hmin_init, > glob_not_yet_finished, > glob_clock_sec, > centuries_in_millinium, > years_in_century, > glob_dump, > MAX_UNCHANGED, > glob_unchanged_h_cnt, > glob_no_eqs, > glob_not_yet_start_msg, > glob_percent_done, > glob_optimal_start, > glob_almost_1, > glob_display_flag, > glob_warned, > glob_relerr, > glob_log10_relerr, > glob_next_display, > hours_in_day, > sec_in_minute, > glob_log10normmin, > glob_log10abserr, > glob_neg_h, > glob_hmax, > glob_clock_start_sec, > glob_good_digits, > #Bottom Generate Globals Decl > #BEGIN CONST > array_const_0D0, > array_const_1, > #END CONST > array_y, > array_x, > array_m1, > array_tmp2_g, > array_type_pole, > array_last_rel_error, > array_tmp1_g, > array_pole, > array_1st_rel_error, > array_norms, > array_y_init, > array_fact_1, > array_tmp0, > array_tmp1, > array_tmp2, > array_tmp3, > array_tmp4, > array_real_pole, > array_y_higher, > array_complex_pole, > array_y_higher_work, > array_y_higher_work2, > array_y_set_initial, > array_poles, > array_fact_2, > glob_last; > > > > local ret; > > if ((((array_x[1] >= glob_next_display) and not glob_neg_h) or ((array_x[1] <= glob_next_display) and glob_neg_h)) or (glob_next_display = 0.0)) then # if number 1 > ret := true; > else > ret := false; > fi;# end if 1 > ; > return(ret); > > # End Function number 3 > end; reached_interval := proc() local ret; global glob_iolevel, DEBUGL, INFO, DEBUGMASSIVE, ALWAYS, glob_max_terms, glob_max_sec, glob_max_iter, glob_initial_pass, days_in_year, glob_current_iter, glob_optimal_clock_start_sec, glob_abserr, glob_reached_optimal_h, djd_debug2, glob_subiter_method, glob_curr_iter_when_opt, glob_start, glob_max_hours, glob_log10_abserr, glob_display_interval, glob_optimal_expect_sec, glob_max_minutes, glob_orig_start_sec, glob_look_poles, glob_last_good_h, glob_disp_incr, glob_optimal_done, djd_debug, glob_max_opt_iter, glob_log10relerr, glob_small_float, glob_dump_analytic, glob_h, glob_iter, glob_warned2, glob_max_trunc_err, glob_max_rel_trunc_err, glob_hmin, min_in_hour, glob_html_log, glob_normmax, glob_smallish_float, glob_large_float, glob_hmin_init, glob_not_yet_finished, glob_clock_sec, centuries_in_millinium, years_in_century, glob_dump, MAX_UNCHANGED, glob_unchanged_h_cnt, glob_no_eqs, glob_not_yet_start_msg, glob_percent_done, glob_optimal_start, glob_almost_1, glob_display_flag, glob_warned, glob_relerr, glob_log10_relerr, glob_next_display, hours_in_day, sec_in_minute, glob_log10normmin, glob_log10abserr, glob_neg_h, glob_hmax, glob_clock_start_sec, glob_good_digits, array_const_0D0, array_const_1, array_y, array_x, array_m1, array_tmp2_g, array_type_pole, array_last_rel_error, array_tmp1_g, array_pole, array_1st_rel_error, array_norms, array_y_init, array_fact_1, array_tmp0, array_tmp1, array_tmp2, array_tmp3, array_tmp4, array_real_pole, array_y_higher, array_complex_pole, array_y_higher_work, array_y_higher_work2, array_y_set_initial, array_poles, array_fact_2, glob_last; if glob_next_display <= array_x[1] and not glob_neg_h or array_x[1] <= glob_next_display and glob_neg_h or glob_next_display = 0. then ret := true else ret := false end if; return ret end proc > # Begin Function number 4 > display_alot := proc(iter) > global > glob_iolevel, > DEBUGL, > INFO, > DEBUGMASSIVE, > ALWAYS, > glob_max_terms, > #Top Generate Globals Decl > glob_max_sec, > glob_max_iter, > glob_initial_pass, > days_in_year, > glob_current_iter, > glob_optimal_clock_start_sec, > glob_abserr, > glob_reached_optimal_h, > djd_debug2, > glob_subiter_method, > glob_curr_iter_when_opt, > glob_start, > glob_max_hours, > glob_log10_abserr, > glob_display_interval, > glob_optimal_expect_sec, > glob_max_minutes, > glob_orig_start_sec, > glob_look_poles, > glob_last_good_h, > glob_disp_incr, > glob_optimal_done, > djd_debug, > glob_max_opt_iter, > glob_log10relerr, > glob_small_float, > glob_dump_analytic, > glob_h, > glob_iter, > glob_warned2, > glob_max_trunc_err, > glob_max_rel_trunc_err, > glob_hmin, > min_in_hour, > glob_html_log, > glob_normmax, > glob_smallish_float, > glob_large_float, > glob_hmin_init, > glob_not_yet_finished, > glob_clock_sec, > centuries_in_millinium, > years_in_century, > glob_dump, > MAX_UNCHANGED, > glob_unchanged_h_cnt, > glob_no_eqs, > glob_not_yet_start_msg, > glob_percent_done, > glob_optimal_start, > glob_almost_1, > glob_display_flag, > glob_warned, > glob_relerr, > glob_log10_relerr, > glob_next_display, > hours_in_day, > sec_in_minute, > glob_log10normmin, > glob_log10abserr, > glob_neg_h, > glob_hmax, > glob_clock_start_sec, > glob_good_digits, > #Bottom Generate Globals Decl > #BEGIN CONST > array_const_0D0, > array_const_1, > #END CONST > array_y, > array_x, > array_m1, > array_tmp2_g, > array_type_pole, > array_last_rel_error, > array_tmp1_g, > array_pole, > array_1st_rel_error, > array_norms, > array_y_init, > array_fact_1, > array_tmp0, > array_tmp1, > array_tmp2, > array_tmp3, > array_tmp4, > array_real_pole, > array_y_higher, > array_complex_pole, > array_y_higher_work, > array_y_higher_work2, > array_y_set_initial, > array_poles, > array_fact_2, > glob_last; > > local abserr, analytic_val_y, ind_var, numeric_val, relerr, term_no; > > > > > > #TOP DISPLAY ALOT > if (reached_interval()) then # if number 1 > if (iter >= 0) then # if number 2 > ind_var := array_x[1]; > omniout_float(ALWAYS,"x[1] ",33,ind_var,20," "); > analytic_val_y := exact_soln_y(ind_var); > omniout_float(ALWAYS,"y[1] (analytic) ",33,analytic_val_y,20," "); > term_no := 1; > numeric_val := array_y[term_no]; > abserr := omniabs(numeric_val - analytic_val_y); > omniout_float(ALWAYS,"y[1] (numeric) ",33,numeric_val,20," "); > if (omniabs(analytic_val_y) <> 0.0) then # if number 3 > relerr := abserr*100.0/omniabs(analytic_val_y); > if (relerr <> 0.0) then # if number 4 > glob_good_digits := -trunc(log10(relerr/100.0)); > else > glob_good_digits := Digits; > fi;# end if 4 > ; > else > relerr := -1.0 ; > glob_good_digits := -1; > fi;# end if 3 > ; > if (glob_iter = 1) then # if number 3 > array_1st_rel_error[1] := relerr; > else > array_last_rel_error[1] := relerr; > fi;# end if 3 > ; > omniout_float(ALWAYS,"absolute error ",4,abserr,20," "); > omniout_float(ALWAYS,"relative error ",4,relerr,20,"%"); > omniout_int(INFO,"Correct digits ",32,glob_good_digits,4," ") > ; > omniout_float(ALWAYS,"h ",4,glob_h,20," "); > fi;# end if 2 > ; > #BOTTOM DISPLAY ALOT > fi;# end if 1 > ; > > # End Function number 4 > end; display_alot := proc(iter) local abserr, analytic_val_y, ind_var, numeric_val, relerr, term_no; global glob_iolevel, DEBUGL, INFO, DEBUGMASSIVE, ALWAYS, glob_max_terms, glob_max_sec, glob_max_iter, glob_initial_pass, days_in_year, glob_current_iter, glob_optimal_clock_start_sec, glob_abserr, glob_reached_optimal_h, djd_debug2, glob_subiter_method, glob_curr_iter_when_opt, glob_start, glob_max_hours, glob_log10_abserr, glob_display_interval, glob_optimal_expect_sec, glob_max_minutes, glob_orig_start_sec, glob_look_poles, glob_last_good_h, glob_disp_incr, glob_optimal_done, djd_debug, glob_max_opt_iter, glob_log10relerr, glob_small_float, glob_dump_analytic, glob_h, glob_iter, glob_warned2, glob_max_trunc_err, glob_max_rel_trunc_err, glob_hmin, min_in_hour, glob_html_log, glob_normmax, glob_smallish_float, glob_large_float, glob_hmin_init, glob_not_yet_finished, glob_clock_sec, centuries_in_millinium, years_in_century, glob_dump, MAX_UNCHANGED, glob_unchanged_h_cnt, glob_no_eqs, glob_not_yet_start_msg, glob_percent_done, glob_optimal_start, glob_almost_1, glob_display_flag, glob_warned, glob_relerr, glob_log10_relerr, glob_next_display, hours_in_day, sec_in_minute, glob_log10normmin, glob_log10abserr, glob_neg_h, glob_hmax, glob_clock_start_sec, glob_good_digits, array_const_0D0, array_const_1, array_y, array_x, array_m1, array_tmp2_g, array_type_pole, array_last_rel_error, array_tmp1_g, array_pole, array_1st_rel_error, array_norms, array_y_init, array_fact_1, array_tmp0, array_tmp1, array_tmp2, array_tmp3, array_tmp4, array_real_pole, array_y_higher, array_complex_pole, array_y_higher_work, array_y_higher_work2, array_y_set_initial, array_poles, array_fact_2, glob_last; if reached_interval() then if 0 <= iter then ind_var := array_x[1]; omniout_float(ALWAYS, "x[1] ", 33, ind_var, 20, " "); analytic_val_y := exact_soln_y(ind_var); omniout_float(ALWAYS, "y[1] (analytic) ", 33, analytic_val_y, 20, " "); term_no := 1; numeric_val := array_y[term_no]; abserr := omniabs(numeric_val - analytic_val_y); omniout_float(ALWAYS, "y[1] (numeric) ", 33, numeric_val, 20, " "); if omniabs(analytic_val_y) <> 0. then relerr := abserr*100.0/omniabs(analytic_val_y); if relerr <> 0. then glob_good_digits := -trunc(log10(relerr/100.0)) else glob_good_digits := Digits end if else relerr := -1.0; glob_good_digits := -1 end if; if glob_iter = 1 then array_1st_rel_error[1] := relerr else array_last_rel_error[1] := relerr end if; omniout_float(ALWAYS, "absolute error ", 4, abserr, 20, " "); omniout_float(ALWAYS, "relative error ", 4, relerr, 20, "%"); omniout_int(INFO, "Correct digits ", 32, glob_good_digits, 4, " "); omniout_float(ALWAYS, "h ", 4, glob_h, 20, " ") end if end if end proc > # Begin Function number 5 > adjust_for_pole := proc(h_param) > global > glob_iolevel, > DEBUGL, > INFO, > DEBUGMASSIVE, > ALWAYS, > glob_max_terms, > #Top Generate Globals Decl > glob_max_sec, > glob_max_iter, > glob_initial_pass, > days_in_year, > glob_current_iter, > glob_optimal_clock_start_sec, > glob_abserr, > glob_reached_optimal_h, > djd_debug2, > glob_subiter_method, > glob_curr_iter_when_opt, > glob_start, > glob_max_hours, > glob_log10_abserr, > glob_display_interval, > glob_optimal_expect_sec, > glob_max_minutes, > glob_orig_start_sec, > glob_look_poles, > glob_last_good_h, > glob_disp_incr, > glob_optimal_done, > djd_debug, > glob_max_opt_iter, > glob_log10relerr, > glob_small_float, > glob_dump_analytic, > glob_h, > glob_iter, > glob_warned2, > glob_max_trunc_err, > glob_max_rel_trunc_err, > glob_hmin, > min_in_hour, > glob_html_log, > glob_normmax, > glob_smallish_float, > glob_large_float, > glob_hmin_init, > glob_not_yet_finished, > glob_clock_sec, > centuries_in_millinium, > years_in_century, > glob_dump, > MAX_UNCHANGED, > glob_unchanged_h_cnt, > glob_no_eqs, > glob_not_yet_start_msg, > glob_percent_done, > glob_optimal_start, > glob_almost_1, > glob_display_flag, > glob_warned, > glob_relerr, > glob_log10_relerr, > glob_next_display, > hours_in_day, > sec_in_minute, > glob_log10normmin, > glob_log10abserr, > glob_neg_h, > glob_hmax, > glob_clock_start_sec, > glob_good_digits, > #Bottom Generate Globals Decl > #BEGIN CONST > array_const_0D0, > array_const_1, > #END CONST > array_y, > array_x, > array_m1, > array_tmp2_g, > array_type_pole, > array_last_rel_error, > array_tmp1_g, > array_pole, > array_1st_rel_error, > array_norms, > array_y_init, > array_fact_1, > array_tmp0, > array_tmp1, > array_tmp2, > array_tmp3, > array_tmp4, > array_real_pole, > array_y_higher, > array_complex_pole, > array_y_higher_work, > array_y_higher_work2, > array_y_set_initial, > array_poles, > array_fact_2, > glob_last; > > local hnew, sz2, tmp; > > > > #TOP ADJUST FOR POLE > > hnew := h_param; > glob_normmax := glob_small_float; > if (omniabs(array_y_higher[1,1]) > glob_small_float) then # if number 1 > tmp := omniabs(array_y_higher[1,1]); > if (tmp < glob_normmax) then # if number 2 > glob_normmax := tmp; > fi;# end if 2 > fi;# end if 1 > ; > if (glob_look_poles and (omniabs(array_pole[1]) > glob_small_float) and (array_pole[1] <> glob_large_float)) then # if number 1 > sz2 := array_pole[1]/10.0; > if (sz2 < hnew) then # if number 2 > omniout_float(INFO,"glob_h adjusted to ",20,h_param,12,"due to singularity."); > omniout_str(INFO,"Reached Optimal"); > return(hnew); > fi;# end if 2 > fi;# end if 1 > ; > if ( not glob_reached_optimal_h) then # if number 1 > glob_reached_optimal_h := true; > glob_curr_iter_when_opt := glob_current_iter; > glob_optimal_clock_start_sec := elapsed_time_seconds(); > glob_optimal_start := array_x[1]; > fi;# end if 1 > ; > hnew := sz2; > ;#END block > return(hnew); > #BOTTOM ADJUST FOR POLE > > # End Function number 5 > end; adjust_for_pole := proc(h_param) local hnew, sz2, tmp; global glob_iolevel, DEBUGL, INFO, DEBUGMASSIVE, ALWAYS, glob_max_terms, glob_max_sec, glob_max_iter, glob_initial_pass, days_in_year, glob_current_iter, glob_optimal_clock_start_sec, glob_abserr, glob_reached_optimal_h, djd_debug2, glob_subiter_method, glob_curr_iter_when_opt, glob_start, glob_max_hours, glob_log10_abserr, glob_display_interval, glob_optimal_expect_sec, glob_max_minutes, glob_orig_start_sec, glob_look_poles, glob_last_good_h, glob_disp_incr, glob_optimal_done, djd_debug, glob_max_opt_iter, glob_log10relerr, glob_small_float, glob_dump_analytic, glob_h, glob_iter, glob_warned2, glob_max_trunc_err, glob_max_rel_trunc_err, glob_hmin, min_in_hour, glob_html_log, glob_normmax, glob_smallish_float, glob_large_float, glob_hmin_init, glob_not_yet_finished, glob_clock_sec, centuries_in_millinium, years_in_century, glob_dump, MAX_UNCHANGED, glob_unchanged_h_cnt, glob_no_eqs, glob_not_yet_start_msg, glob_percent_done, glob_optimal_start, glob_almost_1, glob_display_flag, glob_warned, glob_relerr, glob_log10_relerr, glob_next_display, hours_in_day, sec_in_minute, glob_log10normmin, glob_log10abserr, glob_neg_h, glob_hmax, glob_clock_start_sec, glob_good_digits, array_const_0D0, array_const_1, array_y, array_x, array_m1, array_tmp2_g, array_type_pole, array_last_rel_error, array_tmp1_g, array_pole, array_1st_rel_error, array_norms, array_y_init, array_fact_1, array_tmp0, array_tmp1, array_tmp2, array_tmp3, array_tmp4, array_real_pole, array_y_higher, array_complex_pole, array_y_higher_work, array_y_higher_work2, array_y_set_initial, array_poles, array_fact_2, glob_last; hnew := h_param; glob_normmax := glob_small_float; if glob_small_float < omniabs(array_y_higher[1, 1]) then tmp := omniabs(array_y_higher[1, 1]); if tmp < glob_normmax then glob_normmax := tmp end if end if; if glob_look_poles and glob_small_float < omniabs(array_pole[1]) and array_pole[1] <> glob_large_float then sz2 := array_pole[1]/10.0; if sz2 < hnew then omniout_float(INFO, "glob_h adjusted to ", 20, h_param, 12, "due to singularity."); omniout_str(INFO, "Reached Optimal"); return hnew end if end if; if not glob_reached_optimal_h then glob_reached_optimal_h := true; glob_curr_iter_when_opt := glob_current_iter; glob_optimal_clock_start_sec := elapsed_time_seconds(); glob_optimal_start := array_x[1] end if; hnew := sz2; return hnew end proc > # Begin Function number 6 > prog_report := proc(x_start,x_end) > global > glob_iolevel, > DEBUGL, > INFO, > DEBUGMASSIVE, > ALWAYS, > glob_max_terms, > #Top Generate Globals Decl > glob_max_sec, > glob_max_iter, > glob_initial_pass, > days_in_year, > glob_current_iter, > glob_optimal_clock_start_sec, > glob_abserr, > glob_reached_optimal_h, > djd_debug2, > glob_subiter_method, > glob_curr_iter_when_opt, > glob_start, > glob_max_hours, > glob_log10_abserr, > glob_display_interval, > glob_optimal_expect_sec, > glob_max_minutes, > glob_orig_start_sec, > glob_look_poles, > glob_last_good_h, > glob_disp_incr, > glob_optimal_done, > djd_debug, > glob_max_opt_iter, > glob_log10relerr, > glob_small_float, > glob_dump_analytic, > glob_h, > glob_iter, > glob_warned2, > glob_max_trunc_err, > glob_max_rel_trunc_err, > glob_hmin, > min_in_hour, > glob_html_log, > glob_normmax, > glob_smallish_float, > glob_large_float, > glob_hmin_init, > glob_not_yet_finished, > glob_clock_sec, > centuries_in_millinium, > years_in_century, > glob_dump, > MAX_UNCHANGED, > glob_unchanged_h_cnt, > glob_no_eqs, > glob_not_yet_start_msg, > glob_percent_done, > glob_optimal_start, > glob_almost_1, > glob_display_flag, > glob_warned, > glob_relerr, > glob_log10_relerr, > glob_next_display, > hours_in_day, > sec_in_minute, > glob_log10normmin, > glob_log10abserr, > glob_neg_h, > glob_hmax, > glob_clock_start_sec, > glob_good_digits, > #Bottom Generate Globals Decl > #BEGIN CONST > array_const_0D0, > array_const_1, > #END CONST > array_y, > array_x, > array_m1, > array_tmp2_g, > array_type_pole, > array_last_rel_error, > array_tmp1_g, > array_pole, > array_1st_rel_error, > array_norms, > array_y_init, > array_fact_1, > array_tmp0, > array_tmp1, > array_tmp2, > array_tmp3, > array_tmp4, > array_real_pole, > array_y_higher, > array_complex_pole, > array_y_higher_work, > array_y_higher_work2, > array_y_set_initial, > array_poles, > array_fact_2, > glob_last; > > local clock_sec, opt_clock_sec, clock_sec1, expect_sec, left_sec, percent_done, total_clock_sec; > > > > > > #TOP PROGRESS REPORT > clock_sec1 := elapsed_time_seconds(); > total_clock_sec := convfloat(clock_sec1) - convfloat(glob_orig_start_sec); > glob_clock_sec := convfloat(clock_sec1) - convfloat(glob_clock_start_sec); > left_sec := convfloat(glob_max_sec) + convfloat(glob_orig_start_sec) - convfloat(clock_sec1); > expect_sec := comp_expect_sec(convfloat(x_end),convfloat(x_start),convfloat(array_x[1]) + convfloat(glob_h) ,convfloat( clock_sec1) - convfloat(glob_orig_start_sec)); > opt_clock_sec := convfloat( clock_sec1) - convfloat(glob_optimal_clock_start_sec); > glob_optimal_expect_sec := comp_expect_sec(convfloat(x_end),convfloat(x_start),convfloat(array_x[1]) +convfloat( glob_h) ,convfloat( opt_clock_sec)); > percent_done := comp_percent(convfloat(x_end),convfloat(x_start),convfloat(array_x[1]) + convfloat(glob_h)); > glob_percent_done := percent_done; > omniout_str_noeol(INFO,"Total Elapsed Time "); > omniout_timestr(convfloat(total_clock_sec)); > omniout_str_noeol(INFO,"Elapsed Time(since restart) "); > omniout_timestr(convfloat(glob_clock_sec)); > if (convfloat(percent_done) < convfloat(100.0)) then # if number 1 > omniout_str_noeol(INFO,"Expected Time Remaining "); > omniout_timestr(convfloat(expect_sec)); > omniout_str_noeol(INFO,"Optimized Time Remaining "); > omniout_timestr(convfloat(glob_optimal_expect_sec)); > fi;# end if 1 > ; > omniout_str_noeol(INFO,"Time to Timeout "); > omniout_timestr(convfloat(left_sec)); > omniout_float(INFO, "Percent Done ",33,percent_done,4,"%"); > #BOTTOM PROGRESS REPORT > > # End Function number 6 > end; prog_report := proc(x_start, x_end) local clock_sec, opt_clock_sec, clock_sec1, expect_sec, left_sec, percent_done, total_clock_sec; global glob_iolevel, DEBUGL, INFO, DEBUGMASSIVE, ALWAYS, glob_max_terms, glob_max_sec, glob_max_iter, glob_initial_pass, days_in_year, glob_current_iter, glob_optimal_clock_start_sec, glob_abserr, glob_reached_optimal_h, djd_debug2, glob_subiter_method, glob_curr_iter_when_opt, glob_start, glob_max_hours, glob_log10_abserr, glob_display_interval, glob_optimal_expect_sec, glob_max_minutes, glob_orig_start_sec, glob_look_poles, glob_last_good_h, glob_disp_incr, glob_optimal_done, djd_debug, glob_max_opt_iter, glob_log10relerr, glob_small_float, glob_dump_analytic, glob_h, glob_iter, glob_warned2, glob_max_trunc_err, glob_max_rel_trunc_err, glob_hmin, min_in_hour, glob_html_log, glob_normmax, glob_smallish_float, glob_large_float, glob_hmin_init, glob_not_yet_finished, glob_clock_sec, centuries_in_millinium, years_in_century, glob_dump, MAX_UNCHANGED, glob_unchanged_h_cnt, glob_no_eqs, glob_not_yet_start_msg, glob_percent_done, glob_optimal_start, glob_almost_1, glob_display_flag, glob_warned, glob_relerr, glob_log10_relerr, glob_next_display, hours_in_day, sec_in_minute, glob_log10normmin, glob_log10abserr, glob_neg_h, glob_hmax, glob_clock_start_sec, glob_good_digits, array_const_0D0, array_const_1, array_y, array_x, array_m1, array_tmp2_g, array_type_pole, array_last_rel_error, array_tmp1_g, array_pole, array_1st_rel_error, array_norms, array_y_init, array_fact_1, array_tmp0, array_tmp1, array_tmp2, array_tmp3, array_tmp4, array_real_pole, array_y_higher, array_complex_pole, array_y_higher_work, array_y_higher_work2, array_y_set_initial, array_poles, array_fact_2, glob_last; clock_sec1 := elapsed_time_seconds(); total_clock_sec := convfloat(clock_sec1) - convfloat(glob_orig_start_sec); glob_clock_sec := convfloat(clock_sec1) - convfloat(glob_clock_start_sec); left_sec := convfloat(glob_max_sec) + convfloat(glob_orig_start_sec) - convfloat(clock_sec1); expect_sec := comp_expect_sec(convfloat(x_end), convfloat(x_start), convfloat(array_x[1]) + convfloat(glob_h), convfloat(clock_sec1) - convfloat(glob_orig_start_sec)); opt_clock_sec := convfloat(clock_sec1) - convfloat(glob_optimal_clock_start_sec); glob_optimal_expect_sec := comp_expect_sec(convfloat(x_end), convfloat(x_start), convfloat(array_x[1]) + convfloat(glob_h), convfloat(opt_clock_sec)); percent_done := comp_percent(convfloat(x_end), convfloat(x_start), convfloat(array_x[1]) + convfloat(glob_h)); glob_percent_done := percent_done; omniout_str_noeol(INFO, "Total Elapsed Time "); omniout_timestr(convfloat(total_clock_sec)); omniout_str_noeol(INFO, "Elapsed Time(since restart) "); omniout_timestr(convfloat(glob_clock_sec)); if convfloat(percent_done) < convfloat(100.0) then omniout_str_noeol(INFO, "Expected Time Remaining "); omniout_timestr(convfloat(expect_sec)); omniout_str_noeol(INFO, "Optimized Time Remaining "); omniout_timestr(convfloat(glob_optimal_expect_sec)) end if; omniout_str_noeol(INFO, "Time to Timeout "); omniout_timestr(convfloat(left_sec)); omniout_float(INFO, "Percent Done ", 33, percent_done, 4, "%") end proc > # Begin Function number 7 > check_for_pole := proc() > global > glob_iolevel, > DEBUGL, > INFO, > DEBUGMASSIVE, > ALWAYS, > glob_max_terms, > #Top Generate Globals Decl > glob_max_sec, > glob_max_iter, > glob_initial_pass, > days_in_year, > glob_current_iter, > glob_optimal_clock_start_sec, > glob_abserr, > glob_reached_optimal_h, > djd_debug2, > glob_subiter_method, > glob_curr_iter_when_opt, > glob_start, > glob_max_hours, > glob_log10_abserr, > glob_display_interval, > glob_optimal_expect_sec, > glob_max_minutes, > glob_orig_start_sec, > glob_look_poles, > glob_last_good_h, > glob_disp_incr, > glob_optimal_done, > djd_debug, > glob_max_opt_iter, > glob_log10relerr, > glob_small_float, > glob_dump_analytic, > glob_h, > glob_iter, > glob_warned2, > glob_max_trunc_err, > glob_max_rel_trunc_err, > glob_hmin, > min_in_hour, > glob_html_log, > glob_normmax, > glob_smallish_float, > glob_large_float, > glob_hmin_init, > glob_not_yet_finished, > glob_clock_sec, > centuries_in_millinium, > years_in_century, > glob_dump, > MAX_UNCHANGED, > glob_unchanged_h_cnt, > glob_no_eqs, > glob_not_yet_start_msg, > glob_percent_done, > glob_optimal_start, > glob_almost_1, > glob_display_flag, > glob_warned, > glob_relerr, > glob_log10_relerr, > glob_next_display, > hours_in_day, > sec_in_minute, > glob_log10normmin, > glob_log10abserr, > glob_neg_h, > glob_hmax, > glob_clock_start_sec, > glob_good_digits, > #Bottom Generate Globals Decl > #BEGIN CONST > array_const_0D0, > array_const_1, > #END CONST > array_y, > array_x, > array_m1, > array_tmp2_g, > array_type_pole, > array_last_rel_error, > array_tmp1_g, > array_pole, > array_1st_rel_error, > array_norms, > array_y_init, > array_fact_1, > array_tmp0, > array_tmp1, > array_tmp2, > array_tmp3, > array_tmp4, > array_real_pole, > array_y_higher, > array_complex_pole, > array_y_higher_work, > array_y_higher_work2, > array_y_set_initial, > array_poles, > array_fact_2, > glob_last; > > local cnt, dr1, dr2, ds1, ds2, hdrc, m, n, nr1, nr2, ord_no, rad_c, rcs, rm0, rm1, rm2, rm3, rm4, found; > > > > > > #TOP CHECK FOR POLE > #IN RADII REAL EQ = 1 > #Computes radius of convergence and r_order of pole from 3 adjacent Taylor series terms. EQUATUON NUMBER 1 > #Applies to pole of arbitrary r_order on the real axis, > #Due to Prof. George Corliss. > n := glob_max_terms; > m := n - 1 - 1; > while ((m >= 10) and ((omniabs(array_y_higher[1,m]) < glob_small_float) or (omniabs(array_y_higher[1,m-1]) < glob_small_float) or (omniabs(array_y_higher[1,m-2]) < glob_small_float ))) do # do number 2 > m := m - 1; > od;# end do number 2 > ; > if (m > 10) then # if number 1 > rm0 := array_y_higher[1,m]/array_y_higher[1,m-1]; > rm1 := array_y_higher[1,m-1]/array_y_higher[1,m-2]; > hdrc := convfloat(m-1)*rm0-convfloat(m-2)*rm1; > if (omniabs(hdrc) > glob_small_float) then # if number 2 > rcs := glob_h/hdrc; > ord_no := convfloat(m-1)*rm0/hdrc - convfloat(m) + 2.0; > array_real_pole[1,1] := rcs; > array_real_pole[1,2] := ord_no; > else > array_real_pole[1,1] := glob_large_float; > array_real_pole[1,2] := glob_large_float; > fi;# end if 2 > else > array_real_pole[1,1] := glob_large_float; > array_real_pole[1,2] := glob_large_float; > fi;# end if 1 > ; > #BOTTOM RADII REAL EQ = 1 > #TOP RADII COMPLEX EQ = 1 > #Computes radius of convergence for complex conjugate pair of poles. > #from 6 adjacent Taylor series terms > #Also computes r_order of poles. > #Due to Manuel Prieto. > #With a correction by Dennis J. Darland > n := glob_max_terms - 1 - 1; > cnt := 0; > while ((cnt < 5) and (n >= 10)) do # do number 2 > if (omniabs(array_y_higher[1,n]) > glob_small_float) then # if number 1 > cnt := cnt + 1; > else > cnt := 0; > fi;# end if 1 > ; > n := n - 1; > od;# end do number 2 > ; > m := n + cnt; > if (m <= 10) then # if number 1 > array_complex_pole[1,1] := glob_large_float; > array_complex_pole[1,2] := glob_large_float; > elif ((omniabs(array_y_higher[1,m]) >= (glob_large_float)) or (omniabs(array_y_higher[1,m-1]) >=(glob_large_float)) or (omniabs(array_y_higher[1,m-2]) >= (glob_large_float)) or (omniabs(array_y_higher[1,m-3]) >= (glob_large_float)) or (omniabs(array_y_higher[1,m-4]) >= (glob_large_float)) or (omniabs(array_y_higher[1,m-5]) >= (glob_large_float))) then # if number 2 > array_complex_pole[1,1] := glob_large_float; > array_complex_pole[1,2] := glob_large_float; > else > rm0 := (array_y_higher[1,m])/(array_y_higher[1,m-1]); > rm1 := (array_y_higher[1,m-1])/(array_y_higher[1,m-2]); > rm2 := (array_y_higher[1,m-2])/(array_y_higher[1,m-3]); > rm3 := (array_y_higher[1,m-3])/(array_y_higher[1,m-4]); > rm4 := (array_y_higher[1,m-4])/(array_y_higher[1,m-5]); > nr1 := convfloat(m-1)*rm0 - 2.0*convfloat(m-2)*rm1 + convfloat(m-3)*rm2; > nr2 := convfloat(m-2)*rm1 - 2.0*convfloat(m-3)*rm2 + convfloat(m-4)*rm3; > dr1 := (-1.0)/rm1 + 2.0/rm2 - 1.0/rm3; > dr2 := (-1.0)/rm2 + 2.0/rm3 - 1.0/rm4; > ds1 := 3.0/rm1 - 8.0/rm2 + 5.0/rm3; > ds2 := 3.0/rm2 - 8.0/rm3 + 5.0/rm4; > if ((omniabs(nr1 * dr2 - nr2 * dr1) <= glob_small_float) or (omniabs(dr1) <= glob_small_float)) then # if number 3 > array_complex_pole[1,1] := glob_large_float; > array_complex_pole[1,2] := glob_large_float; > else > if (omniabs(nr1*dr2 - nr2 * dr1) > glob_small_float) then # if number 4 > rcs := ((ds1*dr2 - ds2*dr1 +dr1*dr2)/(nr1*dr2 - nr2 * dr1)); > #(Manuels) rcs := (ds1*dr2 - ds2*dr1)/(nr1*dr2 - nr2 * dr1) > ord_no := (rcs*nr1 - ds1)/(2.0*dr1) -convfloat(m)/2.0; > if (omniabs(rcs) > glob_small_float) then # if number 5 > if (rcs > 0.0) then # if number 6 > rad_c := sqrt(rcs) * omniabs(glob_h); > else > rad_c := glob_large_float; > fi;# end if 6 > else > rad_c := glob_large_float; > ord_no := glob_large_float; > fi;# end if 5 > else > rad_c := glob_large_float; > ord_no := glob_large_float; > fi;# end if 4 > fi;# end if 3 > ; > array_complex_pole[1,1] := rad_c; > array_complex_pole[1,2] := ord_no; > fi;# end if 2 > ; > #BOTTOM RADII COMPLEX EQ = 1 > found := false; > #TOP WHICH RADII EQ = 1 > if ( not found and ((array_real_pole[1,1] = glob_large_float) or (array_real_pole[1,2] = glob_large_float)) and ((array_complex_pole[1,1] <> glob_large_float) and (array_complex_pole[1,2] <> glob_large_float)) and ((array_complex_pole[1,1] > 0.0) and (array_complex_pole[1,2] > 0.0))) then # if number 2 > array_poles[1,1] := array_complex_pole[1,1]; > array_poles[1,2] := array_complex_pole[1,2]; > found := true; > array_type_pole[1] := 2; > if (glob_display_flag) then # if number 3 > omniout_str(ALWAYS,"Complex estimate of poles used"); > fi;# end if 3 > ; > fi;# end if 2 > ; > if ( not found and ((array_real_pole[1,1] <> glob_large_float) and (array_real_pole[1,2] <> glob_large_float) and (array_real_pole[1,1] > 0.0) and (array_real_pole[1,2] > 0.0) and ((array_complex_pole[1,1] = glob_large_float) or (array_complex_pole[1,2] = glob_large_float) or (array_complex_pole[1,1] <= 0.0 ) or (array_complex_pole[1,2] <= 0.0)))) then # if number 2 > array_poles[1,1] := array_real_pole[1,1]; > array_poles[1,2] := array_real_pole[1,2]; > found := true; > array_type_pole[1] := 1; > if (glob_display_flag) then # if number 3 > omniout_str(ALWAYS,"Real estimate of pole used"); > fi;# end if 3 > ; > fi;# end if 2 > ; > if ( not found and (((array_real_pole[1,1] = glob_large_float) or (array_real_pole[1,2] = glob_large_float)) and ((array_complex_pole[1,1] = glob_large_float) or (array_complex_pole[1,2] = glob_large_float)))) then # if number 2 > array_poles[1,1] := glob_large_float; > array_poles[1,2] := glob_large_float; > found := true; > array_type_pole[1] := 3; > if (reached_interval()) then # if number 3 > omniout_str(ALWAYS,"NO POLE"); > fi;# end if 3 > ; > fi;# end if 2 > ; > if ( not found and ((array_real_pole[1,1] < array_complex_pole[1,1]) and (array_real_pole[1,1] > 0.0) and (array_real_pole[1,2] > 0.0))) then # if number 2 > array_poles[1,1] := array_real_pole[1,1]; > array_poles[1,2] := array_real_pole[1,2]; > found := true; > array_type_pole[1] := 1; > if (glob_display_flag) then # if number 3 > omniout_str(ALWAYS,"Real estimate of pole used"); > fi;# end if 3 > ; > fi;# end if 2 > ; > if ( not found and ((array_complex_pole[1,1] <> glob_large_float) and (array_complex_pole[1,2] <> glob_large_float) and (array_complex_pole[1,1] > 0.0) and (array_complex_pole[1,2] > 0.0))) then # if number 2 > array_poles[1,1] := array_complex_pole[1,1]; > array_poles[1,2] := array_complex_pole[1,2]; > array_type_pole[1] := 2; > found := true; > if (glob_display_flag) then # if number 3 > omniout_str(ALWAYS,"Complex estimate of poles used"); > fi;# end if 3 > ; > fi;# end if 2 > ; > if ( not found ) then # if number 2 > array_poles[1,1] := glob_large_float; > array_poles[1,2] := glob_large_float; > array_type_pole[1] := 3; > if (reached_interval()) then # if number 3 > omniout_str(ALWAYS,"NO POLE"); > fi;# end if 3 > ; > fi;# end if 2 > ; > #BOTTOM WHICH RADII EQ = 1 > array_pole[1] := glob_large_float; > array_pole[2] := glob_large_float; > #TOP WHICH RADIUS EQ = 1 > if (array_pole[1] > array_poles[1,1]) then # if number 2 > array_pole[1] := array_poles[1,1]; > array_pole[2] := array_poles[1,2]; > fi;# end if 2 > ; > #BOTTOM WHICH RADIUS EQ = 1 > #BOTTOM CHECK FOR POLE > if (reached_interval()) then # if number 2 > display_pole(); > fi;# end if 2 > > # End Function number 7 > end; check_for_pole := proc() local cnt, dr1, dr2, ds1, ds2, hdrc, m, n, nr1, nr2, ord_no, rad_c, rcs, rm0, rm1, rm2, rm3, rm4, found; global glob_iolevel, DEBUGL, INFO, DEBUGMASSIVE, ALWAYS, glob_max_terms, glob_max_sec, glob_max_iter, glob_initial_pass, days_in_year, glob_current_iter, glob_optimal_clock_start_sec, glob_abserr, glob_reached_optimal_h, djd_debug2, glob_subiter_method, glob_curr_iter_when_opt, glob_start, glob_max_hours, glob_log10_abserr, glob_display_interval, glob_optimal_expect_sec, glob_max_minutes, glob_orig_start_sec, glob_look_poles, glob_last_good_h, glob_disp_incr, glob_optimal_done, djd_debug, glob_max_opt_iter, glob_log10relerr, glob_small_float, glob_dump_analytic, glob_h, glob_iter, glob_warned2, glob_max_trunc_err, glob_max_rel_trunc_err, glob_hmin, min_in_hour, glob_html_log, glob_normmax, glob_smallish_float, glob_large_float, glob_hmin_init, glob_not_yet_finished, glob_clock_sec, centuries_in_millinium, years_in_century, glob_dump, MAX_UNCHANGED, glob_unchanged_h_cnt, glob_no_eqs, glob_not_yet_start_msg, glob_percent_done, glob_optimal_start, glob_almost_1, glob_display_flag, glob_warned, glob_relerr, glob_log10_relerr, glob_next_display, hours_in_day, sec_in_minute, glob_log10normmin, glob_log10abserr, glob_neg_h, glob_hmax, glob_clock_start_sec, glob_good_digits, array_const_0D0, array_const_1, array_y, array_x, array_m1, array_tmp2_g, array_type_pole, array_last_rel_error, array_tmp1_g, array_pole, array_1st_rel_error, array_norms, array_y_init, array_fact_1, array_tmp0, array_tmp1, array_tmp2, array_tmp3, array_tmp4, array_real_pole, array_y_higher, array_complex_pole, array_y_higher_work, array_y_higher_work2, array_y_set_initial, array_poles, array_fact_2, glob_last; n := glob_max_terms; m := n - 2; while 10 <= m and (omniabs(array_y_higher[1, m]) < glob_small_float or omniabs(array_y_higher[1, m - 1]) < glob_small_float or omniabs(array_y_higher[1, m - 2]) < glob_small_float) do m := m - 1 end do; if 10 < m then rm0 := array_y_higher[1, m]/array_y_higher[1, m - 1]; rm1 := array_y_higher[1, m - 1]/array_y_higher[1, m - 2]; hdrc := convfloat(m - 1)*rm0 - convfloat(m - 2)*rm1; if glob_small_float < omniabs(hdrc) then rcs := glob_h/hdrc; ord_no := convfloat(m - 1)*rm0/hdrc - convfloat(m) + 2.0; array_real_pole[1, 1] := rcs; array_real_pole[1, 2] := ord_no else array_real_pole[1, 1] := glob_large_float; array_real_pole[1, 2] := glob_large_float end if else array_real_pole[1, 1] := glob_large_float; array_real_pole[1, 2] := glob_large_float end if; n := glob_max_terms - 2; cnt := 0; while cnt < 5 and 10 <= n do if glob_small_float < omniabs(array_y_higher[1, n]) then cnt := cnt + 1 else cnt := 0 end if; n := n - 1 end do; m := n + cnt; if m <= 10 then array_complex_pole[1, 1] := glob_large_float; array_complex_pole[1, 2] := glob_large_float elif glob_large_float <= omniabs(array_y_higher[1, m]) or glob_large_float <= omniabs(array_y_higher[1, m - 1]) or glob_large_float <= omniabs(array_y_higher[1, m - 2]) or glob_large_float <= omniabs(array_y_higher[1, m - 3]) or glob_large_float <= omniabs(array_y_higher[1, m - 4]) or glob_large_float <= omniabs(array_y_higher[1, m - 5]) then array_complex_pole[1, 1] := glob_large_float; array_complex_pole[1, 2] := glob_large_float else rm0 := array_y_higher[1, m]/array_y_higher[1, m - 1]; rm1 := array_y_higher[1, m - 1]/array_y_higher[1, m - 2]; rm2 := array_y_higher[1, m - 2]/array_y_higher[1, m - 3]; rm3 := array_y_higher[1, m - 3]/array_y_higher[1, m - 4]; rm4 := array_y_higher[1, m - 4]/array_y_higher[1, m - 5]; nr1 := convfloat(m - 1)*rm0 - 2.0*convfloat(m - 2)*rm1 + convfloat(m - 3)*rm2; nr2 := convfloat(m - 2)*rm1 - 2.0*convfloat(m - 3)*rm2 + convfloat(m - 4)*rm3; dr1 := (-1)*(1.0)/rm1 + 2.0/rm2 - 1.0/rm3; dr2 := (-1)*(1.0)/rm2 + 2.0/rm3 - 1.0/rm4; ds1 := 3.0/rm1 - 8.0/rm2 + 5.0/rm3; ds2 := 3.0/rm2 - 8.0/rm3 + 5.0/rm4; if omniabs(nr1*dr2 - nr2*dr1) <= glob_small_float or omniabs(dr1) <= glob_small_float then array_complex_pole[1, 1] := glob_large_float; array_complex_pole[1, 2] := glob_large_float else if glob_small_float < omniabs(nr1*dr2 - nr2*dr1) then rcs := (ds1*dr2 - ds2*dr1 + dr1*dr2)/(nr1*dr2 - nr2*dr1); ord_no := (rcs*nr1 - ds1)/(2.0*dr1) - convfloat(m)/2.0; if glob_small_float < omniabs(rcs) then if 0. < rcs then rad_c := sqrt(rcs)*omniabs(glob_h) else rad_c := glob_large_float end if else rad_c := glob_large_float; ord_no := glob_large_float end if else rad_c := glob_large_float; ord_no := glob_large_float end if end if; array_complex_pole[1, 1] := rad_c; array_complex_pole[1, 2] := ord_no end if; found := false; if not found and (array_real_pole[1, 1] = glob_large_float or array_real_pole[1, 2] = glob_large_float) and array_complex_pole[1, 1] <> glob_large_float and array_complex_pole[1, 2] <> glob_large_float and 0. < array_complex_pole[1, 1] and 0. < array_complex_pole[1, 2] then array_poles[1, 1] := array_complex_pole[1, 1]; array_poles[1, 2] := array_complex_pole[1, 2]; found := true; array_type_pole[1] := 2; if glob_display_flag then omniout_str(ALWAYS, "Complex estimate of poles used") end if end if; if not found and array_real_pole[1, 1] <> glob_large_float and array_real_pole[1, 2] <> glob_large_float and 0. < array_real_pole[1, 1] and 0. < array_real_pole[1, 2] and ( array_complex_pole[1, 1] = glob_large_float or array_complex_pole[1, 2] = glob_large_float or array_complex_pole[1, 1] <= 0. or array_complex_pole[1, 2] <= 0.) then array_poles[1, 1] := array_real_pole[1, 1]; array_poles[1, 2] := array_real_pole[1, 2]; found := true; array_type_pole[1] := 1; if glob_display_flag then omniout_str(ALWAYS, "Real estimate of pole used") end if end if; if not found and (array_real_pole[1, 1] = glob_large_float or array_real_pole[1, 2] = glob_large_float) and ( array_complex_pole[1, 1] = glob_large_float or array_complex_pole[1, 2] = glob_large_float) then array_poles[1, 1] := glob_large_float; array_poles[1, 2] := glob_large_float; found := true; array_type_pole[1] := 3; if reached_interval() then omniout_str(ALWAYS, "NO POLE") end if end if; if not found and array_real_pole[1, 1] < array_complex_pole[1, 1] and 0. < array_real_pole[1, 1] and 0. < array_real_pole[1, 2] then array_poles[1, 1] := array_real_pole[1, 1]; array_poles[1, 2] := array_real_pole[1, 2]; found := true; array_type_pole[1] := 1; if glob_display_flag then omniout_str(ALWAYS, "Real estimate of pole used") end if end if; if not found and array_complex_pole[1, 1] <> glob_large_float and array_complex_pole[1, 2] <> glob_large_float and 0. < array_complex_pole[1, 1] and 0. < array_complex_pole[1, 2] then array_poles[1, 1] := array_complex_pole[1, 1]; array_poles[1, 2] := array_complex_pole[1, 2]; array_type_pole[1] := 2; found := true; if glob_display_flag then omniout_str(ALWAYS, "Complex estimate of poles used") end if end if; if not found then array_poles[1, 1] := glob_large_float; array_poles[1, 2] := glob_large_float; array_type_pole[1] := 3; if reached_interval() then omniout_str(ALWAYS, "NO POLE") end if end if; array_pole[1] := glob_large_float; array_pole[2] := glob_large_float; if array_poles[1, 1] < array_pole[1] then array_pole[1] := array_poles[1, 1]; array_pole[2] := array_poles[1, 2] end if; if reached_interval() then display_pole() end if end proc > # Begin Function number 8 > get_norms := proc() > global > glob_iolevel, > DEBUGL, > INFO, > DEBUGMASSIVE, > ALWAYS, > glob_max_terms, > #Top Generate Globals Decl > glob_max_sec, > glob_max_iter, > glob_initial_pass, > days_in_year, > glob_current_iter, > glob_optimal_clock_start_sec, > glob_abserr, > glob_reached_optimal_h, > djd_debug2, > glob_subiter_method, > glob_curr_iter_when_opt, > glob_start, > glob_max_hours, > glob_log10_abserr, > glob_display_interval, > glob_optimal_expect_sec, > glob_max_minutes, > glob_orig_start_sec, > glob_look_poles, > glob_last_good_h, > glob_disp_incr, > glob_optimal_done, > djd_debug, > glob_max_opt_iter, > glob_log10relerr, > glob_small_float, > glob_dump_analytic, > glob_h, > glob_iter, > glob_warned2, > glob_max_trunc_err, > glob_max_rel_trunc_err, > glob_hmin, > min_in_hour, > glob_html_log, > glob_normmax, > glob_smallish_float, > glob_large_float, > glob_hmin_init, > glob_not_yet_finished, > glob_clock_sec, > centuries_in_millinium, > years_in_century, > glob_dump, > MAX_UNCHANGED, > glob_unchanged_h_cnt, > glob_no_eqs, > glob_not_yet_start_msg, > glob_percent_done, > glob_optimal_start, > glob_almost_1, > glob_display_flag, > glob_warned, > glob_relerr, > glob_log10_relerr, > glob_next_display, > hours_in_day, > sec_in_minute, > glob_log10normmin, > glob_log10abserr, > glob_neg_h, > glob_hmax, > glob_clock_start_sec, > glob_good_digits, > #Bottom Generate Globals Decl > #BEGIN CONST > array_const_0D0, > array_const_1, > #END CONST > array_y, > array_x, > array_m1, > array_tmp2_g, > array_type_pole, > array_last_rel_error, > array_tmp1_g, > array_pole, > array_1st_rel_error, > array_norms, > array_y_init, > array_fact_1, > array_tmp0, > array_tmp1, > array_tmp2, > array_tmp3, > array_tmp4, > array_real_pole, > array_y_higher, > array_complex_pole, > array_y_higher_work, > array_y_higher_work2, > array_y_set_initial, > array_poles, > array_fact_2, > glob_last; > > local iii; > > > > if ( not glob_initial_pass) then # if number 2 > iii := 1; > while (iii <= glob_max_terms) do # do number 2 > array_norms[iii] := 0.0; > iii := iii + 1; > od;# end do number 2 > ; > #TOP GET NORMS > iii := 1; > while (iii <= glob_max_terms) do # do number 2 > if (omniabs(array_y[iii]) > array_norms[iii]) then # if number 3 > array_norms[iii] := omniabs(array_y[iii]); > fi;# end if 3 > ; > iii := iii + 1; > od;# end do number 2 > #BOTTOM GET NORMS > ; > fi;# end if 2 > ; > > # End Function number 8 > end; get_norms := proc() local iii; global glob_iolevel, DEBUGL, INFO, DEBUGMASSIVE, ALWAYS, glob_max_terms, glob_max_sec, glob_max_iter, glob_initial_pass, days_in_year, glob_current_iter, glob_optimal_clock_start_sec, glob_abserr, glob_reached_optimal_h, djd_debug2, glob_subiter_method, glob_curr_iter_when_opt, glob_start, glob_max_hours, glob_log10_abserr, glob_display_interval, glob_optimal_expect_sec, glob_max_minutes, glob_orig_start_sec, glob_look_poles, glob_last_good_h, glob_disp_incr, glob_optimal_done, djd_debug, glob_max_opt_iter, glob_log10relerr, glob_small_float, glob_dump_analytic, glob_h, glob_iter, glob_warned2, glob_max_trunc_err, glob_max_rel_trunc_err, glob_hmin, min_in_hour, glob_html_log, glob_normmax, glob_smallish_float, glob_large_float, glob_hmin_init, glob_not_yet_finished, glob_clock_sec, centuries_in_millinium, years_in_century, glob_dump, MAX_UNCHANGED, glob_unchanged_h_cnt, glob_no_eqs, glob_not_yet_start_msg, glob_percent_done, glob_optimal_start, glob_almost_1, glob_display_flag, glob_warned, glob_relerr, glob_log10_relerr, glob_next_display, hours_in_day, sec_in_minute, glob_log10normmin, glob_log10abserr, glob_neg_h, glob_hmax, glob_clock_start_sec, glob_good_digits, array_const_0D0, array_const_1, array_y, array_x, array_m1, array_tmp2_g, array_type_pole, array_last_rel_error, array_tmp1_g, array_pole, array_1st_rel_error, array_norms, array_y_init, array_fact_1, array_tmp0, array_tmp1, array_tmp2, array_tmp3, array_tmp4, array_real_pole, array_y_higher, array_complex_pole, array_y_higher_work, array_y_higher_work2, array_y_set_initial, array_poles, array_fact_2, glob_last; if not glob_initial_pass then iii := 1; while iii <= glob_max_terms do array_norms[iii] := 0.; iii := iii + 1 end do; iii := 1; while iii <= glob_max_terms do if array_norms[iii] < omniabs(array_y[iii]) then array_norms[iii] := omniabs(array_y[iii]) end if; iii := iii + 1 end do end if end proc > # Begin Function number 9 > atomall := proc() > global > glob_iolevel, > DEBUGL, > INFO, > DEBUGMASSIVE, > ALWAYS, > glob_max_terms, > #Top Generate Globals Decl > glob_max_sec, > glob_max_iter, > glob_initial_pass, > days_in_year, > glob_current_iter, > glob_optimal_clock_start_sec, > glob_abserr, > glob_reached_optimal_h, > djd_debug2, > glob_subiter_method, > glob_curr_iter_when_opt, > glob_start, > glob_max_hours, > glob_log10_abserr, > glob_display_interval, > glob_optimal_expect_sec, > glob_max_minutes, > glob_orig_start_sec, > glob_look_poles, > glob_last_good_h, > glob_disp_incr, > glob_optimal_done, > djd_debug, > glob_max_opt_iter, > glob_log10relerr, > glob_small_float, > glob_dump_analytic, > glob_h, > glob_iter, > glob_warned2, > glob_max_trunc_err, > glob_max_rel_trunc_err, > glob_hmin, > min_in_hour, > glob_html_log, > glob_normmax, > glob_smallish_float, > glob_large_float, > glob_hmin_init, > glob_not_yet_finished, > glob_clock_sec, > centuries_in_millinium, > years_in_century, > glob_dump, > MAX_UNCHANGED, > glob_unchanged_h_cnt, > glob_no_eqs, > glob_not_yet_start_msg, > glob_percent_done, > glob_optimal_start, > glob_almost_1, > glob_display_flag, > glob_warned, > glob_relerr, > glob_log10_relerr, > glob_next_display, > hours_in_day, > sec_in_minute, > glob_log10normmin, > glob_log10abserr, > glob_neg_h, > glob_hmax, > glob_clock_start_sec, > glob_good_digits, > #Bottom Generate Globals Decl > #BEGIN CONST > array_const_0D0, > array_const_1, > #END CONST > array_y, > array_x, > array_m1, > array_tmp2_g, > array_type_pole, > array_last_rel_error, > array_tmp1_g, > array_pole, > array_1st_rel_error, > array_norms, > array_y_init, > array_fact_1, > array_tmp0, > array_tmp1, > array_tmp2, > array_tmp3, > array_tmp4, > array_real_pole, > array_y_higher, > array_complex_pole, > array_y_higher_work, > array_y_higher_work2, > array_y_set_initial, > array_poles, > array_fact_2, > glob_last; > > local kkk, order_d, adj2, temporary, term; > > > > > > #TOP ATOMALL > #END OUTFILE1 > #BEGIN ATOMHDR1 > #emit pre sin 1 $eq_no = 1 > array_tmp1[1] := sin(array_x[1]); > array_tmp1_g[1] := cos(array_x[1]); > #emit pre cos 1 $eq_no = 1 > array_tmp2[1] := cos(array_x[1]); > array_tmp2_g[1] := sin(array_x[1]); > # emit pre mult FULL FULL $eq_no = 1 i = 1 > array_tmp3[1] := (array_tmp1[1] * (array_tmp2[1])); > #emit pre add CONST FULL $eq_no = 1 i = 1 > array_tmp4[1] := array_const_0D0[1] + array_tmp3[1]; > #emit pre assign xxx $eq_no = 1 i = 1 $min_hdrs = 5 > if ( not array_y_set_initial[1,2]) then # if number 1 > if (1 <= glob_max_terms) then # if number 2 > temporary := array_tmp4[1] * expt(glob_h , (1)) * factorial_3(0,1); > array_y[2] := temporary; > array_y_higher[1,2] := temporary; > temporary := temporary / glob_h * (2.0); > array_y_higher[2,1] := temporary > ; > fi;# end if 2 > ; > fi;# end if 1 > ; > kkk := 2; > #END ATOMHDR1 > #BEGIN ATOMHDR2 > #emit pre sin ID_LINEAR iii = 2 $eq_no = 1 > array_tmp1[2] := array_tmp1_g[1] * array_x[2] / 1; > array_tmp1_g[2] := -array_tmp1[1] * array_x[2] / 1; > #emit pre cos ID_LINEAR iii = 2 $eq_no = 1 > array_tmp2[2] := -array_tmp2_g[1] * array_x[2] / 1; > array_tmp2_g[2] := array_tmp2[1] * array_x[2] / 1; > # emit pre mult FULL FULL $eq_no = 1 i = 2 > array_tmp3[2] := ats(2,array_tmp1,array_tmp2,1); > #emit pre add CONST FULL $eq_no = 1 i = 2 > array_tmp4[2] := array_tmp3[2]; > #emit pre assign xxx $eq_no = 1 i = 2 $min_hdrs = 5 > if ( not array_y_set_initial[1,3]) then # if number 1 > if (2 <= glob_max_terms) then # if number 2 > temporary := array_tmp4[2] * expt(glob_h , (1)) * factorial_3(1,2); > array_y[3] := temporary; > array_y_higher[1,3] := temporary; > temporary := temporary / glob_h * (2.0); > array_y_higher[2,2] := temporary > ; > fi;# end if 2 > ; > fi;# end if 1 > ; > kkk := 3; > #END ATOMHDR2 > #BEGIN ATOMHDR3 > #emit pre sin ID_LINEAR iii = 3 $eq_no = 1 > array_tmp1[3] := array_tmp1_g[2] * array_x[2] / 2; > array_tmp1_g[3] := -array_tmp1[2] * array_x[2] / 2; > #emit pre cos ID_LINEAR iii = 3 $eq_no = 1 > array_tmp2[3] := -array_tmp2_g[2] * array_x[2] / 2; > array_tmp2_g[3] := array_tmp2[2] * array_x[2] / 2; > # emit pre mult FULL FULL $eq_no = 1 i = 3 > array_tmp3[3] := ats(3,array_tmp1,array_tmp2,1); > #emit pre add CONST FULL $eq_no = 1 i = 3 > array_tmp4[3] := array_tmp3[3]; > #emit pre assign xxx $eq_no = 1 i = 3 $min_hdrs = 5 > if ( not array_y_set_initial[1,4]) then # if number 1 > if (3 <= glob_max_terms) then # if number 2 > temporary := array_tmp4[3] * expt(glob_h , (1)) * factorial_3(2,3); > array_y[4] := temporary; > array_y_higher[1,4] := temporary; > temporary := temporary / glob_h * (2.0); > array_y_higher[2,3] := temporary > ; > fi;# end if 2 > ; > fi;# end if 1 > ; > kkk := 4; > #END ATOMHDR3 > #BEGIN ATOMHDR4 > #emit pre sin ID_LINEAR iii = 4 $eq_no = 1 > array_tmp1[4] := array_tmp1_g[3] * array_x[2] / 3; > array_tmp1_g[4] := -array_tmp1[3] * array_x[2] / 3; > #emit pre cos ID_LINEAR iii = 4 $eq_no = 1 > array_tmp2[4] := -array_tmp2_g[3] * array_x[2] / 3; > array_tmp2_g[4] := array_tmp2[3] * array_x[2] / 3; > # emit pre mult FULL FULL $eq_no = 1 i = 4 > array_tmp3[4] := ats(4,array_tmp1,array_tmp2,1); > #emit pre add CONST FULL $eq_no = 1 i = 4 > array_tmp4[4] := array_tmp3[4]; > #emit pre assign xxx $eq_no = 1 i = 4 $min_hdrs = 5 > if ( not array_y_set_initial[1,5]) then # if number 1 > if (4 <= glob_max_terms) then # if number 2 > temporary := array_tmp4[4] * expt(glob_h , (1)) * factorial_3(3,4); > array_y[5] := temporary; > array_y_higher[1,5] := temporary; > temporary := temporary / glob_h * (2.0); > array_y_higher[2,4] := temporary > ; > fi;# end if 2 > ; > fi;# end if 1 > ; > kkk := 5; > #END ATOMHDR4 > #BEGIN ATOMHDR5 > #emit pre sin ID_LINEAR iii = 5 $eq_no = 1 > array_tmp1[5] := array_tmp1_g[4] * array_x[2] / 4; > array_tmp1_g[5] := -array_tmp1[4] * array_x[2] / 4; > #emit pre cos ID_LINEAR iii = 5 $eq_no = 1 > array_tmp2[5] := -array_tmp2_g[4] * array_x[2] / 4; > array_tmp2_g[5] := array_tmp2[4] * array_x[2] / 4; > # emit pre mult FULL FULL $eq_no = 1 i = 5 > array_tmp3[5] := ats(5,array_tmp1,array_tmp2,1); > #emit pre add CONST FULL $eq_no = 1 i = 5 > array_tmp4[5] := array_tmp3[5]; > #emit pre assign xxx $eq_no = 1 i = 5 $min_hdrs = 5 > if ( not array_y_set_initial[1,6]) then # if number 1 > if (5 <= glob_max_terms) then # if number 2 > temporary := array_tmp4[5] * expt(glob_h , (1)) * factorial_3(4,5); > array_y[6] := temporary; > array_y_higher[1,6] := temporary; > temporary := temporary / glob_h * (2.0); > array_y_higher[2,5] := temporary > ; > fi;# end if 2 > ; > fi;# end if 1 > ; > kkk := 6; > #END ATOMHDR5 > #BEGIN OUTFILE3 > #Top Atomall While Loop-- outfile3 > while (kkk <= glob_max_terms) do # do number 1 > #END OUTFILE3 > #BEGIN OUTFILE4 > #emit sin LINEAR $eq_no = 1 > array_tmp1[kkk] := array_tmp1_g[kkk - 1] * array_x[2] / (kkk - 1); > array_tmp1_g[kkk] := -array_tmp1[kkk - 1] * array_x[2] / (kkk - 1); > #emit cos LINEAR $eq_no = 1 > array_tmp2[kkk] := -array_tmp2_g[kkk - 1] * array_x[2] / (kkk - 1); > array_tmp2_g[kkk] := array_tmp2[kkk - 1] * array_x[2] / (kkk - 1); > #emit mult FULL FULL $eq_no = 1 > array_tmp3[kkk] := ats(kkk,array_tmp1,array_tmp2,1); > #emit NOT FULL - FULL add $eq_no = 1 > array_tmp4[kkk] := array_tmp3[kkk]; > #emit assign $eq_no = 1 > order_d := 1; > if (kkk + order_d + 1 <= glob_max_terms) then # if number 1 > if ( not array_y_set_initial[1,kkk + order_d]) then # if number 2 > temporary := array_tmp4[kkk] * expt(glob_h , (order_d)) / factorial_3((kkk - 1),(kkk + order_d - 1)); > array_y[kkk + order_d] := temporary; > array_y_higher[1,kkk + order_d] := temporary; > term := kkk + order_d - 1; > adj2 := 2; > while ((adj2 <= order_d + 1) and (term >= 1)) do # do number 2 > temporary := temporary / glob_h * convfp(adj2); > array_y_higher[adj2,term] := temporary; > adj2 := adj2 + 1; > term := term - 1; > od;# end do number 2 > fi;# end if 2 > fi;# end if 1 > ; > kkk := kkk + 1; > od;# end do number 1 > ; > #BOTTOM ATOMALL > #END OUTFILE4 > #BEGIN OUTFILE5 > > #BOTTOM ATOMALL ??? > # End Function number 9 > end; atomall := proc() local kkk, order_d, adj2, temporary, term; global glob_iolevel, DEBUGL, INFO, DEBUGMASSIVE, ALWAYS, glob_max_terms, glob_max_sec, glob_max_iter, glob_initial_pass, days_in_year, glob_current_iter, glob_optimal_clock_start_sec, glob_abserr, glob_reached_optimal_h, djd_debug2, glob_subiter_method, glob_curr_iter_when_opt, glob_start, glob_max_hours, glob_log10_abserr, glob_display_interval, glob_optimal_expect_sec, glob_max_minutes, glob_orig_start_sec, glob_look_poles, glob_last_good_h, glob_disp_incr, glob_optimal_done, djd_debug, glob_max_opt_iter, glob_log10relerr, glob_small_float, glob_dump_analytic, glob_h, glob_iter, glob_warned2, glob_max_trunc_err, glob_max_rel_trunc_err, glob_hmin, min_in_hour, glob_html_log, glob_normmax, glob_smallish_float, glob_large_float, glob_hmin_init, glob_not_yet_finished, glob_clock_sec, centuries_in_millinium, years_in_century, glob_dump, MAX_UNCHANGED, glob_unchanged_h_cnt, glob_no_eqs, glob_not_yet_start_msg, glob_percent_done, glob_optimal_start, glob_almost_1, glob_display_flag, glob_warned, glob_relerr, glob_log10_relerr, glob_next_display, hours_in_day, sec_in_minute, glob_log10normmin, glob_log10abserr, glob_neg_h, glob_hmax, glob_clock_start_sec, glob_good_digits, array_const_0D0, array_const_1, array_y, array_x, array_m1, array_tmp2_g, array_type_pole, array_last_rel_error, array_tmp1_g, array_pole, array_1st_rel_error, array_norms, array_y_init, array_fact_1, array_tmp0, array_tmp1, array_tmp2, array_tmp3, array_tmp4, array_real_pole, array_y_higher, array_complex_pole, array_y_higher_work, array_y_higher_work2, array_y_set_initial, array_poles, array_fact_2, glob_last; array_tmp1[1] := sin(array_x[1]); array_tmp1_g[1] := cos(array_x[1]); array_tmp2[1] := cos(array_x[1]); array_tmp2_g[1] := sin(array_x[1]); array_tmp3[1] := array_tmp1[1]*array_tmp2[1]; array_tmp4[1] := array_const_0D0[1] + array_tmp3[1]; if not array_y_set_initial[1, 2] then if 1 <= glob_max_terms then temporary := array_tmp4[1]*expt(glob_h, 1)*factorial_3(0, 1); array_y[2] := temporary; array_y_higher[1, 2] := temporary; temporary := temporary*2.0/glob_h; array_y_higher[2, 1] := temporary end if end if; kkk := 2; array_tmp1[2] := array_tmp1_g[1]*array_x[2]; array_tmp1_g[2] := -array_tmp1[1]*array_x[2]; array_tmp2[2] := -array_tmp2_g[1]*array_x[2]; array_tmp2_g[2] := array_tmp2[1]*array_x[2]; array_tmp3[2] := ats(2, array_tmp1, array_tmp2, 1); array_tmp4[2] := array_tmp3[2]; if not array_y_set_initial[1, 3] then if 2 <= glob_max_terms then temporary := array_tmp4[2]*expt(glob_h, 1)*factorial_3(1, 2); array_y[3] := temporary; array_y_higher[1, 3] := temporary; temporary := temporary*2.0/glob_h; array_y_higher[2, 2] := temporary end if end if; kkk := 3; array_tmp1[3] := 1/2*array_tmp1_g[2]*array_x[2]; array_tmp1_g[3] := -1/2*array_tmp1[2]*array_x[2]; array_tmp2[3] := -1/2*array_tmp2_g[2]*array_x[2]; array_tmp2_g[3] := 1/2*array_tmp2[2]*array_x[2]; array_tmp3[3] := ats(3, array_tmp1, array_tmp2, 1); array_tmp4[3] := array_tmp3[3]; if not array_y_set_initial[1, 4] then if 3 <= glob_max_terms then temporary := array_tmp4[3]*expt(glob_h, 1)*factorial_3(2, 3); array_y[4] := temporary; array_y_higher[1, 4] := temporary; temporary := temporary*2.0/glob_h; array_y_higher[2, 3] := temporary end if end if; kkk := 4; array_tmp1[4] := 1/3*array_tmp1_g[3]*array_x[2]; array_tmp1_g[4] := -1/3*array_tmp1[3]*array_x[2]; array_tmp2[4] := -1/3*array_tmp2_g[3]*array_x[2]; array_tmp2_g[4] := 1/3*array_tmp2[3]*array_x[2]; array_tmp3[4] := ats(4, array_tmp1, array_tmp2, 1); array_tmp4[4] := array_tmp3[4]; if not array_y_set_initial[1, 5] then if 4 <= glob_max_terms then temporary := array_tmp4[4]*expt(glob_h, 1)*factorial_3(3, 4); array_y[5] := temporary; array_y_higher[1, 5] := temporary; temporary := temporary*2.0/glob_h; array_y_higher[2, 4] := temporary end if end if; kkk := 5; array_tmp1[5] := 1/4*array_tmp1_g[4]*array_x[2]; array_tmp1_g[5] := -1/4*array_tmp1[4]*array_x[2]; array_tmp2[5] := -1/4*array_tmp2_g[4]*array_x[2]; array_tmp2_g[5] := 1/4*array_tmp2[4]*array_x[2]; array_tmp3[5] := ats(5, array_tmp1, array_tmp2, 1); array_tmp4[5] := array_tmp3[5]; if not array_y_set_initial[1, 6] then if 5 <= glob_max_terms then temporary := array_tmp4[5]*expt(glob_h, 1)*factorial_3(4, 5); array_y[6] := temporary; array_y_higher[1, 6] := temporary; temporary := temporary*2.0/glob_h; array_y_higher[2, 5] := temporary end if end if; kkk := 6; while kkk <= glob_max_terms do array_tmp1[kkk] := array_tmp1_g[kkk - 1]*array_x[2]/(kkk - 1); array_tmp1_g[kkk] := -array_tmp1[kkk - 1]*array_x[2]/(kkk - 1); array_tmp2[kkk] := -array_tmp2_g[kkk - 1]*array_x[2]/(kkk - 1); array_tmp2_g[kkk] := array_tmp2[kkk - 1]*array_x[2]/(kkk - 1); array_tmp3[kkk] := ats(kkk, array_tmp1, array_tmp2, 1); array_tmp4[kkk] := array_tmp3[kkk]; order_d := 1; if kkk + order_d + 1 <= glob_max_terms then if not array_y_set_initial[1, kkk + order_d] then temporary := array_tmp4[kkk]*expt(glob_h, order_d)/ factorial_3(kkk - 1, kkk + order_d - 1); array_y[kkk + order_d] := temporary; array_y_higher[1, kkk + order_d] := temporary; term := kkk + order_d - 1; adj2 := 2; while adj2 <= order_d + 1 and 1 <= term do temporary := temporary*convfp(adj2)/glob_h; array_y_higher[adj2, term] := temporary; adj2 := adj2 + 1; term := term - 1 end do end if end if; kkk := kkk + 1 end do end proc > #BEGIN ATS LIBRARY BLOCK > omniout_str := proc(iolevel,str) > global glob_iolevel; > if (glob_iolevel >= iolevel) then > printf("%s\n",str); > fi; > # End Function number 1 > end; omniout_str := proc(iolevel, str) global glob_iolevel; if iolevel <= glob_iolevel then printf("%s\n", str) end if end proc > omniout_str_noeol := proc(iolevel,str) > global glob_iolevel; > if (glob_iolevel >= iolevel) then > printf("%s",str); > fi; > # End Function number 1 > end; omniout_str_noeol := proc(iolevel, str) global glob_iolevel; if iolevel <= glob_iolevel then printf("%s", str) end if end proc > omniout_labstr := proc(iolevel,label,str) > global glob_iolevel; > if (glob_iolevel >= iolevel) then > print(label,str); > fi; > # End Function number 1 > end; omniout_labstr := proc(iolevel, label, str) global glob_iolevel; if iolevel <= glob_iolevel then print(label, str) end if end proc > omniout_float := proc(iolevel,prelabel,prelen,value,vallen,postlabel) > global glob_iolevel; > if (glob_iolevel >= iolevel) then > if vallen = 4 then > printf("%-30s = %-42.4g %s \n",prelabel,value, postlabel); > else > printf("%-30s = %-42.32g %s \n",prelabel,value, postlabel); > fi; > fi; > # End Function number 1 > end; omniout_float := proc(iolevel, prelabel, prelen, value, vallen, postlabel) global glob_iolevel; if iolevel <= glob_iolevel then if vallen = 4 then printf("%-30s = %-42.4g %s \n", prelabel, value, postlabel) else printf("%-30s = %-42.32g %s \n", prelabel, value, postlabel) end if end if end proc > omniout_int := proc(iolevel,prelabel,prelen,value,vallen,postlabel) > global glob_iolevel; > if (glob_iolevel >= iolevel) then > if vallen = 5 then > printf("%-30s = %-32d %s\n",prelabel,value, postlabel); > else > printf("%-30s = %-32d %s \n",prelabel,value, postlabel); > fi; > fi; > # End Function number 1 > end; omniout_int := proc(iolevel, prelabel, prelen, value, vallen, postlabel) global glob_iolevel; if iolevel <= glob_iolevel then if vallen = 5 then printf("%-30s = %-32d %s\n", prelabel, value, postlabel) else printf("%-30s = %-32d %s \n", prelabel, value, postlabel) end if end if end proc > omniout_float_arr := proc(iolevel,prelabel,elemnt,prelen,value,vallen,postlabel) > global glob_iolevel; > if (glob_iolevel >= iolevel) then > print(prelabel,"[",elemnt,"]",value, postlabel); > fi; > # End Function number 1 > end; omniout_float_arr := proc( iolevel, prelabel, elemnt, prelen, value, vallen, postlabel) global glob_iolevel; if iolevel <= glob_iolevel then print(prelabel, "[", elemnt, "]", value, postlabel) end if end proc > dump_series := proc(iolevel,dump_label,series_name, > array_series,numb) > global glob_iolevel; > local i; > if (glob_iolevel >= iolevel) then > i := 1; > while (i <= numb) do > print(dump_label,series_name > ,i,array_series[i]); > i := i + 1; > od; > fi; > # End Function number 1 > end; dump_series := proc(iolevel, dump_label, series_name, array_series, numb) local i; global glob_iolevel; if iolevel <= glob_iolevel then i := 1; while i <= numb do print(dump_label, series_name, i, array_series[i]); i := i + 1 end do end if end proc > dump_series_2 := proc(iolevel,dump_label,series_name2, > array_series2,numb,subnum,array_x) > global glob_iolevel; > local i,sub,ts_term; > if (glob_iolevel >= iolevel) then > sub := 1; > while (sub <= subnum) do > i := 1; > while (i <= numb) do > print(dump_label,series_name2,sub,i,array_series2[sub,i]); > od; > sub := sub + 1; > od; > fi; > # End Function number 1 > end; dump_series_2 := proc( iolevel, dump_label, series_name2, array_series2, numb, subnum, array_x) local i, sub, ts_term; global glob_iolevel; if iolevel <= glob_iolevel then sub := 1; while sub <= subnum do i := 1; while i <= numb do print(dump_label, series_name2, sub, i, array_series2[sub, i]) end do; sub := sub + 1 end do end if end proc > cs_info := proc(iolevel,str) > global glob_iolevel,glob_correct_start_flag,glob_h,glob_reached_optimal_h; > if (glob_iolevel >= iolevel) then > print("cs_info " , str , " glob_correct_start_flag = " , glob_correct_start_flag , "glob_h := " , glob_h , "glob_reached_optimal_h := " , glob_reached_optimal_h) > fi; > # End Function number 1 > end; cs_info := proc(iolevel, str) global glob_iolevel, glob_correct_start_flag, glob_h, glob_reached_optimal_h; if iolevel <= glob_iolevel then print("cs_info ", str, " glob_correct_start_flag = ", glob_correct_start_flag, "glob_h := ", glob_h, "glob_reached_optimal_h := ", glob_reached_optimal_h) end if end proc > # Begin Function number 2 > logitem_time := proc(fd,secs_in) > global centuries_in_millinium, days_in_year, hours_in_day, min_in_hour, sec_in_minute, years_in_century; > local cent_int, centuries, days, days_int, hours, hours_int, millinium_int, milliniums, minutes, minutes_int, sec_in_millinium, sec_int, seconds, secs, years, years_int; > secs := (secs_in); > fprintf(fd,""); > if (secs >= 0.0) then # if number 1 > sec_in_millinium := convfloat(sec_in_minute * min_in_hour * hours_in_day * days_in_year * years_in_century * centuries_in_millinium); > milliniums := convfloat(secs / sec_in_millinium); > millinium_int := floor(milliniums); > centuries := (milliniums - millinium_int)*centuries_in_millinium; > cent_int := floor(centuries); > years := (centuries - cent_int) * years_in_century; > years_int := floor(years); > days := (years - years_int) * days_in_year; > days_int := floor(days); > hours := (days - days_int) * hours_in_day; > hours_int := floor(hours); > minutes := (hours - hours_int) * min_in_hour; > minutes_int := floor(minutes); > seconds := (minutes - minutes_int) * sec_in_minute; > sec_int := floor(seconds); > if (millinium_int > 0) then # if number 2 > fprintf(fd,"%d Millinia %d Centuries %d Years %d Days %d Hours %d Minutes %d Seconds",millinium_int,cent_int,years_int,days_int,hours_int,minutes_int,sec_int); > elif (cent_int > 0) then # if number 3 > fprintf(fd,"%d Centuries %d Years %d Days %d Hours %d Minutes %d Seconds",cent_int,years_int,days_int,hours_int,minutes_int,sec_int); > elif (years_int > 0) then # if number 4 > fprintf(fd,"%d Years %d Days %d Hours %d Minutes %d Seconds",years_int,days_int,hours_int,minutes_int,sec_int); > elif (days_int > 0) then # if number 5 > fprintf(fd,"%d Days %d Hours %d Minutes %d Seconds",days_int,hours_int,minutes_int,sec_int); > elif (hours_int > 0) then # if number 6 > fprintf(fd,"%d Hours %d Minutes %d Seconds",hours_int,minutes_int,sec_int); > elif (minutes_int > 0) then # if number 7 > fprintf(fd,"%d Minutes %d Seconds",minutes_int,sec_int); > else > fprintf(fd,"%d Seconds",sec_int); > fi;# end if 7 > else > fprintf(fd,"Unknown"); > fi;# end if 6 > fprintf(fd,""); > # End Function number 2 > end; logitem_time := proc(fd, secs_in) local cent_int, centuries, days, days_int, hours, hours_int, millinium_int, milliniums, minutes, minutes_int, sec_in_millinium, sec_int, seconds, secs, years, years_int; global centuries_in_millinium, days_in_year, hours_in_day, min_in_hour, sec_in_minute, years_in_century; secs := secs_in; fprintf(fd, ""); if 0. <= secs then sec_in_millinium := convfloat(sec_in_minute*min_in_hour* hours_in_day*days_in_year*years_in_century* centuries_in_millinium); milliniums := convfloat(secs/sec_in_millinium); millinium_int := floor(milliniums); centuries := (milliniums - millinium_int)*centuries_in_millinium; cent_int := floor(centuries); years := (centuries - cent_int)*years_in_century; years_int := floor(years); days := (years - years_int)*days_in_year; days_int := floor(days); hours := (days - days_int)*hours_in_day; hours_int := floor(hours); minutes := (hours - hours_int)*min_in_hour; minutes_int := floor(minutes); seconds := (minutes - minutes_int)*sec_in_minute; sec_int := floor(seconds); if 0 < millinium_int then fprintf(fd, "%d Millinia %d Centuries %\ d Years %d Days %d Hours %d Minutes %d Seconds", millinium_int, cent_int, years_int, days_int, hours_int, minutes_int, sec_int) elif 0 < cent_int then fprintf(fd, "%d Centuries %d Years %d Days %d Hours %d Minutes %d Seconds", cent_int, years_int, days_int, hours_int, minutes_int, sec_int) elif 0 < years_int then fprintf(fd, "%d Years %d Days %d Hours %d Minutes %d Seconds", years_int, days_int, hours_int, minutes_int, sec_int) elif 0 < days_int then fprintf(fd, "%d Days %d Hours %d Minutes %d Seconds", days_int, hours_int, minutes_int, sec_int) elif 0 < hours_int then fprintf(fd, "%d Hours %d Minutes %d Seconds", hours_int, minutes_int, sec_int) elif 0 < minutes_int then fprintf(fd, "%d Minutes %d Seconds", minutes_int, sec_int) else fprintf(fd, "%d Seconds", sec_int) end if else fprintf(fd, "Unknown") end if; fprintf(fd, "") end proc > omniout_timestr := proc (secs_in) > global centuries_in_millinium, days_in_year, hours_in_day, min_in_hour, sec_in_minute, years_in_century; > local cent_int, centuries, days, days_int, hours, hours_int, millinium_int, milliniums, minutes, minutes_int, sec_in_millinium, sec_int, seconds, secs, years, years_int; > secs := convfloat(secs_in); > if (secs >= 0.0) then # if number 6 > sec_in_millinium := convfloat(sec_in_minute * min_in_hour * hours_in_day * days_in_year * years_in_century * centuries_in_millinium); > milliniums := convfloat(secs / sec_in_millinium); > millinium_int := floor(milliniums); > centuries := (milliniums - millinium_int)*centuries_in_millinium; > cent_int := floor(centuries); > years := (centuries - cent_int) * years_in_century; > years_int := floor(years); > days := (years - years_int) * days_in_year; > days_int := floor(days); > hours := (days - days_int) * hours_in_day; > hours_int := floor(hours); > minutes := (hours - hours_int) * min_in_hour; > minutes_int := floor(minutes); > seconds := (minutes - minutes_int) * sec_in_minute; > sec_int := floor(seconds); > > if (millinium_int > 0) then # if number 7 > printf(" = %d Millinia %d Centuries %d Years %d Days %d Hours %d Minutes %d Seconds\n",millinium_int,cent_int,years_int,days_int,hours_int,minutes_int,sec_int); > elif (cent_int > 0) then # if number 8 > printf(" = %d Centuries %d Years %d Days %d Hours %d Minutes %d Seconds\n",cent_int,years_int,days_int,hours_int,minutes_int,sec_int); > elif (years_int > 0) then # if number 9 > printf(" = %d Years %d Days %d Hours %d Minutes %d Seconds\n",years_int,days_int,hours_int,minutes_int,sec_int); > elif (days_int > 0) then # if number 10 > printf(" = %d Days %d Hours %d Minutes %d Seconds\n",days_int,hours_int,minutes_int,sec_int); > elif (hours_int > 0) then # if number 11 > printf(" = %d Hours %d Minutes %d Seconds\n",hours_int,minutes_int,sec_int); > elif (minutes_int > 0) then # if number 12 > printf(" = %d Minutes %d Seconds\n",minutes_int,sec_int); > else > printf(" = %d Seconds\n",sec_int); > fi;# end if 12 > else > printf(" Unknown\n"); > fi;# end if 11 > # End Function number 2 > end; omniout_timestr := proc(secs_in) local cent_int, centuries, days, days_int, hours, hours_int, millinium_int, milliniums, minutes, minutes_int, sec_in_millinium, sec_int, seconds, secs, years, years_int; global centuries_in_millinium, days_in_year, hours_in_day, min_in_hour, sec_in_minute, years_in_century; secs := convfloat(secs_in); if 0. <= secs then sec_in_millinium := convfloat(sec_in_minute*min_in_hour* hours_in_day*days_in_year*years_in_century* centuries_in_millinium); milliniums := convfloat(secs/sec_in_millinium); millinium_int := floor(milliniums); centuries := (milliniums - millinium_int)*centuries_in_millinium; cent_int := floor(centuries); years := (centuries - cent_int)*years_in_century; years_int := floor(years); days := (years - years_int)*days_in_year; days_int := floor(days); hours := (days - days_int)*hours_in_day; hours_int := floor(hours); minutes := (hours - hours_int)*min_in_hour; minutes_int := floor(minutes); seconds := (minutes - minutes_int)*sec_in_minute; sec_int := floor(seconds); if 0 < millinium_int then printf(" = %d Millinia %d Centuries %d\ Years %d Days %d Hours %d Minutes %d Seconds\n", millinium_int, cent_int, years_int, days_int, hours_int, minutes_int, sec_int) elif 0 < cent_int then printf(" = %d Centuries %d Years %d Days \ %d Hours %d Minutes %d Seconds\n", cent_int, years_int, days_int, hours_int, minutes_int, sec_int) elif 0 < years_int then printf( " = %d Years %d Days %d Hours %d Minutes %d Seconds\n", years_int, days_int, hours_int, minutes_int, sec_int) elif 0 < days_int then printf( " = %d Days %d Hours %d Minutes %d Seconds\n", days_int, hours_int, minutes_int, sec_int) elif 0 < hours_int then printf( " = %d Hours %d Minutes %d Seconds\n", hours_int, minutes_int, sec_int) elif 0 < minutes_int then printf(" = %d Minutes %d Seconds\n", minutes_int, sec_int) else printf(" = %d Seconds\n", sec_int) end if else printf(" Unknown\n") end if end proc > # Begin Function number 3 > ats := proc( > mmm_ats,array_a,array_b,jjj_ats) > local iii_ats, lll_ats,ma_ats, ret_ats; > > > > > > ret_ats := 0.0; > if (jjj_ats <= mmm_ats) then # if number 11 > ma_ats := mmm_ats + 1; > iii_ats := jjj_ats; > while (iii_ats <= mmm_ats) do # do number 1 > lll_ats := ma_ats - iii_ats; > ret_ats := ret_ats + array_a[iii_ats]*array_b[lll_ats]; > iii_ats := iii_ats + 1; > od;# end do number 1 > fi;# end if 11 > ; > ret_ats; > > # End Function number 3 > end; ats := proc(mmm_ats, array_a, array_b, jjj_ats) local iii_ats, lll_ats, ma_ats, ret_ats; ret_ats := 0.; if jjj_ats <= mmm_ats then ma_ats := mmm_ats + 1; iii_ats := jjj_ats; while iii_ats <= mmm_ats do lll_ats := ma_ats - iii_ats; ret_ats := ret_ats + array_a[iii_ats]*array_b[lll_ats]; iii_ats := iii_ats + 1 end do end if; ret_ats end proc > # Begin Function number 4 > att := proc( > mmm_att,array_aa,array_bb,jjj_att) > global glob_max_terms; > local al_att, iii_att,lll_att, ma_att, ret_att; > > > > > > ret_att := 0.0; > if (jjj_att <= mmm_att) then # if number 11 > ma_att := mmm_att + 2; > iii_att := jjj_att; > while (iii_att <= mmm_att) do # do number 1 > lll_att := ma_att - iii_att; > al_att := (lll_att - 1); > if (lll_att <= glob_max_terms) then # if number 12 > ret_att := ret_att + array_aa[iii_att]*array_bb[lll_att]* convfp(al_att); > fi;# end if 12 > ; > iii_att := iii_att + 1; > od;# end do number 1 > ; > ret_att := ret_att / convfp(mmm_att) ; > fi;# end if 11 > ; > ret_att; > > # End Function number 4 > end; att := proc(mmm_att, array_aa, array_bb, jjj_att) local al_att, iii_att, lll_att, ma_att, ret_att; global glob_max_terms; ret_att := 0.; if jjj_att <= mmm_att then ma_att := mmm_att + 2; iii_att := jjj_att; while iii_att <= mmm_att do lll_att := ma_att - iii_att; al_att := lll_att - 1; if lll_att <= glob_max_terms then ret_att := ret_att + array_aa[iii_att]*array_bb[lll_att]*convfp(al_att) end if; iii_att := iii_att + 1 end do; ret_att := ret_att/convfp(mmm_att) end if; ret_att end proc > # Begin Function number 5 > display_pole := proc() > global ALWAYS,glob_display_flag, glob_large_float, array_pole; > if ((array_pole[1] <> glob_large_float) and (array_pole[1] > 0.0) and (array_pole[2] <> glob_large_float) and (array_pole[2]> 0.0) and glob_display_flag) then # if number 11 > omniout_float(ALWAYS,"Radius of convergence ",4, array_pole[1],4," "); > omniout_float(ALWAYS,"Order of pole ",4, array_pole[2],4," "); > fi;# end if 11 > # End Function number 5 > end; display_pole := proc() global ALWAYS, glob_display_flag, glob_large_float, array_pole; if array_pole[1] <> glob_large_float and 0. < array_pole[1] and array_pole[2] <> glob_large_float and 0. < array_pole[2] and glob_display_flag then omniout_float(ALWAYS, "Radius of convergence ", 4, array_pole[1], 4, " "); omniout_float(ALWAYS, "Order of pole ", 4, array_pole[2], 4, " ") end if end proc > # Begin Function number 6 > logditto := proc(file) > fprintf(file,""); > fprintf(file,"ditto"); > fprintf(file,""); > # End Function number 6 > end; logditto := proc(file) fprintf(file, ""); fprintf(file, "ditto"); fprintf(file, "") end proc > # Begin Function number 7 > logitem_integer := proc(file,n) > fprintf(file,""); > fprintf(file,"%d",n); > fprintf(file,""); > # End Function number 7 > end; logitem_integer := proc(file, n) fprintf(file, ""); fprintf(file, "%d", n); fprintf(file, "") end proc > # Begin Function number 8 > logitem_str := proc(file,str) > fprintf(file,""); > fprintf(file,str); > fprintf(file,""); > # End Function number 8 > end; logitem_str := proc(file, str) fprintf(file, ""); fprintf(file, str); fprintf(file, "") end proc > # Begin Function number 9 > logitem_good_digits := proc(file,rel_error) > global glob_small_float; > > local good_digits; > > > fprintf(file,""); > if (rel_error <> -1.0) then # if number 11 > if (rel_error <> 0.0) then # if number 12 > good_digits := -trunc(log10(rel_error/100.0)); > fprintf(file,"%d",good_digits); > else > good_digits := Digits; > fprintf(file,"%d",good_digits); > fi;# end if 12 > ; > else > fprintf(file,"Unknown"); > fi;# end if 11 > ; > fprintf(file,""); > > # End Function number 9 > end; logitem_good_digits := proc(file, rel_error) local good_digits; global glob_small_float; fprintf(file, ""); if rel_error <> -1.0 then if rel_error <> 0. then good_digits := -trunc(log10(rel_error/100.0)); fprintf(file, "%d", good_digits) else good_digits := Digits; fprintf(file, "%d", good_digits) end if else fprintf(file, "Unknown") end if; fprintf(file, "") end proc > # Begin Function number 10 > log_revs := proc(file,revs) > fprintf(file,revs); > # End Function number 10 > end; log_revs := proc(file, revs) fprintf(file, revs) end proc > # Begin Function number 11 > logitem_float := proc(file,x) > fprintf(file,""); > fprintf(file,"%g",x); > fprintf(file,""); > # End Function number 11 > end; logitem_float := proc(file, x) fprintf(file, ""); fprintf(file, "%g", x); fprintf(file, "") end proc > # Begin Function number 12 > logitem_pole := proc(file,pole) > fprintf(file,""); > if (pole = 0) then # if number 11 > fprintf(file,"NA"); > elif (pole = 1) then # if number 12 > fprintf(file,"Real"); > elif (pole = 2) then # if number 13 > fprintf(file,"Complex"); > else > fprintf(file,"No Pole"); > fi;# end if 13 > fprintf(file,""); > # End Function number 12 > end; logitem_pole := proc(file, pole) fprintf(file, ""); if pole = 0 then fprintf(file, "NA") elif pole = 1 then fprintf(file, "Real") elif pole = 2 then fprintf(file, "Complex") else fprintf(file, "No Pole") end if; fprintf(file, "") end proc > # Begin Function number 13 > logstart := proc(file) > fprintf(file,""); > # End Function number 13 > end; logstart := proc(file) fprintf(file, "") end proc > # Begin Function number 14 > logend := proc(file) > fprintf(file,"\n"); > # End Function number 14 > end; logend := proc(file) fprintf(file, "\n") end proc > # Begin Function number 15 > not_reached_end := proc(x,x_end) > global neg_h; > local ret; > > > > if ((glob_neg_h and (x > x_end)) or (( not glob_neg_h) and (x < x_end))) then # if number 13 > ret := true; > else > ret := false; > fi;# end if 13 > ; > > > ret; > > # End Function number 15 > end; not_reached_end := proc(x, x_end) local ret; global neg_h; if glob_neg_h and x_end < x or not glob_neg_h and x < x_end then ret := true else ret := false end if; ret end proc > # Begin Function number 16 > chk_data := proc() > global glob_max_iter,ALWAYS, glob_max_terms; > local errflag; > > > > errflag := false; > > if ((glob_max_terms < 15) or (glob_max_terms > 512)) then # if number 13 > omniout_str(ALWAYS,"Illegal max_terms = -- Using 30"); > glob_max_terms := 30; > fi;# end if 13 > ; > if (glob_max_iter < 2) then # if number 13 > omniout_str(ALWAYS,"Illegal max_iter"); > errflag := true; > fi;# end if 13 > ; > if (errflag) then # if number 13 > > quit; > fi;# end if 13 > > # End Function number 16 > end; chk_data := proc() local errflag; global glob_max_iter, ALWAYS, glob_max_terms; errflag := false; if glob_max_terms < 15 or 512 < glob_max_terms then omniout_str(ALWAYS, "Illegal max_terms = -- Using 30"); glob_max_terms := 30 end if; if glob_max_iter < 2 then omniout_str(ALWAYS, "Illegal max_iter"); errflag := true end if; if errflag then quit end if end proc > # Begin Function number 17 > comp_expect_sec := proc(t_end2,t_start2,t2,clock_sec2) > global glob_small_float; > local ms2, rrr, sec_left, sub1, sub2; > > > > ; > ms2 := clock_sec2; > sub1 := (t_end2-t_start2); > sub2 := (t2-t_start2); > if (sub1 = 0.0) then # if number 13 > sec_left := 0.0; > else > if (sub2 > 0.0) then # if number 14 > rrr := (sub1/sub2); > sec_left := rrr * ms2 - ms2; > else > sec_left := 0.0; > fi;# end if 14 > fi;# end if 13 > ; > sec_left; > > # End Function number 17 > end; comp_expect_sec := proc(t_end2, t_start2, t2, clock_sec2) local ms2, rrr, sec_left, sub1, sub2; global glob_small_float; ms2 := clock_sec2; sub1 := t_end2 - t_start2; sub2 := t2 - t_start2; if sub1 = 0. then sec_left := 0. else if 0. < sub2 then rrr := sub1/sub2; sec_left := rrr*ms2 - ms2 else sec_left := 0. end if end if; sec_left end proc > # Begin Function number 18 > comp_percent := proc(t_end2,t_start2, t2) > global glob_small_float; > local rrr, sub1, sub2; > > > > sub1 := (t_end2-t_start2); > sub2 := (t2-t_start2); > if (sub2 > glob_small_float) then # if number 13 > rrr := (100.0*sub2)/sub1; > else > rrr := 0.0; > fi;# end if 13 > ; > rrr; > > # End Function number 18 > end; comp_percent := proc(t_end2, t_start2, t2) local rrr, sub1, sub2; global glob_small_float; sub1 := t_end2 - t_start2; sub2 := t2 - t_start2; if glob_small_float < sub2 then rrr := 100.0*sub2/sub1 else rrr := 0. end if; rrr end proc > # Begin Function number 19 > factorial_2 := proc(nnn) > local ret; > > > > ret := nnn!; > > # End Function number 19 > end; factorial_2 := proc(nnn) local ret; ret := nnn! end proc > # Begin Function number 20 > factorial_1 := proc(nnn) > global glob_max_terms,array_fact_1; > local ret; > > > > if (nnn <= glob_max_terms) then # if number 13 > if (array_fact_1[nnn] = 0) then # if number 14 > ret := factorial_2(nnn); > array_fact_1[nnn] := ret; > else > ret := array_fact_1[nnn]; > fi;# end if 14 > ; > else > ret := factorial_2(nnn); > fi;# end if 13 > ; > ret; > > # End Function number 20 > end; factorial_1 := proc(nnn) local ret; global glob_max_terms, array_fact_1; if nnn <= glob_max_terms then if array_fact_1[nnn] = 0 then ret := factorial_2(nnn); array_fact_1[nnn] := ret else ret := array_fact_1[nnn] end if else ret := factorial_2(nnn) end if; ret end proc > # Begin Function number 21 > factorial_3 := proc(mmm,nnn) > global glob_max_terms,array_fact_2; > local ret; > > > > if ((nnn <= glob_max_terms) and (mmm <= glob_max_terms)) then # if number 13 > if (array_fact_2[mmm,nnn] = 0) then # if number 14 > ret := factorial_1(mmm)/factorial_1(nnn); > array_fact_2[mmm,nnn] := ret; > else > ret := array_fact_2[mmm,nnn]; > fi;# end if 14 > ; > else > ret := factorial_2(mmm)/factorial_2(nnn); > fi;# end if 13 > ; > ret; > > # End Function number 21 > end; factorial_3 := proc(mmm, nnn) local ret; global glob_max_terms, array_fact_2; if nnn <= glob_max_terms and mmm <= glob_max_terms then if array_fact_2[mmm, nnn] = 0 then ret := factorial_1(mmm)/factorial_1(nnn); array_fact_2[mmm, nnn] := ret else ret := array_fact_2[mmm, nnn] end if else ret := factorial_2(mmm)/factorial_2(nnn) end if; ret end proc > # Begin Function number 22 > convfp := proc(mmm) > (mmm); > > # End Function number 22 > end; convfp := proc(mmm) mmm end proc > # Begin Function number 23 > convfloat := proc(mmm) > (mmm); > > # End Function number 23 > end; convfloat := proc(mmm) mmm end proc > elapsed_time_seconds := proc() > time(); > end; elapsed_time_seconds := proc() time() end proc > > > > > > > > > > > > > > > > > > > > omniabs := proc(x) > abs(x); > end; omniabs := proc(x) abs(x) end proc > expt := proc(x,y) > (x^y); > end; expt := proc(x, y) x^y end proc > #END ATS LIBRARY BLOCK > #BEGIN USER DEF BLOCK > #BEGIN USER DEF BLOCK > exact_soln_y := proc(x) > return(2.0 - expt(cos(x),2)/2.0); > end; exact_soln_y := proc(x) return 2.0 - expt(cos(x), 2)/2.0 end proc > > #END USER DEF BLOCK > #END USER DEF BLOCK > #END OUTFILE5 > # Begin Function number 2 > main := proc() > #BEGIN OUTFIEMAIN > local d1,d2,d3,d4,est_err_2,niii,done_once, > term,ord,order_diff,term_no,html_log_file,iiif,jjjf, > rows,r_order,sub_iter,calc_term,iii,temp_sum,current_iter, > x_start,x_end > ,it, log10norm, max_terms, opt_iter, tmp,subiter; > global > glob_iolevel, > DEBUGL, > INFO, > DEBUGMASSIVE, > ALWAYS, > glob_max_terms, > #Top Generate Globals Decl > glob_max_sec, > glob_max_iter, > glob_initial_pass, > days_in_year, > glob_current_iter, > glob_optimal_clock_start_sec, > glob_abserr, > glob_reached_optimal_h, > djd_debug2, > glob_subiter_method, > glob_curr_iter_when_opt, > glob_start, > glob_max_hours, > glob_log10_abserr, > glob_display_interval, > glob_optimal_expect_sec, > glob_max_minutes, > glob_orig_start_sec, > glob_look_poles, > glob_last_good_h, > glob_disp_incr, > glob_optimal_done, > djd_debug, > glob_max_opt_iter, > glob_log10relerr, > glob_small_float, > glob_dump_analytic, > glob_h, > glob_iter, > glob_warned2, > glob_max_trunc_err, > glob_max_rel_trunc_err, > glob_hmin, > min_in_hour, > glob_html_log, > glob_normmax, > glob_smallish_float, > glob_large_float, > glob_hmin_init, > glob_not_yet_finished, > glob_clock_sec, > centuries_in_millinium, > years_in_century, > glob_dump, > MAX_UNCHANGED, > glob_unchanged_h_cnt, > glob_no_eqs, > glob_not_yet_start_msg, > glob_percent_done, > glob_optimal_start, > glob_almost_1, > glob_display_flag, > glob_warned, > glob_relerr, > glob_log10_relerr, > glob_next_display, > hours_in_day, > sec_in_minute, > glob_log10normmin, > glob_log10abserr, > glob_neg_h, > glob_hmax, > glob_clock_start_sec, > glob_good_digits, > #Bottom Generate Globals Decl > #BEGIN CONST > array_const_0D0, > array_const_1, > #END CONST > array_y, > array_x, > array_m1, > array_tmp2_g, > array_type_pole, > array_last_rel_error, > array_tmp1_g, > array_pole, > array_1st_rel_error, > array_norms, > array_y_init, > array_fact_1, > array_tmp0, > array_tmp1, > array_tmp2, > array_tmp3, > array_tmp4, > array_real_pole, > array_y_higher, > array_complex_pole, > array_y_higher_work, > array_y_higher_work2, > array_y_set_initial, > array_poles, > array_fact_2, > glob_last; > glob_last; > ALWAYS := 1; > INFO := 2; > DEBUGL := 3; > DEBUGMASSIVE := 4; > glob_iolevel := INFO; > glob_iolevel := 5; > DEBUGL := 3; > INFO := 2; > DEBUGMASSIVE := 4; > ALWAYS := 1; > glob_max_terms := 30; > glob_max_sec := 10000.0; > glob_max_iter := 1000; > glob_initial_pass := true; > days_in_year := 365; > glob_current_iter := 0; > glob_optimal_clock_start_sec := 0.0; > glob_abserr := 0.1e-10; > glob_reached_optimal_h := false; > djd_debug2 := true; > glob_subiter_method := 3; > glob_curr_iter_when_opt := 0; > glob_start := 0; > glob_max_hours := 0.0; > glob_log10_abserr := 0.1e-10; > glob_display_interval := 0.0; > glob_optimal_expect_sec := 0.1; > glob_max_minutes := 0.0; > glob_orig_start_sec := 0.0; > glob_look_poles := false; > glob_last_good_h := 0.1; > glob_disp_incr := 0.1; > glob_optimal_done := false; > djd_debug := true; > glob_max_opt_iter := 10; > glob_log10relerr := 0.0; > glob_small_float := 0.1e-50; > glob_dump_analytic := false; > glob_h := 0.1; > glob_iter := 0; > glob_warned2 := false; > glob_max_trunc_err := 0.1e-10; > glob_max_rel_trunc_err := 0.1e-10; > glob_hmin := 0.00000000001; > min_in_hour := 60; > glob_html_log := true; > glob_normmax := 0.0; > glob_smallish_float := 0.1e-100; > glob_large_float := 9.0e100; > glob_hmin_init := 0.001; > glob_not_yet_finished := true; > glob_clock_sec := 0.0; > centuries_in_millinium := 10; > years_in_century := 100; > glob_dump := false; > MAX_UNCHANGED := 10; > glob_unchanged_h_cnt := 0; > glob_no_eqs := 0; > glob_not_yet_start_msg := true; > glob_percent_done := 0.0; > glob_optimal_start := 0.0; > glob_almost_1 := 0.9990; > glob_display_flag := true; > glob_warned := false; > glob_relerr := 0.1e-10; > glob_log10_relerr := 0.1e-10; > glob_next_display := 0.0; > hours_in_day := 24; > sec_in_minute := 60; > glob_log10normmin := 0.1; > glob_log10abserr := 0.0; > glob_neg_h := false; > glob_hmax := 1.0; > glob_clock_start_sec := 0.0; > glob_good_digits := 0; > #Write Set Defaults > glob_orig_start_sec := elapsed_time_seconds(); > MAX_UNCHANGED := 10; > glob_curr_iter_when_opt := 0; > glob_display_flag := true; > glob_no_eqs := 1; > glob_iter := -1; > opt_iter := -1; > glob_max_iter := 50000; > glob_max_hours := 0.0; > glob_max_minutes := 15.0; > omniout_str(ALWAYS,"##############ECHO OF PROBLEM#################"); > omniout_str(ALWAYS,"##############temp/mult2postode.ode#################"); > omniout_str(ALWAYS,"diff ( y , x , 1 ) = sin(x) * cos(x) ;"); > omniout_str(ALWAYS,"!"); > omniout_str(ALWAYS,"#BEGIN FIRST INPUT BLOCK"); > omniout_str(ALWAYS,"Digits := 32;"); > omniout_str(ALWAYS,"max_terms := 30;"); > omniout_str(ALWAYS,"!"); > omniout_str(ALWAYS,"#END FIRST INPUT BLOCK"); > omniout_str(ALWAYS,"#BEGIN SECOND INPUT BLOCK"); > omniout_str(ALWAYS,"x_start := 0.1;"); > omniout_str(ALWAYS,"x_end := 10.0 ;"); > omniout_str(ALWAYS,"array_y_init[0 + 1] := exact_soln_y(x_start);"); > omniout_str(ALWAYS,"glob_h := 0.00001 ;"); > omniout_str(ALWAYS,"glob_look_poles := true;"); > omniout_str(ALWAYS,"glob_max_iter := 100;"); > omniout_str(ALWAYS,"#END SECOND INPUT BLOCK"); > omniout_str(ALWAYS,"#BEGIN OVERRIDE BLOCK"); > omniout_str(ALWAYS,"glob_h := 0.005 ;"); > omniout_str(ALWAYS,"glob_display_interval := 0.1;"); > omniout_str(ALWAYS,"glob_look_poles := true;"); > omniout_str(ALWAYS,"glob_max_iter := 10000;"); > omniout_str(ALWAYS,"glob_max_minutes := 10;"); > omniout_str(ALWAYS,"#END OVERRIDE BLOCK"); > omniout_str(ALWAYS,"!"); > omniout_str(ALWAYS,"#BEGIN USER DEF BLOCK"); > omniout_str(ALWAYS,"exact_soln_y := proc(x)"); > omniout_str(ALWAYS,"return(2.0 - expt(cos(x),2)/2.0);"); > omniout_str(ALWAYS,"end;"); > omniout_str(ALWAYS,""); > omniout_str(ALWAYS,"#END USER DEF BLOCK"); > omniout_str(ALWAYS,"#######END OF ECHO OF PROBLEM#################"); > glob_unchanged_h_cnt := 0; > glob_warned := false; > glob_warned2 := false; > glob_small_float := 1.0e-200; > glob_smallish_float := 1.0e-64; > glob_large_float := 1.0e100; > glob_almost_1 := 0.99; > glob_log10_abserr := -8.0; > glob_log10_relerr := -8.0; > glob_hmax := 0.01; > #BEGIN FIRST INPUT BLOCK > #BEGIN FIRST INPUT BLOCK > Digits := 32; > max_terms := 30; > #END FIRST INPUT BLOCK > #START OF INITS AFTER INPUT BLOCK > glob_max_terms := max_terms; > glob_html_log := true; > #END OF INITS AFTER INPUT BLOCK > array_y:= Array(0..(max_terms + 1),[]); > array_x:= Array(0..(max_terms + 1),[]); > array_m1:= Array(0..(max_terms + 1),[]); > array_tmp2_g:= Array(0..(max_terms + 1),[]); > array_type_pole:= Array(0..(max_terms + 1),[]); > array_last_rel_error:= Array(0..(max_terms + 1),[]); > array_tmp1_g:= Array(0..(max_terms + 1),[]); > array_pole:= Array(0..(max_terms + 1),[]); > array_1st_rel_error:= Array(0..(max_terms + 1),[]); > array_norms:= Array(0..(max_terms + 1),[]); > array_y_init:= Array(0..(max_terms + 1),[]); > array_fact_1:= Array(0..(max_terms + 1),[]); > array_tmp0:= Array(0..(max_terms + 1),[]); > array_tmp1:= Array(0..(max_terms + 1),[]); > array_tmp2:= Array(0..(max_terms + 1),[]); > array_tmp3:= Array(0..(max_terms + 1),[]); > array_tmp4:= Array(0..(max_terms + 1),[]); > array_real_pole := Array(0..(1+ 1) ,(0..3+ 1),[]); > array_y_higher := Array(0..(2+ 1) ,(0..max_terms+ 1),[]); > array_complex_pole := Array(0..(1+ 1) ,(0..3+ 1),[]); > array_y_higher_work := Array(0..(2+ 1) ,(0..max_terms+ 1),[]); > array_y_higher_work2 := Array(0..(2+ 1) ,(0..max_terms+ 1),[]); > array_y_set_initial := Array(0..(2+ 1) ,(0..max_terms+ 1),[]); > array_poles := Array(0..(1+ 1) ,(0..3+ 1),[]); > array_fact_2 := Array(0..(max_terms+ 1) ,(0..max_terms+ 1),[]); > term := 1; > while (term <= max_terms) do # do number 2 > array_y[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > term := 1; > while (term <= max_terms) do # do number 2 > array_x[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > term := 1; > while (term <= max_terms) do # do number 2 > array_m1[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > term := 1; > while (term <= max_terms) do # do number 2 > array_tmp2_g[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > term := 1; > while (term <= max_terms) do # do number 2 > array_type_pole[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > term := 1; > while (term <= max_terms) do # do number 2 > array_last_rel_error[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > term := 1; > while (term <= max_terms) do # do number 2 > array_tmp1_g[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > term := 1; > while (term <= max_terms) do # do number 2 > array_pole[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > term := 1; > while (term <= max_terms) do # do number 2 > array_1st_rel_error[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > term := 1; > while (term <= max_terms) do # do number 2 > array_norms[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > term := 1; > while (term <= max_terms) do # do number 2 > array_y_init[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > term := 1; > while (term <= max_terms) do # do number 2 > array_fact_1[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > term := 1; > while (term <= max_terms) do # do number 2 > array_tmp0[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > term := 1; > while (term <= max_terms) do # do number 2 > array_tmp1[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > term := 1; > while (term <= max_terms) do # do number 2 > array_tmp2[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > term := 1; > while (term <= max_terms) do # do number 2 > array_tmp3[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > term := 1; > while (term <= max_terms) do # do number 2 > array_tmp4[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > ord := 1; > while (ord <=1) do # do number 2 > term := 1; > while (term <= 3) do # do number 3 > array_real_pole[ord,term] := 0.0; > term := term + 1; > od;# end do number 3 > ; > ord := ord + 1; > od;# end do number 2 > ; > ord := 1; > while (ord <=2) do # do number 2 > term := 1; > while (term <= max_terms) do # do number 3 > array_y_higher[ord,term] := 0.0; > term := term + 1; > od;# end do number 3 > ; > ord := ord + 1; > od;# end do number 2 > ; > ord := 1; > while (ord <=1) do # do number 2 > term := 1; > while (term <= 3) do # do number 3 > array_complex_pole[ord,term] := 0.0; > term := term + 1; > od;# end do number 3 > ; > ord := ord + 1; > od;# end do number 2 > ; > ord := 1; > while (ord <=2) do # do number 2 > term := 1; > while (term <= max_terms) do # do number 3 > array_y_higher_work[ord,term] := 0.0; > term := term + 1; > od;# end do number 3 > ; > ord := ord + 1; > od;# end do number 2 > ; > ord := 1; > while (ord <=2) do # do number 2 > term := 1; > while (term <= max_terms) do # do number 3 > array_y_higher_work2[ord,term] := 0.0; > term := term + 1; > od;# end do number 3 > ; > ord := ord + 1; > od;# end do number 2 > ; > ord := 1; > while (ord <=2) do # do number 2 > term := 1; > while (term <= max_terms) do # do number 3 > array_y_set_initial[ord,term] := 0.0; > term := term + 1; > od;# end do number 3 > ; > ord := ord + 1; > od;# end do number 2 > ; > ord := 1; > while (ord <=1) do # do number 2 > term := 1; > while (term <= 3) do # do number 3 > array_poles[ord,term] := 0.0; > term := term + 1; > od;# end do number 3 > ; > ord := ord + 1; > od;# end do number 2 > ; > ord := 1; > while (ord <=max_terms) do # do number 2 > term := 1; > while (term <= max_terms) do # do number 3 > array_fact_2[ord,term] := 0.0; > term := term + 1; > od;# end do number 3 > ; > ord := ord + 1; > od;# end do number 2 > ; > #BEGIN ARRAYS DEFINED AND INITIALIZATED > array_x := Array(1..(max_terms+1 + 1),[]); > term := 1; > while (term <= max_terms + 1) do # do number 2 > array_x[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > array_y := Array(1..(max_terms+1 + 1),[]); > term := 1; > while (term <= max_terms + 1) do # do number 2 > array_y[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > array_tmp2_g := Array(1..(max_terms+1 + 1),[]); > term := 1; > while (term <= max_terms + 1) do # do number 2 > array_tmp2_g[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > array_tmp1_g := Array(1..(max_terms+1 + 1),[]); > term := 1; > while (term <= max_terms + 1) do # do number 2 > array_tmp1_g[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > array_tmp4 := Array(1..(max_terms+1 + 1),[]); > term := 1; > while (term <= max_terms + 1) do # do number 2 > array_tmp4[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > array_tmp3 := Array(1..(max_terms+1 + 1),[]); > term := 1; > while (term <= max_terms + 1) do # do number 2 > array_tmp3[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > array_tmp2 := Array(1..(max_terms+1 + 1),[]); > term := 1; > while (term <= max_terms + 1) do # do number 2 > array_tmp2[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > array_tmp1 := Array(1..(max_terms+1 + 1),[]); > term := 1; > while (term <= max_terms + 1) do # do number 2 > array_tmp1[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > array_tmp0 := Array(1..(max_terms+1 + 1),[]); > term := 1; > while (term <= max_terms + 1) do # do number 2 > array_tmp0[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > array_const_0D0 := Array(1..(max_terms+1 + 1),[]); > term := 1; > while (term <= max_terms + 1) do # do number 2 > array_const_0D0[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > array_const_0D0[1] := 0.0; > array_const_1 := Array(1..(max_terms+1 + 1),[]); > term := 1; > while (term <= max_terms + 1) do # do number 2 > array_const_1[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > array_const_1[1] := 1; > array_m1 := Array(1..(max_terms+1 + 1),[]); > term := 1; > while (term <= max_terms) do # do number 2 > array_m1[term] := 0.0; > term := term + 1; > od;# end do number 2 > ; > array_m1[1] := -1.0; > #END ARRAYS DEFINED AND INITIALIZATED > #Initing Factorial Tables > iiif := 0; > while (iiif <= glob_max_terms) do # do number 2 > jjjf := 0; > while (jjjf <= glob_max_terms) do # do number 3 > array_fact_1[iiif] := 0; > array_fact_2[iiif,jjjf] := 0; > jjjf := jjjf + 1; > od;# end do number 3 > ; > iiif := iiif + 1; > od;# end do number 2 > ; > #Done Initing Factorial Tables > #TOP SECOND INPUT BLOCK > #BEGIN SECOND INPUT BLOCK > #END FIRST INPUT BLOCK > #BEGIN SECOND INPUT BLOCK > x_start := 0.1; > x_end := 10.0 ; > array_y_init[0 + 1] := exact_soln_y(x_start); > glob_h := 0.00001 ; > glob_look_poles := true; > glob_max_iter := 100; > #END SECOND INPUT BLOCK > #BEGIN OVERRIDE BLOCK > glob_h := 0.005 ; > glob_display_interval := 0.1; > glob_look_poles := true; > glob_max_iter := 10000; > glob_max_minutes := 10; > #END OVERRIDE BLOCK > #END SECOND INPUT BLOCK > #BEGIN INITS AFTER SECOND INPUT BLOCK > glob_last_good_h := glob_h; > glob_max_terms := max_terms; > glob_max_sec := convfloat(60.0) * convfloat(glob_max_minutes) + convfloat(3600.0) * convfloat(glob_max_hours); > glob_abserr := expt(10.0 , (glob_log10_abserr)); > glob_relerr := expt(10.0 , (glob_log10_relerr)); > if (glob_h > 0.0) then # if number 1 > glob_neg_h := false; > glob_display_interval := omniabs(glob_display_interval); > else > glob_neg_h := true; > glob_display_interval := -omniabs(glob_display_interval); > fi;# end if 1 > ; > chk_data(); > #AFTER INITS AFTER SECOND INPUT BLOCK > array_y_set_initial[1,1] := true; > array_y_set_initial[1,2] := false; > array_y_set_initial[1,3] := false; > array_y_set_initial[1,4] := false; > array_y_set_initial[1,5] := false; > array_y_set_initial[1,6] := false; > array_y_set_initial[1,7] := false; > array_y_set_initial[1,8] := false; > array_y_set_initial[1,9] := false; > array_y_set_initial[1,10] := false; > array_y_set_initial[1,11] := false; > array_y_set_initial[1,12] := false; > array_y_set_initial[1,13] := false; > array_y_set_initial[1,14] := false; > array_y_set_initial[1,15] := false; > array_y_set_initial[1,16] := false; > array_y_set_initial[1,17] := false; > array_y_set_initial[1,18] := false; > array_y_set_initial[1,19] := false; > array_y_set_initial[1,20] := false; > array_y_set_initial[1,21] := false; > array_y_set_initial[1,22] := false; > array_y_set_initial[1,23] := false; > array_y_set_initial[1,24] := false; > array_y_set_initial[1,25] := false; > array_y_set_initial[1,26] := false; > array_y_set_initial[1,27] := false; > array_y_set_initial[1,28] := false; > array_y_set_initial[1,29] := false; > array_y_set_initial[1,30] := false; > if (glob_html_log) then # if number 2 > html_log_file := fopen("html/entry.html",WRITE,TEXT); > fi;# end if 2 > ; > #BEGIN SOLUTION CODE > omniout_str(ALWAYS,"START of Soultion"); > #Start Series -- INITIALIZE FOR SOLUTION > array_x[1] := x_start; > array_x[2] := glob_h; > glob_next_display := x_start; > order_diff := 1; > #Start Series array_y > term_no := 1; > while (term_no <= order_diff) do # do number 2 > array_y[term_no] := array_y_init[term_no] * expt(glob_h , (term_no - 1)) / factorial_1(term_no - 1); > term_no := term_no + 1; > od;# end do number 2 > ; > rows := order_diff; > r_order := 1; > while (r_order <= rows) do # do number 2 > term_no := 1; > while (term_no <= (rows - r_order + 1)) do # do number 3 > it := term_no + r_order - 1; > array_y_higher[r_order,term_no] := array_y_init[it]* expt(glob_h , (term_no - 1)) / ((factorial_1(term_no - 1))); > term_no := term_no + 1; > od;# end do number 3 > ; > r_order := r_order + 1; > od;# end do number 2 > ; > current_iter := 1; > glob_clock_start_sec := elapsed_time_seconds(); > if (omniabs(array_y_higher[1,1]) > glob_small_float) then # if number 2 > tmp := omniabs(array_y_higher[1,1]); > log10norm := (log10(tmp)); > if (log10norm < glob_log10normmin) then # if number 3 > glob_log10normmin := log10norm; > fi;# end if 3 > fi;# end if 2 > ; > display_alot(current_iter) > ; > glob_clock_sec := elapsed_time_seconds(); > glob_current_iter := 0; > glob_iter := 0; > omniout_str(DEBUGL," "); > glob_reached_optimal_h := true; > glob_optimal_clock_start_sec := elapsed_time_seconds(); > while ((glob_current_iter < glob_max_iter) and not_reached_end(array_x[1] , x_end ) and ((convfloat(glob_clock_sec) - convfloat(glob_orig_start_sec)) < convfloat(glob_max_sec))) do # do number 2 > #left paren 0001C > if (reached_interval()) then # if number 2 > omniout_str(INFO," "); > omniout_str(INFO,"TOP MAIN SOLVE Loop"); > fi;# end if 2 > ; > glob_iter := glob_iter + 1; > glob_clock_sec := elapsed_time_seconds(); > glob_current_iter := glob_current_iter + 1; > atomall(); > if (glob_look_poles) then # if number 2 > #left paren 0004C > check_for_pole(); > fi;# end if 2 > ;#was right paren 0004C > if (reached_interval()) then # if number 2 > glob_next_display := glob_next_display + glob_display_interval; > fi;# end if 2 > ; > array_x[1] := array_x[1] + glob_h; > array_x[2] := glob_h; > #Jump Series array_y > order_diff := 1; > #START PART 1 SUM AND ADJUST > #START SUM AND ADJUST EQ =1 > #sum_and_adjust array_y > #BEFORE ADJUST SUBSERIES EQ =1 > ord := 2; > calc_term := 1; > #adjust_subseriesarray_y > iii := glob_max_terms; > while (iii >= calc_term) do # do number 3 > array_y_higher_work[2,iii] := array_y_higher[2,iii] / expt(glob_h , (calc_term - 1)) / factorial_3(iii - calc_term , iii - 1); > iii := iii - 1; > od;# end do number 3 > ; > #AFTER ADJUST SUBSERIES EQ =1 > #BEFORE SUM SUBSERIES EQ =1 > temp_sum := 0.0; > ord := 2; > calc_term := 1; > #sum_subseriesarray_y > iii := glob_max_terms; > while (iii >= calc_term) do # do number 3 > temp_sum := temp_sum + array_y_higher_work[ord,iii]; > iii := iii - 1; > od;# end do number 3 > ; > array_y_higher_work2[ord,calc_term] := temp_sum * expt(glob_h , (calc_term - 1)) / (factorial_1(calc_term - 1)); > #AFTER SUM SUBSERIES EQ =1 > #BEFORE ADJUST SUBSERIES EQ =1 > ord := 1; > calc_term := 2; > #adjust_subseriesarray_y > iii := glob_max_terms; > while (iii >= calc_term) do # do number 3 > array_y_higher_work[1,iii] := array_y_higher[1,iii] / expt(glob_h , (calc_term - 1)) / factorial_3(iii - calc_term , iii - 1); > iii := iii - 1; > od;# end do number 3 > ; > #AFTER ADJUST SUBSERIES EQ =1 > #BEFORE SUM SUBSERIES EQ =1 > temp_sum := 0.0; > ord := 1; > calc_term := 2; > #sum_subseriesarray_y > iii := glob_max_terms; > while (iii >= calc_term) do # do number 3 > temp_sum := temp_sum + array_y_higher_work[ord,iii]; > iii := iii - 1; > od;# end do number 3 > ; > array_y_higher_work2[ord,calc_term] := temp_sum * expt(glob_h , (calc_term - 1)) / (factorial_1(calc_term - 1)); > #AFTER SUM SUBSERIES EQ =1 > #BEFORE ADJUST SUBSERIES EQ =1 > ord := 1; > calc_term := 1; > #adjust_subseriesarray_y > iii := glob_max_terms; > while (iii >= calc_term) do # do number 3 > array_y_higher_work[1,iii] := array_y_higher[1,iii] / expt(glob_h , (calc_term - 1)) / factorial_3(iii - calc_term , iii - 1); > iii := iii - 1; > od;# end do number 3 > ; > #AFTER ADJUST SUBSERIES EQ =1 > #BEFORE SUM SUBSERIES EQ =1 > temp_sum := 0.0; > ord := 1; > calc_term := 1; > #sum_subseriesarray_y > iii := glob_max_terms; > while (iii >= calc_term) do # do number 3 > temp_sum := temp_sum + array_y_higher_work[ord,iii]; > iii := iii - 1; > od;# end do number 3 > ; > array_y_higher_work2[ord,calc_term] := temp_sum * expt(glob_h , (calc_term - 1)) / (factorial_1(calc_term - 1)); > #AFTER SUM SUBSERIES EQ =1 > #END SUM AND ADJUST EQ =1 > #END PART 1 > #START PART 2 MOVE TERMS to REGULAR Array > term_no := glob_max_terms; > while (term_no >= 1) do # do number 3 > array_y[term_no] := array_y_higher_work2[1,term_no]; > ord := 1; > while (ord <= order_diff) do # do number 4 > array_y_higher[ord,term_no] := array_y_higher_work2[ord,term_no]; > ord := ord + 1; > od;# end do number 4 > ; > term_no := term_no - 1; > od;# end do number 3 > ; > #END PART 2 HEVE MOVED TERMS to REGULAR Array > display_alot(current_iter) > ; > od;# end do number 2 > ;#right paren 0001C > omniout_str(ALWAYS,"Finished!"); > if (glob_iter >= glob_max_iter) then # if number 2 > omniout_str(ALWAYS,"Maximum Iterations Reached before Solution Completed!"); > fi;# end if 2 > ; > if (elapsed_time_seconds() - convfloat(glob_orig_start_sec) >= convfloat(glob_max_sec )) then # if number 2 > omniout_str(ALWAYS,"Maximum Time Reached before Solution Completed!"); > fi;# end if 2 > ; > glob_clock_sec := elapsed_time_seconds(); > omniout_str(INFO,"diff ( y , x , 1 ) = sin(x) * cos(x) ;"); > omniout_int(INFO,"Iterations ",32,glob_iter,4," ") > ; > prog_report(x_start,x_end); > if (glob_html_log) then # if number 2 > logstart(html_log_file); > logitem_str(html_log_file,"2012-09-21T02:20:57-05:00") > ; > logitem_str(html_log_file,"Maple") > ; > logitem_str(html_log_file,"mult2") > ; > logitem_str(html_log_file,"diff ( y , x , 1 ) = sin(x) * cos(x) ;") > ; > logitem_float(html_log_file,x_start) > ; > logitem_float(html_log_file,x_end) > ; > logitem_float(html_log_file,array_x[1]) > ; > logitem_float(html_log_file,glob_h) > ; > logitem_integer(html_log_file,Digits) > ; > ; > logitem_good_digits(html_log_file,array_last_rel_error[1]) > ; > logitem_integer(html_log_file,glob_max_terms) > ; > logitem_float(html_log_file,array_1st_rel_error[1]) > ; > logitem_float(html_log_file,array_last_rel_error[1]) > ; > logitem_integer(html_log_file,glob_iter) > ; > logitem_pole(html_log_file,array_type_pole[1]) > ; > if (array_type_pole[1] = 1 or array_type_pole[1] = 2) then # if number 3 > logitem_float(html_log_file,array_pole[1]) > ; > logitem_float(html_log_file,array_pole[2]) > ; > 0; > else > logitem_str(html_log_file,"NA") > ; > logitem_str(html_log_file,"NA") > ; > 0; > fi;# end if 3 > ; > logitem_time(html_log_file,convfloat(glob_clock_sec)) > ; > if (glob_percent_done < 100.0) then # if number 3 > logitem_time(html_log_file,convfloat(glob_optimal_expect_sec)) > ; > 0; > else > logitem_str(html_log_file,"Done") > ; > 0; > fi;# end if 3 > ; > log_revs(html_log_file," 130 ") > ; > logitem_str(html_log_file,"mult2 diffeq.mxt") > ; > logitem_str(html_log_file,"mult2 maple results") > ; > logitem_str(html_log_file,"c c++ Maple and Maxima") > ; > logend(html_log_file) > ; > ; > fi;# end if 2 > ; > if (glob_html_log) then # if number 2 > fclose(html_log_file); > fi;# end if 2 > ; > ;; > #END OUTFILEMAIN > > # End Function number 9 > end; main := proc() local d1, d2, d3, d4, est_err_2, niii, done_once, term, ord, order_diff, term_no, html_log_file, iiif, jjjf, rows, r_order, sub_iter, calc_term, iii, temp_sum, current_iter, x_start, x_end, it, log10norm, max_terms, opt_iter, tmp, subiter; global glob_iolevel, DEBUGL, INFO, DEBUGMASSIVE, ALWAYS, glob_max_terms, glob_max_sec, glob_max_iter, glob_initial_pass, days_in_year, glob_current_iter, glob_optimal_clock_start_sec, glob_abserr, glob_reached_optimal_h, djd_debug2, glob_subiter_method, glob_curr_iter_when_opt, glob_start, glob_max_hours, glob_log10_abserr, glob_display_interval, glob_optimal_expect_sec, glob_max_minutes, glob_orig_start_sec, glob_look_poles, glob_last_good_h, glob_disp_incr, glob_optimal_done, djd_debug, glob_max_opt_iter, glob_log10relerr, glob_small_float, glob_dump_analytic, glob_h, glob_iter, glob_warned2, glob_max_trunc_err, glob_max_rel_trunc_err, glob_hmin, min_in_hour, glob_html_log, glob_normmax, glob_smallish_float, glob_large_float, glob_hmin_init, glob_not_yet_finished, glob_clock_sec, centuries_in_millinium, years_in_century, glob_dump, MAX_UNCHANGED, glob_unchanged_h_cnt, glob_no_eqs, glob_not_yet_start_msg, glob_percent_done, glob_optimal_start, glob_almost_1, glob_display_flag, glob_warned, glob_relerr, glob_log10_relerr, glob_next_display, hours_in_day, sec_in_minute, glob_log10normmin, glob_log10abserr, glob_neg_h, glob_hmax, glob_clock_start_sec, glob_good_digits, array_const_0D0, array_const_1, array_y, array_x, array_m1, array_tmp2_g, array_type_pole, array_last_rel_error, array_tmp1_g, array_pole, array_1st_rel_error, array_norms, array_y_init, array_fact_1, array_tmp0, array_tmp1, array_tmp2, array_tmp3, array_tmp4, array_real_pole, array_y_higher, array_complex_pole, array_y_higher_work, array_y_higher_work2, array_y_set_initial, array_poles, array_fact_2, glob_last; glob_last; ALWAYS := 1; INFO := 2; DEBUGL := 3; DEBUGMASSIVE := 4; glob_iolevel := INFO; glob_iolevel := 5; DEBUGL := 3; INFO := 2; DEBUGMASSIVE := 4; ALWAYS := 1; glob_max_terms := 30; glob_max_sec := 10000.0; glob_max_iter := 1000; glob_initial_pass := true; days_in_year := 365; glob_current_iter := 0; glob_optimal_clock_start_sec := 0.; glob_abserr := 0.1*10^(-10); glob_reached_optimal_h := false; djd_debug2 := true; glob_subiter_method := 3; glob_curr_iter_when_opt := 0; glob_start := 0; glob_max_hours := 0.; glob_log10_abserr := 0.1*10^(-10); glob_display_interval := 0.; glob_optimal_expect_sec := 0.1; glob_max_minutes := 0.; glob_orig_start_sec := 0.; glob_look_poles := false; glob_last_good_h := 0.1; glob_disp_incr := 0.1; glob_optimal_done := false; djd_debug := true; glob_max_opt_iter := 10; glob_log10relerr := 0.; glob_small_float := 0.1*10^(-50); glob_dump_analytic := false; glob_h := 0.1; glob_iter := 0; glob_warned2 := false; glob_max_trunc_err := 0.1*10^(-10); glob_max_rel_trunc_err := 0.1*10^(-10); glob_hmin := 0.1*10^(-10); min_in_hour := 60; glob_html_log := true; glob_normmax := 0.; glob_smallish_float := 0.1*10^(-100); glob_large_float := 0.90*10^101; glob_hmin_init := 0.001; glob_not_yet_finished := true; glob_clock_sec := 0.; centuries_in_millinium := 10; years_in_century := 100; glob_dump := false; MAX_UNCHANGED := 10; glob_unchanged_h_cnt := 0; glob_no_eqs := 0; glob_not_yet_start_msg := true; glob_percent_done := 0.; glob_optimal_start := 0.; glob_almost_1 := 0.9990; glob_display_flag := true; glob_warned := false; glob_relerr := 0.1*10^(-10); glob_log10_relerr := 0.1*10^(-10); glob_next_display := 0.; hours_in_day := 24; sec_in_minute := 60; glob_log10normmin := 0.1; glob_log10abserr := 0.; glob_neg_h := false; glob_hmax := 1.0; glob_clock_start_sec := 0.; glob_good_digits := 0; glob_orig_start_sec := elapsed_time_seconds(); MAX_UNCHANGED := 10; glob_curr_iter_when_opt := 0; glob_display_flag := true; glob_no_eqs := 1; glob_iter := -1; opt_iter := -1; glob_max_iter := 50000; glob_max_hours := 0.; glob_max_minutes := 15.0; omniout_str(ALWAYS, "##############ECHO OF PROBLEM#################"); omniout_str(ALWAYS, "##############temp/mult2postode.ode#################"); omniout_str(ALWAYS, "diff ( y , x , 1 ) = sin(x) * cos(x) ;"); omniout_str(ALWAYS, "!"); omniout_str(ALWAYS, "#BEGIN FIRST INPUT BLOCK"); omniout_str(ALWAYS, "Digits := 32;"); omniout_str(ALWAYS, "max_terms := 30;"); omniout_str(ALWAYS, "!"); omniout_str(ALWAYS, "#END FIRST INPUT BLOCK"); omniout_str(ALWAYS, "#BEGIN SECOND INPUT BLOCK"); omniout_str(ALWAYS, "x_start := 0.1;"); omniout_str(ALWAYS, "x_end := 10.0 ;"); omniout_str(ALWAYS, "array_y_init[0 + 1] := exact_soln_y(x_start);"); omniout_str(ALWAYS, "glob_h := 0.00001 ;"); omniout_str(ALWAYS, "glob_look_poles := true;"); omniout_str(ALWAYS, "glob_max_iter := 100;"); omniout_str(ALWAYS, "#END SECOND INPUT BLOCK"); omniout_str(ALWAYS, "#BEGIN OVERRIDE BLOCK"); omniout_str(ALWAYS, "glob_h := 0.005 ;"); omniout_str(ALWAYS, "glob_display_interval := 0.1;"); omniout_str(ALWAYS, "glob_look_poles := true;"); omniout_str(ALWAYS, "glob_max_iter := 10000;"); omniout_str(ALWAYS, "glob_max_minutes := 10;"); omniout_str(ALWAYS, "#END OVERRIDE BLOCK"); omniout_str(ALWAYS, "!"); omniout_str(ALWAYS, "#BEGIN USER DEF BLOCK"); omniout_str(ALWAYS, "exact_soln_y := proc(x)"); omniout_str(ALWAYS, "return(2.0 - expt(cos(x),2)/2.0);"); omniout_str(ALWAYS, "end;"); omniout_str(ALWAYS, ""); omniout_str(ALWAYS, "#END USER DEF BLOCK"); omniout_str(ALWAYS, "#######END OF ECHO OF PROBLEM#################"); glob_unchanged_h_cnt := 0; glob_warned := false; glob_warned2 := false; glob_small_float := 0.10*10^(-199); glob_smallish_float := 0.10*10^(-63); glob_large_float := 0.10*10^101; glob_almost_1 := 0.99; glob_log10_abserr := -8.0; glob_log10_relerr := -8.0; glob_hmax := 0.01; Digits := 32; max_terms := 30; glob_max_terms := max_terms; glob_html_log := true; array_y := Array(0 .. max_terms + 1, []); array_x := Array(0 .. max_terms + 1, []); array_m1 := Array(0 .. max_terms + 1, []); array_tmp2_g := Array(0 .. max_terms + 1, []); array_type_pole := Array(0 .. max_terms + 1, []); array_last_rel_error := Array(0 .. max_terms + 1, []); array_tmp1_g := Array(0 .. max_terms + 1, []); array_pole := Array(0 .. max_terms + 1, []); array_1st_rel_error := Array(0 .. max_terms + 1, []); array_norms := Array(0 .. max_terms + 1, []); array_y_init := Array(0 .. max_terms + 1, []); array_fact_1 := Array(0 .. max_terms + 1, []); array_tmp0 := Array(0 .. max_terms + 1, []); array_tmp1 := Array(0 .. max_terms + 1, []); array_tmp2 := Array(0 .. max_terms + 1, []); array_tmp3 := Array(0 .. max_terms + 1, []); array_tmp4 := Array(0 .. max_terms + 1, []); array_real_pole := Array(0 .. 2, 0 .. 4, []); array_y_higher := Array(0 .. 3, 0 .. max_terms + 1, []); array_complex_pole := Array(0 .. 2, 0 .. 4, []); array_y_higher_work := Array(0 .. 3, 0 .. max_terms + 1, []); array_y_higher_work2 := Array(0 .. 3, 0 .. max_terms + 1, []); array_y_set_initial := Array(0 .. 3, 0 .. max_terms + 1, []); array_poles := Array(0 .. 2, 0 .. 4, []); array_fact_2 := Array(0 .. max_terms + 1, 0 .. max_terms + 1, []); term := 1; while term <= max_terms do array_y[term] := 0.; term := term + 1 end do ; term := 1; while term <= max_terms do array_x[term] := 0.; term := term + 1 end do ; term := 1; while term <= max_terms do array_m1[term] := 0.; term := term + 1 end do; term := 1; while term <= max_terms do array_tmp2_g[term] := 0.; term := term + 1 end do; term := 1; while term <= max_terms do array_type_pole[term] := 0.; term := term + 1 end do; term := 1; while term <= max_terms do array_last_rel_error[term] := 0.; term := term + 1 end do; term := 1; while term <= max_terms do array_tmp1_g[term] := 0.; term := term + 1 end do; term := 1; while term <= max_terms do array_pole[term] := 0.; term := term + 1 end do; term := 1; while term <= max_terms do array_1st_rel_error[term] := 0.; term := term + 1 end do; term := 1; while term <= max_terms do array_norms[term] := 0.; term := term + 1 end do; term := 1; while term <= max_terms do array_y_init[term] := 0.; term := term + 1 end do; term := 1; while term <= max_terms do array_fact_1[term] := 0.; term := term + 1 end do; term := 1; while term <= max_terms do array_tmp0[term] := 0.; term := term + 1 end do; term := 1; while term <= max_terms do array_tmp1[term] := 0.; term := term + 1 end do; term := 1; while term <= max_terms do array_tmp2[term] := 0.; term := term + 1 end do; term := 1; while term <= max_terms do array_tmp3[term] := 0.; term := term + 1 end do; term := 1; while term <= max_terms do array_tmp4[term] := 0.; term := term + 1 end do; ord := 1; while ord <= 1 do term := 1; while term <= 3 do array_real_pole[ord, term] := 0.; term := term + 1 end do; ord := ord + 1 end do; ord := 1; while ord <= 2 do term := 1; while term <= max_terms do array_y_higher[ord, term] := 0.; term := term + 1 end do; ord := ord + 1 end do; ord := 1; while ord <= 1 do term := 1; while term <= 3 do array_complex_pole[ord, term] := 0.; term := term + 1 end do; ord := ord + 1 end do; ord := 1; while ord <= 2 do term := 1; while term <= max_terms do array_y_higher_work[ord, term] := 0.; term := term + 1 end do; ord := ord + 1 end do; ord := 1; while ord <= 2 do term := 1; while term <= max_terms do array_y_higher_work2[ord, term] := 0.; term := term + 1 end do; ord := ord + 1 end do; ord := 1; while ord <= 2 do term := 1; while term <= max_terms do array_y_set_initial[ord, term] := 0.; term := term + 1 end do; ord := ord + 1 end do; ord := 1; while ord <= 1 do term := 1; while term <= 3 do array_poles[ord, term] := 0.; term := term + 1 end do; ord := ord + 1 end do; ord := 1; while ord <= max_terms do term := 1; while term <= max_terms do array_fact_2[ord, term] := 0.; term := term + 1 end do; ord := ord + 1 end do; array_x := Array(1 .. max_terms + 2, []); term := 1; while term <= max_terms + 1 do array_x[term] := 0.; term := term + 1 end do; array_y := Array(1 .. max_terms + 2, []); term := 1; while term <= max_terms + 1 do array_y[term] := 0.; term := term + 1 end do; array_tmp2_g := Array(1 .. max_terms + 2, []); term := 1; while term <= max_terms + 1 do array_tmp2_g[term] := 0.; term := term + 1 end do; array_tmp1_g := Array(1 .. max_terms + 2, []); term := 1; while term <= max_terms + 1 do array_tmp1_g[term] := 0.; term := term + 1 end do; array_tmp4 := Array(1 .. max_terms + 2, []); term := 1; while term <= max_terms + 1 do array_tmp4[term] := 0.; term := term + 1 end do; array_tmp3 := Array(1 .. max_terms + 2, []); term := 1; while term <= max_terms + 1 do array_tmp3[term] := 0.; term := term + 1 end do; array_tmp2 := Array(1 .. max_terms + 2, []); term := 1; while term <= max_terms + 1 do array_tmp2[term] := 0.; term := term + 1 end do; array_tmp1 := Array(1 .. max_terms + 2, []); term := 1; while term <= max_terms + 1 do array_tmp1[term] := 0.; term := term + 1 end do; array_tmp0 := Array(1 .. max_terms + 2, []); term := 1; while term <= max_terms + 1 do array_tmp0[term] := 0.; term := term + 1 end do; array_const_0D0 := Array(1 .. max_terms + 2, []); term := 1; while term <= max_terms + 1 do array_const_0D0[term] := 0.; term := term + 1 end do; array_const_0D0[1] := 0.; array_const_1 := Array(1 .. max_terms + 2, []); term := 1; while term <= max_terms + 1 do array_const_1[term] := 0.; term := term + 1 end do; array_const_1[1] := 1; array_m1 := Array(1 .. max_terms + 2, []); term := 1; while term <= max_terms do array_m1[term] := 0.; term := term + 1 end do; array_m1[1] := -1.0; iiif := 0; while iiif <= glob_max_terms do jjjf := 0; while jjjf <= glob_max_terms do array_fact_1[iiif] := 0; array_fact_2[iiif, jjjf] := 0; jjjf := jjjf + 1 end do; iiif := iiif + 1 end do; x_start := 0.1; x_end := 10.0; array_y_init[1] := exact_soln_y(x_start); glob_h := 0.00001; glob_look_poles := true; glob_max_iter := 100; glob_h := 0.005; glob_display_interval := 0.1; glob_look_poles := true; glob_max_iter := 10000; glob_max_minutes := 10; glob_last_good_h := glob_h; glob_max_terms := max_terms; glob_max_sec := convfloat(60.0)*convfloat(glob_max_minutes) + convfloat(3600.0)*convfloat(glob_max_hours); glob_abserr := expt(10.0, glob_log10_abserr); glob_relerr := expt(10.0, glob_log10_relerr); if 0. < glob_h then glob_neg_h := false; glob_display_interval := omniabs(glob_display_interval) else glob_neg_h := true; glob_display_interval := -omniabs(glob_display_interval) end if; chk_data(); array_y_set_initial[1, 1] := true; array_y_set_initial[1, 2] := false; array_y_set_initial[1, 3] := false; array_y_set_initial[1, 4] := false; array_y_set_initial[1, 5] := false; array_y_set_initial[1, 6] := false; array_y_set_initial[1, 7] := false; array_y_set_initial[1, 8] := false; array_y_set_initial[1, 9] := false; array_y_set_initial[1, 10] := false; array_y_set_initial[1, 11] := false; array_y_set_initial[1, 12] := false; array_y_set_initial[1, 13] := false; array_y_set_initial[1, 14] := false; array_y_set_initial[1, 15] := false; array_y_set_initial[1, 16] := false; array_y_set_initial[1, 17] := false; array_y_set_initial[1, 18] := false; array_y_set_initial[1, 19] := false; array_y_set_initial[1, 20] := false; array_y_set_initial[1, 21] := false; array_y_set_initial[1, 22] := false; array_y_set_initial[1, 23] := false; array_y_set_initial[1, 24] := false; array_y_set_initial[1, 25] := false; array_y_set_initial[1, 26] := false; array_y_set_initial[1, 27] := false; array_y_set_initial[1, 28] := false; array_y_set_initial[1, 29] := false; array_y_set_initial[1, 30] := false; if glob_html_log then html_log_file := fopen("html/entry.html", WRITE, TEXT) end if; omniout_str(ALWAYS, "START of Soultion"); array_x[1] := x_start; array_x[2] := glob_h; glob_next_display := x_start; order_diff := 1; term_no := 1; while term_no <= order_diff do array_y[term_no] := array_y_init[term_no]*expt(glob_h, term_no - 1) /factorial_1(term_no - 1); term_no := term_no + 1 end do; rows := order_diff; r_order := 1; while r_order <= rows do term_no := 1; while term_no <= rows - r_order + 1 do it := term_no + r_order - 1; array_y_higher[r_order, term_no] := array_y_init[it]* expt(glob_h, term_no - 1)/factorial_1(term_no - 1); term_no := term_no + 1 end do; r_order := r_order + 1 end do; current_iter := 1; glob_clock_start_sec := elapsed_time_seconds(); if glob_small_float < omniabs(array_y_higher[1, 1]) then tmp := omniabs(array_y_higher[1, 1]); log10norm := log10(tmp); if log10norm < glob_log10normmin then glob_log10normmin := log10norm end if end if; display_alot(current_iter); glob_clock_sec := elapsed_time_seconds(); glob_current_iter := 0; glob_iter := 0; omniout_str(DEBUGL, " "); glob_reached_optimal_h := true; glob_optimal_clock_start_sec := elapsed_time_seconds(); while glob_current_iter < glob_max_iter and not_reached_end(array_x[1], x_end) and convfloat(glob_clock_sec) - convfloat(glob_orig_start_sec) < convfloat(glob_max_sec) do if reached_interval() then omniout_str(INFO, " "); omniout_str(INFO, "TOP MAIN SOLVE Loop") end if; glob_iter := glob_iter + 1; glob_clock_sec := elapsed_time_seconds(); glob_current_iter := glob_current_iter + 1; atomall(); if glob_look_poles then check_for_pole() end if; if reached_interval() then glob_next_display := glob_next_display + glob_display_interval end if; array_x[1] := array_x[1] + glob_h; array_x[2] := glob_h; order_diff := 1; ord := 2; calc_term := 1; iii := glob_max_terms; while calc_term <= iii do array_y_higher_work[2, iii] := array_y_higher[2, iii]/( expt(glob_h, calc_term - 1)* factorial_3(iii - calc_term, iii - 1)); iii := iii - 1 end do; temp_sum := 0.; ord := 2; calc_term := 1; iii := glob_max_terms; while calc_term <= iii do temp_sum := temp_sum + array_y_higher_work[ord, iii]; iii := iii - 1 end do; array_y_higher_work2[ord, calc_term] := temp_sum*expt(glob_h, calc_term - 1)/factorial_1(calc_term - 1) ; ord := 1; calc_term := 2; iii := glob_max_terms; while calc_term <= iii do array_y_higher_work[1, iii] := array_y_higher[1, iii]/( expt(glob_h, calc_term - 1)* factorial_3(iii - calc_term, iii - 1)); iii := iii - 1 end do; temp_sum := 0.; ord := 1; calc_term := 2; iii := glob_max_terms; while calc_term <= iii do temp_sum := temp_sum + array_y_higher_work[ord, iii]; iii := iii - 1 end do; array_y_higher_work2[ord, calc_term] := temp_sum*expt(glob_h, calc_term - 1)/factorial_1(calc_term - 1) ; ord := 1; calc_term := 1; iii := glob_max_terms; while calc_term <= iii do array_y_higher_work[1, iii] := array_y_higher[1, iii]/( expt(glob_h, calc_term - 1)* factorial_3(iii - calc_term, iii - 1)); iii := iii - 1 end do; temp_sum := 0.; ord := 1; calc_term := 1; iii := glob_max_terms; while calc_term <= iii do temp_sum := temp_sum + array_y_higher_work[ord, iii]; iii := iii - 1 end do; array_y_higher_work2[ord, calc_term] := temp_sum*expt(glob_h, calc_term - 1)/factorial_1(calc_term - 1) ; term_no := glob_max_terms; while 1 <= term_no do array_y[term_no] := array_y_higher_work2[1, term_no]; ord := 1; while ord <= order_diff do array_y_higher[ord, term_no] := array_y_higher_work2[ord, term_no]; ord := ord + 1 end do; term_no := term_no - 1 end do; display_alot(current_iter) end do; omniout_str(ALWAYS, "Finished!"); if glob_max_iter <= glob_iter then omniout_str(ALWAYS, "Maximum Iterations Reached before Solution Completed!") end if; if convfloat(glob_max_sec) <= elapsed_time_seconds() - convfloat(glob_orig_start_sec) then omniout_str(ALWAYS, "Maximum Time Reached before Solution Completed!") end if; glob_clock_sec := elapsed_time_seconds(); omniout_str(INFO, "diff ( y , x , 1 ) = sin(x) * cos(x) ;"); omniout_int(INFO, "Iterations ", 32, glob_iter, 4, " "); prog_report(x_start, x_end); if glob_html_log then logstart(html_log_file); logitem_str(html_log_file, "2012-09-21T02:20:57-05:00"); logitem_str(html_log_file, "Maple"); logitem_str(html_log_file, "mult2"); logitem_str(html_log_file, "diff ( y , x , 1 ) = sin(x) * cos(x) ;") ; logitem_float(html_log_file, x_start); logitem_float(html_log_file, x_end); logitem_float(html_log_file, array_x[1]); logitem_float(html_log_file, glob_h); logitem_integer(html_log_file, Digits); logitem_good_digits(html_log_file, array_last_rel_error[1]); logitem_integer(html_log_file, glob_max_terms); logitem_float(html_log_file, array_1st_rel_error[1]); logitem_float(html_log_file, array_last_rel_error[1]); logitem_integer(html_log_file, glob_iter); logitem_pole(html_log_file, array_type_pole[1]); if array_type_pole[1] = 1 or array_type_pole[1] = 2 then logitem_float(html_log_file, array_pole[1]); logitem_float(html_log_file, array_pole[2]); 0 else logitem_str(html_log_file, "NA"); logitem_str(html_log_file, "NA"); 0 end if; logitem_time(html_log_file, convfloat(glob_clock_sec)); if glob_percent_done < 100.0 then logitem_time(html_log_file, convfloat(glob_optimal_expect_sec)) ; 0 else logitem_str(html_log_file, "Done"); 0 end if; log_revs(html_log_file, " 130 "); logitem_str(html_log_file, "mult2 diffeq.mxt"); logitem_str(html_log_file, "mult2 maple results"); logitem_str(html_log_file, "c c++ Maple and Maxima"); logend(html_log_file) end if; if glob_html_log then fclose(html_log_file) end if end proc > main(); ##############ECHO OF PROBLEM################# ##############temp/mult2postode.ode################# diff ( y , x , 1 ) = sin(x) * cos(x) ; ! #BEGIN FIRST INPUT BLOCK Digits := 32; max_terms := 30; ! #END FIRST INPUT BLOCK #BEGIN SECOND INPUT BLOCK x_start := 0.1; x_end := 10.0 ; array_y_init[0 + 1] := exact_soln_y(x_start); glob_h := 0.00001 ; glob_look_poles := true; glob_max_iter := 100; #END SECOND INPUT BLOCK #BEGIN OVERRIDE BLOCK glob_h := 0.005 ; glob_display_interval := 0.1; glob_look_poles := true; glob_max_iter := 10000; glob_max_minutes := 10; #END OVERRIDE BLOCK ! #BEGIN USER DEF BLOCK exact_soln_y := proc(x) return(2.0 - expt(cos(x),2)/2.0); end; #END USER DEF BLOCK #######END OF ECHO OF PROBLEM################# START of Soultion x[1] = 0.1 y[1] (analytic) = 1.504983355539689592218950870813 y[1] (numeric) = 1.504983355539689592218950870813 absolute error = 0 relative error = 0 % Correct digits = 32 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=3.8MB, alloc=2.9MB, time=0.33 x[1] = 0.2 y[1] (analytic) = 1.519734751499278729300368316987 y[1] (numeric) = 1.5197347514995107599808580320452 absolute error = 2.320306804897150582e-13 relative error = 1.5267840671591379389552021953123e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop memory used=7.6MB, alloc=3.9MB, time=0.68 NO POLE memory used=11.4MB, alloc=4.2MB, time=1.04 x[1] = 0.3 y[1] (analytic) = 1.5436660962725804256897618752612 y[1] (numeric) = 1.5436660962730257557374906688486 absolute error = 4.453300477287935874e-13 relative error = 2.8848858493693136479383701062456e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=15.2MB, alloc=4.3MB, time=1.40 x[1] = 0.4 y[1] (analytic) = 1.5758233226632086447698125045894 y[1] (numeric) = 1.5758233226638400392988629950039 absolute error = 6.313945290504904145e-13 relative error = 4.0067596409438002426082139723594e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=19.0MB, alloc=4.3MB, time=1.77 memory used=22.8MB, alloc=4.3MB, time=2.14 x[1] = 0.5 y[1] (analytic) = 1.6149244235329650706497658481393 y[1] (numeric) = 1.6149244235337478769705107820901 absolute error = 7.828063207449339508e-13 relative error = 4.8473247994626957869668692650523e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=26.7MB, alloc=4.3MB, time=2.51 x[1] = 0.6 y[1] (analytic) = 1.6594105613808316055904066610942 y[1] (numeric) = 1.6594105613817251347028914666367 absolute error = 8.935291124848055425e-13 relative error = 5.3846174857491598803992237484111e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=30.5MB, alloc=4.3MB, time=2.88 x[1] = 0.7 y[1] (analytic) = 1.7075082142749397653458129911991 y[1] (numeric) = 1.7075082142758989140817824020994 absolute error = 9.591487359694109003e-13 relative error = 5.6172422946538784407963536419887e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop memory used=34.3MB, alloc=4.3MB, time=3.29 NO POLE memory used=38.1MB, alloc=4.4MB, time=3.69 x[1] = 0.8 y[1] (analytic) = 1.7572998805753221815514426157366 y[1] (numeric) = 1.757299880576299230695327730934 absolute error = 9.770491438851151974e-13 relative error = 5.5599454292641231161574953347710e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=41.9MB, alloc=4.4MB, time=4.11 x[1] = 0.9 y[1] (analytic) = 1.8068005236732717638291685766326 y[1] (numeric) = 1.8068005236742182805326248996386 absolute error = 9.465167034563230060e-13 relative error = 5.2386342103334699804893519928693e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=45.7MB, alloc=4.4MB, time=4.52 memory used=49.5MB, alloc=4.4MB, time=4.94 x[1] = 1 y[1] (analytic) = 1.8540367091367855967493920573752 y[1] (numeric) = 1.8540367091376543653961243002135 absolute error = 8.687686467322428383e-13 relative error = 4.6858222517974294272866571202025e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=53.4MB, alloc=4.4MB, time=5.36 x[1] = 1.1 y[1] (analytic) = 1.8971252793138364271310356531637 y[1] (numeric) = 1.8971252793145833316744219362228 absolute error = 7.469045433862830591e-13 relative error = 3.9370333184133624740199907903352e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=57.2MB, alloc=4.4MB, time=5.77 x[1] = 1.2 y[1] (analytic) = 1.9343484288853113749022055568337 y[1] (numeric) = 1.9343484288858971576328599876511 absolute error = 5.857827306544308174e-13 relative error = 3.0283206577834287922883979701208e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=61.0MB, alloc=4.4MB, time=6.17 memory used=64.8MB, alloc=4.4MB, time=6.60 x[1] = 1.3 y[1] (analytic) = 1.9642221883422368084494255379113 y[1] (numeric) = 1.9642221883426286350761865608638 absolute error = 3.918266267610229525e-13 relative error = 1.9948182496182704223754413914071e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=68.6MB, alloc=4.4MB, time=7.03 x[1] = 1.4 y[1] (analytic) = 1.9855555851671645381466970293415 y[1] (numeric) = 1.9855555851673373067962014393996 absolute error = 1.727686495044100581e-13 relative error = 8.7012748872434418461201108972334e-12 % Correct digits = 13 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=72.4MB, alloc=4.4MB, time=7.43 memory used=76.2MB, alloc=4.4MB, time=7.83 x[1] = 1.5 y[1] (analytic) = 1.9974981241501113643178931986828 y[1] (numeric) = 1.9974981241500487062670535903251 absolute error = 6.26580508396083577e-14 relative error = 3.1368265172347978945432737560403e-12 % Correct digits = 13 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=80.1MB, alloc=4.4MB, time=8.24 x[1] = 1.6 y[1] (analytic) = 1.9995736939486882711654151805709 y[1] (numeric) = 1.9995736939483832034107549499229 absolute error = 3.050677546602306480e-13 relative error = 1.5256639731931735125563136170714e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=83.9MB, alloc=4.4MB, time=8.64 x[1] = 1.7 y[1] (analytic) = 1.9916995481448652535705503849414 y[1] (numeric) = 1.9916995481443204572185162002195 absolute error = 5.447963520341847219e-13 relative error = 2.7353340143177018803117761313655e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop memory used=87.7MB, alloc=4.4MB, time=9.06 NO POLE memory used=91.5MB, alloc=4.4MB, time=9.46 x[1] = 1.8 y[1] (analytic) = 1.9741896040835367514675729313165 y[1] (numeric) = 1.9741896040827644648472814248159 absolute error = 7.722866202915065006e-13 relative error = 3.9119171668924846358716670105667e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=95.3MB, alloc=4.4MB, time=9.87 x[1] = 1.9 y[1] (analytic) = 1.9477419279786041749991420435877 y[1] (numeric) = 1.947741927977625705758818212371 absolute error = 9.784692403238312167e-13 relative error = 5.0236082422854720257502243369121e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=99.1MB, alloc=4.4MB, time=10.25 memory used=103.0MB, alloc=4.5MB, time=10.65 x[1] = 2 y[1] (analytic) = 1.9134109052159029786597920457744 y[1] (numeric) = 1.9134109052147478542980746933013 absolute error = 1.1551243617173524731e-12 relative error = 6.0369905835098815232680512601576e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=106.8MB, alloc=4.5MB, time=11.12 x[1] = 2.1 y[1] (analytic) = 1.8725652053351748944138862203443 y[1] (numeric) = 1.8725652053338796851116366376067 absolute error = 1.2952093022495827376e-12 relative error = 6.9167647596963126728519444556723e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=110.6MB, alloc=4.5MB, time=11.60 memory used=114.4MB, alloc=4.5MB, time=11.99 x[1] = 2.2 y[1] (analytic) = 1.8268332174946049207797849355544 y[1] (numeric) = 1.8268332174932117814623798405588 absolute error = 1.3931393174050949956e-12 relative error = 7.6259797778130190590499591204658e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=118.2MB, alloc=4.5MB, time=12.38 x[1] = 2.3 y[1] (analytic) = 1.7780381317337636293574769553073 y[1] (numeric) = 1.778038131732318619110961282922 absolute error = 1.4450102465156723853e-12 relative error = 8.1269924459192784207626599598201e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=122.0MB, alloc=4.5MB, time=12.75 x[1] = 2.4 y[1] (analytic) = 1.7281252541401383576699461855876 y[1] (numeric) = 1.7281252541386896035106203270166 absolute error = 1.4487541593258585710e-12 relative error = 8.3833863075319375670380428716832e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=125.8MB, alloc=4.5MB, time=13.13 memory used=129.7MB, alloc=4.5MB, time=13.51 x[1] = 2.5 y[1] (analytic) = 1.6790844536341934338833402071216 y[1] (numeric) = 1.6790844536327892120854936956179 absolute error = 1.4042217978465115037e-12 relative error = 8.3630206616899348099231886925757e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=133.5MB, alloc=4.5MB, time=13.89 x[1] = 2.6 y[1] (analytic) = 1.6328708321749057603402265183478 y[1] (numeric) = 1.6328708321735925718134266986559 absolute error = 1.3131885267998196919e-12 relative error = 8.0422070192209597785807293592566e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=137.3MB, alloc=4.5MB, time=14.27 memory used=141.1MB, alloc=4.5MB, time=14.68 x[1] = 2.7 y[1] (analytic) = 1.5913267810143414093983120402548 y[1] (numeric) = 1.5913267810131621258428817243525 absolute error = 1.1792835554303159023e-12 relative error = 7.4106938279428599831299686007362e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=144.9MB, alloc=4.5MB, time=15.05 x[1] = 2.8 y[1] (analytic) = 1.5561085303724375505860475844607 y[1] (numeric) = 1.5561085303714297053336626547821 absolute error = 1.0078452523849296786e-12 relative error = 6.4767028308990308328855729682990e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=148.7MB, alloc=4.5MB, time=15.45 x[1] = 2.9 y[1] (analytic) = 1.5286201207646702489588354745596 y[1] (numeric) = 1.5286201207638645406370342438711 absolute error = 8.057083218012306885e-13 relative error = 5.2708211206731118954769503684110e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=152.5MB, alloc=4.5MB, time=15.84 memory used=156.4MB, alloc=4.5MB, time=16.21 x[1] = 3 y[1] (analytic) = 1.5099574283374084948635869255193 y[1] (numeric) = 1.5099574283368275635383653055713 absolute error = 5.809313252216199480e-13 relative error = 3.8473357878789650899859317425832e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=160.2MB, alloc=4.5MB, time=16.58 x[1] = 3.1 y[1] (analytic) = 1.5008644757441956312151493440327 y[1] (numeric) = 1.5008644757438531558029744482424 absolute error = 3.424754121748957903e-13 relative error = 2.2818543426786165153980723590055e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=164.0MB, alloc=4.5MB, time=16.94 memory used=167.8MB, alloc=4.5MB, time=17.32 x[1] = 3.2 y[1] (analytic) = 1.501703770310451835351315225332 y[1] (numeric) = 1.5017037703103519882838921420563 absolute error = 9.98470674230832757e-14 relative error = 6.6489190076709725919954912300621e-12 % Correct digits = 13 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=171.6MB, alloc=4.5MB, time=17.69 x[1] = 3.3 y[1] (analytic) = 1.512441852010367633445065569583 y[1] (numeric) = 1.5124418520105049143276521498897 absolute error = 1.372808825865803067e-13 relative error = 9.0767709452170899301292066305297e-12 % Correct digits = 13 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=175.4MB, alloc=4.5MB, time=18.08 x[1] = 3.4 y[1] (analytic) = 1.5326506274125437068895938400384 y[1] (numeric) = 1.5326506274129031617843815678461 absolute error = 3.594548947877278077e-13 relative error = 2.3453152881591017769492017452533e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=179.2MB, alloc=4.5MB, time=18.45 memory used=183.1MB, alloc=4.5MB, time=18.82 x[1] = 3.5 y[1] (analytic) = 1.5615244364141738404647006195702 y[1] (numeric) = 1.5615244364147316580571251575854 absolute error = 5.578175924245380152e-13 relative error = 3.5722629721087773471716980367576e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=186.9MB, alloc=4.5MB, time=19.21 x[1] = 3.6 y[1] (analytic) = 1.5979121713669363322487873802266 y[1] (numeric) = 1.5979121713676607931294993017982 absolute error = 7.244608807119215716e-13 relative error = 4.5337966234538437668786678341479e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=190.7MB, alloc=4.5MB, time=19.61 memory used=194.5MB, alloc=4.5MB, time=20.01 x[1] = 3.7 y[1] (analytic) = 1.6403631681064023377164753828249 y[1] (numeric) = 1.6403631681072550789340945491213 absolute error = 8.527412176191662964e-13 relative error = 5.1984903965111044441681657191035e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=198.3MB, alloc=4.5MB, time=20.42 x[1] = 3.8 y[1] (analytic) = 1.687185039354436154985461812662 y[1] (numeric) = 1.6871850393553736994563876051295 absolute error = 9.375444709257924675e-13 relative error = 5.5568562372063411335628866514555e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=202.1MB, alloc=4.5MB, time=20.82 x[1] = 3.9 y[1] (analytic) = 1.7365111448593376067418580217619 y[1] (numeric) = 1.7365111448603130965443926276444 absolute error = 9.754898025346058825e-13 relative error = 5.6175268752082979573728742550127e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop memory used=206.0MB, alloc=4.5MB, time=21.22 NO POLE memory used=209.8MB, alloc=4.5MB, time=21.63 x[1] = 4 y[1] (analytic) = 1.7863750084521533814672103454578 y[1] (numeric) = 1.7863750084531184459190281268882 absolute error = 9.650644518177814304e-13 relative error = 5.4023620306577408431410597708722e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=213.6MB, alloc=4.5MB, time=22.03 x[1] = 4.1 y[1] (analytic) = 1.8347887152459588018501220311299 y[1] (numeric) = 1.834788715246865485894731333393 absolute error = 9.066840446093022631e-13 relative error = 4.9416264503662952331146393052567e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=217.4MB, alloc=4.5MB, time=22.42 memory used=221.2MB, alloc=4.5MB, time=22.82 x[1] = 4.2 y[1] (analytic) = 1.8798221635291713247862012101464 y[1] (numeric) = 1.8798221635299740008097157521978 absolute error = 8.026760235145420514e-13 relative error = 4.2699572283348388156553708471214e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=225.0MB, alloc=4.5MB, time=23.23 x[1] = 4.3 y[1] (analytic) = 1.9196800118300031752161174462901 y[1] (numeric) = 1.9196800118306603620762357048877 absolute error = 6.571868601182585976e-13 relative error = 3.4234187784857533320235955294143e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=228.8MB, alloc=4.5MB, time=23.64 x[1] = 4.4 y[1] (analytic) = 1.9527732535154138907222713760548 y[1] (numeric) = 1.9527732535158899074705188333434 absolute error = 4.760167482474572886e-13 relative error = 2.4376447567095886056493248700294e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=232.7MB, alloc=4.5MB, time=24.04 memory used=236.5MB, alloc=4.5MB, time=24.44 x[1] = 4.5 y[1] (analytic) = 1.9777825654711692470920736777953 y[1] (numeric) = 1.9777825654714356354606207562466 absolute error = 2.663883685470784513e-13 relative error = 1.3469042209077036055931563995744e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=240.3MB, alloc=4.5MB, time=24.85 x[1] = 4.6 y[1] (analytic) = 1.993710905351040935485361334619 y[1] (numeric) = 1.9937109053510775944283565049937 absolute error = 3.66589429951703747e-14 relative error = 1.8387291204948133036556396100507e-12 % Correct digits = 13 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=244.1MB, alloc=4.5MB, time=25.25 memory used=247.9MB, alloc=4.5MB, time=25.65 x[1] = 4.7 y[1] (analytic) = 1.9999232605088016180444868551682 y[1] (numeric) = 1.9999232605085976051033222186985 absolute error = 2.040129411646364697e-13 relative error = 1.0201038469482745098425988380115e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=251.7MB, alloc=4.5MB, time=26.05 x[1] = 4.8 y[1] (analytic) = 1.9961719639485317275050855199709 y[1] (numeric) = 1.9961719639480856950496905803306 absolute error = 4.460324553949396403e-13 relative error = 2.2344390335623404838345179270491e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=255.5MB, alloc=4.5MB, time=26.45 memory used=259.4MB, alloc=4.5MB, time=26.85 x[1] = 4.9 y[1] (analytic) = 1.9826065680261883796373444380223 y[1] (numeric) = 1.9826065680255086285919443194085 absolute error = 6.797510454001186138e-13 relative error = 3.4285725486971136567325960695008e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=263.2MB, alloc=4.5MB, time=27.25 x[1] = 5 y[1] (analytic) = 1.959767882269113113064715986956 y[1] (numeric) = 1.9597678822682172619761776595595 absolute error = 8.958510885383273965e-13 relative error = 4.5712101756717642564936495252916e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=267.0MB, alloc=4.5MB, time=27.66 x[1] = 5.1 y[1] (analytic) = 1.928566413006799934332030188527 y[1] (numeric) = 1.9285664130057142169739974221592 absolute error = 1.0857173580327663678e-12 relative error = 5.6296602010196795635688706294913e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=270.8MB, alloc=4.5MB, time=28.06 memory used=274.6MB, alloc=4.5MB, time=28.46 x[1] = 5.2 y[1] (analytic) = 1.8902460643568072667481938644084 y[1] (numeric) = 1.8902460643555654862633175113564 absolute error = 1.2417804848763530520e-12 relative error = 6.5694118257502778973175956439497e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=278.4MB, alloc=4.5MB, time=28.87 x[1] = 5.3 y[1] (analytic) = 1.8463345476929573306857655421445 y[1] (numeric) = 1.8463345476915995119610780328332 absolute error = 1.3578187246875093113e-12 relative error = 7.3541316029867872628190853146370e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=282.2MB, alloc=4.5MB, time=29.29 memory used=286.1MB, alloc=4.5MB, time=29.69 x[1] = 5.4 y[1] (analytic) = 1.7985824766138338735059869853108 y[1] (numeric) = 1.7985824766124046675069621802045 absolute error = 1.4292059990248051063e-12 relative error = 7.9462911354254451188901229036032e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=289.9MB, alloc=4.5MB, time=30.11 x[1] = 5.5 y[1] (analytic) = 1.748893575502987303562911243819 y[1] (numeric) = 1.7488935755015342072403752602117 absolute error = 1.4530963225359836073e-12 relative error = 8.3086606463064427795699615031738e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=293.7MB, alloc=4.5MB, time=30.52 x[1] = 5.6 y[1] (analytic) = 1.6992487840453122255515722095642 y[1] (numeric) = 1.6992487840438836882881592800125 absolute error = 1.4285372634129295517e-12 relative error = 8.4068753017559089141257226137191e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=297.5MB, alloc=4.5MB, time=30.92 memory used=301.3MB, alloc=4.5MB, time=31.32 x[1] = 5.7 y[1] (analytic) = 1.6516272834130273566397356015427 y[1] (numeric) = 1.6516272834116708487258933151181 absolute error = 1.3565079138422864246e-12 relative error = 8.2131599996284418859979880899666e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=305.1MB, alloc=4.5MB, time=31.72 x[1] = 5.8 y[1] (analytic) = 1.6079275925580065225874692396219 y[1] (numeric) = 1.6079275925567666427307795605754 absolute error = 1.2398798566896790465e-12 relative error = 7.7110428506123789798159147176236e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=309.0MB, alloc=4.5MB, time=32.13 memory used=312.8MB, alloc=4.5MB, time=32.53 x[1] = 5.9 y[1] (analytic) = 1.569891880252290448883724662075 y[1] (numeric) = 1.5698918802512071461991719972145 absolute error = 1.0833026845526648605e-12 relative error = 6.9004923089262174557284256832336e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=316.6MB, alloc=4.5MB, time=32.93 x[1] = 6 y[1] (analytic) = 1.5390365103168769738365111767066 y[1] (numeric) = 1.5390365103159839552013346694764 absolute error = 8.930186351765072302e-13 relative error = 5.8024525681501920259024098888309e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=320.4MB, alloc=4.5MB, time=33.33 x[1] = 6.1 y[1] (analytic) = 1.5165915889813406129350454345129 y[1] (numeric) = 1.516591588980663999201911642413 absolute error = 6.766137331337920999e-13 relative error = 4.4614102969426188612379454581183e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=324.2MB, alloc=4.5MB, time=33.73 memory used=328.0MB, alloc=4.5MB, time=34.13 x[1] = 6.2 y[1] (analytic) = 1.5034519244302841041372648163061 y[1] (numeric) = 1.5034519244298413887783010124521 absolute error = 4.427153589638038540e-13 relative error = 2.9446592323300645030983593023838e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=331.8MB, alloc=4.5MB, time=34.54 x[1] = 6.3 y[1] (analytic) = 1.5001413536247488107379969655285 y[1] (numeric) = 1.5001413536245481624352612678372 absolute error = 2.006483027356976913e-13 relative error = 1.3375293084940090096904037602999e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=335.7MB, alloc=4.5MB, time=34.96 memory used=339.5MB, alloc=4.5MB, time=35.36 x[1] = 6.4 y[1] (analytic) = 1.5067918585756411242579539992804 y[1] (numeric) = 1.5067918585756810612438594801893 absolute error = 3.99369859054809089e-14 relative error = 2.6504646728867408214343339161648e-12 % Correct digits = 13 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=343.3MB, alloc=4.5MB, time=35.77 x[1] = 6.5 y[1] (analytic) = 1.5231383046374509465368284611314 y[1] (numeric) = 1.5231383046377203956675408503824 absolute error = 2.694491307123892510e-13 relative error = 1.7690391600815632977117299708635e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=347.1MB, alloc=4.5MB, time=36.17 x[1] = 6.6 y[1] (analytic) = 1.548529010589887420804782280593 y[1] (numeric) = 1.5485290105903661590115213115563 absolute error = 4.787382067390309633e-13 relative error = 3.0915675680926589899753368323443e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop memory used=350.9MB, alloc=4.5MB, time=36.59 NO POLE memory used=354.7MB, alloc=4.5MB, time=36.98 x[1] = 6.7 y[1] (analytic) = 1.5819517291116329165990369905581 y[1] (numeric) = 1.5819517291122923771180110855539 absolute error = 6.594605189740949958e-13 relative error = 4.1686513364375805496079074609974e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=358.5MB, alloc=4.5MB, time=37.39 x[1] = 6.8 y[1] (analytic) = 1.6220740018867128230792455409586 y[1] (numeric) = 1.6220740018875172343183765453587 absolute error = 8.044112391310044001e-13 relative error = 4.9591525306203954504372852492204e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=362.4MB, alloc=4.5MB, time=37.79 memory used=366.2MB, alloc=4.5MB, time=38.19 x[1] = 6.9 y[1] (analytic) = 1.6672962805127380893635033818787 y[1] (numeric) = 1.6672962805136459010029189336128 absolute error = 9.078116394155517341e-13 relative error = 5.4448129587164642073129775862722e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=370.0MB, alloc=4.5MB, time=38.60 x[1] = 7 y[1] (analytic) = 1.7158156954480416014377677808321 y[1] (numeric) = 1.7158156954490071409099350048674 absolute error = 9.655394721672240353e-13 relative error = 5.6272912920003216025922706084495e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=373.8MB, alloc=4.5MB, time=39.01 x[1] = 7.1 y[1] (analytic) = 1.7656979307310206177456477550763 y[1] (numeric) = 1.7656979307319959110565126778173 absolute error = 9.752933108649227410e-13 relative error = 5.5235569679868137938571419627450e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=377.6MB, alloc=4.5MB, time=39.42 memory used=381.4MB, alloc=4.5MB, time=39.83 x[1] = 7.2 y[1] (analytic) = 1.8149543390534388733699139932666 y[1] (numeric) = 1.8149543390543755576706537817926 absolute error = 9.366843007397885260e-13 relative error = 5.1609248816050194025185726725232e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=385.2MB, alloc=4.5MB, time=40.23 x[1] = 7.3 y[1] (analytic) = 1.8616212228530664839269464025552 y[1] (numeric) = 1.861621222853917735588134136099 absolute error = 8.512516611877335438e-13 relative error = 4.5726362094386205619529383879738e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=389.1MB, alloc=4.5MB, time=40.63 memory used=392.9MB, alloc=4.5MB, time=41.04 x[1] = 7.4 y[1] (analytic) = 1.9038381207386800515034839430903 y[1] (numeric) = 1.9038381207394024528254333571832 absolute error = 7.224013219494140929e-13 relative error = 3.7944471963253149267707519802409e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=396.7MB, alloc=4.5MB, time=41.44 x[1] = 7.5 y[1] (analytic) = 1.9399219782147053184620366009083 y[1] (numeric) = 1.9399219782152605886014761043818 absolute error = 5.552701394395034735e-13 relative error = 2.8623323292131271274829139289538e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=400.5MB, alloc=4.5MB, time=41.84 x[1] = 7.6 y[1] (analytic) = 1.9684342457527701230334279255827 y[1] (numeric) = 1.968434245753126644139919652351 absolute error = 3.565211064917267683e-13 relative error = 1.8111913428705143020869784788362e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop memory used=404.3MB, alloc=4.5MB, time=42.26 NO POLE memory used=408.1MB, alloc=4.5MB, time=42.66 x[1] = 7.7 y[1] (analytic) = 1.9882382292217950494173323933552 y[1] (numeric) = 1.988238229221929127137193263351 absolute error = 1.340777198608699958e-13 relative error = 6.7435440024382082760623058705431e-12 % Correct digits = 13 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=412.0MB, alloc=4.5MB, time=43.06 x[1] = 7.8 y[1] (analytic) = 1.9985444062959538058159198535613 y[1] (numeric) = 1.9985444062958506139113310602687 absolute error = 1.031919045887932926e-13 relative error = 5.1633531015728730617047267280414e-12 % Correct digits = 13 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=415.8MB, alloc=4.5MB, time=43.46 memory used=419.6MB, alloc=4.5MB, time=43.86 x[1] = 7.9 y[1] (analytic) = 1.998941902218322144933336528266 y[1] (numeric) = 1.9989419022179763163576584755581 absolute error = 3.458285756780527079e-13 relative error = 1.7300581637428785410653847066822e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=423.4MB, alloc=4.5MB, time=44.27 x[1] = 8 y[1] (analytic) = 1.9894148700808461604749093081628 y[1] (numeric) = 1.9894148700802620013398944359323 absolute error = 5.841591350148722305e-13 relative error = 2.9363364263540117095167092281348e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=427.2MB, alloc=4.5MB, time=44.68 memory used=431.0MB, alloc=4.5MB, time=45.09 x[1] = 8.1 y[1] (analytic) = 1.9703431225905585862315348294466 y[1] (numeric) = 1.9703431225897499041362407652553 absolute error = 8.086820952940641913e-13 relative error = 4.1042703985021091107950975346878e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=434.8MB, alloc=4.5MB, time=45.50 x[1] = 8.2 y[1] (analytic) = 1.9424869901355177074870506285365 y[1] (numeric) = 1.942486990134507261052438158486 absolute error = 1.0104464346124700505e-12 relative error = 5.2018182862680393118518322015698e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=438.7MB, alloc=4.5MB, time=45.88 x[1] = 8.3 y[1] (analytic) = 1.9069570088115967642714872151642 y[1] (numeric) = 1.9069570088104153558260215588641 absolute error = 1.1814084454656563001e-12 relative error = 6.1952547435870218093910960836572e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=442.5MB, alloc=4.5MB, time=46.26 memory used=446.3MB, alloc=4.5MB, time=46.64 x[1] = 8.4 y[1] (analytic) = 1.8651696468528407900586992137214 y[1] (numeric) = 1.8651696468515260376467164843645 absolute error = 1.3147524119827293569e-12 relative error = 7.0489695894480821800996395569115e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=450.1MB, alloc=4.5MB, time=47.02 x[1] = 8.5 y[1] (analytic) = 1.818790834512899230555085664138 y[1] (numeric) = 1.8187908345114940682240757912328 absolute error = 1.4051623310098729052e-12 relative error = 7.7258049927780588407042161640294e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=453.9MB, alloc=4.5MB, time=47.41 memory used=457.7MB, alloc=4.5MB, time=47.83 x[1] = 8.6 y[1] (analytic) = 1.7696695486829598600774660624285 y[1] (numeric) = 1.7696695486815108262330855899098 absolute error = 1.4490338443804725187e-12 relative error = 8.1881605831941117748215479325925e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=461.5MB, alloc=4.5MB, time=48.26 x[1] = 8.7 y[1] (analytic) = 1.7197641000178811124690164612011 y[1] (numeric) = 1.7197641000164364945357154525526 absolute error = 1.4446179333010086485e-12 relative error = 8.4000935551916006779007415341471e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=465.4MB, alloc=4.5MB, time=48.69 x[1] = 8.8 y[1] (analytic) = 1.6710640612701895056645243864615 y[1] (numeric) = 1.6710640612687974150183133801835 absolute error = 1.3920906462110062780e-12 relative error = 8.3305642104041586195565494013958e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=469.2MB, alloc=4.5MB, time=49.09 memory used=473.0MB, alloc=4.5MB, time=49.50 x[1] = 8.9 y[1] (analytic) = 1.6255109493028962937441177559192 y[1] (numeric) = 1.6255109493016027476638304518805 absolute error = 1.2935460802873040387e-12 relative error = 7.9577814030846358166116533529018e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=476.8MB, alloc=4.5MB, time=49.88 x[1] = 9 y[1] (analytic) = 1.5849208229389799637959749888024 y[1] (numeric) = 1.5849208229378270508995770693698 absolute error = 1.1529128963979194326e-12 relative error = 7.2742617783267461323972102356176e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=480.6MB, alloc=4.5MB, time=50.31 memory used=484.4MB, alloc=4.5MB, time=50.72 x[1] = 9.1 y[1] (analytic) = 1.55091188242701909988318743027 y[1] (numeric) = 1.5509118824260433021873965830113 absolute error = 9.757976957908472587e-13 relative error = 6.2917674875494749080736745220488e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=488.2MB, alloc=4.5MB, time=51.10 x[1] = 9.2 y[1] (analytic) = 1.5248399569038077337472176911166 y[1] (numeric) = 1.5248399569030384722446227357071 absolute error = 7.692615025949554095e-13 relative error = 5.0448671620393741428306562596530e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=492.1MB, alloc=4.5MB, time=51.51 x[1] = 9.3 y[1] (analytic) = 1.507744451765237624039868291312 y[1] (numeric) = 1.5077444517646960857767979742469 absolute error = 5.415382630703170651e-13 relative error = 3.5917111977185171599218787769221e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=495.9MB, alloc=4.5MB, time=51.92 memory used=499.7MB, alloc=4.6MB, time=52.33 x[1] = 9.4 y[1] (analytic) = 1.5003069108531974527297196298698 y[1] (numeric) = 1.500306910852895746145565088313 absolute error = 3.017065841545415568e-13 relative error = 2.0109657695502213583040091137233e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=503.5MB, alloc=4.6MB, time=52.75 x[1] = 9.5 y[1] (analytic) = 1.502823845453332686775411785863 y[1] (numeric) = 1.502823845453273358977358413095 absolute error = 5.93277980533727680e-14 relative error = 3.9477546375687368624503509490509e-12 % Correct digits = 13 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=507.3MB, alloc=4.6MB, time=53.16 memory used=511.1MB, alloc=4.6MB, time=53.57 x[1] = 9.6 y[1] (analytic) = 1.5151949133257823635589725763838 y[1] (numeric) = 1.5151949133259582987768744016992 absolute error = 1.759352179018253154e-13 relative error = 1.1611391798805322992511876067354e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=515.0MB, alloc=4.6MB, time=53.99 x[1] = 9.7 y[1] (analytic) = 1.5369269190336340988048574272672 y[1] (numeric) = 1.5369269190340288020745377246218 absolute error = 3.947032696802973546e-13 relative error = 2.5681329723112206793648281595334e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=518.8MB, alloc=4.6MB, time=54.41 x[1] = 9.8 y[1] (analytic) = 1.5671534760886255822517329603796 y[1] (numeric) = 1.5671534760892138370171531049446 absolute error = 5.882547654201445650e-13 relative error = 3.7536512817387747156334912595857e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop memory used=522.6MB, alloc=4.6MB, time=54.82 NO POLE memory used=526.4MB, alloc=4.6MB, time=55.23 x[1] = 9.9 y[1] (analytic) = 1.6046695470463909312181302903125 y[1] (numeric) = 1.604669547047139804635903574266 absolute error = 7.488734177732839535e-13 relative error = 4.6668388463636373446253516934459e-11 % Correct digits = 12 h = 0.005 TOP MAIN SOLVE Loop NO POLE memory used=530.2MB, alloc=4.6MB, time=55.63 x[1] = 10 y[1] (analytic) = 1.6479794845466520034844330347681 y[1] (numeric) = 1.6479794845475221593523648983365 absolute error = 8.701558679318635684e-13 relative error = 5.2801377449867803129939936689062e-11 % Correct digits = 12 h = 0.005 Finished! diff ( y , x , 1 ) = sin(x) * cos(x) ; Iterations = 1980 Total Elapsed Time = 55 Seconds Elapsed Time(since restart) = 55 Seconds Time to Timeout = 9 Minutes 4 Seconds Percent Done = 100.1 % > quit memory used=533.3MB, alloc=4.6MB, time=55.93