Update BlockRIP experiment

This commit is contained in:
Ksyer
2024-01-27 20:58:09 +08:00
parent 8f965c1466
commit c2e23b4fbf
5 changed files with 169 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
% 由于函数单调,因此可以用二分法求 x/log(9x) = k 的解
function result = solve_test(k)
eps = 1e-3;
l = 1;
r = k;
while r - l > eps
mid = (l+r) / 2;
if (foo(mid) < foo(r))
l = mid;
else
r = mid;
end
end
result = l;
end
function f = foo(x)
f = x / log(9 * x);
end