Average Error: 17.6 → 0.1
Time: 1.3min
Precision: binary64
Cost: 13504
\[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U\]
\[U + \cos \left(\frac{K}{2}\right) \cdot \left(\sinh \ell \cdot \left(2 \cdot J\right)\right)\]
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
U + \cos \left(\frac{K}{2}\right) \cdot \left(\sinh \ell \cdot \left(2 \cdot J\right)\right)
(FPCore (J l K U)
 :precision binary64
 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
(FPCore (J l K U)
 :precision binary64
 (+ U (* (cos (/ K 2.0)) (* (sinh l) (* 2.0 J)))))
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 U + (cos(K / 2.0) * (sinh(l) * (2.0 * J)));
}

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

Alternatives

Alternative 1
Error0.1
Cost13504
\[U + \left(2 \cdot J\right) \cdot \left(\cos \left(\frac{K}{2}\right) \cdot \sinh \ell\right)\]
Alternative 2
Error0.6
Cost7104
\[U + \cos \left(\frac{K}{2}\right) \cdot \left(\ell \cdot \left(2 \cdot J\right)\right)\]
Alternative 3
Error0.6
Cost7104
\[U + 2 \cdot \left(\ell \cdot \left(J \cdot \cos \left(K \cdot 0.5\right)\right)\right)\]
Alternative 4
Error8.9
Cost6848
\[U + \sinh \ell \cdot \left(J + J\right)\]
Alternative 5
Error9.1
Cost448
\[U + J \cdot \left(\ell + \ell\right)\]
Alternative 6
Error61.7
Cost64
\[-1\]

Error

Derivation

  1. Initial program 17.6

    \[\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_binary64_12940.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*_binary64_10410.1

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

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

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

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

Reproduce

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