﻿ Difference between simplifying and pruning formulas

# Difference between simplifying and pruning formulas

OAK offers two mechanisms that can alter a formula.  It can simplify them, and it can prune them.  The two are similar in that they make the formula shorter and easier to read.  But there are important differences between them and it is important not to confuse them.

Simplification

Pruning

OAK can simplify a formula by matching them against patterns specified in rules describing algebraic transformations

OAK can prune a formula by evaluating conditional elements of the expression and discarding the bits of the expression that don't apply.

The formula =IF(A1>B1,A1,B1) can be rewritten as =MAX(A1,B1).    OAK has a set of rules that it can use to alter expressions through algebraic transformations.

If the value in cell A1 is bigger than the one in cell B1, then the formula =IF(A1>B1,A1,B1) evaluates to the contents of B1.  One could replace the IF by writing =A1.

The formula will give results in its simplified form that are identical to the one it gave in its original form, no matter what inputs are provided to it....

The formula above would continue to give the same answer after it has been pruned as it did before, only so long as A1 contained to exceed B1.

Offered by OAK

in the Formulas | Optimize command

as an option in Formulas | Reconstruct

as an option in the Formulas | Fan Out Precedents command

Offered by OAK

in the Formulas | Prune Inactive Path command

as an option in the Formulas | Reconstruct command

as an option in the Formulas | Fan Out Precedents command

When developing a spreadsheet, you may like to keep the suggestions of OAK's Formula Optimize command permanently.

You will definitely not want to keep pruned formulas permanently.  Pruning alters the spreadsheet, in a way intended to make it easier to understand, but which will lead the spreadsheet to give the wrong answer with different inputs.  Make sure you keep a copy of the spreadsheet before pruning it.