/* ----------[ M a c s y m a ]---------- */ /* ---------- Initialization ---------- */ showtime: all$ prederror: false$ /* ---------- Mathematics vs Computer Science ---------- */ /* Just how well are pattern matches between mathematically equivalent forms performed? */ matchdeclare(x, true)$ defmatch(match, exp(x), x)$ match(exp(y), y); match(%e^y, y); defmatch(match, %e^x, x)$ match(exp(y), y); match(%e^y, y); defmatch(match, sqrt(x), x)$ match(sqrt(y), y); match(y^(1/2), y); defmatch(match, x^(1/2), x)$ match(sqrt(y), y); match(y^(1/2), y); defmatch(match, %i*x, x)$ match(%i*y, y); match(sqrt(-1)*y, y); match((-1)^(1/2)*y, y); defmatch(match, sqrt(-1)*x, x)$ match(%i*y, y); match(sqrt(-1)*y, y); match((-1)^(1/2)*y, y); defmatch(match, (-1)^(1/2)*x, x)$ match(%i*y, y); match(sqrt(-1)*y, y); match((-1)^(1/2)*y, y); kill(x)$ /* ---------- Quit ---------- */ quit();