Skip to content

Feature: Use better approximation for power #54

@ZCG-coder

Description

@ZCG-coder

Is your feature request related to a problem? Please describe.
When $b$ is not an integer, $a^b$ can be computed as $e^{b \ln(a)}$. This approach is much faster than calling root.

Describe the solution you'd like
Switch the approximation method for power.

Describe alternatives you've considered
None yet

Additional context
Proof of the method

$$ \begin{align} a ^ { b } &= e ^ { b \ln ( a ) } \\ &= e ^ {{ b } ^ { \ln(a) }} \\ &= e ^ { \ln ( a ) ^ { b } } \\ &= a ^ { b } \end{align} $$

Metadata

Metadata

Assignees

Labels

C-C++Code - Pull requests that update C++ code.T-FeatureType - New feature or requestT-ImprovementType - Improvements to components.

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions