Numerical integration: Difference between revisions

Content added Content deleted
(→‎{{header|REXX}}: changed whitespace, changed to use six million approximations instead of five million for the 4th test suite.)
m (aligned columns as originally intended.)
Line 33: Line 33:


Demonstrate your function by showing the results for:
Demonstrate your function by showing the results for:
* {{math|1=ƒ(x) = x<sup>3</sup>}}, where '''x''' is [0,1], with 100 approximations. The exact result is 1/4, or 0.25.
* &nbsp; {{math|1=ƒ(x) = x<sup>3</sup>}}, &nbsp; &nbsp; &nbsp; where &nbsp; '''x''' &nbsp; is &nbsp; &nbsp; [0,1], &nbsp; &nbsp; &nbsp; with &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100 approximations. &nbsp; The exact result is &nbsp; &nbsp; 0.25 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (or 1/4)
* {{math|1=ƒ(x) = 1/x}}, where '''x''' is [1,100], with 1,000 approximations. The exact result is the natural log of 100, or about 4.605170
* &nbsp; {{math|1=ƒ(x) = 1/x}}, &nbsp; &nbsp; where &nbsp; '''x''' &nbsp; is &nbsp; [1,100], &nbsp; &nbsp; with &nbsp; &nbsp; &nbsp; &nbsp;1,000 approximations. &nbsp; The exact result is &nbsp; &nbsp; 4.605170<sup>+</sup> &nbsp; &nbsp; (natural log of 100)
* {{math|1=ƒ(x) = x}}, where '''x''' is [0,5000], with 5,000,000 approximations. The exact result is 12,500,000.
* &nbsp; {{math|1=ƒ(x) = x}}, &nbsp; &nbsp; &nbsp; &nbsp; where &nbsp; '''x''' &nbsp; is &nbsp; [0,5000], &nbsp; with 5,000,000 approximations. &nbsp; The exact result is &nbsp; 12,500,000
* {{math|1=ƒ(x) = x}}, where '''x''' is [0,6000], with 6,000,000 approximations. The exact result is 18,000,000.
* &nbsp; {{math|1=ƒ(x) = x}}, &nbsp; &nbsp; &nbsp; &nbsp; where &nbsp; '''x''' &nbsp; is &nbsp; [0,6000], &nbsp; with 6,000,000 approximations. &nbsp; The exact result is &nbsp; 18,000,000


<br/>
<br/>
'''See also'''
;See also:
* [[Active object]] for integrating a function of real time.
* &nbsp; [[Active object]] for integrating a function of real time.
* [[Special:PrefixIndex/Numerical integration]] for other integration methods.
* &nbsp; [[Special:PrefixIndex/Numerical integration]] for other integration methods.


<br/>
<br/>