fix bad sin derivation