def explnPrime(x):
 def f(val):
  if (val < 0):
   return exp(val)
  else:
   return (1.0 / (val + 1.0))
 try:
  result = array(list(map(f, x)))
 except TypeError:
  result = array(f(x))
 return result

def explnPrime ( x ) : def f ( val ) : if ( val < 0 ) : return exp ( val ) else : return ( 1.0 / ( val + 1.0 ) ) try : result = array ( list ( map ( f , x ) ) ) except TypeError : result = array ( f ( x ) ) return result
this function is the first derivative of the expln function .