19 inline auto partialX(
auto f,
const auto x,
const auto y,
const auto t) {
20 const auto h = std::sqrt(std::numeric_limits<decltype(
x)>::epsilon()) * std::max(1.0, std::abs(
x));
21 return (
f(
x +
h,
y,
t) -
f(
x -
h,
y,
t)) / (2.0 *
h);
37 inline auto partialY(
auto f,
const auto x,
const auto y,
const auto t) {
38 const auto h = std::sqrt(std::numeric_limits<decltype(
y)>::epsilon()) * std::max(1.0, std::abs(
y));
39 return (
f(
x,
y +
h,
t) -
f(
x,
y -
h,
t)) / (2.0 *
h);
55 inline auto partialT(
auto f,
const auto x,
const auto y,
const auto t) {
56 const auto h = std::sqrt(std::numeric_limits<decltype(
t)>::epsilon()) * std::max(1.0, std::abs(
t));
57 return (
f(
x,
y,
t +
h) -
f(
x,
y,
t -
h)) / (2.0 *
h);
auto partialT(auto f, const auto x, const auto y, const auto t)
Approximates the partial derivative ∂f/∂t of a function f(x, y, t) using central differences.
auto partialY(auto f, const auto x, const auto y, const auto t)
Approximates the partial derivative ∂f/∂y of a function f(x, y, t) using central differences.
auto partialX(auto f, const auto x, const auto y, const auto t)
Approximates the partial derivative ∂f/∂x of a function f(x, y, t) using central differences.