r"""
    Return the Achille's Heel function, defined as:
    :math:`\prod_{i=0}^{n/2-1}{X_{2i} + X_{2i+1}}`.

    If *simplify* is ``True``, return a simplified expression.
429349
def AchillesHeel(*xs, simplify=True):
    
    """
    nargs = len(xs)
    if nargs & 1:
        fstr = "expected an even number of arguments, got {}"
        raise ValueError(fstr.format(nargs))
    xs = [Expression.box(x).node for x in xs]
    y = exprnode.and_(*[exprnode.or_(xs[2*i], xs[2*i+1])
                        for i in range(nargs // 2)])
    if simplify:
        y = y.simplify()
    return _expr(y)
994784
function step(x, a, p, q) {
      var temp, w;

      temp = p <= 0.5 ? gratio(a)(x) - p : q - gratioc(a)(x);
      temp /= r(a, x);
      w = (a - 1 - x) / 2;
      if (Math.max(Math.abs(temp), Math.abs(w * temp)) <= 0.1) {
         return x * (1 - (temp + w * temp * temp));
      }
      return x * (1 - temp);
   }
406501
def cosh(x):
    
    if isinstance(x, UncertainFunction):
        mcpts = np.cosh(x._mcpts)
        return UncertainFunction(mcpts)
    else:
        return np.cosh(x)
1051358
def ax(mt, x, m=1):
    
    return (mt.Nx[x] / mt.Dx[x] - 1) + (float(m - 1) / float(m * 2))
623900
def spher2cart(rho, theta, phi):
    """"""
    st = np.sin(theta)
    sp = np.sin(phi)
    ct = np.cos(theta)
    cp = np.cos(phi)
    rhost = rho * st
    x = rhost * cp
    y = rhost * sp
    z = rho * ct
    return np.array([x, y, z])
1122879
function(p, lowerTail, logp) {
        if (p === 1) {
          p = 0;
          lowerTail = !lowerTail;
        }
        if (p === 0) {
          return lowerTail ? logp ? -Infinity : 0
                           : logp ? 0 : 1;
        }
        return lowerTail ? logp ? Math.log(p) : p
                         : logp ? log1p(-p) : 1 - p;
      }
985154
def product(seq):
    
    if len(seq) == 0:
        return 0
    else:
        product = 1
        for x in seq:
            product *= x
        return product
851482
def square(x):
    """"""

    def H(x):
        """Heaveside step function"""

        if x < 0.:
            return 0.
        if x == 0.:
            return 0.5
        if x > 0.:
            return 1.
    return 2 * (H(x / L) - H(x / L - 1)) - 1
456732
def function(vec1, vec2)
		case @func
		when :linear
			return normalized_radius(vec1, vec2)
		when :cubic_alt
			return normalized_radius(vec1, vec2)**(1.5)
		when :thin_plate_splines
			return 0.0 if radius(vec1, vec2) == 0.0
			return normalized_radius(vec1, vec2)**2.0 * Math.log(normalized_radius(vec1, vec2))
		when :thin_plate_splines_alt
			rnorm = ((@r0.prod.abs)**(2.0/@r0.size)*(((vec1-vec2).square / @r0.square).sum + 1.0))
			return rnorm * Math.log(rnorm)
		when :multiquadratic
# 			return Math.sqrt(radius(vec1, vec2)**2 + Math.sqrt(@r0.square.sum))
			(@r0.prod.abs)**(1.0/@r0.size)*Math.sqrt(((vec1-vec2).square / @r0.square).sum + 1.0)
		when :inverse_multiquadratic
			1.0 / ((@r0.prod.abs)**(1.0/@r0.size)*Math.sqrt(((vec1-vec2).square / @r0.square).sum + 1.0))
		when :cubic
			((@r0.prod.abs)**(2.0/@r0.size)*(((vec1-vec2).square / @r0.square).sum + 1.0))**(1.5)
# 			invs = ((vec1-vec2).square + @r0.square).sqrt**(-1)
# 			invs.sum
# 				p @ro
# 			return 1.0 / Math.sqrt(radius(vec1, vec2)**2 + Math.sqrt(@r0.square.sum))
# 		when :inverse_multiquadratic
# # 				p @ro
# 			return 1.0 / Math.sqrt(radius(vec1, vec2)**2 + Math.sqrt(@r0.square.sum))
		else
			raise ArgumentError.new("Bad radial basis function: #{@func}")
		end
	end
836551
def j0_2(a=1):
    """

    def lhs(x):
        return np.exp(-a*x)

    def rhs(b):
        return 1/np.sqrt(b**2 + a**2)

    return Ghosh('j0', lhs, rhs)
254749
function() {

      // asech(c) = log((1+sqrt(1-c^2))/c)

      var a = this['re'];
      var b = this['im'];

      if (this['isZero']()) {
        return Complex['INFINITY'];
      }

      var d = a * a + b * b;
      return (d !== 0)
              ? new Complex(
                      a / d,
                      -b / d).acosh()
              : new Complex(
                      (a !== 0) ? a / 0 : 0,
                      (b !== 0) ? -b / 0 : 0).acosh();
    }
815509
def felli(x):
    """"""
    return sum(1e6**(np.arange(len(x)) / (len(x) - 1)) * (np.array(x, copy=False))**2)
1009060
def _function(self, x, a, b, c, d):
        
        return c/((a**2-x**2)**2 + (b*x)**2)+d
648614
def AcosTriAngles(v, f, normalize):
    

    if normalize:
        nm = lambda x : NormalizedNx3(x)
    else:
        nm = lambda x : x

    return Ch(lambda v :
        Sum3xN(NormalizedNx3(TriEdges(f, 1, 0, nm(v))) * NormalizedNx3(TriEdges(f, 2, 0, nm(v)))) &
        Sum3xN(NormalizedNx3(TriEdges(f, 2, 1, nm(v))) * NormalizedNx3(TriEdges(f, 0, 1, nm(v)))) &
        Sum3xN(NormalizedNx3(TriEdges(f, 0, 2, nm(v))) * NormalizedNx3(TriEdges(f, 1, 2, nm(v)))))
966788
def _function(self, x, a, b, c, d, s):
        
        return c/(np.pi*self._g_a(x, a, b, s)*(1.0+((x-a)/(self._g_a(x, a, b, s)))**2))+d
637458
def derivative(self, z, x, y, fase):
        """"""
        return deriv_H(self, z, x, y, fase)
8091
def acosh(x):
    
    if isinstance(x, UncertainFunction):
        mcpts = np.arccosh(x._mcpts)
        return UncertainFunction(mcpts)
    else:
        return np.arccosh(x)