def _osbornei(e, d):
 def f(rv):
  if (not isinstance(rv, TrigonometricFunction)):
   return rv
  a = rv.args[0].xreplace({d: S.One})
  if (rv.func is sin):
   return (sinh(a) / I)
  elif (rv.func is cos):
   return cosh(a)
  elif (rv.func is tan):
   return (tanh(a) / I)
  elif (rv.func is cot):
   return (coth(a) * I)
  elif (rv.func is sec):
   return (1 / cosh(a))
  elif (rv.func is csc):
   return (I / sinh(a))
  else:
   raise NotImplementedError(('unhandled %s' % rv.func))
 return bottom_up(e, f)

def _osbornei ( e , d ) : def f ( rv ) : if ( not isinstance ( rv , TrigonometricFunction ) ) : return rv a = rv . args [ 0 ] . xreplace ( { d : S . One } ) if ( rv . func is sin ) : return ( sinh ( a ) / I ) elif ( rv . func is cos ) : return cosh ( a ) elif ( rv . func is tan ) : return ( tanh ( a ) / I ) elif ( rv . func is cot ) : return ( coth ( a ) * I ) elif ( rv . func is sec ) : return ( 1 / cosh ( a ) ) elif ( rv . func is csc ) : return ( I / sinh ( a ) ) else : raise NotImplementedError ( ( 'unhandled %s' % rv . func ) ) return bottom_up ( e , f )
replace all trig functions with hyperbolic functions using the osborne rule .