



Bits error versus x
| Original | 59.9 |
|---|---|
| Target | 0.1 |
| Herbie | 0.3 |
Initial program 59.9
Taylor expanded around 0 0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019010 +o rules:numerics
(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: 31.9s)Debug log
| 10.0ms | (- (/ 1 x) (/ 1 (tan x))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 60.2b
Found 1 expressions with local error:
| 2.1b | (- (/ 1 x) (/ 1 (tan x))) |
| 20× | prod-diff |
| 15× | *-un-lft-identity |
| 14× | div-inv |
| 13× | add-sqr-sqrt |
| 11× | add-cube-cbrt |
| 4× | distribute-lft-out-- |
| 4× | associate-/r/ |
| 4× | tan-quot |
| 4× | fma-neg |
| 3× | add-log-exp |
| 1× | difference-of-squares |
| 1× | flip-- |
| 1× | log1p-expm1-u |
| 1× | frac-sub |
| 1× | add-exp-log |
| 1× | diff-log |
| 1× | add-cbrt-cube |
| 1× | flip3-- |
| 1× | sub-neg |
| 1× | pow1 |
| 1× | expm1-log1p-u |
| 4.0ms | (- (/ 1 x) (/ 1 (tan x))) |
| 90.0ms | (- (/ 1 x) (/ 1 (tan x))) |
| 122.0ms | (fma (- (cos x)) (/ 1 (sin x)) (* (cos x) (/ 1 (sin x)))) |
| 114.0ms | (fma (- (cos x)) (/ 1 (sin x)) (* (cos x) (/ 1 (sin x)))) |
| 94.0ms | (fma (sqrt (/ 1 x)) (sqrt (/ 1 x)) (- (* (cos x) (/ 1 (sin x))))) |
| 84.0ms | (fma 1 (/ 1 x) (- (* (cos x) (/ 1 (sin x))))) |
| 84.0ms | (fma 1 (/ 1 x) (- (* (cos x) (/ 1 (sin x))))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 0.4b
Found 2 expressions with local error:
| 0.4b | (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945)) |
| 0.1b | (* (pow x 5) 2/945) |
| 3× | add-cube-cbrt |
| 3× | associate-*l* |
| 3× | *-un-lft-identity |
| 3× | add-sqr-sqrt |
| 2× | add-log-exp |
| 2× | log1p-expm1-u |
| 2× | add-exp-log |
| 2× | add-cbrt-cube |
| 2× | pow1 |
| 2× | expm1-log1p-u |
| 1× | fma-udef |
| 1× | *-commutative |
| 2.0ms | (* (pow x 5) 2/945) |
| 0.0ms | (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945)) |
| 23.0ms | (* (pow x 5) 2/945) |
| 23.0ms | (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945)) |
| 93.0ms | (+ (* 1/3 x) (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5)))) |
| 84.0ms | (+ (* 1/3 x) (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5)))) |
| 65.0ms | (+ (* 1/3 x) (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5)))) |
| 4.0ms | (* 2/945 (pow x 5)) |
| 4.0ms | (* 2/945 (pow x 5)) |
4 alts after pruning (3 fresh and 1 done)
Merged error: 0.3b
Found 4 expressions with local error:
| 0.6b | (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) |
| 0.6b | (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) |
| 0.6b | (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) |
| 0.5b | (* (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945)))) |
| 15× | cbrt-prod |
| 11× | add-cube-cbrt |
| 11× | *-un-lft-identity |
| 11× | add-sqr-sqrt |
| 9× | pow1 |
| 7× | pow1/3 |
| 6× | add-exp-log |
| 6× | associate-*l* |
| 6× | associate-*r* |
| 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 |
| 5.0ms | (* (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945)))) |
| 1.0ms | (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) |
| 1.0ms | (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) |
| 1.0ms | (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) |
| 161.0ms | (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) |
| 142.0ms | (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) |
| 140.0ms | (* (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945)))) |
| 132.0ms | (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) |
| 418.0ms | (+ (* 7/2 (/ (exp (* 1/3 (- (log 2/945) (* 5 (log (/ 1 x)))))) (pow x 2))) (+ (exp (* 1/3 (- (log 2/945) (* 5 (log (/ 1 x)))))) (* 161/4 (/ (exp (* 1/3 (- (log 2/945) (* 5 (log (/ 1 x)))))) (pow x 4))))) |
| 408.0ms | (+ (exp (* 1/3 (- (log 4/893025) (* 10 (log (/ 1 x)))))) (+ (* 371/4 (/ (exp (* 1/3 (- (log 4/893025) (* 10 (log (/ 1 x)))))) (pow x 4))) (* 7 (/ (exp (* 1/3 (- (log 4/893025) (* 10 (log (/ 1 x)))))) (pow x 2))))) |
| 382.0ms | (+ (* 2/45 (* (pow x 2) (exp (* 1/3 (+ (log 1/9) (* 2 (log x))))))) (+ (* 53/14175 (* (pow x 4) (exp (* 1/3 (+ (log 1/9) (* 2 (log x))))))) (exp (* 1/3 (+ (log 1/9) (* 2 (log x))))))) |
| 373.0ms | (+ (* 7/2 (/ (exp (* 1/3 (- (log 2/945) (* 5 (log (/ 1 x)))))) (pow x 2))) (+ (exp (* 1/3 (- (log 2/945) (* 5 (log (/ 1 x)))))) (* 161/4 (/ (exp (* 1/3 (- (log 2/945) (* 5 (log (/ 1 x)))))) (pow x 4))))) |
| 361.0ms | (+ (exp (* 1/3 (+ (log 1/3) (log x)))) (+ (* 23/14175 (* (pow x 4) (exp (* 1/3 (+ (log 1/3) (log x)))))) (* 1/45 (* (pow x 2) (exp (* 1/3 (+ (log 1/3) (log x)))))))) |
12 alts after pruning (11 fresh and 1 done)
Merged error: 0.2b
Found 4 expressions with local error:
| 0.6b | (cbrt (* (* (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945)))) (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))))) |
| 0.6b | (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) |
| 0.6b | (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) |
| 0.6b | (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) |
| 10× | cbrt-prod |
| 7× | add-cube-cbrt |
| 7× | *-un-lft-identity |
| 7× | add-sqr-sqrt |
| 4× | add-log-exp |
| 4× | log1p-expm1-u |
| 4× | add-exp-log |
| 4× | pow1/3 |
| 4× | add-cbrt-cube |
| 4× | pow1 |
| 4× | expm1-log1p-u |
| 1× | rem-cbrt-cube |
| 1× | pow3 |
| 13.0ms | (cbrt (* (* (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945)))) (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))))) |
| 1.0ms | (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) |
| 1.0ms | (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) |
| 1.0ms | (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) |
| 135.0ms | (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) |
| 134.0ms | (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) |
| 132.0ms | (cbrt (* (* (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945)))) (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))))) |
| 111.0ms | (cbrt (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945))) |
| 819.0ms | (+ (* 7/2 (/ (exp (* 1/3 (- (log 2/945) (* 5 (log (/ 1 x)))))) (pow x 2))) (+ (exp (* 1/3 (- (log 2/945) (* 5 (log (/ 1 x)))))) (* 161/4 (/ (exp (* 1/3 (- (log 2/945) (* 5 (log (/ 1 x)))))) (pow x 4))))) |
| 460.0ms | (+ (* 7/2 (/ (exp (* 1/3 (- (log 2/945) (* 5 (log (/ 1 x)))))) (pow x 2))) (+ (exp (* 1/3 (- (log 2/945) (* 5 (log (/ 1 x)))))) (* 161/4 (/ (exp (* 1/3 (- (log 2/945) (* 5 (log (/ 1 x)))))) (pow x 4))))) |
| 419.0ms | (+ (* 7/2 (/ (exp (* 1/3 (- (log 2/945) (* 5 (log (/ 1 x)))))) (pow x 2))) (+ (exp (* 1/3 (- (log 2/945) (* 5 (log (/ 1 x)))))) (* 161/4 (/ (exp (* 1/3 (- (log 2/945) (* 5 (log (/ 1 x)))))) (pow x 4))))) |
| 393.0ms | (+ (* 7/2 (/ (exp (* 1/3 (- (log 2/945) (* 5 (log (/ 1 x)))))) (pow x 2))) (+ (exp (* 1/3 (- (log 2/945) (* 5 (log (/ 1 x)))))) (* 161/4 (/ (exp (* 1/3 (- (log 2/945) (* 5 (log (/ 1 x)))))) (pow x 4))))) |
| 342.0ms | (+ (exp (* 1/3 (+ (log 1/3) (log x)))) (+ (* 23/14175 (* (pow x 4) (exp (* 1/3 (+ (log 1/3) (log x)))))) (* 1/45 (* (pow x 2) (exp (* 1/3 (+ (log 1/3) (log x)))))))) |
14 alts after pruning (12 fresh and 2 done)
Merged error: 0.2b
0% (0.1b remaining)
Error of 0.3b against oracle of 0.2b and baseline of 0.3b