"""Original arithmetic from declared public inputs or explicit worked assumptions."""
import csv
from pathlib import Path
results={'control_mean_price_range':41.01-37.93,'treatment_mean_price_range':41.03-37.56,'mean_range_widening':(41.03-37.56)-(41.01-37.93),'control_other_views':5.22-1.99,'treatment_other_views':5.27-1.90,'contribution_retention_break_even':.060/.061,'max_contribution_decline_pct':(1-.060/.061)*100}
assert abs(results['mean_range_widening']-.39)<1e-9
p=Path(__file__).parent/"data";p.mkdir(exist_ok=True)
with (p/"recommendation-mechanism.csv").open("w",newline="") as f:
 w=csv.writer(f);w.writerow(["metric","value"]);w.writerows(results.items())
print(results)
