Function Repository Resource:

AntiSimplify

Source Notebook

Make a number or expression more complicated—the opposite of Simplify

Contributed by: Wolfram|Alpha Math Team

ResourceFunction["AntiSimplify"][expr]

complicates the value of expr by essentially adding zeroes and multiplying by ones.

ResourceFunction["AntiSimplify"][expr,param]

complicates expr using the numeric or symbolic parameter param.

Details

Random functions are added and multiplied to the expression to obfuscate its original value. Randomness is seeded on the expression itself, so while choices are random for each given function, repeated evaluations of ResourceFunction["AntiSimplify"] will return the same value.
ResourceFunction["AntiSimplify"] accepts the option "Complexity" which takes a positive integer value and defaults to 2. This value increases the number of times the expression is iteratively obfuscated.

Examples

Basic Examples (2) 

Complicate a number:

In[1]:=
ResourceFunction["AntiSimplify"][4]
Out[1]=

Complicate a symbolic expression:

In[2]:=
ResourceFunction["AntiSimplify"][2 x + 1, x]
Out[2]=

Scope (2) 

Use a particular value to expound upon a number:

In[3]:=
ResourceFunction["AntiSimplify"][4, E]
Out[3]=

Simplifying the expression gives back the initial value:

In[4]:=
Simplify[%]
Out[4]=

Obfuscate a symbolic expression by introducing a new variable:

In[5]:=
ResourceFunction["AntiSimplify"][Cos[x^2], y]
Out[5]=

Again, simplifying gives back the initial value:

In[6]:=
Simplify[%]
Out[6]=

Options (4) 

The "Complexity" option ramps up the number of nested obfuscation loops the function applies:

In[7]:=
ResourceFunction["AntiSimplify"][1, x, "Complexity" -> 1]
Out[7]=

Add more complexity:

In[8]:=
ResourceFunction["AntiSimplify"][1, x, "Complexity" -> 2]
Out[8]=

Even more:

In[9]:=
ResourceFunction["AntiSimplify"][1, x, "Complexity" -> 3]
Out[9]=

This can get very complicated with larger values:

In[10]:=
ResourceFunction["AntiSimplify"][(x + 1)/(3 x - 2), x, "Complexity" -> 5]
Out[10]=

Publisher

Wolfram|Alpha Math Team

Version History

  • 2.0.0 – 23 March 2023
  • 1.0.0 – 28 September 2021

Related Resources

Author Notes

To view the full source code for AntiSimplify, evaluate the following:

In[1]:=
SystemOpen[
 FileNameJoin[{DirectoryName[FindFile["ResourceFunctionHelpers`"]], "AntiSimplify.wl"}]]

License Information