2019-10-01 数値微分・中心差分 中心差分 $$ f(x) = \frac{f(x+h) - f(x-h)}{2h} $$ プログラム import numpy as np def n_diff(f, x): h = 1e-4 return (f(x + h) - f(x - h)) / (2 * h)