



Bits error versus re




Bits error versus im
Results
| Original | 43.0 |
|---|---|
| Target | 0.3 |
| Herbie | 1.0 |
Initial program 43.0
Taylor expanded around 0 0.8
rmApplied add-log-exp1.0
Final simplification1.0
herbie shell --seed 2019018
(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: 39.1s)Debug log
| 163.0ms | 126× | body | 1280 | valid |
| 79.0ms | 106× | body | 640 | valid |
| 35.0ms | 72× | body | 320 | valid |
| 21.0ms | 138× | body | 80 | valid |
| 10.0ms | 33× | body | 160 | valid |
| 145.0ms | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 43.4b
Found 2 expressions with local error:
| 7.4b | (- (exp (- im)) (exp im)) |
| 0.0b | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
| 7× | *-un-lft-identity |
| 7× | add-sqr-sqrt |
| 5× | associate-*r* |
| 4× | add-log-exp |
| 4× | add-exp-log |
| 4× | add-cbrt-cube |
| 4× | pow1 |
| 3× | add-cube-cbrt |
| 3× | sub-neg |
| 2× | difference-of-squares |
| 2× | distribute-lft-out-- |
| 2× | flip-- |
| 2× | associate-*r/ |
| 2× | flip3-- |
| 2× | distribute-lft-in |
| 2× | distribute-rgt-in |
| 1× | cbrt-unprod |
| 1× | *-commutative |
| 1× | prod-exp |
| 1× | pow-prod-down |
| 1× | associate-*l* |
| 1× | diff-log |
| 26.0ms | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
| 13.0ms | (- (exp (- im)) (exp im)) |
| 108.0ms | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
| 46.0ms | (- (exp (- im)) (exp im)) |
| 172.0ms | (* 0.5 (* (sin re) (- (exp (* -1 im)) (exp im)))) |
| 121.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
| 120.0ms | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
| 120.0ms | (* 0.5 (* (sin re) (- (exp (- im)) (exp im)))) |
| 71.0ms | (+ (* (exp (- im)) (exp (- im))) (+ (* (exp im) (exp im)) (* (exp (- im)) (exp im)))) |
4 alts after pruning (4 fresh and 0 done)
Merged error: 0.1b
Found 4 expressions with local error:
| 0.1b | (* 1/3 (pow im 3)) |
| 0.1b | (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
| 0.1b | (* 1/60 (pow im 5)) |
| 0.0b | (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))) |
| 18× | associate-*r* |
| 9× | add-log-exp |
| 9× | add-cube-cbrt |
| 9× | *-un-lft-identity |
| 9× | add-sqr-sqrt |
| 6× | add-exp-log |
| 6× | add-cbrt-cube |
| 6× | pow1 |
| 3× | *-commutative |
| 3× | distribute-rgt-neg-in |
| 3× | sum-log |
| 3× | distribute-lft-neg-in |
| 2× | distribute-neg-frac |
| 2× | flip-+ |
| 2× | associate-*r/ |
| 2× | flip3-+ |
| 2× | distribute-neg-in |
| 1× | cbrt-unprod |
| 1× | distribute-rgt-neg-out |
| 1× | prod-exp |
| 1× | pow-prod-down |
| 1× | associate-*l* |
| 1× | unpow3 |
| 1× | distribute-lft-in |
| 1× | neg-mul-1 |
| 1× | associate-+r+ |
| 1× | +-commutative |
| 1× | cube-mult |
| 1× | distribute-rgt-in |
| 26.0ms | (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
| 6.0ms | (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))) |
| 1.0ms | (* 1/3 (pow im 3)) |
| 1.0ms | (* 1/60 (pow im 5)) |
| 142.0ms | (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
| 43.0ms | (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))) |
| 24.0ms | (* 1/60 (pow im 5)) |
| 16.0ms | (* 1/3 (pow im 3)) |
| 417.0ms | (* (* 0.5 (sin re)) (- (+ (* 1/60 (pow im 5)) (* 2 im)))) |
| 336.0ms | (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
| 275.0ms | (* (* (* (* 0.5 (sin re)) (* 0.5 (sin re))) (* 0.5 (sin re))) (* (* (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 235.0ms | (* (- (+ (* 1/60 (pow im 5)) (* 2 im))) (* 0.5 (sin re))) |
| 197.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.0b
Found 4 expressions with local error:
| 2.0b | (log (exp (* 1/3 (pow im 3)))) |
| 0.1b | (* 1/3 (pow im 3)) |
| 0.1b | (* (* 0.5 (sin re)) (- (+ (log (exp (* 1/3 (pow im 3)))) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
| 0.1b | (* 1/60 (pow im 5)) |
| 22× | associate-*r* |
| 16× | *-un-lft-identity |
| 10× | add-cube-cbrt |
| 10× | add-sqr-sqrt |
| 9× | pow1 |
| 6× | add-exp-log |
| 6× | add-cbrt-cube |
| 5× | distribute-rgt-neg-in |
| 5× | distribute-lft-neg-in |
| 4× | add-log-exp |
| 4× | distribute-lft-out |
| 4× | log-pow |
| 3× | *-commutative |
| 3× | log-prod |
| 2× | distribute-neg-frac |
| 2× | associate-*r/ |
| 2× | distribute-neg-in |
| 1× | flip-+ |
| 1× | cbrt-unprod |
| 1× | distribute-rgt-neg-out |
| 1× | prod-exp |
| 1× | pow-prod-down |
| 1× | associate-*l* |
| 1× | rem-log-exp |
| 1× | unpow3 |
| 1× | flip3-+ |
| 1× | distribute-lft-in |
| 1× | neg-mul-1 |
| 1× | exp-prod |
| 1× | cube-mult |
| 1× | distribute-rgt-in |
| 46.0ms | (* (* 0.5 (sin re)) (- (+ (log (exp (* 1/3 (pow im 3)))) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
| 3.0ms | (log (exp (* 1/3 (pow im 3)))) |
| 2.0ms | (* 1/3 (pow im 3)) |
| 2.0ms | (* 1/60 (pow im 5)) |
| 178.0ms | (* (* 0.5 (sin re)) (- (+ (log (exp (* 1/3 (pow im 3)))) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
| 34.0ms | (* 1/60 (pow im 5)) |
| 27.0ms | (* 1/3 (pow im 3)) |
| 25.0ms | (log (exp (* 1/3 (pow im 3)))) |
| 387.0ms | (* (* (* (* 0.5 (sin re)) (* 0.5 (sin re))) (* 0.5 (sin re))) (* (* (- (+ (log (exp (* 1/3 (pow im 3)))) (+ (* 1/60 (pow im 5)) (* 2 im)))) (- (+ (log (exp (* 1/3 (pow im 3)))) (+ (* 1/60 (pow im 5)) (* 2 im))))) (- (+ (log (exp (* 1/3 (pow im 3)))) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 365.0ms | (* (* 0.5 (sin re)) (- (+ (* 1/60 (pow im 5)) (* 2 im)))) |
| 361.0ms | (* (- (+ (* 1/60 (pow im 5)) (* 2 im))) (* 0.5 (sin re))) |
| 360.0ms | (* (* 0.5 (sin re)) (- (+ (log (exp (* 1/3 (pow im 3)))) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
| 298.0ms | (cbrt (- (+ (log (exp (* 1/3 (pow im 3)))) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
11 alts after pruning (10 fresh and 1 done)
Merged error: 0.0b
Found 4 expressions with local error:
| 14.3b | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 14.3b | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 14.3b | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 0.5b | (* (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))))) |
| 20× | associate-*r/ |
| 18× | distribute-neg-frac |
| 18× | cbrt-div |
| 9× | flip-+ |
| 9× | flip3-+ |
| 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× | associate-*l* |
| 4× | associate-*r* |
| 4× | add-cbrt-cube |
| 4× | frac-times |
| 2× | pow-prod-up |
| 2× | associate-*l/ |
| 2× | pow-prod-down |
| 1× | cbrt-unprod |
| 1× | *-commutative |
| 1× | prod-exp |
| 1× | pow-plus |
| 1× | pow2 |
| 41.0ms | (* (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))))) |
| 18.0ms | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 16.0ms | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 11.0ms | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 671.0ms | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 465.0ms | (* (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))))) |
| 388.0ms | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 366.0ms | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 377.0ms | (+ (* (cbrt 0.5) (exp (* 1/3 (- (log (* 1/60 (sin re))) (* 5 (log (/ -1 im))))))) (* 20/3 (/ (* (cbrt 0.5) (exp (* 1/3 (- (log (* 1/60 (sin re))) (* 5 (log (/ -1 im))))))) (pow im 2)))) |
| 367.0ms | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 349.0ms | (* (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))))) |
| 342.0ms | (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
| 338.0ms | (+ (* 20/3 (/ (* (cbrt -0.5) (exp (* 1/3 (- (log (* 1/60 (sin re))) (* 5 (log (/ 1 im))))))) (pow im 2))) (* (cbrt -0.5) (exp (* 1/3 (- (log (* 1/60 (sin re))) (* 5 (log (/ 1 im)))))))) |
14 alts after pruning (12 fresh and 2 done)
Merged error: 0.0b
0% (0.9b remaining)
Error of 1.0b against oracle of 0.1b and baseline of 1.0b
| 6.9s | 4690× | body | 1280 | valid |
| 3.0s | 3737× | body | 640 | valid |
| 1.1s | 1917× | body | 320 | valid |
| 690.0ms | 4452× | body | 80 | valid |
| 337.0ms | 979× | body | 160 | valid |