/* times10 benchmark in Picat v3. bench/times10.pl https://github.com/SWI-Prolog/bench Changes: - $ escaped d/3 in times10/0. - added output This Picat model was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ main => go. go ?=> top, nl. go => true. % generated: 7 March 1990 % option(s): % % (deriv) times10 % % David H. D. Warren % % symbolic derivative of ((((((((x*x)*x)*x)*x)*x)*x)*x)*x)*x top:-times10. times10 :- d($((((((((x*x)*x)*x)*x)*x)*x)*x)*x)*x,x,X), println(X). d(U+V,X,DU+DV) :- !, d(U,X,DU), d(V,X,DV). d(U-V,X,DU-DV) :- !, d(U,X,DU), d(V,X,DV). d(U*V,X,DU*V+U*DV) :- !, d(U,X,DU), d(V,X,DV). d(U/V,X,(DU*V-U*DV)/(^(V,2))) :- !, d(U,X,DU), d(V,X,DV). d(^(U,N),X,DU*N*(^(U,N1))) :- !, integer(N), N1 is N-1, d(U,X,DU). d(-U,X,-DU) :- !, d(U,X,DU). d(exp(U),X,exp(U)*DU) :- !, d(U,X,DU). d(log(U),X,DU/U) :- !, d(U,X,DU). d(X,X,1) :- !. d(_,_,0).