Ticket #5239 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

[with patch, positive review] Sage 3.3.rc0: even more numerical noise in sage/sage/plot/plot.py

Reported by: mabshoff Owned by: mabshoff
Priority: blocker Milestone: sage-3.3
Component: doctest coverage Keywords:
Cc: Work issues:
Report Upstream: Reviewers:
Authors: Merged in:
Dependencies: Stopgaps:

Description

Reported by David M. Monarres on OSX 10.5.6:

sage -t  "devel/sage/sage/plot/plot.py" 
********************************************************************** 
File "/Users/ayeq/sage-3.3.alpha5/devel/sage/sage/plot/plot.py", line   
2582: 
     sage: generate_plot_points(sin(x), (-pi, pi), randomize=False) 
Expected: 
     [(-3.1415926535897931, -1.2246...e-16), (-2.748893571891069, 
     -0.38268343236508989), (-2.3561944901923448, -0.707106781186547...), 
     (-2.1598449493429825, -0.831469612302545...), (-1.9634954084936207, 
     -0.92387953251128674), (-1.7671458676442586, -0.98078528040323043), 
     (-1.5707963267948966, -1.0), (-1.3744467859455345, 
     -0.98078528040323043), (-1.1780972450961724, -0.92387953251128674), 
     (-0.98174770424681035, -0.83146961230254524), (-0.78539816339744828, 
     -0.707106781186547...), (-0.39269908169872414, -0.38268343236508978), 
     (0.0, 0.0), (0.39269908169872414, 0.38268343236508978), 
     (0.78539816339744828, 0.707106781186547...), (0.98174770424681035, 
     0.83146961230254524), (1.1780972450961724, 0.92387953251128674), 
     (1.3744467859455345, 0.98078528040323043), (1.5707963267948966, 1.0), 
     (1.7671458676442586, 0.98078528040323043), (1.9634954084936207, 
     0.92387953251128674), (2.1598449493429825, 0.831469612302545...), 
     (2.3561944901923448, 0.707106781186547...), (2.748893571891069, 
     0.38268343236508989), (3.1415926535897931, 1.2246...e-16)] 
Got: 
     [(-3.1415926535897931, -1.2246467991473532e-16),   
(-2.748893571891069, -0.38268343236508984), (-2.3561944901923448,   
-0.70710678118654757), (-2.1598449493429825, -0.83146961230254546),   
(-1.9634954084936207, -0.92387953251128674), (-1.7671458676442586,   
-0.98078528040323043), (-1.5707963267948966, -1.0),   
(-1.3744467859455345, -0.98078528040323043), (-1.1780972450961724,   
-0.92387953251128674), (-0.98174770424681035, -0.83146961230254512),   
(-0.78539816339744828, -0.70710678118654746), (-0.39269908169872414,   
-0.38268343236508978), (0.0, 0.0), (0.39269908169872414,   
0.38268343236508978), (0.78539816339744828, 0.70710678118654746),   
(0.98174770424681035, 0.83146961230254512), (1.1780972450961724,   
0.92387953251128674), (1.3744467859455345, 0.98078528040323043),   
(1.5707963267948966, 1.0), (1.7671458676442586, 0.98078528040323043),   
(1.9634954084936207, 0.92387953251128674), (2.1598449493429825,   
0.83146961230254546), (2.3561944901923448, 0.70710678118654757),   
(2.748893571891069, 0.38268343236508984), (3.1415926535897931,   
1.2246467991473532e-16)] 

Attachments

trac_5239.patch Download (2.1 KB) - added by mabshoff 4 years ago.

Change History

comment:1 Changed 4 years ago by mabshoff

  • Status changed from new to assigned
  • Summary changed from Sage 3.3.rc0: even more numerical noise in sage/sage/plot/plot.py to [with patch, needs review] Sage 3.3.rc0: even more numerical noise in sage/sage/plot/plot.py

The problems seem to be the following:

    -0.38268343236508989), (-2.3561944901923448, -0.707106781186547...),
    -0.38268343236508984), (-2.3561944901923448, -0.707106781186547   ), 

    (-0.98174770424681035, -0.83146961230254524), (-0.78539816339744828,
    (-0.98174770424681035, -0.83146961230254512), (-0.78539816339744828, 

    0.83146961230254524), (1.1780972450961724, 0.92387953251128674),
    0.83146961230254512), (1.1780972450961724, 0.92387953251128674), 

    0.38268343236508989), (3.1415926535897931, 1.2246...e-16)]
    0.38268343236508984), (3.1415926535897931, 1.2246...e-16)]

Patch coming up.

Cheers,

Michael

Changed 4 years ago by mabshoff

comment:2 Changed 4 years ago by mabshoff

With the patch applied I get:

sage -t -long "devel/sage/sage/plot/plot.py"                
	 [56.7 s]

Cheers,

Michael

comment:3 Changed 4 years ago by jason

  • Summary changed from [with patch, needs review] Sage 3.3.rc0: even more numerical noise in sage/sage/plot/plot.py to [with patch, positive review] Sage 3.3.rc0: even more numerical noise in sage/sage/plot/plot.py

This patch looks trivial enough. The changes look reasonable, and mabshoff ran the doctests, so positive review.

[04:09] <jason--> I got rejects on 5239
[04:09] <mabs> Mhhh
[04:10] <mabs> I build against rc0.
[04:10] <jason--> yeah, I have a messed up rc0
[04:10] <mabs> Well, I patched against rc0.
[04:10] <mabs> Ok
[04:10] <mabs> It works, trust me :)
[04:10] <jason--> can I give this a "I looked at it" positive review?
[04:10] <mabs> Yes, just don't tell anyone.
[04:10] <mabs> :)
[04:10] <jason--> okay, I'll whisper it very quietly on the ticket.
[04:11] <jason--> (with this IRC log :)
[04:11] <mabs> I do have the same OS, compiler and hardware as the reporter and I also took the report to produce the patch.
[04:11] <mabs> And it does fix the issue on my box, so this is a pretty sure thing.

comment:4 Changed 4 years ago by mabshoff

  • Status changed from assigned to closed
  • Resolution set to fixed

Merged in Sage 3.3.rc1.

Cheers,

Michael

Note: See TracTickets for help on using tickets.