



Bits error versus re




Bits error versus im
| Original | 58.0 |
|---|---|
| Target | 0.2 |
| Herbie | 0.8 |
Initial program 58.0
Taylor expanded around 0 0.8
Simplified0.8
Taylor expanded around -inf 0.8
Simplified0.8
Final simplification0.8
herbie shell --seed 2019016 +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: 36.3s)Debug log
| 520× | (pre true 80) |
| 191× | (body real 1280) |
| 144× | (body real 80) |
| 109× | (body real 640) |
| 52× | (body real 320) |
| 24× | (body real 160) |
| 156.0ms | (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 58.1b
Found 2 expressions with local error:
| 4.2b | (- (exp (- 0 im)) (exp im)) |
| 0.0b | (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))) |
| 45× | prod-diff |
| 32× | *-un-lft-identity |
| 32× | add-sqr-sqrt |
| 28× | add-cube-cbrt |
| 20× | exp-sum |
| 17× | distribute-lft-in |
| 17× | distribute-rgt-in |
| 13× | sub-neg |
| 5× | associate-*r* |
| 5× | fma-neg |
| 4× | add-log-exp |
| 4× | add-exp-log |
| 4× | add-cbrt-cube |
| 4× | pow1 |
| 2× | difference-of-squares |
| 2× | distribute-lft-out-- |
| 2× | flip-- |
| 2× | log1p-expm1-u |
| 2× | associate-*r/ |
| 2× | flip3-- |
| 2× | expm1-log1p-u |
| 1× | cbrt-unprod |
| 1× | *-commutative |
| 1× | prod-exp |
| 1× | pow-prod-down |
| 1× | associate-*l* |
| 1× | diff-log |
| 32.0ms | (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))) |
| 18.0ms | (- (exp (- 0 im)) (exp im)) |
| 96.0ms | (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))) |
| 64.0ms | (- (exp (- 0 im)) (exp im)) |
| 335.0ms | (* (* 0.5 (cos re)) (fma (- (exp im)) 1 (* (exp im) 1))) |
| 309.0ms | (* (* 0.5 (cos re)) (fma (- (cbrt (exp im))) (* (cbrt (exp im)) (cbrt (exp im))) (* (cbrt (exp im)) (* (cbrt (exp im)) (cbrt (exp im)))))) |
| 290.0ms | (* (* 0.5 (cos re)) (fma (- (cbrt (exp im))) (* (cbrt (exp im)) (cbrt (exp im))) (* (cbrt (exp im)) (* (cbrt (exp im)) (cbrt (exp im)))))) |
| 290.0ms | (* (fma (- (cbrt (exp im))) (* (cbrt (exp im)) (cbrt (exp im))) (* (cbrt (exp im)) (* (cbrt (exp im)) (cbrt (exp im))))) (* 0.5 (cos re))) |
| 286.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
4 alts after pruning (4 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 im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)) |
| 0.0b | (fma -1/3 (* im im) -2) |
| 6× | add-cube-cbrt |
| 6× | add-exp-log |
| 6× | add-cbrt-cube |
| 6× | *-un-lft-identity |
| 6× | pow1 |
| 6× | add-sqr-sqrt |
| 4× | add-log-exp |
| 4× | log1p-expm1-u |
| 4× | fma-udef |
| 4× | associate-*l* |
| 4× | expm1-log1p-u |
| 3× | associate-*r* |
| 2× | *-commutative |
| 1× | cbrt-unprod |
| 1× | prod-exp |
| 1× | pow-prod-down |
| 1× | distribute-lft-in |
| 1× | distribute-rgt-in |
| 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 im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)) |
| 0.0ms | (fma -1/3 (* im im) -2) |
| 147.0ms | (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 40.0ms | (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)) |
| 38.0ms | (fma -1/3 (* im im) -2) |
| 20.0ms | (* (pow im 5) -1/60) |
| 413.0ms | (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 355.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
| 303.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
| 260.0ms | (- (+ (* 1.0 (* im (cos re))) (+ (* 0.16666666666666666 (* (pow im 3) (cos re))) (* 0.008333333333333333 (* (pow im 5) (cos re)))))) |
| 212.0ms | (- (+ (* 1.0 (* im (cos re))) (+ (* 0.16666666666666666 (* (pow im 3) (cos re))) (* 0.008333333333333333 (* (pow im 5) (cos re)))))) |
10 alts after pruning (10 fresh and 0 done)
Merged error: 0.1b
Found 3 expressions with local error:
| 0.1b | (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)))) |
| 0.0b | (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))) |
| 0.0b | (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)) |
| 10× | associate-*l* |
| 7× | add-cube-cbrt |
| 7× | *-un-lft-identity |
| 7× | add-sqr-sqrt |
| 5× | add-exp-log |
| 5× | add-cbrt-cube |
| 5× | pow1 |
| 4× | fma-udef |
| 3× | add-log-exp |
| 3× | log1p-expm1-u |
| 3× | associate-*r* |
| 3× | distribute-rgt-neg-in |
| 3× | expm1-log1p-u |
| 3× | distribute-lft-neg-in |
| 1× | cbrt-unprod |
| 1× | *-commutative |
| 1× | prod-exp |
| 1× | pow-prod-down |
| 1× | distribute-lft-in |
| 1× | neg-mul-1 |
| 1× | distribute-rgt-in |
| 1× | distribute-lft-neg-out |
| 10.0ms | (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)))) |
| 0.0ms | (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))) |
| 0.0ms | (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)) |
| 133.0ms | (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)))) |
| 67.0ms | (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)) |
| 43.0ms | (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))) |
| 354.0ms | (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)))) |
| 254.0ms | (* (cos re) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)))) |
| 236.0ms | (- (+ (* 1.0 (* im (cos re))) (+ (* 0.16666666666666666 (* (pow im 3) (cos re))) (* 0.008333333333333333 (* (pow im 5) (cos re)))))) |
| 224.0ms | (* (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)) (- (cos re))) |
| 220.0ms | (* (- (cos re)) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))) |
12 alts after pruning (11 fresh and 1 done)
Merged error: 0.0b
Found 4 expressions with local error:
| 0.3b | (cbrt (- (cos re))) |
| 0.3b | (cbrt (- (cos re))) |
| 0.3b | (cbrt (- (cos re))) |
| 0.2b | (* (cbrt (- (cos re))) (cbrt (- (cos re)))) |
| 50× | cbrt-prod |
| 21× | add-cube-cbrt |
| 21× | *-un-lft-identity |
| 21× | add-sqr-sqrt |
| 15× | distribute-rgt-neg-in |
| 15× | distribute-lft-neg-in |
| 13× | associate-*l* |
| 13× | associate-*r* |
| 9× | pow1 |
| 7× | pow1/3 |
| 6× | add-exp-log |
| 5× | neg-mul-1 |
| 4× | add-log-exp |
| 4× | log1p-expm1-u |
| 4× | add-cbrt-cube |
| 4× | expm1-log1p-u |
| 2× | pow-prod-up |
| 2× | pow-prod-down |
| 1× | cbrt-unprod |
| 1× | *-commutative |
| 1× | prod-exp |
| 1× | pow-plus |
| 1× | pow2 |
| 7.0ms | (* (cbrt (- (cos re))) (cbrt (- (cos re)))) |
| 1.0ms | (cbrt (- (cos re))) |
| 1.0ms | (cbrt (- (cos re))) |
| 1.0ms | (cbrt (- (cos re))) |
| 372.0ms | (* (cbrt (- (cos re))) (cbrt (- (cos re)))) |
| 223.0ms | (cbrt (- (cos re))) |
| 204.0ms | (cbrt (- (cos re))) |
| 202.0ms | (cbrt (- (cos re))) |
| 269.0ms | (- (cbrt -1) (+ (* 1/6 (* (pow re 2) (cbrt -1))) (* 1/72 (* (pow re 4) (cbrt -1))))) |
| 244.0ms | (- (cbrt -1) (+ (* 1/6 (* (pow re 2) (cbrt -1))) (* 1/72 (* (pow re 4) (cbrt -1))))) |
| 168.0ms | (- (cbrt -1) (+ (* 1/6 (* (pow re 2) (cbrt -1))) (* 1/72 (* (pow re 4) (cbrt -1))))) |
| 139.0ms | (- (pow (cbrt -1) 2) (+ (* 1/405 (* (pow re 6) (pow (cbrt -1) 2))) (* 1/3 (* (pow re 2) (pow (cbrt -1) 2))))) |
| 24.0ms | (* (- (cos re)) (- (cos re))) |
13 alts after pruning (12 fresh and 1 done)
Merged error: 0.0b
0% (0.7b remaining)
Error of 0.8b against oracle of 0.0b and baseline of 0.8b
| 15930× | (pre true 80) |
| 5734× | (body real 1280) |
| 4437× | (body real 80) |
| 3638× | (body real 640) |
| 1483× | (body real 320) |
| 638× | (body real 160) |