// Compute mean symmetric absolute percentage error on a 0 to 200 scale with zero contribution when both values are zero. pub fn symmetric_ape(actual: vector, predicted: vector) -> f64 { if len(actual)==0 || len(actual)!=len(predicted) { return -1.0; } let mut i = 0; let mut total = 0.0; while ib { a-b } else { b-a }; if aa+bb>0.0 { total += 200.0*d/(aa+bb); } i += 1; } total/at([len(actual)],0) }