Chop
例題
すべて開く すべて閉じる例 (1)
スコープ (2)
アプリケーション (2)
x = N[Pi];
r = Rationalize[x, 10 ^ -12]Chop[x - r] === 0Chop[x - r, 10 ^ -14] === 0Equalで比べる前に非常に小さい項を除去する:
list = {0, 0, 1, 0, 0};
identity = FourierDCT[FourierDCT[{0, 0, 1, 0, 0}, 2], 3]list == identitylist == Chop[identity]特性と関係 (1)
Chopの関数的な実装:
chop[xa_, dxa_ : 10 ^ -10] := Module[{ch},
ch[x_Real, dx_] := If[Abs[x] < dx, 0, x];
ch[Complex[r_, i_], dx_] := ch[r, dx] + I ch[i];
ch[x_ ? AtomQ, dx_] := x;
ch[x_, dx_] := Map[ch[#, dx]&, x];
ch[xa, dxa]
]e = f[$MachineEpsilon, 1. + 2. x + 3. 10 ^ -12 x ^ 2]chop[e]Chop[e]大きい式に関してはChopの方がはるかに速い:
x = ConstantArray[0., 10 ^ 6];
x[[1]] = 1.;y = Fourier[InverseFourier[x]];Timing[Chop[y] == x]Timing[chop[y] == x]考えられる問題 (1)
2. Iこのため,Chopは機械精度複素数の実部を厳密な0にはしない:
Chop[10. ^ -12 + 2. I]Chop[2. + 10. ^ -12 I]テクニカルノート
-
▪
- 数値の精度
履歴
1988 で導入 (1.0)
テキスト
Wolfram Research (1988), Chop, Wolfram言語関数, https://reference.wolfram.com/language/ref/Chop.html.
CMS
Wolfram Language. 1988. "Chop." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Chop.html.
APA
Wolfram Language. (1988). Chop. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Chop.html
BibTeX
@misc{reference.wolfram_2026_chop, author="Wolfram Research", title="{Chop}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/Chop.html}", note=[Accessed: 09-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_chop, organization={Wolfram Research}, title={Chop}, year={1988}, url={https://reference.wolfram.com/language/ref/Chop.html}, note=[Accessed: 09-September-2026]}