# Memoized inverse function through bisection

**URL:** <https://discourse.julialang.org/t/memoized-inverse-function-through-bisection/106027>\
**Category:** General Usage\
**Created:** [November 10, 2023, 9:52am UTC](https://discourse.julialang.org/t/memoized-inverse-function-through-bisection/106027 "2023-11-10T09:52:59Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [November 10, 2023, 1:14pm UTC](https://discourse.julialang.org/t/memoized-inverse-function-through-bisection/106027/10 "2023-11-10T13:14:13Z")

</div>

> [@lrnv](#):
>
> I was wandering if i could do better since i “know” a bit about the function

Is this a continuation of [this](https://discourse.julialang.org/t/interface-for-a-distribution-defined-by-its-cdf/105394) topic? If so, your function is a CDF, just vertically translated by a constant, so you could use the fact that it’s nondecreasing to shave off an instruction or two from the hot loop in the bisection method code. That could maybe be a performance improvement, if the evaluation of the function is cheap enough.

---

_[View the full topic](https://discourse.julialang.org/t/memoized-inverse-function-through-bisection/106027)._
