add koudai
This commit is contained in:
1 parent
7177a07538
commit
bad101802c
2 files changed
+73
-4
No files matched your search
@@ -6,10 +6,10 @@ def calculate_y(x):
|
||||
return y
|
||||
|
||||
|
||||
def calculate_x(y):
|
||||
def reduce_index(index):
|
||||
# Define the function to find the root of
|
||||
def f(x):
|
||||
return (10 * math.log(x + 1) + 30) * math.sqrt(x) - y
|
||||
return (10 * math.log(x + 1) + 30) * math.sqrt(x) - index
|
||||
|
||||
# Set the initial bounds for the bisection method
|
||||
a = 0
|
||||
@@ -32,6 +32,6 @@ def calculate_x(y):
|
||||
|
||||
|
||||
# Example usage
|
||||
y = 10000000
|
||||
x = calculate_y(y)
|
||||
y = 100000
|
||||
x = reduce_index(y)
|
||||
print(x)
|
||||
Reference in new issue
Block a user