Question: Compiling a procedure

Hello there,  How can I compile this? I used   boundarycompiled := Compiler:-Compile(findboundary)    but this didnt work. Thanks in advance

 

> findboundary:=proc(a,b,c,d,e,f,g,h)  ;
> global A,B,lowerbound,upperbound;
> A, B := solve(a = b, x), solve(c = b, x);
> x1a, x1b := evalf(solve((x-e)^2+(a-f)^2-g^2)); if x1a < x1b then minx1, maxx1 := x1a, x1b else minx1, maxx1 := x1b, x1a end if;
> x2a, x2b := evalf(solve((x-e)^2+(b-f)^2-g^2)); if x2a < x2b then minx2, maxx2 := x2a, x2b else minx2, maxx2 := x2b, x2a end if;
> x4a, x4b := evalf(solve((x-e)^2+(d-f)^2-g^2)); if x4a < x4b then minx4, maxx4 := x4a, x4b else minx4, maxx4 := x4b, x4a end if;
> x3a, x3b := evalf(solve((x-e)^2+(c-f)^2-g^2)); if x3a < x3b then minx3, maxx3 := x3a, x3b else minx3, maxx3 := x3b, x3a end if;
> if minx2 < A then lowerbound := minx1 else lowerbound := minx2 end if;
> if B < maxx2 and maxx2 <= h then upperbound := maxx3 elif B > h then upperbound := maxx4 else upperbound := maxx2 end if;
>

> end proc;

Please Wait...