c ********** c c this program checks the constants of machine precision and c smallest and largest machine representable numbers specified in c function spmpar, against the corresponding hardware-determined c machine constants obtained by smchar, a subroutine due to c w. j. cody. c c data statements in spmpar corresponding to the machine used must c be activated by removing c in column 1. c c the printed output consists of the machine constants obtained by c smchar and comparisons of the spmpar constants with their c smchar counterparts. descriptions of the machine constants are c given in the prologue comments of smchar. c c subprograms called c c minpack-supplied ... smchar,spmpar c c minpack. version of january 1979. c burton s. garbow, kenneth e. hillstrom, jorge j. more c c ********** integer ibeta,iexp,irnd,it,machep,maxexp,minexp,negep,ngrd, * nwrite real dwarf,eps,epsmch,epsneg,giant,xmax,xmin real rerr(3) real spmpar c c logical output unit is assumed to be number 6. c data nwrite /6/ c c determine the machine constants dynamically from smchar. c call smchar(ibeta,it,irnd,ngrd,machep,negep,iexp,minexp,maxexp, * eps,epsneg,xmin,xmax) c c compare the spmpar constants with their smchar counterparts and c store the relative differences in rerr. c epsmch = spmpar(1) dwarf = spmpar(2) giant = spmpar(3) rerr(1) = (epsmch - eps)/epsmch rerr(2) = (dwarf - xmin)/dwarf rerr(3) = (xmax - giant)/giant c c write the smchar constants. c write (nwrite,10) * ibeta,it,irnd,ngrd,machep,negep,iexp,minexp,maxexp,eps, * epsneg,xmin,xmax c c write the spmpar constants and the relative differences. c write (nwrite,20) epsmch,rerr(1),dwarf,rerr(2),giant,rerr(3) stop 10 format (17h1smchar constants /// 8h ibeta =, i6 // 8h it =, * i6 // 8h irnd =, i6 // 8h ngrd =, i6 // 9h machep =, * i6 // 8h negep =, i6 // 7h iexp =, i6 // 9h minexp =, * i6 // 9h maxexp =, i6 // 6h eps =, e15.7 // 9h epsneg =, * e15.7 // 7h xmin =, e15.7 // 7h xmax =, e15.7) 20 format ( /// 42h spmpar constants and relative differences /// * 9h epsmch =, e15.7 / 10h rerr(1) =, e15.7 // * 8h dwarf =, e15.7 / 10h rerr(2) =, e15.7 // 8h giant =, * e15.7 / 10h rerr(3) =, e15.7) c c last card of driver. c end .