############################################################# # Building 'integral' and sample output on the SGIs ############################################################# einstein% pwd; ls /usr2/people/phy329/ode/ex2/integral Makefile fcn.f integral.f einstein% make f77 -g -n32 -c integral.f f77 -g -n32 -c fcn.f f77 -g -n32 -L/usr/localn32/lib integral.o fcn.o -lp329f -lodepack \ -llinpack -lblas -o integral ############################################################# # Usage ############################################################# einstein% integral usage: integral [] ############################################################# # We can check the results using the following Maple # code (or similar) # # > Digits := 25; # > evalf(int(exp(-x^2),x=0.0..5.0)); # # .8862269254513954753824605 ############################################################# einstein% integral 0.0 5.0 0.8862269254350943 ^ ############################################################# # > evalf(int(exp(-x^2),x=0.0..10.0)); # # .8862269254527580136490835 ############################################################# einstein% integral 0.0 10.0 0.8862269254428063 ^ ############################################################# # > evalf(int(exp(-x^2),x=0.0..100.0)); # # .8862269254527580136490835 ############################################################# einstein% integral 0.0 100.0 0.8862269254522580 ^ ############################################################# # Repeat previous computation with less stringent tolerance, # note that answer is (roughly) correspondingly less # accurate. ############################################################# einstein% integral 0.0 100.0 1.0d-6 0.8862289729280245 ^ ############################################################# # Beware of strange results which can occur if integrand # 'underflows' ############################################################# einstein% integral -100.0 -100.0 0.0000000000000000E+00