Opened 6 years ago

Closed 6 years ago

#17131 closed defect (fixed)

Improve accuracy of polytopes.regular_polygon()

Reported by: jdemeyer Owned by:
Priority: major Milestone: sage-6.4
Component: geometry Keywords:
Cc: Merged in:
Authors: Jeroen Demeyer Reviewers: Volker Braun
Report Upstream: N/A Work issues:
Branch: 0001941 (Commits) Commit: 0001941d064c6f1b1c0be2aea078eae0fb232b21
Dependencies: Stopgaps:

Description (last modified by jdemeyer)

The function polytopes.regular_polygon() uses a hard-coded approximation of pi (3.14159265359) which has an error of 466 ulp. Moreover, it uses Python floats instead of RR.

Note: there are actually a lot of these fishy approximations (like QQ(1618033)/1000000 for the golden ratio). Since this ticket is intended to avoid a doctest failure in #17130, I only fixed regular_polygon().

Change History (5)

comment:1 Changed 6 years ago by jdemeyer

  • Branch set to u/jdemeyer/ticket/17131
  • Created changed from 10/11/14 12:35:22 to 10/11/14 12:35:22
  • Modified changed from 10/11/14 12:35:22 to 10/11/14 12:35:22

comment:2 Changed 6 years ago by jdemeyer

  • Authors set to Jeroen Demeyer
  • Commit set to 0001941d064c6f1b1c0be2aea078eae0fb232b21
  • Status changed from new to needs_review

New commits:

0001941Improve accuracy of polytopes.regular_polygon()

comment:3 Changed 6 years ago by jdemeyer

  • Description modified (diff)

comment:4 Changed 6 years ago by vbraun

  • Reviewers set to Volker Braun
  • Status changed from needs_review to positive_review

Yes, this is all ancient cruft...

comment:5 Changed 6 years ago by vbraun

  • Branch changed from u/jdemeyer/ticket/17131 to 0001941d064c6f1b1c0be2aea078eae0fb232b21
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.