From 2a38543ba0c21ae29e107b41a749cd19c88521ba Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 23 Aug 2023 13:53:37 +0200 Subject: [PATCH] Avoid FPE in Jastrow --- org/qmckl_jastrow_champ.org | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/org/qmckl_jastrow_champ.org b/org/qmckl_jastrow_champ.org index 8be1e7b..9a34500 100644 --- a/org/qmckl_jastrow_champ.org +++ b/org/qmckl_jastrow_champ.org @@ -9943,7 +9943,12 @@ integer function qmckl_compute_jastrow_champ_value_doc_f(context, & end do do i = 1, walk_num - value(i) = dexp(value(i)) + ! Flush to zero to avoid floating-point exception + if (value(i) < -100.d0) then + value(i) = 0.d0 + else + value(i) = dexp(value(i)) + endif end do end function qmckl_compute_jastrow_champ_value_doc_f