Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

added 101 characters in body
Source Link
att
  • 22.8k
  • 2
  • 19
  • 70

Wolfram Language (Mathematica), 42 bytes

Re[#+#2√Log[16/r^2]I^r]I^r&
r:=4Random[]

Try it online!

RandomVariate@NormalDistribution is costly (and, as noted by Ben Izd , doesn't work with stdev=0), so this uses Box-Muller to generate a normal distribution from two uniform ones.

Sample distributions (N=10000):
enter image description here

Wolfram Language (Mathematica), 42 bytes

Re[#+#2√Log[16/r^2]I^r]I^r&
r:=4Random[]

Try it online!

RandomVariate@NormalDistribution is costly, so this uses Box-Muller to generate a normal distribution from two uniform ones.

Sample distributions (N=10000):
enter image description here

Wolfram Language (Mathematica), 42 bytes

Re[#+#2√Log[16/r^2]I^r]I^r&
r:=4Random[]

Try it online!

RandomVariate@NormalDistribution is costly (and, as noted by Ben Izd , doesn't work with stdev=0), so this uses Box-Muller to generate a normal distribution from two uniform ones.

Sample distributions (N=10000):
enter image description here

Source Link
att
  • 22.8k
  • 2
  • 19
  • 70

Wolfram Language (Mathematica), 42 bytes

Re[#+#2√Log[16/r^2]I^r]I^r&
r:=4Random[]

Try it online!

RandomVariate@NormalDistribution is costly, so this uses Box-Muller to generate a normal distribution from two uniform ones.

Sample distributions (N=10000):
enter image description here

AltStyle によって変換されたページ (->オリジナル) /