1
$\begingroup$

I have a continuous function f[x], and I want to calculate the coordinates of the discontinuities in Round[f[x]]. My code needs to do this computation many thousands of times, so very efficient code is appreciated!

$\endgroup$
6
  • 1
    $\begingroup$ Can you explain further? Round[x] has discontinuities at each integer value of x. So Round[f[x]] would have discontinuities every time f[x] is an integer. If this what you are looking for? And what does this have to do with edges of a piecewise curve? $\endgroup$
    – bill s
    Jul 6, 2020 at 23:16
  • $\begingroup$ Indeed, this is what I am looking for! Sorry if my question is not clear: I want to find where Round[f[x]] changes. Perhaps piecewise is not the correct terminology. $\endgroup$
    – Guy
    Jul 6, 2020 at 23:17
  • 1
    $\begingroup$ Maybe you could tell us what kind of function f[x] is? Or provide a simple example? $\endgroup$
    – bill s
    Jul 6, 2020 at 23:20
  • 1
    $\begingroup$ f[x] is a continuous function on some finite interval, say x in [0,1]. That is all that's known. For a simple example, consider a/(1 + b x) Sin[c x] for a,b,c >1 $\endgroup$
    – Guy
    Jul 6, 2020 at 23:21
  • $\begingroup$ I'm not sure what kind of answer you can expect. Consider (3/2) Sin[1/x] on [0,1]. This has an infinite number of such points. $\endgroup$
    – bill s
    Jul 6, 2020 at 23:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.