Average Error: 17.7 → 0.5
Time: 8.3s
Precision: binary64
\[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U\]
\[\left(2 \cdot \left(\ell \cdot J\right) + 0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\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(2 \cdot \left(\ell \cdot J\right) + 0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\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
 (+
  (*
   (+ (* 2.0 (* l J)) (* 0.3333333333333333 (* J (pow l 3.0))))
   (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 (((2.0 * (l * J)) + (0.3333333333333333 * (J * pow(l, 3.0)))) * 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.7

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

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

    \[\leadsto \left(J \cdot \color{blue}{\left(\left(\ell + \ell\right) + 0.3333333333333333 \cdot {\ell}^{3}\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U\]
  4. Using strategy rm
  5. Applied distribute-rgt-in_binary640.5

    \[\leadsto \color{blue}{\left(\left(\ell + \ell\right) \cdot J + \left(0.3333333333333333 \cdot {\ell}^{3}\right) \cdot J\right)} \cdot \cos \left(\frac{K}{2}\right) + U\]
  6. Simplified0.5

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

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

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

Reproduce

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