% % Written by: % -- % John L. Weatherwax 2009-04-21 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- addpath('../../BookCode'); close all; clc; clear; % Problem EPage 82 % for a = [1,2] approx = simp1( 'c_4_p_8_fn', a, a+1, 512 ); truth = a * log( a ) - a + log( sqrt( 2 * pi ) ); disp( sprintf( 'a= %10.6f, truth= %10.6f, approx= %10.6f', a, truth, approx ) ); end