



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 2019022 +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: 40.4s)Debug log
| 197.0ms | 175× | body | 1280 | valid |
| 67.0ms | 107× | body | 640 | valid |
| 22.0ms | 46× | body | 320 | valid |
| 14.0ms | 118× | body | 80 | valid |
| 8.0ms | 27× | body | 160 | valid |
| 180.0ms | (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 58.9b
Found 2 expressions with local error:
| 6.8b | (- (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 |
| 31.0ms | (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))) |
| 16.0ms | (- (exp (- 0 im)) (exp im)) |
| 115.0ms | (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))) |
| 51.0ms | (- (exp (- 0 im)) (exp im)) |
| 523.0ms | (* (* 0.5 (cos re)) (fma (- (sqrt (exp im))) (sqrt (exp im)) (* (sqrt (exp im)) (sqrt (exp im))))) |
| 338.0ms | (* (* 0.5 (cos re)) (fma (- (cbrt (exp im))) (* (cbrt (exp im)) (cbrt (exp im))) (* (cbrt (exp im)) (* (cbrt (exp im)) (cbrt (exp im)))))) |
| 305.0ms | (* (* 0.5 (cos re)) (fma (- (exp im)) 1 (* (exp im) 1))) |
| 294.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
| 289.0ms | (* (* 0.5 (cos re)) (fma (- (exp im)) 1 (* (exp im) 1))) |
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.0b | (* (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 |
| 11.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)) |
| 0.0ms | (fma -1/3 (* im im) -2) |
| 123.0ms | (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 35.0ms | (* (pow im 5) -1/60) |
| 28.0ms | (fma -1/3 (* im im) -2) |
| 27.0ms | (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)) |
| 454.0ms | (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 297.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
| 292.0ms | (- (+ (* 1.0 (* im (cos re))) (+ (* 0.16666666666666666 (* (pow im 3) (cos re))) (* 0.008333333333333333 (* (pow im 5) (cos re)))))) |
| 284.0ms | (- (+ (* 1.0 (* im (cos re))) (+ (* 0.16666666666666666 (* (pow im 3) (cos re))) (* 0.008333333333333333 (* (pow im 5) (cos re)))))) |
| 265.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
11 alts after pruning (11 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 |
| 9.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)) |
| 120.0ms | (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)))) |
| 45.0ms | (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)) |
| 37.0ms | (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))) |
| 323.0ms | (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)))) |
| 266.0ms | (* (- (cos re)) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))) |
| 234.0ms | (- (+ (* 1.0 (* im (cos re))) (+ (* 0.16666666666666666 (* (pow im 3) (cos re))) (* 0.008333333333333333 (* (pow im 5) (cos re)))))) |
| 229.0ms | (- (* 0.5 (* (pow re 2) im)) (+ (* 0.16666666666666666 (pow im 3)) (* 1.0 im))) |
| 208.0ms | (* (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)) (- (cos re))) |
14 alts after pruning (13 fresh and 1 done)
Merged error: 0.0b
Found 4 expressions with local error:
| 0.6b | (cbrt (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))))) |
| 0.6b | (cbrt (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))))) |
| 0.6b | (cbrt (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))))) |
| 0.5b | (* (cbrt (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))))) (cbrt (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)))))) |
| 9× | pow1 |
| 7× | pow1/3 |
| 6× | add-cube-cbrt |
| 6× | add-exp-log |
| 6× | *-un-lft-identity |
| 6× | add-sqr-sqrt |
| 5× | cbrt-prod |
| 4× | add-log-exp |
| 4× | log1p-expm1-u |
| 4× | associate-*l* |
| 4× | associate-*r* |
| 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 |
| 21.0ms | (* (cbrt (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))))) (cbrt (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)))))) |
| 6.0ms | (cbrt (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))))) |
| 5.0ms | (cbrt (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))))) |
| 5.0ms | (cbrt (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))))) |
| 643.0ms | (* (cbrt (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))))) (cbrt (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)))))) |
| 344.0ms | (cbrt (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))))) |
| 322.0ms | (cbrt (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))))) |
| 321.0ms | (cbrt (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))))) |
| 444.0ms | (* (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)))) (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))))) |
| 414.0ms | (* (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)))) (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))))) |
| 393.0ms | (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)))) |
| 391.0ms | (sqrt (cbrt (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)))))) |
| 372.0ms | (+ (* (cbrt -1) (exp (* 1/3 (- (log (* 0.008333333333333333 (cos re))) (* 5 (log (/ 1 im))))))) (* 6.666666666666666 (/ (* (cbrt -1) (exp (* 1/3 (- (log (* 0.008333333333333333 (cos re))) (* 5 (log (/ 1 im))))))) (pow im 2)))) |
15 alts after pruning (13 fresh and 2 done)
Merged error: 0.0b
0% (0.7b remaining)
Error of 0.8b against oracle of 0.0b and baseline of 0.8b
| 7.4s | 5772× | body | 1280 | valid |
| 2.5s | 3500× | body | 640 | valid |
| 1.1s | 1488× | body | 320 | valid |
| 613.0ms | 4318× | body | 80 | valid |
| 195.0ms | 705× | body | 160 | valid |