### odd trig function behavior

I get different behavior for trig functions at poles depending on how I evaluate them. For example:

```
f(x)=tan(x)^2-tan(x)
f(pi/2)
```

gives `0`

, which is disturbing.

Yet

```
f(x)=tan(x)*(tan(x)-1)
f(pi/2)
```

gives `Infinity`

.

And,

```
tan(pi/2)^2-tan(pi/2)
```

gives

`Infinity`

.

What's going on here?