#############################################################################

[main]

[main - data:]

# method
method: TABL

[main - header:]

/* prototypes */
double pdf( double x, UNUR_DISTR *distr );

double pdf_negative( double x, const UNUR_DISTR *distr );
double pdf_partnegative( double x, const UNUR_DISTR *distr );

\#define COMPARE_SAMPLE_SIZE   (10000)
\#define VIOLATE_SAMPLE_SIZE   (20)

#############################################################################

[new]

[new - invalid NULL ptr: 
   distr = NULL; ]

~( distr );
	--> expected_NULL --> UNUR_ERR_NULL

[new - invalid distribution type:
   distr = unur_distr_discr_new(); ]

~( distr );
	 --> expected_NULL --> UNUR_ERR_DISTR_INVALID

[new - data missing in distribution object:
   distr = unur_distr_cont_new(); ]

/* pdf */
~( distr );
	--> expected_NULL --> UNUR_ERR_DISTR_REQUIRED

#############################################################################

[set]

[set - invalid NULL ptr: 
   double slopes[2] = {0.,1.};
   par = NULL; ]

~_cpoints( par, 0, NULL );
	--> expected_setfailed --> UNUR_ERR_NULL

~_useear( par, 1 );
	--> expected_setfailed --> UNUR_ERR_NULL

~_usedars( par, 1 );
	--> expected_setfailed --> UNUR_ERR_NULL

~_darsfactor( par, 1. );
	--> expected_setfailed --> UNUR_ERR_NULL

~_variant_splitmode( par, 1 );
	--> expected_setfailed --> UNUR_ERR_NULL

~_areafraction( par, 0.2 );
	--> expected_setfailed --> UNUR_ERR_NULL

~_nstp( par, 30 );
	--> expected_setfailed --> UNUR_ERR_NULL

~_slopes( par, slopes, 2 );
	--> expected_setfailed --> UNUR_ERR_NULL

~_boundary( par, 0.,1. );
	--> expected_setfailed --> UNUR_ERR_NULL

~_guidefactor( par, 1. );
	--> expected_setfailed --> UNUR_ERR_NULL

~_max_sqhratio( par, 0.95 );
	--> expected_setfailed --> UNUR_ERR_NULL

~_max_intervals( par, 100 );
	--> expected_setfailed --> UNUR_ERR_NULL

~_verify( par, 1 );
	--> expected_setfailed --> UNUR_ERR_NULL

~_pedantic( par, 1 );
	--> expected_setfailed --> UNUR_ERR_NULL

~_variant_ia( par, TRUE );
	--> expected_setfailed --> UNUR_ERR_NULL


[set - invalid parameter object:
   double fpar[2] = {0.,1.};
   double slopes[2] = {0.,1.};
   distr = unur_distr_normal(fpar,2);
   par = unur_arou_new(distr); ]

~_cpoints( par, 0, NULL );
	--> expected_setfailed --> UNUR_ERR_PAR_INVALID

~_useear( par, 1 );
	--> expected_setfailed --> UNUR_ERR_PAR_INVALID

~_usedars( par, 1 );
	--> expected_setfailed --> UNUR_ERR_PAR_INVALID

~_darsfactor( par, -1. );
	--> expected_setfailed --> UNUR_ERR_PAR_INVALID

~_variant_splitmode( par, 1 );
	--> expected_setfailed --> UNUR_ERR_PAR_INVALID

~_areafraction( par, 0.2 );
	--> expected_setfailed --> UNUR_ERR_PAR_INVALID

~_nstp( par, 30 );
	--> expected_setfailed --> UNUR_ERR_PAR_INVALID

~_slopes( par, slopes, 2 );
	--> expected_setfailed --> UNUR_ERR_PAR_INVALID

~_boundary( par, 0.,1. );
	--> expected_setfailed --> UNUR_ERR_PAR_INVALID

~_guidefactor( par, 1. );
	--> expected_setfailed --> UNUR_ERR_PAR_INVALID

~_max_sqhratio( par, 0.95 );
	--> expected_setfailed --> UNUR_ERR_PAR_INVALID

~_max_intervals( par, 100 );
	--> expected_setfailed --> UNUR_ERR_PAR_INVALID

~_verify( par, 1 );
	--> expected_setfailed --> UNUR_ERR_PAR_INVALID

~_pedantic( par, 1 );
	--> expected_setfailed --> UNUR_ERR_PAR_INVALID

~_variant_ia( par, TRUE );
	--> expected_setfailed --> UNUR_ERR_PAR_INVALID


unur_par_free(par);

[set - invalid parameters:
   double slopesA[4] = {0.,1.,0.5,2.};
   double slopesB[4] = {1.,2.,0.,1.};
   double stp[] = {1.,0.,1.};
   int n_stp = 3;
   double fpar[2] = {0.,1.};
   distr = unur_distr_normal(fpar,2);
   par = unur_tabl_new(distr); ]

~_cpoints( par, -1, NULL );
	--> expected_setfailed --> UNUR_ERR_PAR_SET

~_cpoints( par, n_stp, stp );
	--> expected_setfailed --> UNUR_ERR_PAR_SET

~_variant_splitmode( par, 0 );
	--> expected_setfailed --> UNUR_ERR_PAR_SET

~_variant_splitmode( par, 4 );
	--> expected_setfailed --> UNUR_ERR_PAR_SET

~_areafraction( par, -0.1 );
	--> expected_setfailed --> UNUR_ERR_PAR_SET

~_nstp( par, -1 );
	--> expected_setfailed --> UNUR_ERR_PAR_SET

~_slopes( par, slopesA, 0 );
	--> expected_setfailed --> UNUR_ERR_PAR_SET

~_slopes( par, slopesA, 4 );
	--> expected_setfailed --> UNUR_ERR_PAR_SET

~_slopes( par, slopesB, 4 );
	--> expected_setfailed --> UNUR_ERR_PAR_SET

~_boundary( par, 2., 1. );
	--> expected_setfailed --> UNUR_ERR_PAR_SET

~_boundary( par, 0., UNUR_INFINITY );
	--> expected_setfailed --> UNUR_ERR_PAR_SET

~_boundary( par, -UNUR_INFINITY, 0. );
	--> expected_setfailed --> UNUR_ERR_PAR_SET

~_guidefactor( par, -0.1 );
	--> expected_setfailed --> UNUR_ERR_PAR_SET

~_max_sqhratio( par, -0.1 );
	--> expected_setfailed --> UNUR_ERR_PAR_SET

~_max_sqhratio( par, 1.1 );
	--> expected_setfailed --> UNUR_ERR_PAR_SET

~_max_intervals( par, 0 );
	--> expected_setfailed --> UNUR_ERR_PAR_SET

unur_par_free(par);

#############################################################################

[get]

[get - invalid NULL ptr: 
   gen = NULL; ]

~_sqhratio(gen);
        --> expected_INFINITY --> UNUR_ERR_NULL

~_hatarea(gen);
        --> expected_INFINITY --> UNUR_ERR_NULL

~_squeezearea(gen);
        --> expected_INFINITY --> UNUR_ERR_NULL

~_n_intervals(gen);
        --> expected_zero --> UNUR_ERR_NULL


[get - invalid generator object:
   distr = unur_distr_normal(NULL,0);
   par = unur_arou_new(distr);
   gen = unur_init(par); <-- ! NULL ]

~_sqhratio(gen);
        --> expected_INFINITY --> UNUR_ERR_GEN_INVALID

~_hatarea(gen);
        --> expected_INFINITY --> UNUR_ERR_GEN_INVALID

~_squeezearea(gen);
        --> expected_INFINITY --> UNUR_ERR_GEN_INVALID

~_n_intervals(gen);
        --> expected_zero --> UNUR_ERR_GEN_INVALID


#############################################################################

[chg]

[chg - invalid generator object:
   double fpar[2] = {0.,1.};
   distr = unur_distr_normal(fpar,2);
   par = unur_arou_new(distr);
   unur_set_debug(par,0);
   gen = unur_init( par ); <-- ! NULL ]

~_verify(gen,1);
	--> expected_setfailed --> UNUR_ERR_GEN_INVALID


#############################################################################

[init]

[init - invalid NULL ptr: 
   par = NULL; ]

unur_init( par );
	--> expected_NULL --> UNUR_ERR_NULL

[init - wrong mode:
   distr = unur_distr_normal(NULL,0);
   par = NULL; ]

unur_distr_cont_set_mode(distr,-1.);
par = unur_tabl_new(distr);
unur_init( par );
	--> expected_NULL --> UNUR_ERR_GEN_CONDITION

unur_distr_cont_set_mode(distr,1.);
par = unur_tabl_new(distr);
unur_init( par );
	--> expected_NULL --> UNUR_ERR_GEN_CONDITION

[init - negative value of pdf:
   distr = unur_distr_cont_new(); 
   unur_distr_cont_set_pdf(distr,pdf_negative);
   par = NULL; ]

par = unur_tabl_new(distr);
unur_init( par );
	--> expected_NULL --> UNUR_ERR_GEN_CONDITION

unur_distr_cont_set_domain(distr,-2.,2.);
par = unur_tabl_new(distr);
unur_init( par );
	--> expected_NULL --> UNUR_ERR_GEN_CONDITION


#############################################################################

[reinit]

[reinit - does not exist:
   distr = unur_distr_normal(NULL,0);
   par = unur_tabl_new(distr);
   gen = unur_init( par ); <-- ! NULL ]

unur_reinit( gen );
	--> expected_setfailed --> UNUR_ERR_NO_REINIT

unur_sample_cont( gen );
	--> expected_INFINITY --> UNUR_ERR_GEN_CONDITION

#############################################################################

[sample]

[sample - compare:
   distr = unur_distr_normal(NULL,0); 
   par = NULL; ]

# default (immediate acceptance)
par = unur_tabl_new(distr);
        -->compare_sequence_par_start

# default - verifying mode */
par = unur_tabl_new(distr);
unur_tabl_set_verify(par,1);
        -->compare_sequence_par

# "classical" acceptance/rejection (RH)
par = unur_tabl_new(distr);
unur_tabl_set_variant_ia(par,FALSE);
        -->compare_sequence_par_start

# "classical" acceptance/rejection (RH) - verifying mode */
par = unur_tabl_new(distr);
unur_tabl_set_variant_ia(par,FALSE);
unur_tabl_set_verify(par,1);
        -->compare_sequence_par

#.....................................................................

[sample - compare clone:
   UNUR_GEN *clone;
   distr = unur_distr_normal(NULL,0); 
   par = NULL;
   gen = NULL; ]

/* original generator object */
par = unur_tabl_new(distr);
unur_tabl_set_max_sqhratio(par,0.);
gen = unur_init(par);
        -->compare_sequence_gen_start

/* clone */
clone = unur_gen_clone(gen);
unur_free(gen);
gen = clone;
        -->compare_sequence_gen

#.....................................................................

[sample - compare stringparser:
   double fpar[2] = {3.,3.};
   double slopes[] = {0.5,-1,0.5,1};
   distr = NULL;
   par = NULL;
   gen = NULL; ]

distr = unur_distr_beta(fpar,2);
par = unur_tabl_new(distr);
unur_tabl_set_areafraction(par,0.25);
unur_tabl_set_boundary(par,0.1,0.9);
unur_tabl_set_guidefactor(par,5.);
unur_tabl_set_max_intervals(par,50);
unur_tabl_set_max_sqhratio(par,0.8);
unur_tabl_set_nstp(par,30);
unur_tabl_set_usedars(par,0);
unur_tabl_set_variant_splitmode(par,3);
unur_tabl_set_verify(par,TRUE);
gen = unur_init(par);
	-->compare_sequence_gen_start
	
unur_free(gen); gen = NULL;
unur_distr_free(distr); distr = NULL;
gen = unur_str2gen( "beta(3.,3.) & \
   method = tabl; areafraction = 0.25; boundary = (0.1,0.9); \
   guidefactor = 5; max_intervals = 50; max_sqhratio = 0.8; \
   nstp = 30; usedars = 0; variant_splitmode = 3; verify" );
	-->compare_sequence_gen


unur_free(gen); gen = NULL;
distr = unur_distr_beta(fpar,2);
par = unur_tabl_new(distr);
unur_tabl_set_slopes(par,slopes,2);
gen = unur_init(par);
	-->compare_sequence_gen_start
	
unur_free(gen); gen = NULL;
unur_distr_free(distr); distr = NULL;
gen = unur_str2gen( "beta(3.,3.) & \
   method = tabl; slopes = (0.5,-1,0.5,1),2 " );
	-->compare_sequence_gen


unur_free(gen); gen = NULL;
distr = unur_distr_beta(fpar,2);
par = unur_tabl_new(distr);
unur_tabl_set_usedars(par,TRUE);
unur_tabl_set_darsfactor(par,0.5);
gen = unur_init(par);
	-->compare_sequence_gen_start
	
unur_free(gen); gen = NULL;
unur_distr_free(distr); distr = NULL;
gen = unur_str2gen( "beta(3.,3.) & method = tabl; usedars=on; darsfactor=0.5" );
	-->compare_sequence_gen


############################################################################

[validate]

[validate - generators:]

# with DARS (default - immediate accatance)
par[0] = unur_tabl_new(@distr@);
unur_tabl_set_usedars(par,TRUE);

# default, truncated
par[1] = unur_tabl_new(@distr@);
unur_tabl_chg_truncated(gen,0.5,0.9);

# without DARS (immediate accatance)
par[2] = unur_tabl_new(@distr@);
unur_tabl_set_usedars(par,FALSE);

# "classical" acceptance/rejection
par[3] = unur_tabl_new(@distr@);
unur_tabl_set_variant_ia(par,FALSE);

# "classical" acceptance/rejection
par[4] = unur_tabl_new(@distr@);
unur_tabl_set_variant_ia(par,FALSE);
unur_tabl_chg_truncated(gen,0.5,0.9);

# give slopes of the distribution
{double slopes[4] = {0.,-0.5,0.,2.};
par[5] = unur_tabl_new(@distr@);
unur_tabl_set_slopes(par,slopes,2);}

# give construction points
{double cpoints[] = {0.,0.5,1.0,1.5,2.0,2.5,3.0};
par[6] = unur_tabl_new(@distr@);
unur_tabl_set_cpoints(par,7,cpoints);}

# give slopes of the distribution
{double slopes[6] = {1.,0.,2.,1.,3.,2.};
par[7] = unur_tabl_new(@distr@);
unur_tabl_set_slopes(par,slopes,3);}

{double slopes[8] = {-2.,-1.,-1.,0.,1.,0.,2.,1.};
par[8] = unur_tabl_new(@distr@);
unur_tabl_set_slopes(par,slopes,4);}

# dars disabled, ear disabled, urng_aux
par[9] = unur_tabl_new(@distr@);
unur_tabl_set_variant_ia(par,FALSE);
unur_tabl_set_usedars(par,FALSE);
unur_tabl_set_useear(par,FALSE);
unur_use_urng_aux_default(par);


[validate - distributions:]

# Beta distributions
fpm[0] = 1.;
fpm[1] = 2.;
distr[0] = unur_distr_beta(fpm,2);

fpm[0] = 1.;
fpm[1] = 5.;
distr[1] = unur_distr_beta(fpm,2);

fpm[0] = 1.;
fpm[1] = 100.;
distr[2] = unur_distr_beta(fpm,2);

fpm[0] = 3.;
fpm[1] = 4.;
distr[3] = unur_distr_beta(fpm,2);

fpm[0] = 5.;
fpm[1] = 100.;
distr[4] = unur_distr_beta(fpm,2);

fpm[0] = 500.;
fpm[1] = 300.;
distr[5] = unur_distr_beta(fpm,2);

fpm[0] = 5.;
fpm[1] = 10.;
fpm[2] = -3.;
fpm[3] = 15.;
distr[6] = unur_distr_beta(fpm,4);

# Cauchy distributions
distr[7] = unur_distr_cauchy(NULL,0);

fpm[0] = 1.;
fpm[1] = 20.;
distr[8] = unur_distr_cauchy(fpm,2);

# Exponential distributions
distr[23] = unur_distr_exponential(NULL,0);

fpm[0] = 30.;
fpm[1] = -5.;
distr[24] = unur_distr_exponential(fpm,2);

# Gamma distributions
fpm[0] = 1.;
distr[9] = unur_distr_gamma(fpm,1);

fpm[0] = 2.;
distr[10] = unur_distr_gamma(fpm,1);

fpm[0] = 3.;
distr[11] = unur_distr_gamma(fpm,1);

fpm[0] = 10.;
distr[12] = unur_distr_gamma(fpm,1);

fpm[0] = 1000.;
distr[13] = unur_distr_gamma(fpm,1);

fpm[0] = 5.;
fpm[1] = 1000.;
distr[14] = unur_distr_gamma(fpm,2);

fpm[0] = 5.;
fpm[1] = 1.e-5;
distr[15] = unur_distr_gamma(fpm,2);

fpm[0] = 5.;
fpm[1] = 10.;
fpm[2] = 1000;
distr[16] = unur_distr_gamma(fpm,3);

# Laplace distributions
distr[25] = unur_distr_laplace(NULL,0);

fpm[0] = -10.;
fpm[1] = 100.;
distr[26] = unur_distr_laplace(fpm,2);

# Normal distributions
distr[17] = unur_distr_normal(NULL,0);

fpm[0] = 1.;
fpm[1] = 1.e-5;
distr[18] = unur_distr_normal(fpm,2);

fpm[0] = 0.;
fpm[1] = 1.e+5;
distr[19] = unur_distr_normal(fpm,2);

# Uniform distributions
distr[20] = unur_distr_uniform(NULL,0);

fpm[0] = 1.;
fpm[1] = 20.;
distr[21] = unur_distr_uniform(fpm,2);

# truncated distributions
distr[22] = unur_distr_cauchy(NULL,0);
unur_distr_cont_set_domain(distr[22],0.1,1.);
unur_distr_cont_upd_mode(distr[22]);
unur_distr_cont_upd_pdfarea(distr[22]);

# sawtooth distribution with continuous PDF
{ double domain[2] = {0., 3.};
distr[27] = unur_distr_sawtooth_contpdf(domain, 2); }

{ double domain[2] = {0., 5.};
distr[28] = unur_distr_sawtooth_contpdf(domain, 2); }

# sawtooth distribution with discontinuous PDF
{ double domain[2] = {0., 3.};
distr[29] = unur_distr_sawtooth_discpdf(domain, 2); }

{ double domain[2] = {-2., 2.};
distr[30] = unur_distr_sawtooth_discpdf(domain, 2); }


# number of distributions: 31


[validate - test chi2:]

#  + ... pass test
#  0 ... fail to initialize generator
#  - ... fail test
#  . ... do not run test
#  # ... comment
#
# generators:
#   [0] ... default (immediate acceptance)
#   [1] ... default, truncated
#   [2] ... without DARS
#   [3] ... "classical" acceptance/rejection
#   [4] ... "classical" acceptance/rejection, truncated
#   [5] ... use slopes (-0.5, 0.) and (0.,2.)
#   [6] ... give construction points
#   [7] ... use slopes [for particular sawtooth distribution only]
#   [8] ... use slopes [for particular sawtooth distribution only]
#   [9] ... dars disabled, ear disabled, urng_aux
#
#	[0]  [1]  [2]  [3]  [4]  [5]  [6]  [7]  [8]  [9]	# distribution
#-----------------------------------------------------------------------------
x <0>	 +    +    +    +    +    +    +    0    0    +		# beta (1, 2)
  <1>	 +    +    +    +    +    +    +    0    0    + 	# beta (1, 5)
x <2>	 +    +    +    +    +    +    +    0    0    + 	# beta (1, 100)
  <3>	 +    +    +    +    +    0    .    0    0    + 	# beta (3, 4)
  <4>	 +    .    +    +    .    0    0    0    0    + 	# beta (5, 100)
  <5>	 +    +    +    +    +    0    0    0    0    + 	# beta (500, 300)
  <6>	 +    +    +    +    +    0    +    0    0    + 	# beta (5, 10, -3, 15)
  <7>	 +    +    +    +    +    0    +    0    0    + 	# cauchy ()
  <8>	 +    +    +    +    +    0    +    0    0    + 	# cauchy (1, 20)
 <23>	 +    +    +    +    +    0    +    0    0    + 	# exponential ()
 <24>	 +    +    +    +    +    0    +    0    0    + 	# exponential (30, -5)
x <9>	 +    +    +    +    +    0    +    0    0    + 	# gamma (1)
 <10> 	 +    +    +    +    +    0    +    0    0    + 	# gamma (2)
 <11>	 +    +    +    +    +    0    +    0    0    + 	# gamma (3)
 <12>	 +    +    +    +    +    0    0    0    0    + 	# gamma (10)
x<13>	 +    .    +    +    .    0    0    0    0    + 	# gamma (1000)
 <14>	 +    +    +    +    +    0    -    0    0    + 	# gamma (5, 1000, 0)
x<15>	 +    +    +    +    +    0    0    0    0    + 	# gamma (5, 1e-05, 0)
x<16>	 +    .    +    +    .    0    0    0    0    + 	# gamma (5, 10, 100000)
 <25>	 +    +    +    +    +    0    +    0    0    + 	# laplace ()
 <26>	 +    +    +    +    +    0    .    0    0    + 	# laplace (-10, 100)
 <17>	 +    +    +    +    +    0    +    0    0    + 	# normal ()
x<18>	 +    .    +    +    .    0    +    0    0    + 	# normal (1, 1e-05)
 <19>	 +    +    +    +    +    0    +    0    0    + 	# normal (1, 1e+05)
 <20>	 +    +    +    +    +    +    +    +    +    + 	# uniform ()
 <21>	 +    .    +    +    .    0    +    0    0    + 	# uniform (1, 20)

 <22>	 +    +    +    +    +    +    +    0    0    + 	# cauchy () - truncated

 <27>	 0    0    0    0    0    0    +    0    0    0 	# sawtooth-cont (0,3)
 <28>	 0    0    0    0    0    0    0    0    0    0 	# sawtooth-cont (0,5)
 <29>	 0    0    0    0    0    0    0    +    0    0 	# sawtooth-disc (0,3)
 <30>	 0    0    0    0    0    0    0    0    +    0 	# sawtooth-disc (-2,2)


[validate - verify hat:]

#  + ... pass test
#  0 ... fail to initialize generator
#  - ... fail test
#  . ... do not run test
#  # ... comment
#
# generators:
#   [0] ... default (immediate acceptance)
#   [1] ... default, truncated
#   [2] ... without DARS
#   [3] ... "classical" acceptance/rejection
#   [4] ... "classical" acceptance/rejection, truncated
#   [5] ... use slopes (-0.5, 0.) and (0.,2.)
#   [6] ... give construction points
#   [7] ... use slopes [for particular sawtooth distribution only]
#   [8] ... use slopes [for particular sawtooth distribution only]
#   [9] ... dars disabled, ear disabled, urng_aux
#
#	[0]  [1]  [2]  [3]  [4]  [5]  [6]  [7]  [8]  [9]	# distribution
#-----------------------------------------------------------------------------
x <0>	 +    .    +    +    .    +    +    .    .    . 	# beta (1, 2)
  <1>	 +    .    +    +    .    +    +    .    .    . 	# beta (1, 5)
x <2>	 +    .    +    +    .    +    +    .    .    . 	# beta (1, 100)
  <3>	 +    .    +    +    .    .    .    .    .    . 	# beta (3, 4)
  <4>	 +    .    +    +    .    .    .    .    .    . 	# beta (5, 100)
  <5>	 +    .    +    +    .    .    .    .    .    . 	# beta (500, 300)
  <6>	 +    .    +    +    .    .    .    .    .    . 	# beta (5, 10, -3, 15)
  <7>	 +    .    +    +    .    .    +    .    .    . 	# cauchy ()
  <8>	 +    .    +    +    .    .    +    .    .    . 	# cauchy (1, 20)
 <23>	 +    .    +    +    .    .    +    .    .    . 	# exponential ()
 <24>	 +    .    +    +    .    .    +    .    .    . 	# exponential (30, -5)
x <9>	 +    .    +    +    .    .    +    .    .    . 	# gamma (1)
 <10> 	 +    .    +    +    .    .    +    .    .    . 	# gamma (2)
 <11>	 +    .    +    +    .    .    +    .    .    . 	# gamma (3)
 <12>	 +    .    +    +    .    .    .    .    .    . 	# gamma (10)
x<13>	 +    .    +    +    .    .    .    .    .    . 	# gamma (1000)
 <14>	 +    .    +    +    .    .    .    .    .    . 	# gamma (5, 1000, 0)
x<15>	 +    .    +    +    .    .    .    .    .    . 	# gamma (5, 1e-05, 0)
x<16>	 +    .    +    +    .    .    .    .    .    . 	# gamma (5, 10, 100000)
 <25>	 +    .    +    +    .    .    +    .    .    . 	# laplace ()
 <26>	 +    .    +    +    .    .    -    .    .    . 	# laplace (-10, 100)
 <17>	 +    .    +    +    .    .    +    .    .    . 	# normal ()
x<18>	 +    .    +    +    .    .    +    .    .    . 	# normal (1, 1e-05)
 <19>	 +    .    +    +    .    .    +    .    .    . 	# normal (1, 1e+05)
 <20>	 +    .    +    +    .    +    +    .    .    . 	# uniform ()
 <21>	 +    .    +    +    .    .    +    .    .    . 	# uniform (1, 20)

 <22>	 +    .    +    +    .    +    +    .    .    . 	# cauchy () - truncated

 <27>	 .    .    .    .    .    .    +    .    .    . 	# sawtooth-cont (0,3)
 <28>	 .    .    .    .    .    .    .    .    .    . 	# sawtooth-cont (0,5)
 <29>	 .    .    .    .    .    .    .    .    .    . 	# sawtooth-disc (0,3)
 <30>	 .    .    .    .    .    .    .    .    .    . 	# sawtooth-disc (-2,2)


#############################################################################
#############################################################################

[verbatim]

/* pdf with negative value */
double pdf_negative( double x, const UNUR_DISTR *distr ATTRIBUTE__UNUSED)
{ return (-x*x); }

/* pdf with partial negative value */
double pdf_partnegative( double x, const UNUR_DISTR *distr ATTRIBUTE__UNUSED)  
{ return ((x>-0.89 && x<0.89) ? -1.: exp(-x*x)); }

#############################################################################

