Optimistic Optimization of Deterministic Functions