def _osborne(e, d):
 def f(rv):
  if (not isinstance(rv, HyperbolicFunction)):
   return rv
  a = rv.args[0]
  a = ((a * d) if (not a.is_Add) else Add._from_args([(i * d) for i in a.args]))
  if (rv.func is sinh):
   return (I * sin(a))
  elif (rv.func is cosh):
   return cos(a)
  elif (rv.func is tanh):
   return (I * tan(a))
  elif (rv.func is coth):
   return (cot(a) / I)
  else:
   raise NotImplementedError(('unhandled %s' % rv.func))
 return bottom_up(e, f)

def _osborne ( e , d ) : def f ( rv ) : if ( not isinstance ( rv , HyperbolicFunction ) ) : return rv a = rv . args [ 0 ] a = ( ( a * d ) if ( not a . is_Add ) else Add . _from_args ( [ ( i * d ) for i in a . args ] ) ) if ( rv . func is sinh ) : return ( I * sin ( a ) ) elif ( rv . func is cosh ) : return cos ( a ) elif ( rv . func is tanh ) : return ( I * tan ( a ) ) elif ( rv . func is coth ) : return ( cot ( a ) / I ) else : raise NotImplementedError ( ( 'unhandled %s' % rv . func ) ) return bottom_up ( e , f )
replace all hyperbolic functions with trig functions using the osborne rule .