A python implementation of the algorithm used to generate optimal piecewise linear approximations of convex functions proposed by Imamoto and Tang. The algorithm uses an iterative search to find the piecewise linear function g with smallest minimax deviation from f.