Opened 9 years ago

Last modified 3 years ago

#9874 new defect

add a function for the derivative of ceil and floor

Reported by: burcin Owned by: burcin
Priority: major Milestone: sage-6.8
Component: symbolics Keywords: sd35.5
Cc: ktkohl, rws, kcrisman, pelegm Merged in:
Authors: Karen Kohl Reviewers:
Report Upstream: N/A Work issues:
Branch: u/ktkohl/add_a_function_for_the_derivative_of_ceil_and_floor (Commits) Commit: 8013b9f89b3670847007f6d3560252035a899638
Dependencies: Stopgaps:

Description

We should define a new symbolic function for the derivative of ceil or floor.

In Maple:

> diff(floor(x),x);
                                  floor(1, x)
> diff(floor(x),x,x);
                                  floor(1, x)
> diff(ceil(x),x,x); 
                                  floor(1, x)
> eval(diff(ceil(x),x,x),x=1.5);
                                       0
> eval(diff(ceil(x),x,x),x=0);  
Error, (in floor) floor is not differentiable at integers

Change History (12)

comment:1 Changed 8 years ago by ktkohl

  • Cc ktkohl added
  • Keywords sd35.5 added

comment:2 Changed 6 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:3 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:4 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:5 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:6 Changed 5 years ago by ktkohl

  • Authors set to ktkohl

comment:7 Changed 5 years ago by ktkohl

  • Branch set to u/ktkohl/add_a_function_for_the_derivative_of_ceil_and_floor

comment:8 Changed 5 years ago by ktkohl

  • Commit set to 8013b9f89b3670847007f6d3560252035a899638

These give the right answer but also a runtime error:

sage: floor(x).derivative().subs(x=1.5)
Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python object' in 'sage.structure.parent.good_as_coerce_domain' ignored
0
sage: ceil(x).derivative().subs(x=1.5)
Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python object' in 'sage.structure.parent.good_as_coerce_domain' ignored
0

New commits:

8013b9fAdded ceiling and floor functions to allow 2nd argument for derivative.

comment:9 Changed 5 years ago by ktkohl

  • Authors changed from ktkohl to Karen Kohl

comment:10 Changed 5 years ago by ktkohl

  • Cc rws kcrisman added

comment:11 Changed 5 years ago by rws

  • Milestone changed from sage-6.4 to sage-6.8

Just a quick note that there are empty examples and tests fields but you probably know that.

comment:12 Changed 3 years ago by pelegm

  • Cc pelegm added
Note: See TracTickets for help on using tickets.