add koudai

This commit is contained in:
jianxin committed 2023-11-03 15:56:43 +08:00
1 parent 7177a07538
commit bad101802c
2 files changed
+73 -4

No files matched your search

+4 -4
View File
@@ -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)