From: nicolas Date: Sun, 5 Aug 2012 19:55:27 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~5185 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6997fa95c06ff1c1edce6d83e1d935057e7f18fa;p=imagemagick --- diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c index d95d8107a..71116e6c4 100644 --- a/MagickCore/enhance.c +++ b/MagickCore/enhance.c @@ -3383,11 +3383,9 @@ MagickExport MagickBooleanType SigmoidalContrastImage(Image *image, #define SCALED_SIGMOIDAL(a,b,x) ( \ (SIGMOIDAL((a),(b),(x))-SIGMOIDAL((a),(b),0.0)) / \ (SIGMOIDAL((a),(b),1.0)-SIGMOIDAL((a),(b),0.0)) ) -#define INVERSE_SCALED_SIGMOIDAL(a,b,x) ( \ - (b) - \ - log( -1.0 + 1.0 / \ - ((SIGMOIDAL((a),(b),1.0)-SIGMOIDAL((a),(b),0.0))*(x)+SIGMOIDAL((a),(b),0.0)) \ - ) / (a) ) +#define INVERSE_SCALED_SIGMOIDAL(a,b,x) ( \ + (b) - log( -1.0+1.0/((SIGMOIDAL((a),(b),1.0)-SIGMOIDAL((a),(b),0.0))*(x)+ \ + SIGMOIDAL((a),(b),0.0)) ) / (a) ) /* The limit of SCALED_SIGMOIDAL as a->0 is the identity, but a=0 gives a * division by zero. This is fixed below by hardwiring the identity when a is * small. This would appear to be safe because the series expansion of the