Haskell
- 1 ответ
- 0 вопросов
0
Вклад в тег
module Main where
import Text.Printf
idef i nn steps =
1 - sum [ n*(n+1)**2 + i*(n+1) + j | j <- [0..nn], n <- [0..steps]]
calcAndPrint i nn steps = do
let res = idef i nn steps
printf "%d %f" i res
return res
defect k nn steps =
maximum [ calcAndPrint i nn steps | i <- [nn- k+1 .. nn]]
main = do
let defect_0 = ...
let defect_N = defect <k> <nn> <steps>
printf "defect of P_tau_LH=%f=%e\n" defect_0