Пример #1
0
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
func ThreePoint(fn util.Functioner, x float64) (fp float64) {
	h := StepSize
	f := fn.Function()
	return ((f(x+h) - f(x-h)) / (2 * h))
}