what am I missing?

26 views
Skip to first unread message

Fernando Gouvea

unread,
Apr 13, 2023, 4:15:17 PM4/13/23
to sage-support

I must be missing something here...

sage: g(x)=x^10/(1-x)^11
sage: plot(g(x),(0,0.9))

sage: g(0.7)
15945.8104850773

What's wrong?

Fernando

-- 
=============================================================
Fernando Q. Gouvea         http://www.colby.edu/~fqgouvea
Carter Professor of Mathematics
Dept. of Mathematics
Colby College              
5836 Mayflower Hill        
Waterville, ME 04901       

Further Pronunciation Advice

That math whiz Euler (Leonhard)
Had a great mind, but a peon heart.
His life was spare and frugal,
His sex life strictly conjugal.

  -- John Derbyshire

William Stein

unread,
Apr 13, 2023, 4:18:19 PM4/13/23
to sage-s...@googlegroups.com
Hi,

I think I randomly ran into this same thing with sage-9.8 this week too.  My guess is that there is some sort of overflow bug in the computation of the y-axis labels.  It's probably one of the most severe bugs in sage ever, since it is so likely to be randomly misleading...

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/57352ea7-2214-50af-9944-1eed986c9442%40colby.edu.


--

Fernando Gouvea

unread,
Apr 13, 2023, 4:22:42 PM4/13/23
to sage-s...@googlegroups.com

I get the same results in 9.2 and 9.6.

Fernando

-- 
=============================================================
Fernando Q. Gouvea         http://www.colby.edu/~fqgouvea
Carter Professor of Mathematics
Dept. of Mathematics
Colby College              
5836 Mayflower Hill        
Waterville, ME 04901       

Flagrant breaches of good breeding, like singing in the streets
or any other gross misconduct, are easily apparent and do not
call especially for admonition and instruction.
  -- Cicero, De Oficiis

William Stein

unread,
Apr 13, 2023, 4:33:49 PM4/13/23
to sage-s...@googlegroups.com
I tried "plot(g(x),(0.8,0.9))" and it says "1e10" in the upper left of the plot, suggesting it is labeling the y axis with the labels divided by 1e10, and maybe somehow that 1e10 gets cut off in your example. See below.  The default plotting in Sage got implemented as follows: In 2006 I said to Alex Clemesha (who had just got his undergrad degree), "implement 2d plotting for Sage that has the same API and look as mathematica, but translated to be pythonic", and he did that.  So whatever is happening here with the labels changing, might be just copying what "Mathematica in 2006" did...

image.png

Fernando Gouvea

unread,
Apr 13, 2023, 5:13:44 PM4/13/23
to sage-s...@googlegroups.com

That seems right. Plotting x^6/(1-x)^7 shows the error, but x^5/(1-x)^6 does not. And

.9^6/.1^7 = 5.31441000000001e6

.9^5/.1^6 = 590490.000000001

So it seems that there should be a 1e6 label that is somehow not appearing.

Fernando

John H Palmieri

unread,
Apr 13, 2023, 5:20:10 PM4/13/23
to sage-support
This looks like the issue reported at https://github.com/sagemath/sage/issues/34233.

--
John
Reply all
Reply to author
Forward
0 new messages