Average Error: 43.7 → 0.8
Time: 28.2s
Precision: 64
Internal Precision: 1344
\[\Im(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{e^{x} - e^{-x}}{2} \cdot \sin y i\right))\]
\[\Im(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{\left(\frac{1}{60} \cdot {x}^{5} + \frac{1}{3} \cdot {x}^{3}\right) + 2 \cdot x}{2} \cdot \sin y i\right))\]

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 43.7

    \[\Im(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{e^{x} - e^{-x}}{2} \cdot \sin y i\right))\]
  2. Taylor expanded around 0 0.8

    \[\leadsto \Im(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{\color{blue}{2 \cdot x + \left(\frac{1}{3} \cdot {x}^{3} + \frac{1}{60} \cdot {x}^{5}\right)}}{2} \cdot \sin y i\right))\]
  3. Final simplification0.8

    \[\leadsto \Im(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{\left(\frac{1}{60} \cdot {x}^{5} + \frac{1}{3} \cdot {x}^{3}\right) + 2 \cdot x}{2} \cdot \sin y i\right))\]

Reproduce

herbie shell --seed 2019005 
(FPCore (x y)
  :name "Euler formula imaginary part (p55)"
  (im (complex (* (/ (+ (exp x) (exp (- x))) 2) (cos y)) (* (/ (- (exp x) (exp (- x))) 2) (sin y)))))

Details

Time bar (total: 24.3s)Debug log

sample408.0ms

Algorithm
halfpoints

simplify127.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

126.0ms
(im (complex (* (/ (+ (exp x) (exp (- x))) 2) (cos y)) (* (/ (- (exp x) (exp (- x))) 2) (sin y))))

prune24.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 43.0b

localize100.0ms

Local error

Found 3 expressions with local error:

57.2b
(- (exp x) (exp (- x)))
0.1b
(* (/ (- (exp x) (exp (- x))) 2) (sin y))
0.0b
(+ (exp x) (exp (- x)))

rewrite21.0ms

Algorithm
rewrite-expression-head
Counts
3 → 45
Calls

3 calls. Slowest were:

10.0ms
(* (/ (- (exp x) (exp (- x))) 2) (sin y))
6.0ms
(- (exp x) (exp (- x)))
4.0ms
(+ (exp x) (exp (- x)))

series178.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

96.0ms
(* (/ (- (exp x) (exp (- x))) 2) (sin y))
50.0ms
(- (exp x) (exp (- x)))
32.0ms
(+ (exp x) (exp (- x)))

simplify1.4s

Counts
25 → 54
Calls

25 calls. Slowest were:

375.0ms
(* (* (* (/ (- (exp x) (exp (- x))) 2) (/ (- (exp x) (exp (- x))) 2)) (/ (- (exp x) (exp (- x))) 2)) (* (* (sin y) (sin y)) (sin y)))
315.0ms
(* 1/2 (* (- (exp x) (exp (* -1 x))) (sin y)))
293.0ms
(* 1/2 (* (- (exp x) (exp (- x))) (sin y)))

prune841.0ms

Pruning

5 alts after pruning (5 fresh and 0 done)

Merged error: 0.1b

localize60.0ms

Local error

Found 4 expressions with local error:

0.2b
(* 1/3 (pow x 3))
0.1b
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
0.1b
(* 1/60 (pow x 5))
0.0b
(+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))

rewrite36.0ms

Algorithm
rewrite-expression-head
Counts
4 → 54
Calls

4 calls. Slowest were:

23.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
7.0ms
(+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))
3.0ms
(* 1/3 (pow x 3))

series198.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

85.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
66.0ms
(+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))
27.0ms
(* 1/3 (pow x 3))
20.0ms
(* 1/60 (pow x 5))

simplify830.0ms

Counts
30 → 66
Calls

30 calls. Slowest were:

148.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
144.0ms
(* (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) (sin y))
86.0ms
(+ (* 1/120 (* (pow x 5) (sin y))) (* 1/6 (* (pow x 3) (sin y))))

prune1.5s

Pruning

10 alts after pruning (9 fresh and 1 done)

Merged error: 0.0b

localize49.0ms

Local error

Found 4 expressions with local error:

21.2b
(log (exp (* 1/3 (pow x 3))))
0.2b
(* 1/3 (pow x 3))
0.1b
(* (/ (+ (* 2 x) (+ (log (exp (* 1/3 (pow x 3)))) (* 1/60 (pow x 5)))) 2) (sin y))
0.1b
(* 1/60 (pow x 5))

rewrite35.0ms

Algorithm
rewrite-expression-head
Counts
4 → 56
Calls

4 calls. Slowest were:

29.0ms
(* (/ (+ (* 2 x) (+ (log (exp (* 1/3 (pow x 3)))) (* 1/60 (pow x 5)))) 2) (sin y))
2.0ms
(* 1/60 (pow x 5))
2.0ms
(log (exp (* 1/3 (pow x 3))))

series188.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

99.0ms
(* (/ (+ (* 2 x) (+ (log (exp (* 1/3 (pow x 3)))) (* 1/60 (pow x 5)))) 2) (sin y))
34.0ms
(* 1/60 (pow x 5))
28.0ms
(log (exp (* 1/3 (pow x 3))))
28.0ms
(* 1/3 (pow x 3))

simplify891.0ms

Counts
33 → 68
Calls

33 calls. Slowest were:

138.0ms
(* (/ (+ (* 2 x) (+ (log (exp (* 1/3 (pow x 3)))) (* 1/60 (pow x 5)))) 2) (sin y))
135.0ms
(* (+ (* 2 x) (+ (log (exp (* 1/3 (pow x 3)))) (* 1/60 (pow x 5)))) (sin y))
92.0ms
(+ (log (/ (+ (* 2 x) (+ (log (exp (* 1/3 (pow x 3)))) (* 1/60 (pow x 5)))) 2)) (log (sin y)))

prune1.5s

Pruning

9 alts after pruning (8 fresh and 1 done)

Merged error: 0.0b

localize35.0ms

Local error

Found 4 expressions with local error:

0.6b
(cbrt (sin y))
0.6b
(cbrt (sin y))
0.6b
(cbrt (sin y))
0.5b
(* (cbrt (sin y)) (cbrt (sin y)))

rewrite14.0ms

Algorithm
rewrite-expression-head
Counts
4 → 61
Calls

4 calls. Slowest were:

10.0ms
(* (cbrt (sin y)) (cbrt (sin y)))
1.0ms
(cbrt (sin y))
1.0ms
(cbrt (sin y))

series672.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

195.0ms
(cbrt (sin y))
178.0ms
(* (cbrt (sin y)) (cbrt (sin y)))
172.0ms
(cbrt (sin y))
128.0ms
(cbrt (sin y))

simplify340.0ms

Counts
41 → 73
Calls

41 calls. Slowest were:

88.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
86.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
52.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))

prune1.7s

Pruning

12 alts after pruning (10 fresh and 2 done)

Merged error: 0.0b

regimes259.0ms

Accuracy

0% (0.7b remaining)

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

bsearch6.0ms

end0.0ms

sample12.8s

Algorithm
halfpoints