



Bits error versus re




Bits error versus im
Results
| Original | 44.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.8 |
Initial program 44.0
Taylor expanded around 0 0.8
rmApplied distribute-neg-in0.8
Applied distribute-lft-in0.8
Simplified0.8
Final simplification0.8
herbie shell --seed 2018360
(FPCore (re im)
:name "math.cos on complex, imaginary part"
:herbie-target
(if (< (fabs im) 1) (- (* (sin re) (+ (+ im (* (* (* 1/6 im) im) im)) (* (* (* (* (* 1/120 im) im) im) im) im)))) (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))
(* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))
Time bar (total: 26.0s)Debug log
2 alts after pruning (2 fresh and 0 done)
Merged error: 44.8b
Found 2 expressions with local error:
| 4.9b | (- (exp (- im)) (exp im)) |
| 0.0b | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
2 calls. Slowest were:
| 26.0ms | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
| 13.0ms | (- (exp (- im)) (exp im)) |
2 calls. Slowest were:
| 115.0ms | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
| 56.0ms | (- (exp (- im)) (exp im)) |
24 calls. Slowest were:
| 163.0ms | (* 0.5 (* (sin re) (- (exp (* -1 im)) (exp im)))) |
| 157.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
| 153.0ms | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
2 alts after pruning (2 fresh and 0 done)
Merged error: 0.1b
Found 4 expressions with local error:
| 0.1b | (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
| 0.1b | (* 1/3 (pow im 3)) |
| 0.1b | (* 1/60 (pow im 5)) |
| 0.0b | (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))) |
4 calls. Slowest were:
| 34.0ms | (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
| 6.0ms | (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))) |
| 1.0ms | (* 1/3 (pow im 3)) |
4 calls. Slowest were:
| 135.0ms | (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
| 32.0ms | (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))) |
| 21.0ms | (* 1/60 (pow im 5)) |
| 16.0ms | (* 1/3 (pow im 3)) |
39 calls. Slowest were:
| 437.0ms | (- (+ (* 0.16666666666666666 (* (sin re) (pow im 3))) (+ (* 1.0 (* (sin re) im)) (* 0.008333333333333333 (* (sin re) (pow im 5)))))) |
| 400.0ms | (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
| 389.0ms | (* (* 0.5 (sin re)) (- (+ (* 1/60 (pow im 5)) (* 2 im)))) |
8 alts after pruning (8 fresh and 0 done)
Merged error: 0.0b
Found 4 expressions with local error:
| 0.1b | (* (+ (* im -2) (* -1/60 (pow im 5))) (* 0.5 (sin re))) |
| 0.1b | (* 1/3 (pow im 3)) |
| 0.1b | (* (* 0.5 (sin re)) (- (* 1/3 (pow im 3)))) |
| 0.1b | (* -1/60 (pow im 5)) |
4 calls. Slowest were:
| 14.0ms | (* (+ (* im -2) (* -1/60 (pow im 5))) (* 0.5 (sin re))) |
| 12.0ms | (* (* 0.5 (sin re)) (- (* 1/3 (pow im 3)))) |
| 7.0ms | (* 1/3 (pow im 3)) |
4 calls. Slowest were:
| 82.0ms | (* (+ (* im -2) (* -1/60 (pow im 5))) (* 0.5 (sin re))) |
| 77.0ms | (* (* 0.5 (sin re)) (- (* 1/3 (pow im 3)))) |
| 26.0ms | (* 1/3 (pow im 3)) |
| 20.0ms | (* -1/60 (pow im 5)) |
36 calls. Slowest were:
| 418.0ms | (+ (log (* 0.5 (sin re))) (log (- (* 1/3 (pow im 3))))) |
| 200.0ms | (* (* 0.5 (sin re)) (- (* 1/3 (pow im 3)))) |
| 199.0ms | (- (* 0.027777777777777776 (* (pow re 3) (pow im 3))) (* 0.16666666666666666 (* re (pow im 3)))) |
8 alts after pruning (7 fresh and 1 done)
Merged error: 0.0b
Found 4 expressions with local error:
| 0.6b | (cbrt (+ (* im -2) (* -1/60 (pow im 5)))) |
| 0.6b | (cbrt (+ (* im -2) (* -1/60 (pow im 5)))) |
| 0.6b | (cbrt (+ (* im -2) (* -1/60 (pow im 5)))) |
| 0.5b | (* (cbrt (+ (* im -2) (* -1/60 (pow im 5)))) (cbrt (+ (* im -2) (* -1/60 (pow im 5))))) |
4 calls. Slowest were:
| 15.0ms | (* (cbrt (+ (* im -2) (* -1/60 (pow im 5)))) (cbrt (+ (* im -2) (* -1/60 (pow im 5))))) |
| 3.0ms | (cbrt (+ (* im -2) (* -1/60 (pow im 5)))) |
| 2.0ms | (cbrt (+ (* im -2) (* -1/60 (pow im 5)))) |
4 calls. Slowest were:
| 823.0ms | (* (cbrt (+ (* im -2) (* -1/60 (pow im 5)))) (cbrt (+ (* im -2) (* -1/60 (pow im 5))))) |
| 755.0ms | (cbrt (+ (* im -2) (* -1/60 (pow im 5)))) |
| 741.0ms | (cbrt (+ (* im -2) (* -1/60 (pow im 5)))) |
| 722.0ms | (cbrt (+ (* im -2) (* -1/60 (pow im 5)))) |
59 calls. Slowest were:
| 536.0ms | (- (+ (exp (* 1/3 (- (log 1/60) (* 5 (log (/ -1 im)))))) (* 40 (/ (exp (* 1/3 (- (log 1/60) (* 5 (log (/ -1 im)))))) (pow im 4)))) (* 1600 (/ (exp (* 1/3 (- (log 1/60) (* 5 (log (/ -1 im)))))) (pow im 8)))) |
| 472.0ms | (* (cbrt (+ (* (* im -2) (* im -2)) (- (* (* -1/60 (pow im 5)) (* -1/60 (pow im 5))) (* (* im -2) (* -1/60 (pow im 5)))))) (cbrt (- (* im -2) (* -1/60 (pow im 5))))) |
| 429.0ms | (* (cbrt (+ (pow (* im -2) 3) (pow (* -1/60 (pow im 5)) 3))) (cbrt (- (* (* im -2) (* im -2)) (* (* -1/60 (pow im 5)) (* -1/60 (pow im 5)))))) |
9 alts after pruning (7 fresh and 2 done)
Merged error: 0.0b
0% (0.3b remaining)
Error of 0.8b against oracle of 0.5b and baseline of 0.8b