Average Error: 17.3 → 0.6
Time: 27.6s
Precision: 64
Internal Precision: 128
\[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U\]
\[(\left(\left(\ell \cdot J\right) \cdot 2\right) \cdot \left(\cos \left(\frac{K}{2}\right)\right) + U)_*\]

Error

Bits error versus J

Bits error versus l

Bits error versus K

Bits error versus U

Derivation

  1. Initial program 17.3

    \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U\]
  2. Initial simplification17.3

    \[\leadsto (\left(J \cdot e^{\ell} - \frac{J}{e^{\ell}}\right) \cdot \left(\cos \left(\frac{K}{2}\right)\right) + U)_*\]
  3. Taylor expanded around 0 0.6

    \[\leadsto (\color{blue}{\left(2 \cdot \left(J \cdot \ell\right)\right)} \cdot \left(\cos \left(\frac{K}{2}\right)\right) + U)_*\]
  4. Final simplification0.6

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

Reproduce

herbie shell --seed 2018362 +o rules:numerics
(FPCore (J l K U)
  :name "Maksimov and Kolovsky, Equation (4)"
  (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2))) U))

Details

Time bar (total: 10.9s)Debug log

start343.0ms

Algorithm
intervals

setup314.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 20.0b

localize46.0ms

Local error

Found 3 expressions with local error:

5.9b
(- (* J (exp l)) (/ J (exp l)))
0.0b
(fma (- (* J (exp l)) (/ J (exp l))) (cos (/ K 2)) U)
0.0b
(/ J (exp l))

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
3 → 45
Calls

3 calls. Slowest were:

8.0ms
(- (* J (exp l)) (/ J (exp l)))
1.0ms
(/ J (exp l))
0.0ms
(fma (- (* J (exp l)) (/ J (exp l))) (cos (/ K 2)) U)

series356.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

227.0ms
(fma (- (* J (exp l)) (/ J (exp l))) (cos (/ K 2)) U)
93.0ms
(- (* J (exp l)) (/ J (exp l)))
36.0ms
(/ J (exp l))

simplify1.3s

Counts
22 → 54
Calls

22 calls. Slowest were:

494.0ms
(* -1 (* J (- (/ 1 (exp l)) (exp l))))
250.0ms
(- (+ J (* 1/2 (* J (pow l 2)))) (* J l))
120.0ms
(- (+ (* (cos (* 1/2 K)) (* (exp l) J)) U) (/ (* (cos (* 1/2 K)) J) (exp l)))

prune836.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0.1b

localize9.0ms

Local error

Found 2 expressions with local error:

0.1b
(fma (* 2 (* J l)) (cos (/ K 2)) U)
0.0b
(* 2 (* J l))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
2 → 21
Calls

2 calls. Slowest were:

1.0ms
(* 2 (* J l))
0.0ms
(fma (* 2 (* J l)) (cos (/ K 2)) U)

series81.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

70.0ms
(fma (* 2 (* J l)) (cos (/ K 2)) U)
11.0ms
(* 2 (* J l))

simplify105.0ms

Counts
6 → 27
Calls

6 calls. Slowest were:

45.0ms
(+ (* 2 (* (cos (* 1/2 K)) (* J l))) U)
29.0ms
(+ (* 2 (* (cos (* 1/2 K)) (* J l))) U)
9.0ms
(* 2 (* J l))

prune407.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.1b

localize26.0ms

Local error

Found 4 expressions with local error:

13.1b
(cbrt (* 2 (* J l)))
13.1b
(cbrt (* 2 (* J l)))
13.1b
(cbrt (* 2 (* J l)))
0.5b
(* (cbrt (* 2 (* J l))) (cbrt (* 2 (* J l))))

rewrite11.0ms

Algorithm
rewrite-expression-head
Counts
4 → 59
Calls

4 calls. Slowest were:

8.0ms
(* (cbrt (* 2 (* J l))) (cbrt (* 2 (* J l))))
1.0ms
(cbrt (* 2 (* J l)))
1.0ms
(cbrt (* 2 (* J l)))

series514.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

149.0ms
(* (cbrt (* 2 (* J l))) (cbrt (* 2 (* J l))))
137.0ms
(cbrt (* 2 (* J l)))
124.0ms
(cbrt (* 2 (* J l)))
104.0ms
(cbrt (* 2 (* J l)))

simplify1.9s

Counts
31 → 71
Calls

31 calls. Slowest were:

189.0ms
(* (exp (* 1/3 (+ (* 2 (log J)) (* 2 (log l))))) (pow (cbrt 2) 2))
180.0ms
(* (* 2 (* J l)) (* 2 (* J l)))
174.0ms
(* (pow (cbrt 2) 2) (exp (* -1/3 (+ (* 2 (log (/ 1 l))) (* 2 (log (/ 1 J)))))))

prune1.1s

Pruning

10 alts after pruning (8 fresh and 2 done)

Merged error: 0.1b

localize40.0ms

Local error

Found 4 expressions with local error:

13.1b
(cbrt (* J l))
13.1b
(cbrt (* 2 (* J l)))
13.1b
(cbrt (* 2 (* J l)))
1.0b
(cbrt 2)

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
4 → 43
Calls

4 calls. Slowest were:

1.0ms
(cbrt (* 2 (* J l)))
1.0ms
(cbrt (* 2 (* J l)))
1.0ms
(cbrt (* J l))

series326.0ms

Counts
4 → 10
Calls

4 calls. Slowest were:

138.0ms
(cbrt (* 2 (* J l)))
110.0ms
(cbrt (* 2 (* J l)))
78.0ms
(cbrt (* J l))
0.0ms
(cbrt 2)

simplify1.4s

Counts
13 → 53
Calls

13 calls. Slowest were:

425.0ms
(exp (* -1/3 (+ (log (/ 1 l)) (log (/ 1 J)))))
177.0ms
(* (exp (* -1/3 (+ (log (/ 1 l)) (log (/ 1 J))))) (cbrt 2))
172.0ms
(* (exp (* -1/3 (+ (log (/ -1 l)) (log (/ -1 J))))) (cbrt 2))

prune956.0ms

Pruning

10 alts after pruning (9 fresh and 1 done)

Merged error: 0.1b

regimes714.0ms

Accuracy

0% (0.5b remaining)

Error of 0.6b against oracle of 0.1b and baseline of 0.6b

bsearch3.0ms