]> source.dussan.org Git - rspamd.git/commitdiff
* Fix normalization for systems that have not tanhl function
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 18 Aug 2010 11:35:26 +0000 (15:35 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 18 Aug 2010 11:35:26 +0000 (15:35 +0400)
src/classifiers/winnow.c

index c86782d854f8f930bb5c246ebe42d9da6592f756..c0c1bd7558c641a9598d563b92690c391cfd9083 100644 (file)
@@ -274,7 +274,7 @@ winnow_classify (struct classifier_ctx *ctx, statfile_pool_t * pool, GTree * inp
          * As some implementations of libm does not support tanhl, try to use
          * tanh
          */
-        max = tanh ((double) score);
+        max = tanh ((double) max);
 #endif
                sumbuf = memory_pool_alloc (task->task_pool, 32);
                rspamd_snprintf (sumbuf, 32, "%.2F", max);
@@ -570,7 +570,7 @@ end:
          * As some implementations of libm does not support tanhl, try to use
          * tanh
          */
-        *sum = tanh ((double) score);
+        *sum = tanh ((double) max);
 #endif
        }
        return TRUE;