Calculating marginal improvement in the 1% Rule

I got curious as to how the 37% improvement in James Clear’s book “Atomic Habits” was calculated. As such, I went about figuring out how and tried to generalize it to different time periods (rather than just a year) and with variable improvement and regression rates for each day. ...