RE: Transformation rules for Floor/Ceiling
- To: mathgroup at smc.vnet.net
- Subject: [mg16989] RE: [mg16953] Transformation rules for Floor/Ceiling
- From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
- Date: Sat, 10 Apr 1999 02:13:29 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Mitch Harris wrote: ----------------------- I am trying to come up with a set of transformation rules (in Mathematica) to help simplify formulas involving Floor and Ceiling. There are a number of identities for these (e.g. Ceiling[a/b] = Floor[a+b-1/b] if b is an integer). Since anykind of programming is difficult from scratch, I'd like to see some examples to see if I'm going about it in the right manner. 1) I've done a web search for something like this and I can't find anything of the sort. Have you ever seen something like this (and if so, do you have pointers as to how to do it)? 2) The Mathematica docs give some ideas (when to use :> rather than ->, checking FullForm to make sure you're matching the appropriate patterns). But I'd really like to see a large example, like for instance the actual transformation rules that Mathematica uses for polynomials or trig (i.e. the internal rules it uses for Simplify, FullSimplify, Reduce, TrigReduce, etc.). Any ideas? Pointers? ---------------------- You said: Ceiling[a/b] = Floor[a+b-1/b] if b is an integer Where did you ever get that idea? In[1]:= Ceiling[7/8] Out[1]= 1 In[2]:= Ceiling[7+8-1/8] Out[2]= 15 Well if you are still interested see (ReIm.m) in the standard packages. Also goto http://www.mathsource.com/Content/Enhancements/Algebraic and look at: - NonNegativeQ - Generalization of Abs and Arg for symbolic expressions - ExactNumber.m A package to improve the handling of mixtures of exact and inexact numbers --------- Anyway I am having a hard time coming up with rules that are always true without very restrictive conditions. Regards, Ted Ersek