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

Alternatives

Alternative 1
Error0.5
Cost7104
\[U + \cos \left(\frac{K}{2}\right) \cdot \left(\left(2 \cdot J\right) \cdot \ell\right)\]
Alternative 2
Error8.8
Cost7939
\[\begin{array}{l} \mathbf{if}\;J \leq -1.0248851657408603 \cdot 10^{+257}:\\ \;\;\;\;\left(J \cdot \left(\ell + \ell\right)\right) \cdot \cos \left(K \cdot 0.5\right)\\ \mathbf{elif}\;J \leq -1.036908238623153 \cdot 10^{+155}:\\ \;\;\;\;U + J \cdot \left(\ell + \ell\right)\\ \mathbf{elif}\;J \leq -2.124979930094211 \cdot 10^{+132}:\\ \;\;\;\;\left(J \cdot \left(\ell + \ell\right)\right) \cdot \cos \left(K \cdot 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot J\right) \cdot \sinh \ell + U\\ \end{array}\]
Alternative 3
Error8.5
Cost6848
\[\left(2 \cdot J\right) \cdot \sinh \ell + U\]
Alternative 4
Error8.8
Cost448
\[U + J \cdot \left(\ell + \ell\right)\]
Alternative 5
Error18.3
Cost1101
\[\begin{array}{l} \mathbf{if}\;U \leq -6.651757748365109 \cdot 10^{-101}:\\ \;\;\;\;U\\ \mathbf{elif}\;U \leq -1.1149716906082464 \cdot 10^{-118} \lor \neg \left(U \leq -5.255952915470628 \cdot 10^{-239}\right) \land U \leq 5.965809540484049 \cdot 10^{-184}:\\ \;\;\;\;J \cdot \left(\ell + \ell\right)\\ \mathbf{else}:\\ \;\;\;\;U\\ \end{array}\]
Alternative 6
Error18.5
Cost64
\[U\]

Error

Time

Derivation

  1. Initial program 17.5

    \[\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 *-un-lft-identity_binary64_11010.1

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

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

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

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

Reproduce

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