#218 Add C99's expm1() family

closed-fixed
nobody
2005-02-11
2005-01-26
No

This message
http://sf.net/mailarchive/message.php?msg_id=10611421
explains how to implement expm1l() by cloning the expl.c
already in mingwex. Related functions expm1() and expm1f()
are trivially implemented the same way mingwex handles
expf(). I had thought I'd need assignment papers for this
patch, but I forgot you're not FSF and this isn't part
of gcc.

Discussion

  • Anonymous - 2005-01-29

    Logged In: YES
    user_id=231935

    Danny--Attachment expm1-20050129T1629Z.tar.bz2 reflects
    our recent discussions on mingw-users. List yourself as coauthor
    if you like--I didn't know what attribution you'd want.

     
  • Anonymous - 2005-01-29

    Add expm1 functions

     
  • Danny Smith

    Danny Smith - 2005-01-31

    Logged In: YES
    user_id=11494

    This comment in your test case:
    // Differences of exactly one for infinite or indefinite
    arguments
    // are observed for values of extremely high absolute
    value. Is that
    // important?

    is spurious.
    This shows why:

    #include <stdio.h>
    int main ()
    {
    double d1 = 1.0/0.0; /* INF */
    double d2 = 1.0/0.0;
    double diff = d1 - d2; /* NAN */
    printf ("%10.0g\n", diff);
    printf ("%0.10g\n", diff);
    return 0;
    }

    I'll fix up. Still testing. I've noticed that GCC replaces the
    Cephes magic numbers with fldl2e and fldln2 at -O2. Curious.
    Danny

     
  • Danny Smith

    Danny Smith - 2005-02-01

    Logged In: YES
    user_id=11494

    Greg, attached patch (expm1-20050201.diff) has following
    modifications to your submission:

    - split up into three modules rather than using casts (sibcall
    optimisation doesn't worK all that well when changing fp
    types) I realize that this is a maintenance burden, but I think
    its worth it in a standard runtime lib.

    - use fabs rather than (-CONST < x && x < CONST). This
    allows gcc to use fpu opcodes when it thinks it should (based
    on -mtune). The optimization in gcc code gets fooled by
    negation of the CONST. If you have gcc sources, the
    relavant code is in
    gcc/config/i386/i386.c:standard_80387_constant_p() and
    friends.

    - I won't include your testcase in CVS just yet, until we get
    some kind of plan on how we should manage testsuite.

    Comments?

    Danny

     
  • Danny Smith

    Danny Smith - 2005-02-11
    • status: open --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks