Second-order mollified derivatives and optimization