Average Error: 17.6 → 0.3
Time: 8.9s
Precision: binary64
\[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U\]
\[J \cdot \left(\left(\ell + \left(\ell + \left(0.3333333333333333 \cdot {\ell}^{3} + 0.016666666666666666 \cdot {\ell}^{5}\right)\right)\right) \cdot \cos \left(\frac{K}{2}\right)\right) + U\]
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
J \cdot \left(\left(\ell + \left(\ell + \left(0.3333333333333333 \cdot {\ell}^{3} + 0.016666666666666666 \cdot {\ell}^{5}\right)\right)\right) \cdot \cos \left(\frac{K}{2}\right)\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
 (+
  (*
   J
   (*
    (+
     l
     (+
      l
      (+
       (* 0.3333333333333333 (pow l 3.0))
       (* 0.016666666666666666 (pow l 5.0)))))
    (cos (/ K 2.0))))
  U))
double code(double J, double l, double K, double U) {
	return ((double) (((double) (((double) (J * ((double) (((double) exp(l)) - ((double) exp(((double) -(l)))))))) * ((double) cos((K / 2.0))))) + U));
}
double code(double J, double l, double K, double U) {
	return ((double) (((double) (J * ((double) (((double) (l + ((double) (l + ((double) (((double) (0.3333333333333333 * ((double) pow(l, 3.0)))) + ((double) (0.016666666666666666 * ((double) pow(l, 5.0)))))))))) * ((double) 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 Error: 17.6 bits

    \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U\]
  2. SimplifiedError: 17.6 bits

    \[\leadsto \color{blue}{J \cdot \left(\left(e^{\ell} - e^{-\ell}\right) \cdot \cos \left(\frac{K}{2}\right)\right) + U}\]
  3. Taylor expanded around 0 Error: 0.3 bits

    \[\leadsto J \cdot \left(\color{blue}{\left(0.3333333333333333 \cdot {\ell}^{3} + \left(0.016666666666666666 \cdot {\ell}^{5} + 2 \cdot \ell\right)\right)} \cdot \cos \left(\frac{K}{2}\right)\right) + U\]
  4. SimplifiedError: 0.3 bits

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

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

Reproduce

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