Remove["LogExp`*"]
Remove["LogExp`Private`*"]

BeginPackage["LogExp`", {"Useful`"}]

ExpTrans::usage =
"ExpTrans is an equality-preserving transformation due to Kahan."

ExpTrans1::usage = ""

Begin["`Private`"]

Unprotect[Log]
Log[Exp[z_]] := z - 2 Pi I Round[Im[z] / (2 Pi)]
Protect[Log]

Unprotect[Im]
Im[Log[z_]] := Arg[z]
Im[c_?IsReal z_] := c Im[z]
Protect[Im]

Unprotect[Round]
Round[Arg[z_] / (2 Pi)] := 0

ExpTrans1[c_Integer z_] := - ExpTrans1[- c z] /; c < 0
ExpTrans1[z_] := Log[Exp[z]] + 2 Pi I Round[Im[z] / (2 Pi)]
ExpTrans[e_] := ExpTrans1 /@ e

End[]
EndPackage[]
