| ||||||||||
Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Announcement | Current Contest Past Contests Scheduled Contests Award Contest |
Numerical Integration
Description In
his freshman year, flymouse studied integral. Symbolic integration
frustrated him a lot. He was often confused by those subtle techniques:
alternately trying integration by substitution and integration by parts
until the integrand appears in a tabulated form then employing
integration by quadrature to have the work finally done. In contrast,
numerical integration intrigued him much. By following some fixed
procedures such as Newton-Cotes formulas, he could easily find the
approximation to some definite integrals without too much effort. Given
the exercises flymouse did, can your program do as nice a job as
flymouse did? Input The input contains several test cases. Each test case consists of one line containing a univariate function f(x) and two real numbers a and b meaning the approximate value of And the syntax is given below: Operator precedence and associativity are almost the same as those in C except that ¡® f(x)
is not necessarily continuous. It can have singularities which are
always isolated if exist. It can be oscillatory, but it will never be
oscillatory in the neighborhood of singularities where it blows up. The
integral is guaranteed to converge. Length of the interval over which f(x) is integrated is not longer than 10. Process to end of file. Output For
each test case, output one line with only the approximate value of the
integral rounded to exactly four digits past the decimal point. Sample Input Sample Output Hint Source |
[Submit] [Go Back] [Status] [Discuss]
All Rights Reserved 2003-2006 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator