unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Default simplifications in Calc (adding simplifications)
@ 2012-06-17  3:17 Jay Belanger
  2012-06-20 20:20 ` Štěpán Němec
  0 siblings, 1 reply; 4+ messages in thread
From: Jay Belanger @ 2012-06-17  3:17 UTC (permalink / raw)
  To: emacs-devel; +Cc: jay.p.belanger


I'm wondering if anyone has any opinions on moving some algebraic
simplifications to Calc's default simplifications.

Calc does not do some "natural" simplifications by default, but
these simplifications can be done using the "a s" command or by using
Calc's Algebraic Simplification mode.  For example,  by default:
* Calc will simplify `x+x+y' to `2x+y' but will not simplify `x+y+x',
* Calc will not simplify 'x*y + y*x', 
* Calc will not reduce i^2 to -1,
* Calc will not cancel common factors in the top and bottom of a fraction
* Calc will not simplify cos(x)tan(x) to sin(x).
There are others, see (info "(Calc) Algebraic Simplifications")

I think the simplifications done by Algebraic Simplification mode (or
at least some of them) should be done by default; they are not done by
default (according to the manual) "because they may be too slow to
apply all the time, or may not be desirable all of the time."  
I don't think speed is an issue any longer (computers are a bit faster
than they were when Calc was originally written), but since this would
be a change to default behavior I thought I should see if anyone has any
thoughts on the matter. 

Jay




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Default simplifications in Calc (adding simplifications)
  2012-06-17  3:17 Default simplifications in Calc (adding simplifications) Jay Belanger
@ 2012-06-20 20:20 ` Štěpán Němec
  2012-06-20 21:17   ` Jay Belanger
  0 siblings, 1 reply; 4+ messages in thread
From: Štěpán Němec @ 2012-06-20 20:20 UTC (permalink / raw)
  To: jay.p.belanger; +Cc: emacs-devel

On Sat, 16 Jun 2012 22:17:29 -0500
Jay Belanger wrote:

> I'm wondering if anyone has any opinions on moving some algebraic
> simplifications to Calc's default simplifications.

I'm just a casual Calc user, but considering the lack of other answers,
I figured something might be better than nothing.

I agree the simplifications should be done by default. I believe that
even to someone who never used Calc, things like

> * Calc will simplify `x+x+y' to `2x+y' but will not simplify `x+y+x',

must seem strange (inconsistent from a user's standpoint).

Personally I can't imagine why anyone would _not_ want the
simplifications done, esp. if they don't incur any (noticeable)
performance loss.

Thanks,

  Štěpán



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Default simplifications in Calc (adding simplifications)
  2012-06-20 20:20 ` Štěpán Němec
@ 2012-06-20 21:17   ` Jay Belanger
  2012-06-21  6:23     ` Miles Bader
  0 siblings, 1 reply; 4+ messages in thread
From: Jay Belanger @ 2012-06-20 21:17 UTC (permalink / raw)
  To: Štěpán Němec; +Cc: jay.p.belanger, emacs-devel


Hi Štěpán,

Thanks for the feedback.

> I agree the simplifications should be done by default. I believe that
> even to someone who never used Calc, things like
>
>> * Calc will simplify `x+x+y' to `2x+y' but will not simplify `x+y+x',
>
> must seem strange (inconsistent from a user's standpoint).

I agree.

The manual mentions that i^2 isn't reduced to -1 in case the user
redefines the variable i.
Also, the case could be made that x/x isn't quite 1.
While the case could be made that these should be "unsafe
simplifications", they are pretty standard and in my opinion should be
default simplifications.

> Personally I can't imagine why anyone would _not_ want the
> simplifications done, esp. if they don't incur any (noticeable)
> performance loss.

Right.
When Calc first came out, they probably did cause a performance loss,
but I think the time has come to make them default.

Unless there are any objections, then, I'll make all of the
simplifications in Algebraic Mode part of the default simplifications.

Jay



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Default simplifications in Calc (adding simplifications)
  2012-06-20 21:17   ` Jay Belanger
@ 2012-06-21  6:23     ` Miles Bader
  0 siblings, 0 replies; 4+ messages in thread
From: Miles Bader @ 2012-06-21  6:23 UTC (permalink / raw)
  To: jay.p.belanger; +Cc: Štěpán Němec, emacs-devel

Jay Belanger <jay.p.belanger@gmail.com> writes:
> Unless there are any objections, then, I'll make all of the
> simplifications in Algebraic Mode part of the default simplifications.

Sounds good to me (I often use calc for simple algebraic
manipulations..)!

-miles

-- 
Any man who is a triangle, has thee right, when in Cartesian Space,
to have angles, which when summed, come to know more, nor no less,
than nine score degrees, should he so wish.  [TEMPLE OV THEE LEMUR]



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-21  6:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-17  3:17 Default simplifications in Calc (adding simplifications) Jay Belanger
2012-06-20 20:20 ` Štěpán Němec
2012-06-20 21:17   ` Jay Belanger
2012-06-21  6:23     ` Miles Bader

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).