Function parser error

Found a bug? Tell us about it here
Post Reply
Posts: 15
Joined: Wed Dec 10, 2003 8:11 am

Function parser error

Post by akselfr »

I'm plotting some functions using the 'Generate -> Y=f(X)' option.
For some odd reason the following expression returns identically
zero for x in [0;3], dX=0.01

f(x) = 5.*(cosh(4.*x)+4.*cosh(2.*x)+3.)

If I build up the expression term by term, everything works fine,
until I enclose in parentheses. Then the result is exactly 0.

Any clues ?
I'm running version
User avatar
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi

Post by DPlotAdmin »

Thanks for pointing out the problem. The function parser doesn't like trailing decimal points in numbers. DPlot preprocesses the function before passing it to the parser and, among other things, eliminates trailing decimal points (all numbers are treated as doubles, so nothing is lost here). But I've somehow fouled up in this case and missed the last "3.", which throws off the parser. That's much more information than you need to know, just wanted to let you know what's going on here. If you instead use:

f(x) = 5*(cosh(4*x)+4*cosh(2*x)+3)


f(x) = 5.0*(cosh(4.0*x)+4.0*cosh(2.0*x)+3.0)

then you'll get the expected result. This will definitely be fixed in the next release; sorry for the inconvenience.
Visualize Your Data
Posts: 9
Joined: Wed May 22, 2024 9:35 pm

cialis with food or empty stomach

Post by Serbeitte »

50 one is better quality <a href= ... cialis>buy cialis viagra</a> Tamoxifen 200ОјM clearly diminished the ATP content and increased the ADP content of livers in the presence of lactate with a diminution of the ATP ADP ratio from 1
Post Reply