Average Error: 43.0 → 1.0
Time: 34.0s
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.0

    \[\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 1.0

    \[\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 simplification1.0

    \[\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 2019008 
(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: 30.5s)Debug log

sample411.0ms

Algorithm
halfpoints

simplify80.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune14.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 43.7b

localize74.0ms

Local error

Found 4 expressions with local error:

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

rewrite47.0ms

Algorithm
rewrite-expression-head
Counts
4 → 64
Calls

4 calls. Slowest were:

17.0ms
(* (/ (- (exp x) (exp (- x))) 2) (sin y))
13.0ms
(* (/ (+ (exp x) (exp (- x))) 2) (cos y))
9.0ms
(+ (exp x) (exp (- x)))

series231.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

93.0ms
(* (/ (- (exp x) (exp (- x))) 2) (sin y))
62.0ms
(- (exp x) (exp (- x)))
52.0ms
(* (/ (+ (exp x) (exp (- x))) 2) (cos y))
25.0ms
(+ (exp x) (exp (- x)))

simplify1.9s

Counts
38 → 76
Calls

38 calls. Slowest were:

296.0ms
(* (* (* (/ (- (exp x) (exp (- x))) 2) (/ (- (exp x) (exp (- x))) 2)) (/ (- (exp x) (exp (- x))) 2)) (* (* (sin y) (sin y)) (sin y)))
255.0ms
(* 1/2 (* (- (exp x) (exp (* -1 x))) (sin y)))
244.0ms
(* 1/2 (* (- (exp x) (exp (- x))) (sin y)))

prune1.3s

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0.1b

localize33.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.0b
(* 1/60 (pow x 5))
0.0b
(* (/ (+ (exp x) (exp (- x))) 2) (cos y))

rewrite44.0ms

Algorithm
rewrite-expression-head
Counts
4 → 62
Calls

4 calls. Slowest were:

20.0ms
(* (/ (+ (exp x) (exp (- x))) 2) (cos y))
20.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
2.0ms
(* 1/60 (pow x 5))

series232.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

99.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
72.0ms
(* (/ (+ (exp x) (exp (- x))) 2) (cos y))
33.0ms
(* 1/60 (pow x 5))
29.0ms
(* 1/3 (pow x 3))

simplify1.6s

Counts
39 → 74
Calls

39 calls. Slowest were:

254.0ms
(* (* (* (/ (+ (exp x) (exp (- x))) 2) (/ (+ (exp x) (exp (- x))) 2)) (/ (+ (exp x) (exp (- x))) 2)) (* (* (cos y) (cos y)) (cos y)))
185.0ms
(* 1/2 (* (+ (exp (* -1 x)) (exp x)) (cos y)))
184.0ms
(* 1/2 (* (+ (exp x) (exp (- x))) (cos y)))

prune1.4s

Pruning

10 alts after pruning (9 fresh and 1 done)

Merged error: 0.0b

localize30.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)))

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
4 → 61
Calls

4 calls. Slowest were:

5.0ms
(* (cbrt (sin y)) (cbrt (sin y)))
1.0ms
(cbrt (sin y))
0.0ms
(cbrt (sin y))

series677.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

182.0ms
(* (cbrt (sin y)) (cbrt (sin y)))
170.0ms
(cbrt (sin y))
166.0ms
(cbrt (sin y))
159.0ms
(cbrt (sin y))

simplify323.0ms

Counts
41 → 73
Calls

41 calls. Slowest were:

80.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
73.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
64.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))

prune2.2s

Pruning

11 alts after pruning (10 fresh and 1 done)

Merged error: 0.0b

localize25.0ms

Local error

Found 4 expressions with local error:

0.7b
(cbrt (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2))
0.7b
(cbrt (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2))
0.7b
(cbrt (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2))
0.5b
(* (cbrt (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2)) (cbrt (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2)))

rewrite29.0ms

Algorithm
rewrite-expression-head
Counts
4 → 72
Calls

4 calls. Slowest were:

17.0ms
(* (cbrt (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2)) (cbrt (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2)))
4.0ms
(cbrt (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2))
4.0ms
(cbrt (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2))

series839.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

247.0ms
(* (cbrt (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2)) (cbrt (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2)))
203.0ms
(cbrt (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2))
195.0ms
(cbrt (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2))
194.0ms
(cbrt (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2))

simplify4.2s

Counts
53 → 84
Calls

53 calls. Slowest were:

338.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2))
305.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2))
298.0ms
(- (+ (* 1/18 (* (cbrt 1/2) (* (pow x 2) (exp (* 1/3 (+ (log 2) (log x))))))) (* (cbrt 1/2) (exp (* 1/3 (+ (log 2) (log x)))))) (* 1/3240 (* (cbrt 1/2) (* (pow x 4) (exp (* 1/3 (+ (log 2) (log x))))))))

prune2.1s

Pruning

12 alts after pruning (10 fresh and 2 done)

Merged error: 0.0b

regimes330.0ms

Accuracy

0% (0.9b remaining)

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

bsearch6.0ms

end0.0ms

sample12.5s

Algorithm
halfpoints