[BLAST_ANAWARE] question about Numerical.h in DGen

From: Aaron Joseph Maschinot (ajmasch@MIT.EDU)
Date: Fri Aug 06 2004 - 15:42:39 EDT


hi, chi:

in the splint function inside of Numerical.h, there is the following line
for implementing trapezoidal numerical integration:

  s += (hi/2.0) * (y[i]+y[i+1] - (hi*hi/12.)*(y2[i]+y2[i+1]));

the first contribution is the trapezoidal area; the second is the error
term, i assume. am i interpreting this right?

if so, is this formula correct? my reference says that the error term for
the trapezoidal rule is:

  err = - h1 * h1 * h1 * y2[c] / 12.0

where c is the value such that y2[c] is maximum on the interval. i wonder
about the relevance of taking the end-point average second derivative and
assuming that this is the maximum.

also, can you even add the error term like this? doesn't the error
derivation require an absolute value sign:

  abs( int(f(x),x=a,b) - trap(f(x),x=a,b) ) < err

aaron



This archive was generated by hypermail 2.1.2 : Mon Feb 24 2014 - 14:07:31 EST