Average Error: 43.1 → 0.7
Time: 33.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.1

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

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

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

sample398.0ms

Algorithm
halfpoints

simplify95.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune20.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 43.8b

localize89.0ms

Local error

Found 4 expressions with local error:

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

rewrite29.0ms

Algorithm
rewrite-expression-head
Counts
4 → 64
Calls

4 calls. Slowest were:

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

series197.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

81.0ms
(* (/ (- (exp x) (exp (- x))) 2) (sin y))
51.0ms
(* (/ (+ (exp x) (exp (- x))) 2) (cos y))
42.0ms
(- (exp x) (exp (- x)))
23.0ms
(+ (exp x) (exp (- x)))

simplify2.0s

Counts
38 → 76
Calls

38 calls. Slowest were:

439.0ms
(* (* (* (/ (- (exp x) (exp (- x))) 2) (/ (- (exp x) (exp (- x))) 2)) (/ (- (exp x) (exp (- x))) 2)) (* (* (sin y) (sin y)) (sin y)))
262.0ms
(* (* (* (/ (+ (exp x) (exp (- x))) 2) (/ (+ (exp x) (exp (- x))) 2)) (/ (+ (exp x) (exp (- x))) 2)) (* (* (cos y) (cos y)) (cos y)))
251.0ms
(* 1/2 (* (- (exp x) (exp (- x))) (sin y)))

prune859.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.1b

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

rewrite18.0ms

Algorithm
rewrite-expression-head
Counts
4 → 55
Calls

4 calls. Slowest were:

11.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
4.0ms
(+ (exp x) (exp (- x)))
1.0ms
(* 1/3 (pow x 3))

series135.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

66.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
30.0ms
(* 1/60 (pow x 5))
24.0ms
(+ (exp x) (exp (- x)))
16.0ms
(* 1/3 (pow x 3))

simplify793.0ms

Counts
31 → 67
Calls

31 calls. Slowest were:

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

prune1.2s

Pruning

9 alts after pruning (8 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.6b
(* (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))

series593.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

178.0ms
(cbrt (sin y))
159.0ms
(* (cbrt (sin y)) (cbrt (sin y)))
132.0ms
(cbrt (sin y))
123.0ms
(cbrt (sin y))

simplify319.0ms

Counts
41 → 73
Calls

41 calls. Slowest were:

83.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))))
63.0ms
(- (+ (pow y 2/3) (* 1/405 (pow (pow y 14) 1/3))) (* 1/9 (pow (pow y 8) 1/3)))

prune1.7s

Pruning

10 alts after pruning (9 fresh and 1 done)

Merged error: 0.0b

localize16.0ms

Local error

Found 4 expressions with local error:

14.4b
(cbrt (* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y)))
14.4b
(cbrt (* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y)))
14.4b
(cbrt (* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y)))
0.5b
(* (cbrt (* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))) (cbrt (* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))))

rewrite43.0ms

Algorithm
rewrite-expression-head
Counts
4 → 57
Calls

4 calls. Slowest were:

18.0ms
(* (cbrt (* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))) (cbrt (* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))))
11.0ms
(cbrt (* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y)))
7.0ms
(cbrt (* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y)))

series1.1s

Counts
4 → 12
Calls

4 calls. Slowest were:

346.0ms
(* (cbrt (* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))) (cbrt (* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))))
277.0ms
(cbrt (* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y)))
271.0ms
(cbrt (* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y)))
249.0ms
(cbrt (* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y)))

simplify6.1s

Counts
38 → 69
Calls

38 calls. Slowest were:

542.0ms
(* (cbrt (cbrt (* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y)))) (cbrt (cbrt (* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y)))))
357.0ms
(+ (* 20/3 (/ (* (exp (* 1/3 (- (log (* 1/60 (sin y))) (* 5 (log (/ -1 x)))))) (cbrt -1/2)) (pow x 2))) (* (exp (* 1/3 (- (log (* 1/60 (sin y))) (* 5 (log (/ -1 x)))))) (cbrt -1/2)))
343.0ms
(+ (* 20/3 (/ (* (exp (* 1/3 (- (log (* 1/60 (sin y))) (* 5 (log (/ -1 x)))))) (cbrt -1/2)) (pow x 2))) (* (exp (* 1/3 (- (log (* 1/60 (sin y))) (* 5 (log (/ -1 x)))))) (cbrt -1/2)))

prune1.6s

Pruning

10 alts after pruning (8 fresh and 2 done)

Merged error: 0.0b

regimes266.0ms

Accuracy

0% (0.7b remaining)

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

bsearch7.0ms

end0.0ms

sample12.2s

Algorithm
halfpoints