RANDCAUCHY Function (Gnumeric)
RANDCAUCHY(a) uses a nonnegative scale and zero location. For positive scale the ideal Cauchy distribution has a median, but no defined mean or variance.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: RANDCAUCHY(a) uses a nonnegative scale and zero location. For positive scale the ideal Cauchy distribution has a median, but no defined mean or variance.
Syntax
=RANDCAUCHY(a)
Availability and evidence
- Introduction: Gnumeric 1.1.6 NEWS explicitly lists this new function. This release-history evidence is separate from a native test of that old version.
- Source support: Registered in the Gnumeric 1.12.62 random plugin. No retirement is established; the last functioning native application version is unverified.
- Evidence dates: Official Gnumeric source retained October 13–14, 2026 was reviewed October 15. Mathematical controls were independently recalculated October 15. No native application, compiled Gnumeric helper or random generator was executed.
Parameter and source contract
The required argument a is the scale, not a standard deviation. Negative a is rejected with #NUM!. The callback and helper both contain this guard. Scale0 gives 0 for an accepted finite transform, while the ordinary Cauchy model uses positive scale.
The helper requests a unit driver U, rejects exactly0 and 0.5, then returns a*TAN(PI()*U) using its dedicated tanpi routine. The positive branch occurs below 0.5 and the negative branch above 0.5. This differs in ordering from the common centered inverse CDF, even though it represents the same ideal symmetric distribution.
Complete worksheet setup
Create CauchyControls. Put scale 2 in B2 and a separate location 10 in B3. In D2 enter =RANDCAUCHY($B$2). In D3 enter =$B$3+D2 to shift that same random result.
D2 has no fixed expected draw. Under the ideal model its median is 0 and quartiles are -2 and 2. D3 has median 10 and quartiles 8 and 12. Do not label either median as an expected value or substitute the scale for a standard deviation; those moment-based summaries are undefined for a positive-scale Cauchy distribution.
Deterministic source-transform controls
Put 0.125, 0.25, 0.75 and 0.875 in A7:A10. In B7 enter =$B$2*TAN(PI()*A7) and fill through B10. The independent mathematical results are:
| Supplied input or control | Independent reference result |
|---|---|
| U=.125 | 0.8284271247462 |
| U=.25 | 2.0 |
| U=.75 | -2.0 |
| U=.875 | -0.8284271247462 |
This worksheet uses ordinary TAN/PI arithmetic to illustrate the source mapping, not to claim bit-for-bit equality with the dedicated tanpi implementation. Safe inputs away from the pole are intentional. U=0.5 is rejected by the source rather than evaluated, and U=0 is rejected too.
Advanced: use quantiles and central coverage
For positive scale a, the ideal probability of -t≤X≤t is 2*ATAN(t/a)/PI() for t≥0. With a=2 and t=2, the central probability is 0.5. With t=20 it is approximately 0.936548965139.
Thus even an interval extending ten scales on either side contains only about93.65% of the ideal distribution. Large observations are consistent with this heavy-tailed model; they are not automatically evidence that the formula malfunctioned.
For location 10 and scale 2, the middle50% interval is 8 through 12. Shifting location changes its center but not width. Doubling scale doubles its interquartile range from 4 to 8.
Advanced: why an average is a poor validation target
A finite worksheet sample has a calculable arithmetic average when all its values are finite, but the ideal population mean does not exist. Increasing the number of draws does not justify expecting that sample average to settle near0 in the ordinary finite-variance sense.
Use the parameter interpretation, deterministic transform controls, and appropriate quantiles to inspect a model instead. A single large draw should not be discarded merely to make the sample mean resemble the median. This guide does not perform a statistical-quality test of the actual generator.
Advanced: separate shared draws from separate calls
D3 references D2 so the location shift is exact apart from ordinary addition rounding. Two independent-looking formulas =RANDCAUCHY(2) and =10+RANDCAUCHY(2) are separate calls and will not in general differ by10.
Similarly, scaling one saved result by2 demonstrates a same-draw scale change. Calling RANDCAUCHY(4) separately changes the distribution but does not reproduce twice the preceding RANDCAUCHY(2) result.
Boundary and numerical cautions
=RANDCAUCHY(-2) returns #NUM!. =RANDCAUCHY(0) returns 0 after an accepted driver is found; it is a degenerate source extension rather than a positive-scale Cauchy population. It can still consume generator state.
The source rejects the exact tangent pole, but values near it can be large and multiplying by a large scale can overflow. The finite driver lattice also limits the representable tails. No exact maximum magnitude or native final-digit guarantee is asserted here.
Working with a changing result
The function is registered as volatile. A recalculation can replace its result; neither a copied screenshot nor an earlier value is a promised next draw. There is no seed argument in this function’s worksheet signature. Exact recalculation triggers, shared-generator sequencing and saved-file replay were not tested.
The controls below separate a changing random formula from deterministic arithmetic. The supplied driver values are teaching inputs, not values captured from Gnumeric’s generator. Population summaries describe the ideal continuous distribution and are not empirical certifications of the finite-resolution implementation.
Troubleshooting and verification limits
Use explicit finite numeric inputs for these controls. Text parsing, blank-cell coercion, locale-specific separators and array broadcasting are outside the verified examples. The numeric result constructor turns non-finite arithmetic into #NUM!; very large parameters or extreme transformed values can therefore fail even when the mathematical distribution is defined.
The underlying unit generator has finite resolution. Endpoint exclusions, rounding, overflow and underflow mean a theoretical continuous distribution is not a literal list of every machine output. No random samples, native worksheet execution, distribution-quality test, GUI operation or cross-application file transfer was performed for this guide. The executable checks verify deterministic transformations and mathematical reference values only.