Hacker News new | ask | show | jobs
by hggigg 618 days ago
Rather nice that. I like it.

Doesn't handle divide by zero very well though i.e. f(x)=1/x. Should probably consider that as undefined rather than a bad expression.

1 comments

You could also set the x_min to 0.001 or so.
Or, since the function expression is just JavaScript, singularities can also be avoided like this: x == 0 ? 1 : Math.sin(x) / x