diff --git a/src/spicelib/devices/hisim2/hsm2eval.c b/src/spicelib/devices/hisim2/hsm2eval.c index e10fd5f66..00caef669 100644 --- a/src/spicelib/devices/hisim2/hsm2eval.c +++ b/src/spicelib/devices/hisim2/hsm2eval.c @@ -205,6 +205,8 @@ double TMF1 , TMF2 , TMF3 , TMF4 ; TMF2 = sqrt ( ( x ) * ( x ) + 4.0 * ( delta ) * ( delta) ) ; \ dx = 0.5 * ( 1.0 + ( x ) / TMF2 ) ; \ y = 0.5 * ( ( x ) + TMF2 ) ; \ + if (y < 0) \ + y = 0 ; \ } #if 0 /*---------------------------------------------------* diff --git a/src/spicelib/devices/hisim2/hsm2temp.c b/src/spicelib/devices/hisim2/hsm2temp.c index 4d851c22f..b71071fd9 100644 --- a/src/spicelib/devices/hisim2/hsm2temp.c +++ b/src/spicelib/devices/hisim2/hsm2temp.c @@ -41,6 +41,8 @@ #define Fn_SZtemp( y , x , delta ) { \ T1 = sqrt ( ( x ) * ( x ) + 4.0 * ( delta ) * ( delta) ) ; \ y = 0.5 * ( ( x ) + T1 ) ; \ + if (y < 0) \ + y = 0 ; \ } #define Fn_SUtemp( y , x , xmax , delta ) { \