How to calculate reversible speed value while accelerating

13 Views Asked by At

I am working on a special video editing task and I have faced some math problem

I have video that I want to speed up for example to 200%, and to reverse (or 'cancel') it I need to do 100/200 * 100 = 50%, so this is not a problem as I get back exactly where I was, the problem if I want to accelerate from 100% to 200% over some period of time i will face values that are approximate for example speed up to 147% for the reversion I need 100/147 * 100 = 68.0272108844 (approximate), computers cannot work with approximate values and will cut some values, over time it will create a derivation, I wonder how can I avoid this

My current thought process is to pre-calculate the exact amount of the values I will receive between 100 and 200 over n time based on video fps, and leave only those values that give the exact reversible values like 100/200 * 100 = 50, and if there are not many of those then calculate the need amount of numbers that be reversed without cutting

is it possible to do?