Remove Multiple Unused Imports and Variable

This commit is contained in:
ParthS007
2018-10-18 02:58:57 +05:30
parent 765a3267fc
commit 0856a61859
22 changed files with 34 additions and 50 deletions

View File

@@ -3,16 +3,14 @@
from sympy import diff
from decimal import Decimal
from math import sin, cos, exp
def NewtonRaphson(func, a):
''' Finds root from the point 'a' onwards by Newton-Raphson method '''
while True:
x = a
c = Decimal(a) - ( Decimal(eval(func)) / Decimal(eval(str(diff(func)))) )
x = c
a = c
# This number dictates the accuracy of the answer
if abs(eval(func)) < 10**-15:
return c