---
name: "std::cauchy_distribution"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/std::cauchy_distribution"
---

# std::cauchy\_distribution(3)

A cauchy\_distribution random number distribution.

## NAME

std::cauchy\_distribution\< \_RealType \> - A cauchy\_distribution random number distribution.

## SYNOPSIS

\#include \<random\>

### Classes

struct **param\_type**\

### Public Types

typedef \_RealType **result\_type**\

### Public Member Functions

**cauchy\_distribution** (\_RealType \_\_a, \_RealType \_\_b=1.0)\
 **cauchy\_distribution** (const **param\_type** &\_\_p)\
 template\<typename \_ForwardIterator, typename \_UniformRandomNumberGenerator\> void **\_\_generate** (\_ForwardIterator \_\_f, \_ForwardIterator \_\_t, \_UniformRandomNumberGenerator &\_\_urng)\
 template\<typename \_ForwardIterator, typename \_UniformRandomNumberGenerator\> void **\_\_generate** (\_ForwardIterator \_\_f, \_ForwardIterator \_\_t, \_UniformRandomNumberGenerator &\_\_urng, const **param\_type** &\_\_p)\
 template\<typename \_UniformRandomNumberGenerator\> void **\_\_generate** (**result\_type** \*\_\_f, **result\_type** \*\_\_t, \_UniformRandomNumberGenerator &\_\_urng, const **param\_type** &\_\_p)\
 \_RealType **a** () const\
 \_RealType **b** () const\
 **result\_type** **max** () const\
 Returns the least upper bound value of the distribution.  **result\_type** **min** () const\
 Returns the greatest lower bound value of the distribution.  template\<typename \_UniformRandomNumberGenerator\> **result\_type** **operator()** (\_UniformRandomNumberGenerator &\_\_urng)\
 Generating functions.  template\<typename \_UniformRandomNumberGenerator\> **result\_type** **operator()** (\_UniformRandomNumberGenerator &\_\_urng, const **param\_type** &\_\_p)\
 **param\_type** **param** () const\
 Returns the parameter set of the distribution.  void **param** (const **param\_type** &\_\_param)\
 Sets the parameter set of the distribution.  void **reset** ()\
 Resets the distribution state.

### Friends

bool **operator==** (const cauchy\_distribution &\_\_d1, const cauchy\_distribution &\_\_d2)\
 Return true if two Cauchy distributions have the same parameters.

## Detailed Description

### template\<typename \_RealType = double\>

class std::cauchy\_distribution\< \_RealType \>"A cauchy\_distribution random number distribution.

The formula for the normal probability mass function is $p(x\|a,b) = (i b (1 + (ac{x-a}{b})^2))^{-1}$

**Since**

C++11

## Member Typedef Documentation

### template\<typename \_RealType = double\> typedef \_RealType std::cauchy\_distribution\< \_RealType \>::result\_type

The type of the range of the distribution.

## Member Function Documentation

### template\<typename \_RealType = double\> result\_type std::cauchy\_distribution\< \_RealType \>::max () const \[inline\]

Returns the least upper bound value of the distribution.

### template\<typename \_RealType = double\> result\_type std::cauchy\_distribution\< \_RealType \>::min () const \[inline\]

Returns the greatest lower bound value of the distribution.

### template\<typename \_RealType = double\> template\<typename \_UniformRandomNumberGenerator\> result\_type std::cauchy\_distribution\< \_RealType \>::operator() (\_UniformRandomNumberGenerator & \_\_urng) \[inline\]

Generating functions.

Referenced by **operator()()**.

### template\<typename \_RealType = double\> param\_type std::cauchy\_distribution\< \_RealType \>::param () const \[inline\]

Returns the parameter set of the distribution.

Referenced by **std::operator\>\>()**.

### template\<typename \_RealType = double\> void std::cauchy\_distribution\< \_RealType \>::param (const param\_type & \_\_param) \[inline\]

Sets the parameter set of the distribution.

**Parameters**

*\_\_param* The new parameter set of the distribution.

### template\<typename \_RealType = double\> void std::cauchy\_distribution\< \_RealType \>::reset () \[inline\]

Resets the distribution state.

## Friends And Related Symbol Documentation

### template\<typename \_RealType = double\> bool operator== (const cauchy\_distribution\< \_RealType \> & \_\_d1, const cauchy\_distribution\< \_RealType \> & \_\_d2) \[friend\]

Return true if two Cauchy distributions have the same parameters.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
