]> granicus.if.org Git - imagemagick/commitdiff
InverseScaledSig: replace division by reciprocal multiplication
authornicolas <nicolas@git.imagemagick.org>
Mon, 10 Sep 2012 14:43:25 +0000 (14:43 +0000)
committernicolas <nicolas@git.imagemagick.org>
Mon, 10 Sep 2012 14:43:25 +0000 (14:43 +0000)
ChangeLog
MagickCore/enhance.c

index 669b0506ba04a462060eba70ccec4b3991c0d9fd..c3c230d9b07fec125ae80c05770033122df8d013 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2012-09-10  7.0.0-0 Nicolas Robidoux <nicolas.robidoux@gmail...>
+  * InverseScaledSig: replace division by reciprocal multiplication.
+
 2012-09-04  7.0.0-0 Nicolas Robidoux <nicolas.robidoux@gmail...>
   * Add tanh/atanh clone of legacy sigmoidal map (faster & more accurate).
 
 2012-09-04  7.0.0-0 Nicolas Robidoux <nicolas.robidoux@gmail...>
   * Add tanh/atanh clone of legacy sigmoidal map (faster & more accurate).
 
index 3a62d833fc208212373b719127e88ca183ff25ba..75affa19dfea7bf00cd0d0c09984b8055a9be2e4 100644 (file)
@@ -3356,13 +3356,11 @@ MagickExport MagickBooleanType SigmoidalContrastImage(Image *image,
     Inverse of ScaledSig, used for +sigmoidal-contrast:
   */
 #if defined(MAGICKCORE_HAVE_ATANH)
     Inverse of ScaledSig, used for +sigmoidal-contrast:
   */
 #if defined(MAGICKCORE_HAVE_ATANH)
-#define InverseScaledSig(a,b,x) ( (b) +                             \
-  atanh( (Sig((a),(b),1.0)-Sig((a),(b),0.0))*(x)+Sig((a),(b),0.0) ) \
-  / (0.5*(a)) )
+#define InverseScaledSig(a,b,x) ( (b) + (2.0/(a)) * \
+  atanh( (Sig((a),(b),1.0)-Sig((a),(b),0.0))*(x)+Sig((a),(b),0.0) ) )
 #else
 #else
-#define InverseScaledSig(a,b,x) ( (b) -                                     \
-  log( 1.0/((Sig((a),(b),1.0)-Sig((a),(b),0.0))*(x)+Sig((a),(b),0.0))-1.0 ) \
-  / (a) )
+#define InverseScaledSig(a,b,x) ( (b) + (-1.0/(a)) * \
+  log( 1.0/((Sig((a),(b),1.0)-Sig((a),(b),0.0))*(x)+Sig((a),(b),0.0))-1.0 ) )
 #endif
 
   /*
 #endif
 
   /*