Question: Extending a function

I have defined my own function to implement inverse erf. I am trying to extend Maple so it recognizes basic identities. For example, I would like to Maple to simplify InverseErf(erf(x)) to x when x is real. I've used the following code in a module, but it doesn't seem to work (the evalf does work). Any suggestions?

ModuleLoad := proc()
global `evalf/InverseErf`;
global `erf/InverseErf`;
global `InverseErf/erf`;
`evalf/InverseErf` := proc(x)
local y,z;
y:=evalf(x);
if not type(y,complex(float)) then
return `InverseErf`(x);
end if;
fsolve(y=erf(z),z,fulldigits);
end proc:
`erf/InverseErf` := proc(x)
if (x<1 and x>-1 and is(x,real)) then
return x;
else
return 'erf/InverseErf'(x);
end if;
end proc:
`InverseErf/erf` := proc(x)
print(x);
if is(x,real) then
return x;
else
return 'InverseErf/erf'(x);
end if;
end proc:
end proc:

Please Wait...