star-wf

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

commit d2defaaef06b36edc9efa367124872959e130003
parent 66220095b441c72c7eb24d5792bbe03018c2fb11
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue, 12 Mar 2024 14:06:48 +0100

Small adjustment to H function tests

Update of the x range to be tested.

Diffstat:
Msrc/test_swf_H3d.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/test_swf_H3d.c b/src/test_swf_H3d.c @@ -73,11 +73,11 @@ check_tabulation_inversion(void) CHK(swf_H3d_tabulate(&args, &tab) == RES_OK); - for(x0 = args.x_min; x0 < args.x_max; x0 += x0*args.step) { - const double x1 = x0 + x0*args.step; + for(x0 = args.x_min; x0 <= args.x_max; x0 += x0*args.step) { + const double x1 = MMIN(x0 + x0*args.step, args.x_max); const double delta_x = (x1 - x0) / (double)nsteps; - for(i = 1; i < nsteps; ++i) { + for(i = 0; i < nsteps; ++i) { const double x = x0 + (double)i*delta_x; const double Hx = swf_H3d_eval(x); const double xl = swf_tabulation_inverse(tab, SWF_LINEAR, Hx); @@ -91,7 +91,7 @@ check_tabulation_inversion(void) * inversion result, numerically speaking. */ if(Hx == pHx) continue; - printf("%e %.20e %e %e\n", x, Hx, errq, errl); + printf("%e %e %e %e\n", x, Hx, errq, errl); if(1e-9 < Hx && Hx < (1.0 - 1e-9)) { CHK(errl < 1.e-5); CHK(errq < 1.e-7);