예제 #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))
}