Skip to content
Snippets Groups Projects
Commit b9f6b029 authored by iliya's avatar iliya
Browse files

feat: testing with another example

parent 7274bdda
No related branches found
No related tags found
No related merge requests found
......@@ -7,14 +7,28 @@ def f(x: Dual_Number):
return ((x * x - 1) * Dual_Number.exp(x - 1)).d
def g(x: Dual_Number):
return (Dual_Number.sin(x * x) + Dual_Number.exp(x + 3) *
Dual_Number.cos(5 - x)).d
def dfdx(x: float):
return f(Dual_Number(x, 1))
def dgdx(x: float):
return g(Dual_Number(x, 1))
if __name__ == "__main__":
# Example for f(x)
start = -6
stop = -1
# Example for g(x)
# start = -2
# stop = 0.1
print("----------------------------------------------")
print(f"Rec bisection = {rec_bisection(start, stop, dfdx, False)}")
print("----------------------------------------------")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment