star-wf

First-passage time of brownian motion
git clone git://git.meso-star.fr/star-wf.git
Log | Files | Refs | README | LICENSE

commit f4c603c2a4cd4782f56f3d911c403aec9d3fba9a
parent 6bf96511daec4f6f485dbc8e31c8ed8e778260c1
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Sun, 10 Mar 2024 10:21:59 +0100

Update default tabulation range for H

The minimum lower limit is set at 7.5e-3. Below this limit, the
calculation of H falls into numerical uncertainties that cause it to
oscillate and is therefore not strictly increasing as it should (H is a
cumulative).

Reducing the tabulation interval to this limit is not really an issue,
since the tabulation is used for the inversion of H(x) in [0, 1[. And H
of 7.5e-3 is 4.32987e-14. Put another way, below this minimum, some
people try to invert a value whose corresponding argument is negligible
in relation to the probability of its occurrence (of the order of
1e-14).

Diffstat:
Msrc/swf.h | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/swf.h b/src/swf.h @@ -40,7 +40,7 @@ struct swf_H_tabulate_args { double delta_x; struct mem_allocator* allocator; /* NULL <=> use default allocator */ }; -#define SWF_H_TABULATE_ARGS_DEFAULT__ {0, 3.88, 1e-5, NULL} +#define SWF_H_TABULATE_ARGS_DEFAULT__ {7.5e-3, 3.8, 1e-5, NULL} static const struct swf_H_tabulate_args SWF_H_TABULATE_ARGS_DEFAULT = SWF_H_TABULATE_ARGS_DEFAULT__;