```
f <- function(x) sin(10*pi*x) + 0.5*(x-0.5)^2
a <- 0; b <- 1
direct1d(f, 0, 1, maxiter = 20)
# $xmin: 0.5499493794 (error: 3.5e-6)
# $fmin: -0.9987512652
## Not run:
# ezplot(f, a, b, 1000)## End(Not run)
```

Run the code above in your browser using DataLab