Average Error: 43.3 → 0.9
Time: 27.8s
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.3

    \[\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.9

    \[\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.9

    \[\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 2019007 
(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.7s)Debug log

sample522.0ms

Algorithm
halfpoints

simplify104.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune19.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 47.0b

localize115.0ms

Local error

Found 4 expressions with local error:

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

rewrite40.0ms

Algorithm
rewrite-expression-head
Counts
4 → 64
Calls

4 calls. Slowest were:

17.0ms
(* (/ (- (exp x) (exp (- x))) 2) (sin y))
10.0ms
(* (/ (+ (exp x) (exp (- x))) 2) (cos y))
8.0ms
(- (exp x) (exp (- x)))

series255.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

96.0ms
(* (/ (- (exp x) (exp (- x))) 2) (sin y))
80.0ms
(* (/ (+ (exp x) (exp (- x))) 2) (cos y))
51.0ms
(- (exp x) (exp (- x)))
27.0ms
(+ (exp x) (exp (- x)))

simplify2.2s

Counts
38 → 76
Calls

38 calls. Slowest were:

350.0ms
(* (* (* (/ (- (exp x) (exp (- x))) 2) (/ (- (exp x) (exp (- x))) 2)) (/ (- (exp x) (exp (- x))) 2)) (* (* (sin y) (sin y)) (sin y)))
326.0ms
(* 1/2 (* (- (exp x) (exp (* -1 x))) (sin y)))
314.0ms
(* (* (* (/ (+ (exp x) (exp (- x))) 2) (/ (+ (exp x) (exp (- x))) 2)) (/ (+ (exp x) (exp (- x))) 2)) (* (* (cos y) (cos y)) (cos y)))

prune1.0s

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0.1b

localize31.0ms

Local error

Found 4 expressions with local error:

0.1b
(* 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)))

rewrite22.0ms

Algorithm
rewrite-expression-head
Counts
4 → 54
Calls

4 calls. Slowest were:

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

series159.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

64.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
58.0ms
(+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))
20.0ms
(* 1/60 (pow x 5))
16.0ms
(* 1/3 (pow x 3))

simplify859.0ms

Counts
30 → 66
Calls

30 calls. Slowest were:

121.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
120.0ms
(* (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) (sin y))
106.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

localize27.0ms

Local error

Found 4 expressions with local error:

0.7b
(cbrt (sin y))
0.7b
(cbrt (sin y))
0.7b
(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))
1.0ms
(cbrt (sin y))

series619.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

211.0ms
(* (cbrt (sin y)) (cbrt (sin y)))
153.0ms
(cbrt (sin y))
128.0ms
(cbrt (sin y))
127.0ms
(cbrt (sin y))

simplify279.0ms

Counts
41 → 73
Calls

41 calls. Slowest were:

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

prune1.8s

Pruning

10 alts after pruning (9 fresh and 1 done)

Merged error: 0.0b

localize23.0ms

Local error

Found 4 expressions with local error:

0.7b
(cbrt (sin y))
0.7b
(cbrt (sin y))
0.7b
(cbrt (sin y))
0.7b
(cbrt (sin y))

rewrite3.0ms

Algorithm
rewrite-expression-head
Counts
4 → 44
Calls

4 calls. Slowest were:

1.0ms
(cbrt (sin y))
1.0ms
(cbrt (sin y))
1.0ms
(cbrt (sin y))

series568.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

159.0ms
(cbrt (sin y))
147.0ms
(cbrt (sin y))
139.0ms
(cbrt (sin y))
123.0ms
(cbrt (sin y))

simplify257.0ms

Counts
24 → 56
Calls

24 calls. Slowest were:

65.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
61.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
54.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))

prune1.4s

Pruning

10 alts after pruning (8 fresh and 2 done)

Merged error: 0.0b

regimes269.0ms

Accuracy

0% (0.7b remaining)

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

bsearch3.0ms

end0.0ms

sample12.6s

Algorithm
halfpoints