[sage-support] Re: latex of acos
thank you :) On Oct 7, 6:23 pm, Håkan Granath <[EMAIL PROTECTED]> wrote: > On Oct 1, 4:21 pm, pragma <[EMAIL PROTECTED]> wrote: > > > > > ive tried this but it doesnt seem to do the job: > > > class c_arccos(sage.calculus.calculus.Function_arccos): > > def __init__(self): > > pass > > def _latex_(self): > > return "\\arccos" > > > p_arccos = c_arccos() > > > print latex(p_arccos(1/3)) > > print latex(p_arccos) > > > # > > #outputs: > > > > > \cos^{-1} \left( \frac{1}{3} \right) > > \arccos > > > the first line still outputs \cos^{-1} instead ofarccos > > This seems to work: > > sage: sage.calculus.calculus.Function_arccos._latex_ = lambda self : "\ > \arccos" > sage: latex(arccos(1/3)) > \arccos \left( \frac{1}{3} \right) > > Best, > > /Håkan --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: math range error on sqrt()
See http://trac.sagemath.org/sage_trac/ticket/4266 On Oct 10, 2008, at 4:14 PM, mabshoff wrote: > > > > On Oct 10, 4:04 pm, john_perry_usm <[EMAIL PROTECTED]> wrote: >> Try adding another 1. Apparently I copied & pasted the wrong one. >> > > I can reproduce it on a 64 bit box: > > sage: > round(sqrt > (1 > 11 > 11 > 11 > 11)) > 1.05409255339e+154 > sage: > round(sqrt > (1 > 11 > 11 > 11 > 111)) > -- > - > OverflowError Traceback (most recent call > last) > > /scratch/mabshoff/release-cycle/sage-3.1.3.rc0/ in > () > > /scratch/mabshoff/release-cycle/sage-3.1.3.rc0/local/lib/python2.5/ > site-packages/sage/misc/functional.pyc in round(x, ndigits) > 845 else: > 846 try: return x.round() > --> 847 except AttributeError: return > RealDoubleElement(__builtin__.round(x, 0)) > 848 > 849 def quotient(x, y, *args, **kwds): > > /scratch/mabshoff/release-cycle/sage-3.1.3.rc0/local/lib/python2.5/ > site-packages/sage/calculus/calculus.pyc in __float__(self) >6201 f = self._operands[0] >6202 g = self._operands[1] > -> 6203 return float(f._approx_(float(g))) >6204 >6205 def _fast_float_(self, *vars): > > /scratch/mabshoff/release-cycle/sage-3.1.3.rc0/local/lib/python2.5/ > site-packages/sage/calculus/calculus.pyc in _approx_(self, x) >7978 >7979 def _approx_(self, x): > -> 7980 return math.sqrt(x) >7981 >7982 sqrt = Function_sqrt() > > OverflowError: math range error > > The issue seems to be that RealDoubleElement() cannot deal with a > value that large since it overflows the range that float provides. > > Cheers, > > Michael > > --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: numeric approximations for symbolic expressions
On Fri, 10 Oct 2008 17:48:57 -0500 Jason Grout <[EMAIL PROTECTED]> wrote: > > Burcin Erocal wrote: > > On Fri, 10 Oct 2008 10:35:16 -0500 > > Jason Grout <[EMAIL PROTECTED]> wrote: > > > >> The general request still stands, though: is there a way to > >> numerically approximate all the constants in a symbolic expression, > >> but keep the variables as variables? > > > > The pynac based symbolics code does the following: > > > > sage: x,y,z = var("x y z", ns=1) > > sage: t = 1 + sqrt(2)*x + sin(x) > > sage: t.n() > > sin(x) + (1.4142135623730951)*x + 1.0 > > > > This is with the bundle at #3872 and patches at #4244 applied, and > > the package at #4243. > > > Is there any chance this could be merged into 3.1.3 to get wider > testing? That is, if it's a purely optional framework. Barring > that, is there a chance we could get a single huge patch that > consolidates all of this, or even just a single patch that contains > the changes in the bundle? Since 3.1.3 is almost out the door, and these tickets have not been reviewed yet, they won't be in 3.1.3. I've been told they are high priority for 3.2, so hopefully they will be in the first alpha. I have some fixes I haven't pushed to trac yet. I will try to set up a canonical location where you can get the latest version of my tree. This might be tomorrow afternoon though. Cheers, Burcin --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---