



Bits error versus x
Results
| Original | 59.9 |
|---|---|
| Target | 0.1 |
| Herbie | 0.3 |
Initial program 59.9
Taylor expanded around 0 0.3
Final simplification0.3
herbie shell --seed 2019021
(FPCore (x)
:name "invcot (example 3.9)"
:pre (and (< -0.026 x) (< x 0.026))
:herbie-target
(if (< (fabs x) 0.026) (* (/ x 3) (+ 1 (/ (* x x) 15))) (- (/ 1 x) (/ 1 (tan x))))
(- (/ 1 x) (/ 1 (tan x))))
Time bar (total: 20.3s)Debug log
| 285.0ms | 98× | body | 2560 | valid |
| 123.0ms | 83× | body | 1280 | valid |
| 37.0ms | 20× | body | 320 | valid |
| 35.0ms | 42× | body | 640 | valid |
| 9.0ms | 256× | pre | 80 | true |
| 5.0ms | 12× | body | 160 | valid |
| 0.0ms | 1× | body | 80 | valid |
| 5.0ms | (- (/ 1 x) (/ 1 (tan x))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 60.0b
Found 2 expressions with local error:
| 3.2b | (- (/ 1 x) (/ 1 (tan x))) |
| 0.0b | (/ 1 (tan x)) |
| 7× | *-un-lft-identity |
| 5× | div-inv |
| 5× | add-sqr-sqrt |
| 4× | add-log-exp |
| 4× | distribute-lft-out-- |
| 3× | add-cube-cbrt |
| 3× | add-exp-log |
| 3× | associate-/r* |
| 3× | pow1 |
| 2× | add-cbrt-cube |
| 1× | difference-of-squares |
| 1× | inv-pow |
| 1× | flip-- |
| 1× | pow-flip |
| 1× | frac-sub |
| 1× | associate-/r/ |
| 1× | tan-quot |
| 1× | diff-log |
| 1× | flip3-- |
| 1× | frac-2neg |
| 1× | sub-neg |
| 1× | clear-num |
| 1× | rec-exp |
| 4.0ms | (- (/ 1 x) (/ 1 (tan x))) |
| 1.0ms | (/ 1 (tan x)) |
| 95.0ms | (- (/ 1 x) (/ 1 (tan x))) |
| 44.0ms | (/ 1 (tan x)) |
| 133.0ms | (- (/ 1 x) (+ (* 1/3 x) (* 1/45 (pow x 3)))) |
| 33.0ms | (+ (* 1/3 x) (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5)))) |
| 27.0ms | (/ (exp (/ 1 x)) (exp (/ 1 (tan x)))) |
| 8.0ms | (- (/ 1 x) (/ (cos x) (sin x))) |
| 8.0ms | (- (* 1 (tan x)) (* x 1)) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 0.3b
Found 4 expressions with local error:
| 0.3b | (* 1/3 x) |
| 0.1b | (* 1/45 (pow x 3)) |
| 0.1b | (* 2/945 (pow x 5)) |
| 0.0b | (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5))) |
| 8× | associate-*r* |
| 6× | add-log-exp |
| 6× | add-cube-cbrt |
| 6× | *-un-lft-identity |
| 6× | add-sqr-sqrt |
| 4× | add-exp-log |
| 4× | add-cbrt-cube |
| 4× | pow1 |
| 3× | *-commutative |
| 1× | flip-+ |
| 1× | unpow3 |
| 1× | flip3-+ |
| 1× | sum-log |
| 1× | +-commutative |
| 1× | cube-mult |
| 5.0ms | (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5))) |
| 2.0ms | (* 1/45 (pow x 3)) |
| 2.0ms | (* 2/945 (pow x 5)) |
| 0.0ms | (* 1/3 x) |
| 56.0ms | (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5))) |
| 25.0ms | (* 1/45 (pow x 3)) |
| 23.0ms | (* 2/945 (pow x 5)) |
| 17.0ms | (* 1/3 x) |
| 21.0ms | (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5))) |
| 18.0ms | (* (exp (* 1/45 (pow x 3))) (exp (* 2/945 (pow x 5)))) |
| 16.0ms | (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5))) |
| 12.0ms | (* 1/45 (pow x 3)) |
| 11.0ms | (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5))) |
5 alts after pruning (4 fresh and 1 done)
Merged error: 0.2b
Found 4 expressions with local error:
| 0.6b | (cbrt (* 1/3 x)) |
| 0.6b | (cbrt (* 1/3 x)) |
| 0.6b | (cbrt (* 1/3 x)) |
| 0.5b | (* (cbrt (* 1/3 x)) (cbrt (* 1/3 x))) |
| 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 |
| 2× | pow-prod-up |
| 2× | pow-prod-down |
| 1× | cbrt-unprod |
| 1× | *-commutative |
| 1× | prod-exp |
| 1× | pow-plus |
| 1× | pow2 |
| 4.0ms | (* (cbrt (* 1/3 x)) (cbrt (* 1/3 x))) |
| 0.0ms | (cbrt (* 1/3 x)) |
| 0.0ms | (cbrt (* 1/3 x)) |
| 0.0ms | (cbrt (* 1/3 x)) |
| 384.0ms | (* (cbrt (* 1/3 x)) (cbrt (* 1/3 x))) |
| 291.0ms | (cbrt (* 1/3 x)) |
| 278.0ms | (cbrt (* 1/3 x)) |
| 258.0ms | (cbrt (* 1/3 x)) |
| 16.0ms | (* (pow (cbrt -1/3) 2) (pow (pow x 2) 1/3)) |
| 14.0ms | (* (* 1/3 x) (* 1/3 x)) |
| 14.0ms | (* (pow (cbrt 1/3) 2) (pow (pow x 2) 1/3)) |
| 14.0ms | (* (pow (cbrt 1/3) 2) (pow (pow x 2) 1/3)) |
| 9.0ms | (* (cbrt -1/3) (pow (* x -1) 1/3)) |
11 alts after pruning (9 fresh and 2 done)
Merged error: 0.2b
Found 4 expressions with local error:
| 0.6b | (cbrt x) |
| 0.6b | (cbrt (* 1/3 x)) |
| 0.6b | (cbrt (* 1/3 x)) |
| 0.5b | (* (cbrt (* 1/3 x)) (* (cbrt x) (cbrt 1/3))) |
| 9× | add-exp-log |
| 9× | pow1 |
| 6× | pow1/3 |
| 5× | add-cube-cbrt |
| 5× | pow-prod-down |
| 5× | add-cbrt-cube |
| 5× | *-un-lft-identity |
| 5× | add-sqr-sqrt |
| 4× | add-log-exp |
| 4× | associate-*l* |
| 3× | cbrt-unprod |
| 3× | prod-exp |
| 3× | cbrt-prod |
| 1× | *-commutative |
| 1× | associate-*r* |
| 17.0ms | (* (cbrt (* 1/3 x)) (* (cbrt x) (cbrt 1/3))) |
| 1.0ms | (cbrt (* 1/3 x)) |
| 1.0ms | (cbrt (* 1/3 x)) |
| 0.0ms | (cbrt x) |
| 378.0ms | (* (cbrt (* 1/3 x)) (* (cbrt x) (cbrt 1/3))) |
| 303.0ms | (cbrt x) |
| 298.0ms | (cbrt (* 1/3 x)) |
| 260.0ms | (cbrt (* 1/3 x)) |
| 190.0ms | (* (* 1/3 x) (* (* (* (cbrt x) (cbrt 1/3)) (* (cbrt x) (cbrt 1/3))) (* (cbrt x) (cbrt 1/3)))) |
| 53.0ms | (* (* (cbrt -1/3) (* (cbrt 1/3) (cbrt -1))) (pow (pow x 2) 1/3)) |
| 21.0ms | (+ (log (cbrt (* 1/3 x))) (log (* (cbrt x) (cbrt 1/3)))) |
| 16.0ms | (* (pow (cbrt 1/3) 2) (pow (pow x 2) 1/3)) |
| 15.0ms | (* (* 1/3 x) (* x 1/3)) |
13 alts after pruning (10 fresh and 3 done)
Merged error: 0.2b
0% (0.1b remaining)
Error of 0.3b against oracle of 0.2b and baseline of 0.3b
| 7.9s | 3271× | body | 2560 | valid |
| 3.9s | 2480× | body | 1280 | valid |
| 1.1s | 1267× | body | 640 | valid |
| 389.0ms | 628× | body | 320 | valid |
| 199.0ms | 8000× | pre | 80 | true |
| 126.0ms | 313× | body | 160 | valid |
| 7.0ms | 41× | body | 80 | valid |