<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="cuserrnd">
  <refmeta>
    <refentrytitle>cuserrnd</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>cuserrnd</refname>
    <refpurpose>
      Continuous USER-defined-distribution RaNDom generator.
      <indexterm id="IndexCuserrnd"><primary>cuserrnd</primary></indexterm>
    </refpurpose>
  </refnamediv>
  
  <refsect1>
    <title>Description</title>
    <para>
      Continuous USER-defined-distribution RaNDom generator.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis>aout <command>cuserrnd</command> kmin, kmax, ktableNum</synopsis>

    <synopsis>iout <command>cuserrnd</command> imin, imax, itableNum</synopsis>

    <synopsis>kout <command>cuserrnd</command> kmin, kmax, ktableNum</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>imin</emphasis> -- minimum range limit
    </para>

    <para>
      <emphasis>imax</emphasis> -- maximum range limit
    </para>

    <para>
      <emphasis>itableNum</emphasis> -- number of table containing the random-distribution function.  Such table is generated by the user. See <link linkend="GEN40">GEN40</link>, <link linkend="GEN41">GEN41</link>, and <link linkend="GEN42">GEN42</link>. The table length does not need to be a power of 2
    </para>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>ktableNum</emphasis> -- number of table containing the random-distribution function.  Such table is generated by the user. See <link linkend="GEN40">GEN40</link>, <link linkend="GEN41">GEN41</link>, and <link linkend="GEN42">GEN42</link>. The table length does not need to be a power of 2
    </para>
    <para>
      <emphasis>kmin</emphasis> -- minimum range limit
    </para>

    <para>
      <emphasis>kmax</emphasis> -- maximum range limit
    </para>

    <para>
      <emphasis>cuserrnd</emphasis> (continuous user-defined-distribution random generator) generates random values according to a continuous random distribution created by the user. In this case the shape of the distribution histogram can be drawn or generated by any GEN routine. The table containing the shape of such histogram must then be translated to a distribution function by means of GEN40 (see <link linkend="GEN40">GEN40</link> for more details). Then such function must be assigned to the XtableNum argument of cuserrnd.  The output range can then be rescaled according to the Xmin and Xmax arguments. cuserrnd linearly interpolates between table elements, so it is not recommended for discrete distributions (<link linkend="GEN41">GEN41</link> and <link linkend="GEN42">GEN42</link>).
    </para>

    <para>
      For a tutorial about random distribution histograms and functions see:

      <itemizedlist>
        <listitem>
          <para>
            D. Lorrain. "A panoply of stochastic cannons". In C. Roads, ed. 1989. Music machine. Cambridge, Massachusetts: MIT press, pp. 351 - 379.
          </para>
        </listitem>
      </itemizedlist>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="duserrnd"><citetitle>duserrnd</citetitle></link>,
      <link linkend="urd"><citetitle>urd</citetitle></link>
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>Author: &namegabriel;</para>
    <para>New in Version 4.16</para>
  </refsect1>
</refentry>
