



Bits error versus re




Bits error versus im
| Original | 43.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.8 |
Initial program 43.6
Taylor expanded around 0 0.8
Simplified0.8
Taylor expanded around inf 0.8
Simplified0.8
Final simplification0.8
herbie shell --seed 2019004 +o rules:numerics
(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: 32.9s)Debug log
1 calls. Slowest were:
| 207.0ms | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 44.0b
Found 2 expressions with local error:
| 6.9b | (- (exp (- im)) (exp im)) |
| 0.0b | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
2 calls. Slowest were:
| 28.0ms | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
| 16.0ms | (- (exp (- im)) (exp im)) |
2 calls. Slowest were:
| 108.0ms | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
| 74.0ms | (- (exp (- im)) (exp im)) |
62 calls. Slowest were:
| 355.0ms | (* (* 0.5 (sin re)) (fma (- (exp im)) 1 (* (exp im) 1))) |
| 300.0ms | (* (* 0.5 (sin re)) (fma (- (cbrt (exp im))) (* (cbrt (exp im)) (cbrt (exp im))) (* (cbrt (exp im)) (* (cbrt (exp im)) (cbrt (exp im)))))) |
| 300.0ms | (* (* 0.5 (sin re)) (fma (- (cbrt (exp im))) (* (cbrt (exp im)) (cbrt (exp im))) (* (cbrt (exp im)) (* (cbrt (exp im)) (cbrt (exp im)))))) |
4 alts after pruning (4 fresh and 0 done)
Merged error: 0.2b
Found 3 expressions with local error:
| 0.2b | (* (* 0.5 (sin re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 0.0b | (* (pow im 5) -1/60) |
| 0.0b | (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)) |
3 calls. Slowest were:
| 8.0ms | (* (* 0.5 (sin re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 2.0ms | (* (pow im 5) -1/60) |
| 0.0ms | (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)) |
3 calls. Slowest were:
| 151.0ms | (* (* 0.5 (sin re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 39.0ms | (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)) |
| 36.0ms | (* (pow im 5) -1/60) |
19 calls. Slowest were:
| 500.0ms | (* (* 0.5 (sin re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 320.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
| 294.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
8 alts after pruning (8 fresh and 0 done)
Merged error: 0.1b
Found 3 expressions with local error:
| 0.2b | (* (- (sin re)) (fma (* im im) (* im 0.16666666666666666) (* 1.0 im))) |
| 0.0b | (* (- (sin re)) (pow im 5)) |
| 0.0b | (fma (* (- (sin re)) (pow im 5)) 0.008333333333333333 (* (- (sin re)) (fma (* im im) (* im 0.16666666666666666) (* 1.0 im)))) |
3 calls. Slowest were:
| 5.0ms | (* (- (sin re)) (fma (* im im) (* im 0.16666666666666666) (* 1.0 im))) |
| 4.0ms | (* (- (sin re)) (pow im 5)) |
| 0.0ms | (fma (* (- (sin re)) (pow im 5)) 0.008333333333333333 (* (- (sin re)) (fma (* im im) (* im 0.16666666666666666) (* 1.0 im)))) |
3 calls. Slowest were:
| 148.0ms | (fma (* (- (sin re)) (pow im 5)) 0.008333333333333333 (* (- (sin re)) (fma (* im im) (* im 0.16666666666666666) (* 1.0 im)))) |
| 126.0ms | (* (- (sin re)) (fma (* im im) (* im 0.16666666666666666) (* 1.0 im))) |
| 99.0ms | (* (- (sin re)) (pow im 5)) |
39 calls. Slowest were:
| 325.0ms | (- (+ (* 0.16666666666666666 (* (sin re) (pow im 3))) (* 1.0 (* (sin re) im)))) |
| 300.0ms | (- (+ (* 0.16666666666666666 (* (sin re) (pow im 3))) (* 1.0 (* (sin re) im)))) |
| 262.0ms | (- (+ (* 0.16666666666666666 (* (sin re) (pow im 3))) (+ (* 1.0 (* (sin re) im)) (* 0.008333333333333333 (* (sin re) (pow im 5)))))) |
12 alts after pruning (11 fresh and 1 done)
Merged error: 0.0b
Found 4 expressions with local error:
| 0.6b | (cbrt (- (sin re))) |
| 0.6b | (cbrt (- (sin re))) |
| 0.6b | (cbrt (- (sin re))) |
| 0.4b | (* (cbrt (- (sin re))) (cbrt (- (sin re)))) |
4 calls. Slowest were:
| 13.0ms | (* (cbrt (- (sin re))) (cbrt (- (sin re)))) |
| 2.0ms | (cbrt (- (sin re))) |
| 2.0ms | (cbrt (- (sin re))) |
4 calls. Slowest were:
| 273.0ms | (* (cbrt (- (sin re))) (cbrt (- (sin re)))) |
| 223.0ms | (cbrt (- (sin re))) |
| 211.0ms | (cbrt (- (sin re))) |
| 204.0ms | (cbrt (- (sin re))) |
76 calls. Slowest were:
| 442.0ms | (- (* (pow re 1/3) (cbrt -1)) (+ (* 1/3240 (* (pow (pow re 13) 1/3) (cbrt -1))) (* 1/18 (* (pow (pow re 7) 1/3) (cbrt -1))))) |
| 431.0ms | (- (* (pow re 1/3) (cbrt -1)) (+ (* 1/3240 (* (pow (pow re 13) 1/3) (cbrt -1))) (* 1/18 (* (pow (pow re 7) 1/3) (cbrt -1))))) |
| 364.0ms | (- (* (pow re 1/3) (cbrt -1)) (+ (* 1/3240 (* (pow (pow re 13) 1/3) (cbrt -1))) (* 1/18 (* (pow (pow re 7) 1/3) (cbrt -1))))) |
12 alts after pruning (11 fresh and 1 done)
Merged error: 0.0b
0% (0.7b remaining)
Error of 0.8b against oracle of 0.1b and baseline of 0.8b