Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#8847 closed defect (fixed)

pynac.pyx use double precision special functions instead of long double

Reported by: mhansen Owned by: tbd
Priority: major Milestone: sage-4.4.3
Component: porting: Cygwin Keywords: pynac
Cc: Merged in: sage-4.4.3.alpha0
Authors: Mike Hansen Reviewers: Burcin Erocal, Mike Hansen, William Stein
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

Many systems such as cygwin don't have the long double version. Plus, they are being applied to floats/doubles so the extra precision doesn't buy much.

Attachments (4)

trac_8847.patch (2.3 KB) - added by mhansen 9 years ago.
trac_8847-take2.patch (2.1 KB) - added by was 9 years ago.
apply only this (not the one below)
trac_8847-take3.patch (2.8 KB) - added by was 9 years ago.
trac_8847-take4.patch (2.9 KB) - added by mhansen 9 years ago.

Download all attachments as: .zip

Change History (11)

Changed 9 years ago by mhansen

comment:1 Changed 9 years ago by mhansen

  • Status changed from new to needs_review

comment:2 Changed 9 years ago by burcin

  • Keywords pynac added
  • Milestone set to sage-4.4.2
  • Reviewers set to Burcin Erocal
  • Status changed from needs_review to needs_work

This gives the following doctest failures on my 64-bit T9300 Core 2 Duo laptop, with gcc (Gentoo 4.3.4 p1.0, pie-10.1.5) 4.3.4 and glibc-2.10.1. I have no idea what is relevant, so I give some random information. :)

**********************************************************************
File "/home/burcin/sage/sage-4.4.1.alpha2-patched/devel/sage-t/sage/functions/other.py", line 428:
    sage: gamma1(float(6))
Expected:
    120.0
Got:
    119.99999999999997
**********************************************************************
**********************************************************************
File "/home/burcin/sage/sage-4.4.1.alpha2-patched/devel/sage-t/sage/symbolic/expression.pyx", line 5318:
    sage: SR(10.0r).gamma()
Expected:
    362880.0
Got:
    362880.00000000047
**********************************************************************

comment:3 Changed 9 years ago by mhansen

It'd be nice if we could just do like an ifdef in Cython.

comment:4 Changed 9 years ago by burcin

We can put the ifdef in c_lib/include/ginac_wrapper.h to define the long double versions on Cygwin. Initially, they could just wrap the double precision functions.

comment:5 Changed 9 years ago by was

  • Status changed from needs_work to needs_review

I just did something at runtime using a bint. It's very simple, and will have a very minimal performance hit.

Changed 9 years ago by was

apply only this (not the one below)

Changed 9 years ago by was

Changed 9 years ago by mhansen

comment:6 Changed 9 years ago by was

  • Merged in set to 4.4.3.alpha0
  • Resolution set to fixed
  • Reviewers changed from Burcin Erocal to Burcin Erocal, Mike Hansen, William Stein
  • Status changed from needs_review to closed

comment:7 Changed 9 years ago by mvngu

  • Merged in changed from 4.4.3.alpha0 to sage-4.4.3.alpha0
Note: See TracTickets for help on using tickets.