diff --git a/src/mcx_core.cu b/src/mcx_core.cu index 9709c4b5..e3e075f7 100644 --- a/src/mcx_core.cu +++ b/src/mcx_core.cu @@ -2142,7 +2142,7 @@ __global__ void mcx_main_loop(uint media[], OutputType field[], float genergy[], if (gcfg->outputtype == otEnergy) { weight = w0 - p.w; } else if (gcfg->outputtype == otFluence || gcfg->outputtype == otFlux) { - weight = (prop.mua < EPS) ? (w0 * len) : __fdividef(w0 - p.w, prop.mua); /** when mua->0, the first two terms of Taylor expansion of w0*(1-exp(-mua*len))/mua = w0*len - mua*len^2*w0/2 */ + weight = (prop.mua < EPS) ? (w0 * f.pathlen) : __fdividef(w0 - p.w, prop.mua); /** when mua->0, the first two terms of Taylor expansion of w0*(1-exp(-mua*len))/mua = w0*len - mua*len^2*w0/2 */ } else if (gcfg->seed == SEED_FROM_FILE) { if (gcfg->outputtype == otJacobian || gcfg->outputtype == otRF) { weight = replayweight[(idx * gcfg->threadphoton + min(idx, gcfg->oddphotons - 1) + (int)f.ndone)] * f.pathlen;