Changeset 4405
- Timestamp:
- 07/25/08 05:51:57 (4 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/threads/integration2d/functions2d.lgt
r4392 r4405 14 14 argnames is ['Function', 'X', 'Y', 'Fxy']]). 15 15 16 :- public(result/2). 17 :- mode(result(+atom, -float), one). 18 :- info(resul/2, [ 19 comment is 'Shows the Correct Result of the Integral.', 20 argnames is ['Function', 'I']]). 21 22 result(circle, 21.33333). 23 result(poly6, 5.88698). 24 result(i14, 11.947778). 25 result(i15, 7.7359). 26 result(bailey1, 0.765196). 27 result(bailey2, 1.07664). 28 result(bailey3, 3.17344). 29 result(bailey4, 4.66927). 30 result(bailey5, 1.82396). 31 32 16 33 % [-2,2-2,2] 17 34 % Integral = 21.33333 18 35 eval(circle, X, Y, Fxy) :- 19 Fxy is X*X + Y*Y - 2*2. 36 Fxy is X*X + Y*Y - 2.0*2.0. 37 38 % [-2,2-2,2] 39 % Integral = 5.88698 40 eval(poly6, X, Y, Fxy) :- 41 Fxy is X**6.0/200.0 - X*Y**5.0 - 0.1*X*X*Y*Y + 0.5. 20 42 21 43 % [-2,2-2,2] … … 27 49 % Integral = 7.7359 28 50 eval(i15, X, Y, Fxy) :- 29 F is sin(6 *X*Y), Fxy is F*F.51 F is sin(6.0*X*Y), Fxy is F*F. 30 52 31 53 % [0,1,0,1]
