# S.Chekanov
from jhplot import *
from jhplot.math.Random import *
from jhplot.math.StatisticSample import *
c1 = HPlot("Canvas",600,400)
c1.setGTitle("Title")
c1.visible(1)
c1.setAutoRange()
f=F1D("x*exp(x)",1,2)
p=f.getParse()
a=rejection(p,15,1,2)
# print a
c1.draw(f)
a=randomRejection(1000,p,15,1,2)
h=H1D("x*exp(x)",100,1,2)
h.fill(a)
c1.draw(h)
for i in range(10):
print f.eval(i)
Ads help maintain this website.