I thought I'd try it out in @numbas, then realised that the way Numbas evaluates expressions is far too slow for this kind of numerical approximation - it does a lot of dynamic type-checking that takes a long time.
So I nerdsniped myself into writing a routine to take a Numbas JME expression and make a function which is as close to native JS as I can get. It works on all of the operations that you'd expect a student to use, since those have plain-JS implementations. There's just the control flow stuff and things to do with collections that need the whole JME system.
It's really simple to implement in Numbas: you set up a JSXGraph diagram, and fill in the function parameter of the implicit curve object with the expression the student typed. Just a few lines of code. Nice!
I've just noticed that the #JSXGraph team are revamping their collection of examples: http://jsxgraph.org/share/. This is very welcome! The old wiki was very hard to use, and hard to tell if the example you wanted was there or not.