Average Error: 17.7 → 0.1
Time: 10.6s
Precision: binary64
\[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U\]
\[\left(2 \cdot \sinh \ell\right) \cdot \left(J \cdot \cos \left(K \cdot 0.5\right)\right) + U\]
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\left(2 \cdot \sinh \ell\right) \cdot \left(J \cdot \cos \left(K \cdot 0.5\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
 (+ (* (* 2.0 (sinh l)) (* J (cos (* K 0.5)))) 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 * sinh(l)) * (J * cos(K * 0.5))) + 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 inf 17.7

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

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

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

Reproduce

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