I can also confirm the IRD is using that formula.
(Days in HKG/365 * income - Single/Married Person Allowance)=Income chargeable to HKG tax)
One thing I found during my experience is a discrepancy in counting days...
CX counts any day in HKG as one full day in HKG (arrive on Monday, depart on Friday... thats 5 days).
HKG IRD counts the arrival and departure days as 1/2 days. So arrive on Monday and depart on Friday is 4 days. Arrive Monday and depart Tuesday is only 1 day. Arrive and depart on Monday is a 1/2 day.
This can significantly reduce your "days in HKG" for IRD purposes.
GovHK: How to Report Income in Your Tax Return