MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / realNum

Function realNum

src/compute-engine/rubi/rubi-utils.ts:115–123  ·  view source on GitHub ↗

real machine value of an expression, or null if not a real number

(e: Expression)

Source from the content-addressed store, hash-verified

113 // The general form Subst[u, expr, v] := u /. expr -> v replaces the
114 // subexpression `expr` (a non-variable, e.g. the expanded log argument
115 // c·dⁿ·(e+f·x)^{m·n}) with `v` — used by the 6 "power-in-log" /
116 // radical back-substitution rules (1.1.3.1 #44/#45, 1.1.3.2 #103/#104,
117 // 3.2.2 #15, 3.3 #60). Dispatching on args[1] here is essential:
118 // substituting ctx.x for those compound middles rewrites `x` itself and
119 // corrupts the antiderivative (spurious powers in the log argument).
120 const target = build(args[1], ctx);
121 if (target.symbol === ctx.x) return u.subs({ [ctx.x]: v }).evaluate();
122 return replaceSubexpr(u, target, v).evaluate();
123 }
124 case 'Rational':
125 // NOTE: ce.number() does not accept a MathJSON array (spins) — box
126 return ce.expr(json as any);

Callers 15

ratConstantFunction · 0.85
polyDegreeXFunction · 0.85
monomialsXFunction · 0.85
rubi-utils.tsFile · 0.85
igtQEFunction · 0.85
eqNumFunction · 0.85
cmpChainFunction · 0.85
intCmpFunction · 0.85
posAuxFunction · 0.85
simplerQFunction · 0.85
rtExprFunction · 0.85
sumBaseTermsFunction · 0.85

Calls 3

isNumberFunction · 0.90
NMethod · 0.65
isFiniteMethod · 0.45

Tested by

no test coverage detected