NumPyで使用するための独自のufunc(ユニバーサル関数)の作成方法 https://odigo.jp/numpy-ufunc-creation/