示例#1
0
文件: fivepoint.go 项目: Arrow/nm
func FivePoint(fn util.Functioner, x float64) (fp float64) {
	h := StepSize
	f := fn.Function()
	return ((f(x-2*h) - 8*f(x-h) + 8*f(x+h) - f(x+2*h)) / (12 * h))
}
示例#2
0
文件: threepoint.go 项目: Arrow/nm
func ThreePoint(fn util.Functioner, x float64) (fp float64) {
	h := StepSize
	f := fn.Function()
	return ((f(x+h) - f(x-h)) / (2 * h))
}