Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.5K Views
|
1 Reply
|
1 Total Like
View groups...
Share
Share this post:

Control Simplify[ ] outputs?

Posted 10 years ago

Hi,

Very simple question:

Simplify[Sqrt[a^2 - a^2 e^2]]

gives as output

Sqrt[-a^2 (-1 + e^2)]

There are two minus signs that can be "eliminated" so to get

Sqrt[a^2 (1 - e^2)]

Is it possible to use Simplify to get this more elegant answer in one shot ?

Thanks and regards

POSTED BY: Francois Hurter

Simplify tries to reduce the LeafCount of an expression. According to this metric, the solution it gives you is simpler than the one you want. See the documentation for LeafCount and ComplexityFunction for more information.

So the answer to your question is probably to define a ComplexityFunction that's more like what you want. Maybe you want to try something like:

ComplexityFunction -> (StringLength@ToString@# &)
POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard