>>866
% Prolog

f(X,Y) :- Y is 3 * X * X.

区間求積法(M,S) :-
  findsum(U,(for(0,N,M),V is N / M,f(V,W),U is (1.0 / M) * W),S).