From 2729a9b9388fd905ce5416e79e9620c0d99d9c0d Mon Sep 17 00:00:00 2001 From: Andrea Valassi Date: Thu, 3 Oct 2024 16:16:25 +0300 Subject: [PATCH] [amd] in gg_tt.mad, workaround for FPE #1011 in vxxxxx on HIP: replace "pvec0 / ( vmass * pp )" by "pvec0 / vmass / pp" --- epochX/cudacpp/gg_tt.mad/src/HelAmps_sm.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/epochX/cudacpp/gg_tt.mad/src/HelAmps_sm.h b/epochX/cudacpp/gg_tt.mad/src/HelAmps_sm.h index 561a125384..febf1dcf42 100644 --- a/epochX/cudacpp/gg_tt.mad/src/HelAmps_sm.h +++ b/epochX/cudacpp/gg_tt.mad/src/HelAmps_sm.h @@ -478,7 +478,10 @@ namespace mg5amcCpu } else { - const fptype emp = pvec0 / ( vmass * pp ); + //printf( "DEBUG1011 (before emp): pvec0=%f vmass=%f pp=%f vmass*pp=%f\n", pvec0, vmass, pp, vmass * pp ); + //const fptype emp = pvec / ( vmass * pp ); // this may give a FPE #1011 (why?! maybe when vmass=+-epsilon?) + const fptype emp = pvec0 / vmass / pp; // workaround for FPE #1011 + //printf( "DEBUG1011 (after emp): emp=%f\n", emp ); vc[2] = cxmake( hel0 * pp / vmass, 0. ); vc[5] = cxmake( hel0 * pvec3 * emp + hel * pt / pp * sqh, 0. ); if( pt != 0. )