Ticket #5722 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

[with patch, positive review] fast callable pow

Reported by: robertwb Owned by: somebody
Priority: critical Milestone: sage-3.4.1
Component: basic arithmetic Keywords:
Cc: cwitty Work issues:
Report Upstream: Reviewers:
Authors: Merged in:
Dependencies: Stopgaps:

Description

pow(double, double) inconsistent for bad input. See extensive documentation in floatobject.c

Attachments

5722-fast-callable-pow.patch Download (3.7 KB) - added by robertwb 4 years ago.

Change History

comment:1 Changed 4 years ago by robertwb

  • Summary changed from fast callable pow to [with patch, needs review] fast callable pow

comment:2 Changed 4 years ago by mabshoff

Oops, I spoke too soon in person. There are two doctest failures that need fixing:

sage -t -long "devel/sage/sage/ext/fast_callable.pyx"       
**********************************************************************
File "/scratch/mabshoff/sage-3.4.1.rc2/devel/sage/sage/ext/fast_callable.pyx", line 2213:
    sage: fast_callable(sin(x)/x, vars=[x], domain=RDF).get_orig_args()
Expected:
    {'domain': Real Double Field, 'code': [0, 0, 16, 0, 0, 7, 2], 'py_constants': [], 'args': 1, 'stack': 2, 'constants': []}
Got:
    {'domain': Real Double Field, 'code': [0, 0, 16, 0, 0, 8, 2], 'py_constants': [], 'args': 1, 'stack': 2, 'constants': []}
**********************************************************************
1 items had failures:

And

sage -t -long "devel/sage/sage/ext/gen_interpreters.py"
**********************************************************************
File "/scratch/mabshoff/sage-3.4.1.rc2/devel/sage/sage/ext/gen_interpreters.py", line 2772:
    sage: print buff.getvalue()
Expected:
        case 7: /* div */
          {
            double i1 = *--stack;
            double i0 = *--stack;
            double o0;
            o0 = i0 / i1;
            *stack++ = o0;
          }
          break;
    <BLANKLINE>
Got:
        case 8: /* div */
          {
            double i1 = *--stack;
            double i0 = *--stack;
            double o0;
            o0 = i0 / i1;
            *stack++ = o0;
          }
          break;
    <BLANKLINE>
<SNIP>

I think that just the doctests need to be updated, but I will leave this to you :)

Cheers,

Michael

comment:3 Changed 4 years ago by robertwb

Yes, those are both inconsequential ordering issues.

comment:4 Changed 4 years ago by mabshoff

Hi Robert,

there are actually two more doctest failure that I cut off since the failure message is quite long:

File "/scratch/mabshoff/sage-3.4.1.rc2/devel/sage-main/sage/ext/gen_interpreters.py", line 3592:
File "/scratch/mabshoff/sage-3.4.1.rc2/devel/sage-main/sage/ext/gen_interpreters.py", line 3608:

Sorry for causing confusion ;)

But the other doctest failures are fixed.

Cheers,

Michael

Changed 4 years ago by robertwb

comment:5 Changed 4 years ago by robertwb

OK, all doctests in that file pass now.

comment:6 Changed 4 years ago by mabshoff

  • Summary changed from [with patch, needs review] fast callable pow to [with patch, positive review] fast callable pow

Positive review. Doctests do pass :).

I also read the patch and I am happy with it.

Cheers,

Michael

comment:7 Changed 4 years ago by mabshoff

  • Cc cwitty added
  • Status changed from new to closed
  • Resolution set to fixed

Merged in Sage 3.4.1.rc2.

CCing cwitty so he is aware of this patch.

Cheers,

Michael

Note: See TracTickets for help on using tickets.