From 84761c125f89dd9c142d1ff83901b81f26c2fc4a Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 28 Oct 2017 12:35:50 +0200 Subject: [PATCH] fix erfc() usage in cider cider relied on our broken ngspice variant of erfc() which behaved as erfc_ngspice(x) = erfc(fabs(x)) Note: apart from cider, erfc is used in devices/ltra/ltramisc.c always with positive argument and src/frontend/spec.c again always with positive argument Thus, the difference in implementation never mathered anywhere except in cider --- src/ciderlib/oned/onedopng.c | 2 +- src/ciderlib/twod/twodopng.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ciderlib/oned/onedopng.c b/src/ciderlib/oned/onedopng.c index 025ae64b5..24d6e0322 100644 --- a/src/ciderlib/oned/onedopng.c +++ b/src/ciderlib/oned/onedopng.c @@ -90,7 +90,7 @@ ONEdopingValue(DOPprofile *pProfile, DOPtable *pTable, double x) if (argP > 10.0) { value = 0.0; } else { - value = pProfile->PEAK_CONC * erfc(-argP); + value = pProfile->PEAK_CONC * erfc(argP); } break; case LOOKUP: diff --git a/src/ciderlib/twod/twodopng.c b/src/ciderlib/twod/twodopng.c index 7b9bbb39d..779831123 100644 --- a/src/ciderlib/twod/twodopng.c +++ b/src/ciderlib/twod/twodopng.c @@ -111,7 +111,7 @@ TWOdopingValue(DOPprofile *pProfile, DOPtable *pTable, double x, if ( argP > 10.0 ) { value = 0.0; } else { - value = pProfile->PEAK_CONC * erfc( -argP ); + value = pProfile->PEAK_CONC * erfc( argP ); } break; case LOOKUP: @@ -156,7 +156,7 @@ TWOdopingValue(DOPprofile *pProfile, DOPtable *pTable, double x, if ( argP > 10.0 ) { value = 0.0; } else { - value *= erfc( -argL ); + value *= erfc( argL ); } break; case LOOKUP: