# Carathéodory-Fejér Approximation as an Alternative to Remez

DevFeed: [Carathéodory-Fejér Approximation as an Alternative to Remez](<https://devfeed.tech/articles/anyone-know-of-an-approachable-proof-of-the-caratheodory-fejer-theorem-40515.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/shortform/2025-02-09-1947/>)

Published: 2025-02-10T03:47:59Z

Content type: opinion

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Python](<https://devfeed.tech/topics/python.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [python](<https://devfeed.tech/tags/python.md>), [remez](<https://devfeed.tech/tags/remez.md>), [shortform](<https://devfeed.tech/tags/shortform.md>)

## AI overview

The author describes replacing a brittle Remez approximation prototype with the Carathéodory-Fejér method, which a colleague prototyped and the author is porting to C++ for the HEIR compiler. The author seeks an approachable proof of the Carathéodory-Fejér theorem and notes known limitations of the method.

## Source excerpt

A colleague of mine recently lent a hand implementing a polynomial approximation routine I could port to our compiler, though it wasn't the method I was expecting. As I had written about previously, I was studying the Remez algorithm and implementing a prototype in Python. Remez approximation involves an iterated loop that alternates between root-finding and linear-system solving, and as such it can be rather brittle and difficult. Numerical errors and accuracy limits in these subsolvers contribute to weird edge cases that make the algorithm fail to converge.