How to evaluate gradient at arbitrary point?