Skip to content

Instantly share code, notes, and snippets.

@taroyabuki
Last active December 11, 2015 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taroyabuki/4660957 to your computer and use it in GitHub Desktop.
Save taroyabuki/4660957 to your computer and use it in GitHub Desktop.
http://blog.unfindable.net/archives/5410Bug in Mathematica 8.0.4, 9.0.0, 9.0.1 for Microsoft Windows (64-bit) (December 12, 2012).To avoid this issue, you need run the following command:SetSystemOptions["CompileOptions" -> {"TableCompileLength Infinity}]
f[] := With[{p = RandomVariate[NormalDistribution[]]}, If[0 <= p, p, f[]]]
data = Table[f[], {249}]; (* no problem *)
data2 = Table[f[], {250}]; (* crash! *)
g[] := With[{p = RandomVariate[BinomialDistribution[10, 1/10]]}, If[0 <= p, p, g[]]]
data = Table[g[], {249}]; (* no problem *)
data2 = Table[g[], {250}]; (* crash! *)
h = With[{p = RandomVariate[NormalDistribution[]]}, If[0 <= p, p, h[]]] &;
data2 = Table[h[], {250}]; (* no problem *)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment