



Bits error versus x
| Original | 60.0 |
|---|---|
| Target | 0.1 |
| Herbie | 0.4 |
Initial program 60.0
Taylor expanded around 0 0.3
Simplified0.3
rmApplied add-log-exp0.4
rmApplied add-cube-cbrt0.4
Applied log-prod0.4
Final simplification0.4
herbie shell --seed 2018360 +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: 11.9s)Debug log
1 alts after pruning (1 fresh and 0 done)
Merged error: 59.7b
Found 2 expressions with local error:
| 2.1b | (- (/ 1 x) (/ 1 (tan x))) |
| 0.0b | (/ 1 (tan x)) |
2 calls. Slowest were:
| 9.0ms | (- (/ 1 x) (/ 1 (tan x))) |
| 2.0ms | (/ 1 (tan x)) |
2 calls. Slowest were:
| 65.0ms | (- (/ 1 x) (/ 1 (tan x))) |
| 38.0ms | (/ 1 (tan x)) |
62 calls. Slowest were:
| 189.0ms | (- (/ 1 x) (+ (* 1/3 x) (* 1/45 (pow x 3)))) |
| 83.0ms | (fma (* (cbrt (/ 1 x)) (cbrt (/ 1 x))) (cbrt (/ 1 x)) (- (* (cos x) (/ 1 (sin x))))) |
| 83.0ms | (fma 1 (/ 1 x) (- (* (cos x) (/ 1 (sin x))))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 0.4b
Found 3 expressions with local error:
| 0.4b | (fma x (fma 1/45 (* x x) 1/3) (* (pow x 5) 2/945)) |
| 0.1b | (* (pow x 5) 2/945) |
| 0.0b | (fma 1/45 (* x x) 1/3) |
3 calls. Slowest were:
| 4.0ms | (* (pow x 5) 2/945) |
| 0.0ms | (fma x (fma 1/45 (* x x) 1/3) (* (pow x 5) 2/945)) |
| 0.0ms | (fma 1/45 (* x x) 1/3) |
3 calls. Slowest were:
| 43.0ms | (fma x (fma 1/45 (* x x) 1/3) (* (pow x 5) 2/945)) |
| 38.0ms | (fma 1/45 (* x x) 1/3) |
| 35.0ms | (* (pow x 5) 2/945) |
11 calls. Slowest were:
| 53.0ms | (+ (* 1/3 x) (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5)))) |
| 45.0ms | (+ (* 1/3 x) (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5)))) |
| 31.0ms | (+ (* 1/3 x) (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5)))) |
4 alts after pruning (4 fresh and 0 done)
Merged error: 0.3b
Found 4 expressions with local error:
| 1.3b | (log (exp (* (pow x 5) 2/945))) |
| 0.4b | (fma x (fma 1/45 (* x x) 1/3) (log (exp (* (pow x 5) 2/945)))) |
| 0.1b | (* (pow x 5) 2/945) |
| 0.0b | (fma 1/45 (* x x) 1/3) |
4 calls. Slowest were:
| 4.0ms | (log (exp (* (pow x 5) 2/945))) |
| 4.0ms | (* (pow x 5) 2/945) |
| 0.0ms | (fma x (fma 1/45 (* x x) 1/3) (log (exp (* (pow x 5) 2/945)))) |
4 calls. Slowest were:
| 42.0ms | (fma x (fma 1/45 (* x x) 1/3) (log (exp (* (pow x 5) 2/945)))) |
| 34.0ms | (fma 1/45 (* x x) 1/3) |
| 34.0ms | (log (exp (* (pow x 5) 2/945))) |
| 33.0ms | (* (pow x 5) 2/945) |
18 calls. Slowest were:
| 34.0ms | (+ (* 1/3 x) (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5)))) |
| 33.0ms | (+ (* 1/3 x) (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5)))) |
| 32.0ms | (+ (* 1/3 x) (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5)))) |
4 alts after pruning (4 fresh and 0 done)
Merged error: 0.3b
Found 4 expressions with local error:
| 1.4b | (log (cbrt (exp (* (pow x 5) 2/945)))) |
| 1.4b | (log (* (cbrt (exp (* (pow x 5) 2/945))) (cbrt (exp (* (pow x 5) 2/945))))) |
| 0.4b | (fma x (fma 1/45 (* x x) 1/3) (+ (log (* (cbrt (exp (* (pow x 5) 2/945))) (cbrt (exp (* (pow x 5) 2/945))))) (log (cbrt (exp (* (pow x 5) 2/945)))))) |
| 0.1b | (* (pow x 5) 2/945) |
4 calls. Slowest were:
| 9.0ms | (log (* (cbrt (exp (* (pow x 5) 2/945))) (cbrt (exp (* (pow x 5) 2/945))))) |
| 2.0ms | (log (cbrt (exp (* (pow x 5) 2/945)))) |
| 2.0ms | (* (pow x 5) 2/945) |
4 calls. Slowest were:
| 1.6s | (log (cbrt (exp (* (pow x 5) 2/945)))) |
| 1.6s | (log (* (cbrt (exp (* (pow x 5) 2/945))) (cbrt (exp (* (pow x 5) 2/945))))) |
| 407.0ms | (fma x (fma 1/45 (* x x) 1/3) (+ (log (* (cbrt (exp (* (pow x 5) 2/945))) (cbrt (exp (* (pow x 5) 2/945))))) (log (cbrt (exp (* (pow x 5) 2/945)))))) |
| 22.0ms | (* (pow x 5) 2/945) |
27 calls. Slowest were:
| 544.0ms | (+ (* 1/3 x) (+ (* 1/45 (pow x 3)) (+ (log (pow (pow (exp (* 2/945 (pow x 5))) 2) 1/3)) (* 2/2835 (pow x 5))))) |
| 514.0ms | (+ (* 1/3 x) (+ (* 1/45 (pow x 3)) (+ (log (pow (pow (exp (* 2/945 (pow x 5))) 2) 1/3)) (* 2/2835 (pow x 5))))) |
| 62.0ms | (log (pow (pow (exp (* 2/945 (pow x 5))) 2) 1/3)) |
4 alts after pruning (3 fresh and 1 done)
Merged error: 0.3b
0% (0.1b remaining)
Error of 0.4b against oracle of 0.3b and baseline of 0.4b