Skip to content

Commit

Permalink
argmin-testfunctions/easom: render math using KaTeX
Browse files Browse the repository at this point in the history
  • Loading branch information
airwoodix committed Oct 21, 2024
1 parent 4a3597c commit 5752f58
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions crates/argmin-testfunctions/src/easom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
//!
//! Defined as
//!
//! `f(x_1, x_2) = - cos(x_1) * cos(x_2) * exp(-(x_1 - pi)^2 - (x_2 - pi)^2)`
//! $$
//! f(x_1, x_2) = - \cos(x_1)\cos(x_2)\exp\left(-(x_1 - \pi)^2 - (x_2 - \pi)^2\right)
//! $$
//!
//! where `x_i \in [-100, 100]`.
//! where $x_i \in [-100,\\,100]$.
//!
//! The global minimum is at `f(x_1, x_2) = f(pi, pi) = -1`.
//! The global minimum is at $f(x_1, x_2) = f(\pi, \pi) = -1$.
use num::{Float, FromPrimitive};
use std::f64::consts::PI;
Expand All @@ -22,11 +24,13 @@ use std::f64::consts::PI;
///
/// Defined as
///
/// `f(x_1, x_2) = - cos(x_1) * cos(x_2) * exp(-(x_1 - pi)^2 - (x_2 - pi)^2)`
/// $$
/// f(x_1, x_2) = - \cos(x_1)\cos(x_2)\exp\left(-(x_1 - \pi)^2 - (x_2 - \pi)^2\right)
/// $$
///
/// where `x_i \in [-100, 100]`.
/// where $x_i \in [-100,\\,100]$.
///
/// The global minimum is at `f(x_1, x_2) = f(pi, pi) = -1`.
/// The global minimum is at $f(x_1, x_2) = f(\pi, \pi) = -1$.
pub fn easom<T>(param: &[T; 2]) -> T
where
T: Float + FromPrimitive,
Expand Down

0 comments on commit 5752f58

Please sign in to comment.