NumPhp::expm1

Calculate the exponential of all elements in the input array.

Description

SciPhp\NdArray NumPhp::expm1( array|NdArray $m )

Parameters

$m
An array [1, 2, 3] or a NdArray.

Return Values

A SciPhp\NdArray

Examples

Example #1: Exponential of a vector

use SciPhp\NumPhp as np;

$m np::expm1([00.10.01]);

echo 
"m\n$m";

The above example will output:

m
[0                  0.10517091807565   0.010050167084168]

Example #2: Exponential of a matrix

use SciPhp\NumPhp as np;

$m np::diag([0.10.050.01]);

$r np::expm1($m);

echo 
"m\n$m""r\n$r";

The above example will output:

m
[[0.1   0     0   ]
 [0     0.05  0   ]
 [0     0     0.01]]
r
[[0.10517091807565   0                  0                ]
 [0                  0.051271096376024  0                ]
 [0                  0                  0.010050167084168]]

See Also