



Bits error versus re




Bits error versus im
| Original | 58.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.7 |
Initial program 58.0
Taylor expanded around 0 0.7
Simplified0.7
rmApplied fma-udef0.7
Applied distribute-lft-in0.7
Final simplification0.7
herbie shell --seed 2018365 +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: 30.0s)Debug log
2 alts after pruning (2 fresh and 0 done)
Merged error: 57.5b
Found 2 expressions with local error:
| 6.5b | (- (exp (- 0 im)) (exp im)) |
| 0.0b | (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))) |
2 calls. Slowest were:
| 20.0ms | (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))) |
| 17.0ms | (- (exp (- 0 im)) (exp im)) |
2 calls. Slowest were:
| 107.0ms | (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))) |
| 62.0ms | (- (exp (- 0 im)) (exp im)) |
88 calls. Slowest were:
| 314.0ms | (* (fma (- (exp im)) 1 (* (exp im) 1)) (* 0.5 (cos re))) |
| 310.0ms | (* (* 0.5 (cos re)) (fma (- (exp im)) 1 (* (exp im) 1))) |
| 300.0ms | (* (* 0.5 (cos re)) (fma (- (exp im)) 1 (* (exp im) 1))) |
2 alts after pruning (2 fresh and 0 done)
Merged error: 0.1b
Found 3 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 im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)) |
3 calls. Slowest were:
| 10.0ms | (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 4.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:
| 109.0ms | (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 28.0ms | (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)) |
| 20.0ms | (* (pow im 5) -1/60) |
19 calls. Slowest were:
| 571.0ms | (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 352.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
| 311.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 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:
| 12.0ms | (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2))) |
| 10.0ms | (* (* 0.5 (cos re)) (* (pow im 5) -1/60)) |
| 4.0ms | (* (pow im 5) -1/60) |
4 calls. Slowest were:
| 129.0ms | (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2))) |
| 99.0ms | (* (* 0.5 (cos re)) (* (pow im 5) -1/60)) |
| 52.0ms | (* im (fma -1/3 (* im im) -2)) |
| 33.0ms | (* (pow im 5) -1/60) |
30 calls. Slowest were:
| 742.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))) |
| 393.0ms | (- (+ (* 1.0 (* im (cos re))) (* 0.16666666666666666 (* (pow im 3) (cos re))))) |
| 385.0ms | (- (+ (* 1.0 (* im (cos re))) (* 0.16666666666666666 (* (pow im 3) (cos re))))) |
8 alts after pruning (7 fresh and 1 done)
Merged error: 0.1b
Found 4 expressions with local error:
| 0.6b | (cbrt (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2)))) |
| 0.6b | (cbrt (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2)))) |
| 0.6b | (cbrt (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2)))) |
| 0.4b | (* (cbrt (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2)))) (cbrt (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2))))) |
4 calls. Slowest were:
| 24.0ms | (* (cbrt (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2)))) (cbrt (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2))))) |
| 6.0ms | (cbrt (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2)))) |
| 3.0ms | (cbrt (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2)))) |
4 calls. Slowest were:
| 319.0ms | (* (cbrt (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2)))) (cbrt (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2))))) |
| 239.0ms | (cbrt (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2)))) |
| 227.0ms | (cbrt (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2)))) |
| 223.0ms | (cbrt (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2)))) |
31 calls. Slowest were:
| 1.3s | (* (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2))) (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2)))) |
| 1.0s | (* (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2))) (* (* 0.5 (cos re)) (* im (fma -1/3 (* im im) -2)))) |
| 494.0ms | (+ (* 2 (/ (* (cbrt 0.5) (exp (* 1/3 (- (log (* -1/3 (cos re))) (* 3 (log (/ 1 im))))))) (pow im 2))) (* (cbrt 0.5) (exp (* 1/3 (- (log (* -1/3 (cos re))) (* 3 (log (/ 1 im)))))))) |
11 alts after pruning (9 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