Average Error: 17.3 → 0.3
Time: 13.6s
Precision: binary64
\[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U\]
\[\left(0.0003968253968253968 \cdot \left(J \cdot {\ell}^{7}\right) + \left(0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right) + \left(0.016666666666666666 \cdot \left(J \cdot {\ell}^{5}\right) + 2 \cdot \left(J \cdot \ell\right)\right)\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U\]
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\left(0.0003968253968253968 \cdot \left(J \cdot {\ell}^{7}\right) + \left(0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right) + \left(0.016666666666666666 \cdot \left(J \cdot {\ell}^{5}\right) + 2 \cdot \left(J \cdot \ell\right)\right)\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
(FPCore (J l K U)
 :precision binary64
 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
(FPCore (J l K U)
 :precision binary64
 (+
  (*
   (+
    (* 0.0003968253968253968 (* J (pow l 7.0)))
    (+
     (* 0.3333333333333333 (* J (pow l 3.0)))
     (+ (* 0.016666666666666666 (* J (pow l 5.0))) (* 2.0 (* J l)))))
   (cos (/ K 2.0)))
  U))
double code(double J, double l, double K, double U) {
	return ((J * (exp(l) - exp(-l))) * cos(K / 2.0)) + U;
}
double code(double J, double l, double K, double U) {
	return (((0.0003968253968253968 * (J * pow(l, 7.0))) + ((0.3333333333333333 * (J * pow(l, 3.0))) + ((0.016666666666666666 * (J * pow(l, 5.0))) + (2.0 * (J * l))))) * cos(K / 2.0)) + U;
}

Error

Bits error versus J

Bits error versus l

Bits error versus K

Bits error versus U

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 17.3

    \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U\]
  2. Taylor expanded around 0 0.3

    \[\leadsto \color{blue}{\left(0.0003968253968253968 \cdot \left(J \cdot {\ell}^{7}\right) + \left(0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right) + \left(0.016666666666666666 \cdot \left(J \cdot {\ell}^{5}\right) + 2 \cdot \left(J \cdot \ell\right)\right)\right)\right)} \cdot \cos \left(\frac{K}{2}\right) + U\]
  3. Final simplification0.3

    \[\leadsto \left(0.0003968253968253968 \cdot \left(J \cdot {\ell}^{7}\right) + \left(0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right) + \left(0.016666666666666666 \cdot \left(J \cdot {\ell}^{5}\right) + 2 \cdot \left(J \cdot \ell\right)\right)\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U\]

Reproduce

herbie shell --seed 2021024 
(FPCore (J l K U)
  :name "Maksimov and Kolovsky, Equation (4)"
  :precision binary64
  (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))