Average Error: 17.7 → 0.1
Time: 12.1s
Precision: binary64
\[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
\[\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 \cdot \sinh \ell\right)\right) + U \]
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 \cdot \sinh \ell\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
 (+ (* (cos (* 0.5 K)) (* J (* 2.0 (sinh l)))) 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 (cos(0.5 * K) * (J * (2.0 * sinh(l)))) + 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. Using strategy rm
  3. Applied sinh-undef_binary640.1

    \[\leadsto \left(J \cdot \color{blue}{\left(2 \cdot \sinh \ell\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
  4. Applied associate-*r*_binary640.1

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

    \[\leadsto \left(\color{blue}{\left(2 \cdot J\right)} \cdot \sinh \ell\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
  6. Using strategy rm
  7. Applied pow1_binary640.1

    \[\leadsto \left(\left(2 \cdot J\right) \cdot \sinh \ell\right) \cdot \color{blue}{{\cos \left(\frac{K}{2}\right)}^{1}} + U \]
  8. Applied pow1_binary640.1

    \[\leadsto \left(\left(2 \cdot J\right) \cdot \color{blue}{{\sinh \ell}^{1}}\right) \cdot {\cos \left(\frac{K}{2}\right)}^{1} + U \]
  9. Applied pow1_binary640.1

    \[\leadsto \left(\left(2 \cdot \color{blue}{{J}^{1}}\right) \cdot {\sinh \ell}^{1}\right) \cdot {\cos \left(\frac{K}{2}\right)}^{1} + U \]
  10. Applied pow1_binary640.1

    \[\leadsto \left(\left(\color{blue}{{2}^{1}} \cdot {J}^{1}\right) \cdot {\sinh \ell}^{1}\right) \cdot {\cos \left(\frac{K}{2}\right)}^{1} + U \]
  11. Applied pow-prod-down_binary640.1

    \[\leadsto \left(\color{blue}{{\left(2 \cdot J\right)}^{1}} \cdot {\sinh \ell}^{1}\right) \cdot {\cos \left(\frac{K}{2}\right)}^{1} + U \]
  12. Applied pow-prod-down_binary640.1

    \[\leadsto \color{blue}{{\left(\left(2 \cdot J\right) \cdot \sinh \ell\right)}^{1}} \cdot {\cos \left(\frac{K}{2}\right)}^{1} + U \]
  13. Applied pow-prod-down_binary640.1

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

    \[\leadsto {\color{blue}{\left(J \cdot \left(2 \cdot \left(\sinh \ell \cdot \cos \left(\frac{K}{2}\right)\right)\right)\right)}}^{1} + U \]
  15. Taylor expanded around 0 28.7

    \[\leadsto \color{blue}{\left(J \cdot \left(e^{\ell} \cdot \cos \left(0.5 \cdot K\right)\right) + U\right) - e^{-\ell} \cdot \left(J \cdot \cos \left(0.5 \cdot K\right)\right)} \]
  16. Simplified0.1

    \[\leadsto \color{blue}{\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 \cdot \sinh \ell\right)\right) + U} \]
  17. Final simplification0.1

    \[\leadsto \cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 \cdot \sinh \ell\right)\right) + U \]

Reproduce

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