Improving computational reliability with automatic differentiation and self-validating numerical methods