problem formulation in plot2d function



Hi all,



My function is defined in Maxima as follows 

y(x):= if x>=-1 or x<=1 then 4-x^2 else 2$

and is plotted with

                plot2d(y(x),[x,-5,5], [y,-1,8])

however the plot is incorrect. It only plots the parabola (4-x^2), even
outside the given range, and not the constant (2).

 

Redefining the function

                y(x):= if x<-1 or x>1 then 2 else 4-x^2$

with the same plot2d command as above yields the correct plot.

 

Can anyone see a problem with my first form?

 

Thanks

 

Ron

 

Ronald F. Modesitt, PE