In the two python scripts below the first one works but the second fails and mathematically they are de same. See differences in the definition of f(x)
—- good script
from numpy import *
import matplotlib.pyplot as plt
def f(x):
return cos(x)*10.
x=linspace(0.1,0.5,50)
plt.plot(x,f(x))
plt.grid()
plt.show()
——- bad script
from numpy import *
import matplotlib.pyplot as plt
def f(x):
return 10.*cos(x)
x=linspace(0.1,0.5,50)
plt.plot(x,f(x))
plt.grid()
plt.show()
Environment
Epsilon version 23.2.5
The platform(s) on which the problem happens: only tried actual device
Describe the bug
In the two python scripts below the first one works but the second fails and mathematically they are de same. See differences in the definition of f(x)
—- good script from numpy import * import matplotlib.pyplot as plt
def f(x): return cos(x)*10.
x=linspace(0.1,0.5,50)
plt.plot(x,f(x)) plt.grid() plt.show()
——- bad script from numpy import * import matplotlib.pyplot as plt
def f(x): return 10.*cos(x)
x=linspace(0.1,0.5,50)
plt.plot(x,f(x)) plt.grid() plt.show()
Environment