Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • $\begingroup$ Thank you for the trick of defining at $sp$ with the Limit. However, the workaround with the workingprecision and recursion is for the Plot. However, I would like to smooth out the function for the purposes of applying RandomVariate on it efficiently. I should have probably been more precise in the question, I will try to amend it if possible. ( I will try just defining well on sp, wether that improves the randomVariate) $\endgroup$ Commented Oct 17, 2022 at 15:43
  • $\begingroup$ You can also specify a WorkingPrecision with RandomVariate and RandomReal $\endgroup$ Commented Oct 17, 2022 at 15:45
  • $\begingroup$ Will try that ! Edit : Adding explicitely the WorkingPrecision in RandomVariate (although I though that 15 was the default) indeed solves also the problem and evaluates fast. I will mark this question as accepted as it applies more broadly to the problem, unlike the other valid answer which is specific to my function. $\endgroup$ Commented Oct 17, 2022 at 15:58