Natural Logarithm: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
(Created page with ":''This page describes the monadic arithmetic function. For the dyadic logarithm function, see Logarithm.'' {{Built-in|Natural Logarithm|⍟}}, or '''Natural Log''', is a...")
 
m (Text replacement - "<source" to "<syntaxhighlight")
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[File:TreeLog.jpg|thumb|right|A natural log]]
:''This page describes the monadic arithmetic function. For the dyadic logarithm function, see [[Logarithm]].''
:''This page describes the monadic arithmetic function. For the dyadic logarithm function, see [[Logarithm]].''


{{Built-in|Natural Logarithm|⍟}}, or '''Natural Log''', is a [[monadic]] [[scalar function]] which computes the [[wikipedia:natural logarithm|natural logarithm]] of the [[argument]]. Logarithm shares the [[glyph]] <source lang=apl inline>⍟</source> with the dyadic arithmetic function [[Logarithm]].
{{Built-in|Natural Logarithm|⍟}}, or '''Natural Log''', is a [[monadic]] [[scalar function]] which computes the [[wikipedia:natural logarithm|natural logarithm]] of the [[argument]]. Logarithm shares the [[glyph]] <syntaxhighlight lang=apl inline>⍟</syntaxhighlight> with the dyadic arithmetic function [[Logarithm]]. The [[glyph]], a composition of the glyphs for [[Circular]] (<syntaxhighlight lang=apl inline>○</syntaxhighlight>) and [[Exponential]] (<syntaxhighlight lang=apl inline>*</syntaxhighlight>) to indicate its close mathematical ties with these two functions, is a stylised tree log.<ref>[[E. E. McDonnell|McDonnell, E. E.]]. [https://www.jsoftware.com/papers/eem/storyofo.htm Recreational APL: The Story of <syntaxhighlight lang=apl inline>○</syntaxhighlight>]. [[APL Quote-Quad]], Volume 8, Number 2, 1977-12.</ref>


== Examples ==
== Examples ==


<source lang=apl>
<syntaxhighlight lang=apl>
       ⍟1 2 (*1) (*10)
       ⍟1 2 (*1) (*10)
0 0.6931471806 1 10
0 0.6931471806 1 10
</source>
</syntaxhighlight>


== Properties ==
== Properties ==


Natural logarithm is a special case of [[Logarithm]] with the default left argument of e (<source lang=apl inline>*1</source>).
Natural logarithm is a special case of [[Logarithm]] with the default left argument of e (<syntaxhighlight lang=apl inline>*1</syntaxhighlight>).


<source lang=apl>
<syntaxhighlight lang=apl>
       ((*1)∘⍟ ≡ ⍟) 1 ¯1 0J1
       ((*1)∘⍟ ≡ ⍟) 1 ¯1 0J1
1
1
</source>{{Works in|[[Dyalog APL]]}}
</syntaxhighlight>{{Works in|[[Dyalog APL]]}}


Natural logarithm and [[exponential]] <source lang=apl inline>*</source> are inverses of each other, except where the natural log is undefined.
Natural logarithm and [[exponential]] <syntaxhighlight lang=apl inline>*</syntaxhighlight> are inverses of each other, except where the natural log is undefined.


<source lang=apl>
<syntaxhighlight lang=apl>
       (⊢ ≡ ⍟∘*) 0 1 ¯1 0J1
       (⊢ ≡ ⍟∘*) 0 1 ¯1 0J1
1
1
       (⊢ ≡ *∘⍟) 1 ¯1 0J1 ⍝ natural log of zero is undefined
       (⊢ ≡ *∘⍟) 1 ¯1 0J1 ⍝ natural log of zero is undefined
1
1
</source>{{Works in|[[Dyalog APL]]}}
</syntaxhighlight>{{Works in|[[Dyalog APL]]}}


== External links ==
== External links ==
Line 32: Line 33:
=== Documentation ===
=== Documentation ===


* [http://help.dyalog.com/latest/#Language/Primitive%20Functions/Natural%20Logarithm.htm Dyalog]
* [https://help.dyalog.com/latest/#Language/Primitive%20Functions/Natural%20Logarithm.htm Dyalog]
* [http://microapl.com/apl_help/ch_020_020_210.htm APLX]
* [http://microapl.com/apl_help/ch_020_020_210.htm APLX]
* J [https://www.jsoftware.com/help/dictionary/d201.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/hatdot NuVoc]
* J [https://www.jsoftware.com/help/dictionary/d201.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/hatdot NuVoc]
== References ==
<references/>
{{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar monadic functions]]
{{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar monadic functions]]

Latest revision as of 21:17, 10 September 2022

A natural log
This page describes the monadic arithmetic function. For the dyadic logarithm function, see Logarithm.

Natural Logarithm (), or Natural Log, is a monadic scalar function which computes the natural logarithm of the argument. Logarithm shares the glyph with the dyadic arithmetic function Logarithm. The glyph, a composition of the glyphs for Circular () and Exponential (*) to indicate its close mathematical ties with these two functions, is a stylised tree log.[1]

Examples

      ⍟1 2 (*1) (*10)
0 0.6931471806 1 10

Properties

Natural logarithm is a special case of Logarithm with the default left argument of e (*1).

      ((*1)∘⍟ ≡ ⍟) 1 ¯1 0J1
1
Works in: Dyalog APL

Natural logarithm and exponential * are inverses of each other, except where the natural log is undefined.

      (⊢ ≡ ⍟∘*) 0 1 ¯1 0J1
1
      (⊢ ≡ *∘⍟) 1 ¯1 0J1 ⍝ natural log of zero is undefined
1
Works in: Dyalog APL

External links

Documentation

References

APL built-ins [edit]
Primitives (Timeline) Functions
Scalar
Monadic ConjugateNegateSignumReciprocalMagnitudeExponentialNatural LogarithmFloorCeilingFactorialNotPi TimesRollTypeImaginarySquare Root
Dyadic AddSubtractTimesDivideResiduePowerLogarithmMinimumMaximumBinomialComparison functionsBoolean functions (And, Or, Nand, Nor) ∙ GCDLCMCircularComplexRoot
Non-Scalar
Structural ShapeReshapeTallyDepthRavelEnlistTableCatenateReverseRotateTransposeRazeMixSplitEncloseNestCut (K)PairLinkPartitioned EnclosePartition
Selection FirstPickTakeDropUniqueIdentityStopSelectReplicateExpandSet functions (IntersectionUnionWithout) ∙ Bracket indexingIndexCartesian ProductSort
Selector Index generatorGradeIndex OfInterval IndexIndicesDealPrefix and suffix vectors
Computational MatchNot MatchMembershipFindNub SieveEncodeDecodeMatrix InverseMatrix DivideFormatExecuteMaterialiseRange
Operators Monadic EachCommuteConstantReplicateExpandReduceWindowed ReduceScanOuter ProductKeyI-BeamSpawnFunction axis
Dyadic BindCompositions (Compose, Reverse Compose, Beside, Withe, Atop, Over) ∙ Inner ProductDeterminantPowerAtUnderRankDepthVariantStencilCutDirect definition (operator)
Quad names Index originComparison toleranceMigration levelAtomic vector