Sqrt
The principal square root of x: .
✓ checked against that system · ! checked, with disagreements (hover a chip)Wikipedia
Square rootMathWorldSquareRootWikidataQ134237Britannicatopic/square-rootFungrimSqrtWolfram LanguageSqrt!Typed signatures
| Type | Package | Applies |
|---|---|---|
(complex | infinity) -> complex | infinity | analyticreplaces compute-engine | on Around, CenteredInterval, Interval |
(complex | infinity) -> complex | infinity | compute-engine | always |
Details
- The principal square root: . See Root for other roots and Square for the inverse operation.
- Evaluates exactly only when the radicand is a perfect square (or a ratio of perfect squares); otherwise it stays in symbolic surd form, like .
- A negative radicand gives an imaginary result, for -- but only reduces to an exact Complex number when itself is a perfect square.
- .
- compute-engine's Sqrt is a special case of the more general Root: canonicalizes to .
Examples
8 more kept as data, checked against the oraclesScope #
live ↗
InOut
live ↗
InOut
live ↗
InOut
live ↗
InOut
Sqrt(-Infinity) = i Infinity, the principal branch's direction as the radicand goes to -Infinity (DLMF 4.2.2)
live ↗InOut
Known value · Wolfram MathematicalFunctionData, Sqrt
Possible issues #
Negative but not a perfect square: stays symbolic rather than reducing to an exact complex value
live ↗InOut
A negative rational still evaluates exactly when both numerator and denominator are perfect squares
live ↗InOut
About
| Examples | 37 |
|---|---|
| Checked against | Wolfram Language 36 agree1 differSageMath 33 agreeSymPy 35 agree1 differmpmath 31 agree1 differRust 13 agree12 differ1 unevaluated2 error |
| Crosswalk | WikipediaMathWorldWikidataBritannicaFungrimWolfram LanguageSageMathSymPympmathRust |
Implementation
mapped
sympypackages/oracle/src/mappings.tsmapped
mpmathpackages/oracle/src/mappings.tsmapped
sagepackages/oracle/src/mappings.tsmapped
rustpackages/oracle/src/mappings.ts