A new tool for efficient optimization by automatic differentiation and program transparency