# Typo in Hyman non-negative constraint - 28 years later

May 23, 2017 · 2 minute read · Commentsquantmath

In their paper “Nonnegativity-, Monotonicity-, or Convexity-Preserving Cubic and Quintic Hermite Interpolation”, Dougherty, Edelman and Hyman present a simple filter on the first derivatives to maintain positivity of a cubic spline interpolant.

Unfortunately, in their main formula for non-negativity, they made a typo: the equation (3.3) is not consistent with the equation (3.1): the \Delta x_{i-^{1}⁄_{2}} is interverted with \Delta x_{i+^{1}⁄_{2}}.

It was not obvious to find out which equation was wrong since there is no proof in the paper. Fortunately, the proof is in the reference paper “Monotone piecewise bicubic interpolation” from Carlson and Fritsch and it is clear then that equation (3.1) is the correct one.

Here is a counter example for equation (3.3) for a Hermite cubic spline with natural boundary conditions

```
x := []float64{-2.427680355823974, -2.3481443181227126, -2.268608280421452, -2.189072242720191, -2.1095362050189297, -2.0300001673176684, -1.9504641296164076, -1.8709280919151465, -1.7913920542138855, -1.7118560165126244, -1.6323199788113634, -1.5527839411101023, -1.4732479034088413, -1.3937118657075802, -1.3141758280063192, -1.234639790305058, -1.155103752603797, -1.075567714902536, -0.996031677201275, -0.9164956395000139, -0.8369596017987528, -0.7574235640974918, -0.6778875263962307, -0.5983514886949697, -0.5188154509937086, -0.4392794132924476, -0.3597433755911865, -0.28020733788992525, -0.20067130018866441, -0.12113526248740358, -0.04159922478614231, 0.03793681291511897, 0.1174728506163798, 0.19700888831764063, 0.2765449260189019, 0.3560809637201632, 0.435617001421424, 0.5151530391226848, 0.5946890768239461, 0.6742251145252074, 0.7537611522264682}
y := []float64{0.22303659708933243, 0.22655584607177778, 0.16305913092318047, 0.10448859033589929, 0.16002349837315494, 0.15632461201014838, 0.20216975718723287, 0.15780097999496998, 0.1293436080647528, 0.13101037880853464, 0.13496819587884762, 0.1241082758487616, 0.13677319399415233, 0.11493379360854317, 0.10181073092072719, 0.10390553149978735, 0.09705141597989163, 0.09469310717587004, 0.09397968424452849, 0.08115526370674754, 0.07021707117654993, 0.07896827656600293, 0.0733165278111029, 0.06626131630031683, 0.06036157053511007, 0.05598416466538939, 0.049613807117723785, 0.04821691404672292, 0.04274830629369516, 0.04053002586588819, 0.03690680495068648, 0.03232925805830648, 0.02686034599416645, 0.02152456554605186, 0.01281016667726421, 0.005672278716525797, 0.0021938540693167367, 0.0015582304062002356, 0.0002050615897307207, 3.232807285235909e-07, 4.059553937573009e-06}
z := 0.7410184269884271
```

In the above example, even though the step size \Delta x is constant, the error is visible at the last node since then only one inequation apply, and it will be different with the typo.

It is quite annoying to stumble upon such typos, especially when the equations stem from a derived correct paper. We wonder then where are the other typos in the paper and our trust in the equations is greatly weakened. Unfortunately, such mistakes happen to everybody, including myself, and they are rarely caught by reviewers.