crsa ml asn3: vectorize cost fctn