Make third derivative continuous between first and second segment. See De Boor, A Practical Guide to Splines, revised edition, page 43. There's already a work-in-progress branch for that: https://github.com/mgeier/splines/tree/not-a-knot