merge_weights(float w1, float w2)
merge_weights(int w1, int w2)
merge_weights(float w1, float w2) {	float result = w1 + w2;	if(w1 <= -INFINITY || w2 <= -INFINITY) {		if(w1 >= INFINITY || w2 >= INFINITY) {			pe_warn("-INFINITY + INFINITY == -INFINITY");		}		return -INFINITY;	} else if(w1 >= INFINITY || w2 >= INFINITY) {		return INFINITY;	}	/* detect wrap-around */	if(result > 0) {		if(w1 <= 0 && w2 < 0) {			result = -INFINITY;		}			} else if(w1 > 0 && w2 > 0) {		result = INFINITY;	}	/* detect +/- INFINITY */	if(result >= INFINITY) {		result = INFINITY;			} else if(result <= -INFINITY) {		result = -INFINITY;	}	return result;}