用Newtown开高阶根号
6^(1/7)
Go
(2^7-122)^(1/7)
Go
2*(1-122/128)^(1/7)
Go
Newton 展开有
2*( 1+ 1/7*(-122/128)/1!+ 1/7*(1/7-1)*(-122/128)^2/2! +
(defun pow (num count)
(if (or (> count 1) (eq count 1))
(* num
(pow num
(- count 1) ) )
1))
(defun slayer(count)
(if (or (> count 1) (eq count 1))
(* count
(slayer
(- count 1) ) )
1))
(defun slayerex(n count )
(if (or (> count 1) (eq count 1))
(* n
(slayerex
(- n 1)
(- count 1) ) )
1))
(defun expr (n x y count)
(if (> n count)
0
(+ (expr (+ n 1)
x
y
count)
(/ (* (slayerex x n)
(pow y n))
(slayer n)))))
(print (* 2 (expr 0 (/ 1.0 7) -122/128 32) ) )
(print 'compare )
(print (pow (* 2 (expr 0 (/ 1.0 7) -122/128 32)) 7))
这种方法收敛得很慢,要到32项才慢慢接近目标。因为其中-122/128的值还是比较接近1,而不是0