Math::...vative(3pm)
π Math::Symbolic::Derivative β the manual, but make it make sense π
okay bestie, sit down, hydrate, because we're about to talk about Math::Symbolic::Derivative β that's the Math::Symbolic::Derivative page from the User Contributed Perl Documentation, and yes it's a real one, no cap. this is the module that does derivatives for Math::Symbolic trees. calculus girlies rise π§β¨
πΈ NAME πΈ
Math::Symbolic::Derivative β literally here to derive Math::Symbolic trees. that's the whole job. that's the vibe. π
β¨ SYNOPSIS β¨
look at her go:
use Math::Symbolic::Derivative qw/:all/;
$derived = partial_derivative($term, $variable);
# or:
$derived = total_derivative($term, $variable);
two flavours, one dream. pick your fighter π
π¦ DESCRIPTION π¦
so. this module implements derivatives for Math::Symbolic trees, fr fr. here's the cute little plot twist: derivatives are Math::Symbolic::Operators, but their actual implementation lives over here in this module, because it is significantly more complex than how most operators get built. she's high maintenance but she delivers. π
derivatives come in two flavours, bestie:
- partial derivatives
- total derivatives
now, explaining the precise difference between partial and total derivatives is, and i quote, beyond the scope of this document π. but in the context of Math::Symbolic? the difference is simple: partial derivatives derive in terms of explicit dependency on the differential variable, while total derivatives recognize implicit dependencies from variable signatures. that's it, that's the tea. π
partial derivatives are faster, have been tested more thoroughly, and are probably what you want for simpler applications anyway. so if you're unsure β go partial. she's the reliable bestie. π«Ά
π EXPORT π
none by default, sorry angel. but you may choose to import the total_derivative() and partial_derivative() functions. opt-in only, we don't do surprise imports here. β¨
π CLASS DATA π
the package variable %Partial_Rules contains partial derivative rules as key-value pairs of names and subroutines. very demure, very mindful, very %Partial_Rules. π§
π SUBROUTINES π
π
partial_derivative
takes a Math::Symbolic tree and a Math::Symbolic::Variable as argument. the third argument is an optional boolean that says whether or not the tree has to be cloned before being derived.
and here's the warning, okay, listen up: if that third argument is true, the subroutine happily stomps on any code that might rely on any components of the Math::Symbolic tree that was passed to the sub as first argument. it just π¦Ά stomps. no remorse. clone responsibly. π
π
total_derivative
takes a Math::Symbolic tree and a Math::Symbolic::Variable as argument. the third argument is an optional boolean that says whether or not the tree has to be cloned before being derived.
and same deal, same energy: if it's true, the subroutine happily stomps on any code that might rely on any components of the Math::Symbolic tree that was passed to the sub as first argument. two subs, one chaotic streak. π
π AUTHOR π
please send feedback, bug reports, and support requests to the Math::Symbolic support mailing list: math-symbolic-support at lists dot sourceforge dot net. and please consider letting us know how you use Math::Symbolic β they genuinely wanna hear it. thank you, mwah π«Ά
if you're interested in helping with the development or extending the module's functionality, hit up the developers' mailing list: math-symbolic-develop at lists dot sourceforge dot net.
list of contributors, aka the icons:
Steffen MΓΌller, symbolic-module at steffen-mueller dot net
Stray Toaster, mwk at users dot sourceforge dot net
Oliver EbenhΓΆh
π SEE ALSO π
- new versions of this module live at
http://steffen-mueller.netor on CPAN π - the module development takes place on Sourceforge at
http://sourceforge.net/projects/math-symbolic/ - also go look at
Math::Symbolicβ she's the main character here, this module is her derivative sidekick π¦
and that's the whole page, bestie! periodt π this was perl v5.40.0, dated 2024-09-16, and yes she ate. go derive something gorgeous. βπ
π¦ where this page comes from
- ubuntu resolute: libmath-symbolic-perl 0.613-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmath-symbolic-perl 0.613-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms