else {
rc = process_single_symbol(cd, sym, &ms, comp_atom);
- if (rc) {
+ if (fabs(rc) > epsilon) {
process_symbol_removal(atom,
cd,
ms,
return;
}
+ msg_debug_composites ("%s: start processing composite %s",
+ cd->metric_res->name,
+ cd->composite->sym.c_str());
+
rc = rspamd_process_expression(comp->expr, RSPAMD_EXPRESSION_FLAG_NOOPT,
cd);
#define MIN_RESORT_EVALS 50
#define MAX_RESORT_EVALS 150
-#define DOUBLE_EPSILON 1e-9
enum rspamd_expression_elt_type {
ELT_OP = 0,
switch (elt->p.op.op) {
case OP_NOT:
- ret = fabs (operand) > DOUBLE_EPSILON ? 0.0 : 1.0;
+ ret = fabs (operand) > DBL_EPSILON ? 0.0 : 1.0;
break;
default:
g_assert_not_reached ();
ret = acc * val;
break;
case OP_AND:
- ret = (acc * val);
+ ret = (acc > DBL_EPSILON) && (val > DBL_EPSILON);
break;
case OP_OR:
- ret = (acc + val);
+ ret = (acc > DBL_EPSILON) || (val > DBL_EPSILON);
break;
default:
case OP_NOT:
elt->value = process_data->process_closure (process_data->ud, elt->p.atom);
- if (fabs (elt->value) > 1e-9) {
+ if (fabs (elt->value) > DBL_EPSILON) {
elt->p.atom->hits ++;
if (process_data->trace) {