Mon Feb 16 10:52:49 MST 1998 aquarius% mupad *----* MuPAD 1.4.0 -- Multi Processing Algebra Data Tool /| /| *----* | Copyright (c) 1997 - 98 by SciFace Software GmbH | *--|-* All rights reserved. |/ |/ *----* Licensed to: Michael Wester >> # ----------[ M u P A D ]---------- # >> # ---------- Initialization ---------- # >> TEXTWIDTH:= 80: >> read("../../Time.mupad"): >> # ---------- Mathematics vs Computer Science ---------- # >> # Just how well are pattern matches between mathematically equivalent forms &> performed? # >> d:= domain("match"): >> d::FREEVARIABLE:= TRUE: >> x:= new(d, "x", TRUE): >> match(exp(y), exp(x)); table( "x" = y ) Time: 320 msec Type: DOM_TABLE >> match(E^y, exp(x)); FAIL Time: 60 msec Type: DOM_FAIL >> match(exp(y), E^x); FAIL Time: 60 msec Type: DOM_FAIL >> match(E^y, E^x); table( "x" = y ) Time: 60 msec Type: DOM_TABLE >> match(sqrt(y), sqrt(x)); table( "x" = y ) Time: 120 msec Type: DOM_TABLE >> match(y^(1/2), sqrt(x)); table( "x" = y ) Time: 80 msec Type: DOM_TABLE >> match(sqrt(y), x^(1/2)); table( "x" = y ) Time: 70 msec Type: DOM_TABLE >> match(y^(1/2), x^(1/2)); table( "x" = y ) Time: 80 msec Type: DOM_TABLE >> match(I*y, I*x); table( "x" = y ) Time: 80 msec Type: DOM_TABLE >> match(sqrt(-1)*y, I*x); table( "x" = y ) Time: 140 msec Type: DOM_TABLE >> match((-1)^(1/2)*y, I*x); table( "x" = y ) Time: 70 msec Type: DOM_TABLE >> match(I*y, sqrt(-1)*x); table( "x" = y ) Time: 70 msec Type: DOM_TABLE >> match(sqrt(-1)*y, sqrt(-1)*x); table( "x" = y ) Time: 80 msec Type: DOM_TABLE >> match((-1)^(1/2)*y, sqrt(-1)*x); table( "x" = y ) Time: 80 msec Type: DOM_TABLE >> match(I*y, (-1)^(1/2)*x); table( "x" = y ) Time: 80 msec Type: DOM_TABLE >> match(sqrt(-1)*y, (-1)^(1/2)*x); table( "x" = y ) Time: 70 msec Type: DOM_TABLE >> match((-1)^(1/2)*y, (-1)^(1/2)*x); table( "x" = y ) Time: 60 msec Type: DOM_TABLE >> x:= NIL: >> # ---------- Quit ---------- # >> quit real 4.17 user 3.54 sys 0.53