I want to define a named constant standing for a more complicated symbolic expression, for example, PlasticConstant
for the plastic constant:
((9 - √69)^(1/3) + (9 + √69)^(1/3))/(2^(1/3) 3^(2/3))
and I want it to have evaluation rules similar to GoldenRatio
:
- it remains in its named form during normal evaluation (so, simple
Set
does not solve my problem); - it can be numerically evaluated to an arbitrary precision using
N
; - it can be converted to the underlying expression in radicals by
FunctionExpand
, can be converted to aRoot
object byRootReduce
; FullSimplify
is able to replace it with its underlying expression when it helps reducing overall complexity of a containing expression, but leaves it in its named form otherwise;
Equality and inequality operators between the named constant and its underlying expression should automatically evaluate to Boolean values:
PlasticConstant == ((9 - √69)^(1/3) + (9 + √69)^(1/3))/(2^(1/3) 3^(2/3))
(* True *)
similar to how it happens here:
GoldenRatio == (1 + √5)/2
(* True *)
How can we do it?