Implement a function that computes both ordinary and weighted importance sampling estimates for off-policy evaluation in reinforcement learning.
In off-policy learning, we want to evaluate a target policy using data collected under a different behavior policy. Importance sampling corrects for this distribution mismatch by weighting each episode's return by the ratio of action probabilities under the two policies.
Given:
Write a function weighted_importance_sampling(returns, target_probs, behavior_probs) that:
If the sum of all importance sampling ratios is zero, return 0.0 for the weighted estimate.