All published worksheets from http://sagenb.org
Image: ubuntu2004
File: /usr/local/sage/local/lib/python2.6/site-packages/sage/functions/trig.py
Type: <class ‘sage.functions.trig.Function_sin’>
Definition: sin(*args, coerce=True, hold=False, dont_call_method_on_arg=False)
Docstring:
The sine function.
EXAMPLES:
sage: sin(0) 0 sage: sin(x).subs(x==0) 0 sage: sin(2).n(100) 0.90929742682568169539601986591 sage: loads(dumps(sin)) sin
File: /usr/local/sage/local/lib/python2.6/site-packages/sage/combinat/combinat.py
Type: <type ‘function’>
Definition: fibonacci(n, algorithm=’pari’)
Docstring:
Returns the n-th Fibonacci number. The Fibonacci sequence F_n is defined by the initial conditions F_1=F_2=1 and the recurrence relation F_{n+2} = F_{n+1} + F_n. For negative n we define F_n = (-1)^{n+1}F_{-n}, which is consistent with the recurrence relation.
INPUT:
- algorithm - string:
- "pari" - (default) - use the PARI C library’s fibo function.
- "gap" - use GAP’s Fibonacci function
Note
PARI is tens to hundreds of times faster than GAP here; moreover, PARI works for every large input whereas GAP doesn’t.
EXAMPLES:
sage: fibonacci(10) 55 sage: fibonacci(10, algorithm='gap') 55sage: fibonacci(-100) -354224848179261915075 sage: fibonacci(100) 354224848179261915075sage: fibonacci(0) 0 sage: fibonacci(1/2) ... TypeError: no conversion of this rational to integer
File: /usr/local/sage/local/lib/python2.6/site-packages/sage/functions/log.py
Type: <class ‘sage.functions.log.Function_exp’>
Definition: exp(x, coerce=True, hold=False, prec=None, dont_call_method_on_arg=False)
Docstring:
The exponential function, \exp(x) = e^x.
EXAMPLES:
sage: exp(-1) e^(-1) sage: exp(2) e^2 sage: exp(2).n(100) 7.3890560989306502272304274606 sage: exp(x^2 + log(x)) e^(x^2 + log(x)) sage: exp(x^2 + log(x)).simplify() x*e^(x^2) sage: exp(2.5) 12.1824939607035 sage: exp(float(2.5)) 12.182493960703473 sage: exp(RDF('2.5')) 12.1824939607sage: exp(pi*I/2) I sage: exp(pi*I) -1 sage: exp(8*pi*I) 1 sage: exp(7*pi*I/2) -ITEST:
sage: latex(exp(x)) e^{x} sage: latex(exp(sqrt(x))) e^{\sqrt{x}} sage: latex(exp) \exp sage: latex(exp(sqrt(x))^x) \left(e^{\sqrt{x}}\right)^{x} sage: latex(exp(sqrt(x)^x)) e^{\left(\sqrt{x}^{x}\right)}Test simplifications when taking powers of exp, #7264:
sage: var('a,b,c,I') (a, b, c, I) sage: model_exp = exp(I)**a*(b) sage: sol1_l={b: 5.0, a: 1.1} sage: model_exp.subs(sol1_l) 5.00000000000000*(e^I)^1.10000000000000sage: exp(3)^I*exp(x) (e^3)^I*e^x sage: exp(x)*exp(x) e^(2*x) sage: exp(x)*exp(a) e^(a + x) sage: exp(x)*exp(a)^2 e^(2*a + x)Another instance of the same problem, #7394:
sage: 2*sqrt(e) 2*sqrt(e)