Changeset 7386:9a74afabd367
- Timestamp:
- 11/20/07 07:30:58 (6 years ago)
- Branch:
- default
- Location:
- sage/calculus
- Files:
-
- 2 edited
-
all.py (modified) (1 diff)
-
calculus.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sage/calculus/all.py
r7385 r7386 11 11 sin, cos, sec, csc, cot, tan, log, erf, sqrt, asin, acos, atan, 12 12 tanh, sinh, cosh, coth, sech, csch, ln, 13 asinh, acosh, atanh, 13 14 ceil, floor, 14 15 polylog, -
sage/calculus/calculus.py
r7385 r7386 129 129 sage: f.diff(x) 130 130 1/(3*sqrt(x^2/9 + 1)) 131 132 We compute the length of the parabola from 0 to 2: 133 sage: x = var('x') 134 sage: y = x^2 135 sage: dy = diff(y,x) 136 sage: z = integral(sqrt(1 + dy^2), x, 0, 2) 137 sage: print z 138 asinh(4) + 4 sqrt(17) 139 --------------------- 140 4 141 sage: n(z,200) 142 4.6467837624329358733826155674904591885104869874232887508703 143 sage: float(z) 144 4.6467837624329356 131 145 132 146 COERCION EXAMPLES: … … 4377 4391 _syms['asin'] = asin 4378 4392 4393 class Function_asinh(PrimitiveFunction): 4394 """ 4395 The inverse of the hyperbolic sine function. 4396 4397 EXAMPLES: 4398 sage: asinh(0.5) 4399 0.481211825059603 4400 sage: asinh(1/2) 4401 asinh(1/2) 4402 sage: asinh(1 + I*1.0) 4403 0.6662394324925153*I + 1.061275061905036 4404 """ 4405 def _repr_(self, simplify=True): 4406 return "asinh" 4407 4408 def _latex_(self): 4409 return "\\sinh^{-1}" 4410 4411 def _approx_(self, x): 4412 return float(pari(float(x)).asinh()) 4413 4414 asinh = Function_asinh() 4415 _syms['asinh'] = asinh 4416 4417 class Function_acosh(PrimitiveFunction): 4418 """ 4419 The inverse of the hyperbolic cose function. 4420 4421 EXAMPLES: 4422 sage: acosh(1/2) 4423 acosh(1/2) 4424 sage: acosh(1 + I*1.0) 4425 0.9045568943023813*I + 1.061275061905036 4426 4427 Warning: If the input is real the output will be real or NaN: 4428 sage: acosh(0.5) 4429 NaN 4430 4431 But evaluate where the input is in the complex field yields a complex output: 4432 sage: acosh(CC(0.5)) 4433 1.04719755119660*I 4434 4435 """ 4436 def _repr_(self, simplify=True): 4437 return "acosh" 4438 4439 def _latex_(self): 4440 return "\\cosh^{-1}" 4441 4442 def _approx_(self, x): 4443 return float(pari(float(x)).acosh()) 4444 4445 acosh = Function_acosh() 4446 _syms['acosh'] = acosh 4447 4448 class Function_atanh(PrimitiveFunction): 4449 """ 4450 The inverse of the hyperbolic tane function. 4451 4452 EXAMPLES: 4453 sage: atanh(0.5) 4454 0.549306144334055 4455 sage: atanh(1/2) 4456 atanh(1/2) 4457 sage: atanh(1 + I*1.0) 4458 1.017221967897851*I + 0.4023594781085251 4459 """ 4460 def _repr_(self, simplify=True): 4461 return "atanh" 4462 4463 def _latex_(self): 4464 return "\\tanh^{-1}" 4465 4466 def _approx_(self, x): 4467 return float(pari(float(x)).atanh()) 4468 4469 atanh = Function_atanh() 4470 _syms['atanh'] = atanh 4471 4379 4472 class Function_acos(PrimitiveFunction): 4380 4473 """ … … 4932 5025 self._kwds = kwds 4933 5026 5027 def __float__(self): 5028 return float(maxima(self)) 5029 4934 5030 def _is_atomic(self): 4935 5031 return True … … 4940 5036 def keyword_arguments(self): 4941 5037 return self._kwds 4942 5038 4943 5039 def _repr_(self, simplify=True): 4944 5040 if simplify: … … 5234 5330 nm = msg[i+1:j] 5235 5331 5236 res = re.match( nm + '\s*\(.*\)', s)5332 res = re.match('.*' + nm + '\s*\(.*\)', s) 5237 5333 if res: 5238 5334 syms[nm] = function(nm)
Note: See TracChangeset
for help on using the changeset viewer.
