Thanks cowcow. I've pushed some changes that may help you.
I should point out that the function you've chose is fractal. I'm afraid that it may not be "sufficiently smooth" enough for the gradient evaluation to work. This might be a time where you are better off sticking with marching cubes.