Changeset 4405

Show
Ignore:
Timestamp:
07/25/08 05:51:57 (4 months ago)
Author:
crocker
Message:

Added one more example and an auxiliary predicate for testing.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/examples/threads/integration2d/functions2d.lgt

    r4392 r4405  
    1414        argnames is ['Function', 'X', 'Y', 'Fxy']]). 
    1515 
     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 
    1633    % [-2,2-2,2] 
    1734    % Integral = 21.33333 
    1835    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. 
    2042 
    2143    % [-2,2-2,2] 
     
    2749    % Integral = 7.7359 
    2850    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. 
    3052 
    3153    % [0,1,0,1]