You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/usr/bin/env python3
import numpy as np
import chebpy as ch
def g(x):
return .3+.02*x+abs(x)**1.8
ch.core.settings.userPrefs.eps = 1e-18
R = ch.chebfun(g, [-1,1])
n = 17
for i in range(n):
x = -1+2*i/(n-1)
print(x, g(x), R(x), g(x)-R(x))
generates this output (on a x86_64 with Python 3.9.2, numpy 1.19.5-1 from Debian):
Document userPrefs (in README or whereever), advise on settings for eps.
Why is accuracy lowest at x=0? I'd guess that this can be overcome by enforcing even (or odd?) order of the approximant.
For eps << 1e-18, we get a "UserWarning: The Chebtech2 constructor did not converge: using 65537 points." Upon this warning, the user does not know whether the resulting polynomial can be trusted.
The warning can be overcome by increasing core.settings.userPrefs.maxpow2. This needs documentation.
The actual accuracy is much lower than eps. Is there a way to inform the user about the maximum error?
The text was updated successfully, but these errors were encountered:
This code
generates this output (on a x86_64 with Python 3.9.2, numpy 1.19.5-1 from Debian):
Before setting eps to 1e-18, the output was
Suggestions for improvement:
The text was updated successfully, but these errors were encountered: