todo: divide by zero check within the function before eval for newtons method..