The OpenD Programming Language

cauchyCDF

Ditto, with location and scale parameters (by standardizing x).

  1. T cauchyCDF(T x)
  2. T cauchyCDF(T x, T location, T scale)
    @safe pure nothrow @nogc
    T
    cauchyCDF
    (
    T
    )
    (
    const T x
    ,
    const T location
    ,
    const T scale
    )
    if (
    isFloatingPoint!T
    )

Parameters

x T

value to evaluate CDF

location T

location parameter

scale T

scale parameter

Examples

import mir.test: shouldApprox;

cauchyCDF(-3.0).shouldApprox == 0.1024164;
cauchyCDF(-2.0).shouldApprox == 0.1475836;
cauchyCDF(-1.0).shouldApprox == 0.25;
cauchyCDF(0.0).shouldApprox == 0.5;
cauchyCDF(1.0).shouldApprox == 0.75;
cauchyCDF(2.0).shouldApprox == 0.8524164;
cauchyCDF(3.0).shouldApprox == 0.8975836;

// Can include location/scale
cauchyCDF(-3.0, 1, 2).shouldApprox == 0.1475836;
cauchyCDF(-2.0, 1, 2).shouldApprox == 0.187167;
cauchyCDF(-1.0, 1, 2).shouldApprox == 0.25;
cauchyCDF(0.0, 1, 2).shouldApprox == 0.3524164;
cauchyCDF(1.0, 1, 2).shouldApprox == 0.5;
cauchyCDF(2.0, 1, 2).shouldApprox == 0.6475836;
cauchyCDF(3.0, 1, 2).shouldApprox == 0.75;

Meta