# Cannot evaluate linear functions using \`EvalPoly\`

**URL:** <https://openfhe.discourse.group/t/cannot-evaluate-linear-functions-using-evalpoly/2227>\
**Category:** Library Questions\
**Created:** [December 1, 2025, 1:10pm UTC](https://openfhe.discourse.group/t/cannot-evaluate-linear-functions-using-evalpoly/2227 "2025-12-01T13:10:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hsanzg](https://avatars.discourse-cdn.com/v4/letter/h/a9adbd/32.png) [@hsanzg](https://openfhe.discourse.group/u/hsanzg)\
**Post date:** [December 1, 2025, 1:10pm UTC](https://openfhe.discourse.group/t/cannot-evaluate-linear-functions-using-evalpoly/2227/1 "2025-12-01T13:10:37Z")

</div>

Commit e21a859ac9e5e05935612e0aba392d61dcf1f62a inadvertently introduced an off-by-one error in `internalEvalPolyLinearWithPrecomp`, which throws an exception when the polynomial to evaluate has degree 1 (it should only throw when the polynomial is of degree 0).

The following commit [Fix evaluation of linear functions with `EvalPoly` · hsanzg/openfhe-development@b9bdf4d · GitHub](https://github.com/hsanzg/openfhe-development/commit/b9bdf4daa0e5802b3fd4473bc867698c38f830d4) fixes the issue and adds a test. I haven’t been able to submit it directly, because the GitHub repo doesn’t allow merge requests from external contributors.

---

<div class="post-metadata">

**Author:** ![ypolyakov](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/ypolyakov/32/47_2.png) [@ypolyakov](https://openfhe.discourse.group/u/ypolyakov)\
**Post date:** [December 1, 2025, 10:48pm UTC](https://openfhe.discourse.group/t/cannot-evaluate-linear-functions-using-evalpoly/2227/2 "2025-12-01T22:48:02Z")

</div>

Thank you for catching it. Please create an issue, a local branch, and PR directly in openfhe-development (I added your account to the repo).
