In general Cauchy distribution doesn't have standard deviation defined, though it should be possible to calculate it for a given interval.
This is the formula that I'm trying to use:
PDF for Cauchy is
The mean for Cauchy is 0, so taking 0.4 as a scale and [-3;3] as interval we get an integral
Which gives a value of 0.6174 = (0.7858)^2
But when I generate any number of Cauchy values with scale 0.4 (I was trying to generate 10,000 and 10,000,000 numbers - it didn't matter) and filter-out all the numbers which absolute value is greater than 3 it always gives me SD = 0.8198 which is completely different.
Any ideas on what am I doing wrong? Sorry to ask such a silly question.