Apr-14-2019, 11:38 AM
Thanks,
I understand what you are saying,
I came up with a correction to my code, however
my graphs are still empty.
I'd like to know why so and what I should do in order
to solve this issue.
I understand what you are saying,
I came up with a correction to my code, however
my graphs are still empty.
I'd like to know why so and what I should do in order
to solve this issue.
def applog(n,x): a0=(1+x)/2 b0=sqrt(x) for i in range(n): a0=(a0+b0)/2 b0=sqrt((a0)*b0) return (x-1)/a0 print("the log approximation is: " , ((applog(100,4)))) print("log value-------------------:" , (np.log(4)) ) error=(abs( applog(100,4)- (np.log(4)) ) ) print("the error is : ", error) plt.show() plt.plot((applog(100,4)) ) plt.plot(np.log(4)) plt.show() #should plot both funtctions in the same graph plt.plot(error ) plt.show() # should plot the difference of both functions