Average Error: 43.6 → 0.8
Time: 33.9s
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.6

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

sample466.0ms

Algorithm
halfpoints

simplify102.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

101.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.8b

localize88.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))) 2) (cos y))
0.0b
(+ (exp x) (exp (- x)))

rewrite52.0ms

Algorithm
rewrite-expression-head
Counts
4 → 64
Calls

4 calls. Slowest were:

26.0ms
(* (/ (- (exp x) (exp (- x))) 2) (sin y))
11.0ms
(* (/ (+ (exp x) (exp (- x))) 2) (cos y))
9.0ms
(- (exp x) (exp (- x)))

series237.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

84.0ms
(* (/ (- (exp x) (exp (- x))) 2) (sin y))
82.0ms
(* (/ (+ (exp x) (exp (- x))) 2) (cos y))
42.0ms
(- (exp x) (exp (- x)))
28.0ms
(+ (exp x) (exp (- x)))

simplify2.0s

Counts
38 → 76
Calls

38 calls. Slowest were:

354.0ms
(* 1/2 (* (- (exp x) (exp (- x))) (sin y)))
341.0ms
(* (* (* (/ (- (exp x) (exp (- x))) 2) (/ (- (exp x) (exp (- x))) 2)) (/ (- (exp x) (exp (- x))) 2)) (* (* (sin y) (sin y)) (sin y)))
290.0ms
(* 1/2 (* (- (exp x) (exp (* -1 x))) (sin y)))

prune958.0ms

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.1b

localize52.0ms

Local error

Found 4 expressions with local error:

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

rewrite25.0ms

Algorithm
rewrite-expression-head
Counts
4 → 55
Calls

4 calls. Slowest were:

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

series176.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

86.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
34.0ms
(+ (exp x) (exp (- x)))
34.0ms
(* 1/60 (pow x 5))
22.0ms
(* 1/3 (pow x 3))

simplify782.0ms

Counts
31 → 67
Calls

31 calls. Slowest were:

150.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
134.0ms
(* (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) (sin y))
85.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.4s

Pruning

10 alts after pruning (9 fresh and 1 done)

Merged error: 0.1b

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

series701.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

188.0ms
(cbrt (sin y))
187.0ms
(* (cbrt (sin y)) (cbrt (sin y)))
178.0ms
(cbrt (sin y))
147.0ms
(cbrt (sin y))

simplify310.0ms

Counts
41 → 73
Calls

41 calls. Slowest were:

87.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
82.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
46.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))

prune1.8s

Pruning

12 alts after pruning (11 fresh and 1 done)

Merged error: 0.0b

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

rewrite35.0ms

Algorithm
rewrite-expression-head
Counts
4 → 72
Calls

4 calls. Slowest were:

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

series814.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

246.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))
198.0ms
(cbrt (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2))
167.0ms
(cbrt (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2))

simplify4.6s

Counts
53 → 84
Calls

53 calls. Slowest were:

543.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))
448.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))
346.0ms
(+ (* (pow (cbrt 1/2) 2) (exp (* 1/3 (+ (log 4) (* 2 (log x)))))) (+ (* 1/405 (* (pow (cbrt 1/2) 2) (* (pow x 4) (exp (* 1/3 (+ (log 4) (* 2 (log x)))))))) (* 1/9 (* (pow (cbrt 1/2) 2) (* (pow x 2) (exp (* 1/3 (+ (log 4) (* 2 (log x))))))))))

prune2.2s

Pruning

13 alts after pruning (11 fresh and 2 done)

Merged error: 0.0b

regimes478.0ms

Accuracy

0% (0.8b remaining)

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

bsearch6.0ms

end0.0ms

sample12.5s

Algorithm
halfpoints