



Bits error versus re




Bits error versus im
| Original | 58.1 |
|---|---|
| Target | 0.2 |
| Herbie | 0.7 |
Initial program 58.1
Taylor expanded around 0 0.7
Simplified0.7
rmApplied fma-udef0.7
Applied distribute-lft-in0.7
Final simplification0.7
herbie shell --seed 2019002 +o rules:numerics
(FPCore (re im)
:name "math.sin on complex, imaginary part"
:herbie-target
(if (< (fabs im) 1) (- (* (cos re) (+ (+ im (* (* (* 1/6 im) im) im)) (* (* (* (* (* 1/120 im) im) im) im) im)))) (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))))
(* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))))
Time bar (total: 44.5s)Debug log
1 calls. Slowest were:
| 182.0ms | (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 58.3b
Found 2 expressions with local error:
| 7.0b | (- (exp (- 0 im)) (exp im)) |
| 0.0b | (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))) |
2 calls. Slowest were:
| 37.0ms | (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))) |
| 16.0ms | (- (exp (- 0 im)) (exp im)) |
2 calls. Slowest were:
| 79.0ms | (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))) |
| 67.0ms | (- (exp (- 0 im)) (exp im)) |
88 calls. Slowest were:
| 660.0ms | (* (* 0.5 (cos re)) (fma (- (cbrt (exp im))) (* (cbrt (exp im)) (cbrt (exp im))) (* (cbrt (exp im)) (* (cbrt (exp im)) (cbrt (exp im)))))) |
| 388.0ms | (* (* 0.5 (cos re)) (fma (- (cbrt (exp im))) (* (cbrt (exp im)) (cbrt (exp im))) (* (cbrt (exp im)) (* (cbrt (exp im)) (cbrt (exp im)))))) |
| 347.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
3 alts after pruning (3 fresh and 0 done)
Merged error: 0.1b
Found 4 expressions with local error:
| 0.1b | (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 0.1b | (* (pow im 5) -1/60) |
| 0.0b | (fma -1/3 (* im im) -2) |
| 0.0b | (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)) |
4 calls. Slowest were:
| 5.0ms | (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 2.0ms | (* (pow im 5) -1/60) |
| 0.0ms | (fma -1/3 (* im im) -2) |
4 calls. Slowest were:
| 133.0ms | (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 31.0ms | (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)) |
| 22.0ms | (* (pow im 5) -1/60) |
| 21.0ms | (fma -1/3 (* im im) -2) |
22 calls. Slowest were:
| 589.0ms | (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 344.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
| 326.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
9 alts after pruning (9 fresh and 0 done)
Merged error: 0.0b
Found 4 expressions with local error:
| 0.1b | (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2))) |
| 0.1b | (* (pow im 5) -1/60) |
| 0.0b | (* (* 0.5 (cos re)) (* (pow im 5) -1/60)) |
| 0.0b | (* im (fma -1/3 (* im im) -2)) |
4 calls. Slowest were:
| 15.0ms | (* (* 0.5 (cos re)) (* (pow im 5) -1/60)) |
| 13.0ms | (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2))) |
| 4.0ms | (* (pow im 5) -1/60) |
4 calls. Slowest were:
| 147.0ms | (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2))) |
| 139.0ms | (* (* 0.5 (cos re)) (* (pow im 5) -1/60)) |
| 58.0ms | (* im (fma -1/3 (* im im) -2)) |
| 34.0ms | (* (pow im 5) -1/60) |
30 calls. Slowest were:
| 690.0ms | (* (* (* (* 0.5 (cos re)) (* 0.5 (cos re))) (* 0.5 (cos re))) (* (* (* (pow im 5) -1/60) (* (pow im 5) -1/60)) (* (pow im 5) -1/60))) |
| 323.0ms | (- (+ (* 1.0 (* im (cos re))) (* 0.16666666666666666 (* (pow im 3) (cos re))))) |
| 308.0ms | (- (+ (* 1.0 (* im (cos re))) (* 0.16666666666666666 (* (pow im 3) (cos re))))) |
9 alts after pruning (8 fresh and 1 done)
Merged error: 0.0b
Found 4 expressions with local error:
| 0.6b | (cbrt (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)))) |
| 0.6b | (cbrt (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)))) |
| 0.6b | (cbrt (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)))) |
| 0.5b | (* (cbrt (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)))) (cbrt (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))))) |
4 calls. Slowest were:
| 24.0ms | (* (cbrt (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)))) (cbrt (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))))) |
| 6.0ms | (cbrt (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)))) |
| 5.0ms | (cbrt (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)))) |
4 calls. Slowest were:
| 558.0ms | (* (cbrt (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)))) (cbrt (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))))) |
| 335.0ms | (cbrt (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)))) |
| 301.0ms | (cbrt (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)))) |
| 281.0ms | (cbrt (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)))) |
31 calls. Slowest were:
| 553.0ms | (* (cbrt (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)))) (cbrt (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))))) |
| 541.0ms | (* (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)))) |
| 523.0ms | (cbrt (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)))) |
10 alts after pruning (8 fresh and 2 done)
Merged error: 0.0b
0% (0.6b remaining)
Error of 0.7b against oracle of 0.1b and baseline of 0.7b