



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
rmApplied add-log-exp0.3
Final simplification0.3
herbie shell --seed 2019004 +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: 24.3s)Debug log
1 calls. Slowest were:
| 5.0ms | (- (/ 1 x) (/ 1 (tan x))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 59.6b
Found 2 expressions with local error:
| 3.5b | (- (/ 1 x) (/ 1 (tan x))) |
| 0.0b | (/ 1 (tan x)) |
2 calls. Slowest were:
| 4.0ms | (- (/ 1 x) (/ 1 (tan x))) |
| 1.0ms | (/ 1 (tan x)) |
2 calls. Slowest were:
| 77.0ms | (- (/ 1 x) (/ 1 (tan x))) |
| 48.0ms | (/ 1 (tan x)) |
62 calls. Slowest were:
| 160.0ms | (- (/ 1 x) (+ (* 1/3 x) (* 1/45 (pow x 3)))) |
| 116.0ms | (fma (- (cos x)) (/ 1 (sin x)) (* (cos x) (/ 1 (sin x)))) |
| 91.0ms | (fma (- (cos x)) (/ 1 (sin 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 (fma 1/45 (* x x) 1/3) x (* (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:
| 2.0ms | (* (pow x 5) 2/945) |
| 0.0ms | (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945)) |
| 0.0ms | (fma 1/45 (* x x) 1/3) |
3 calls. Slowest were:
| 36.0ms | (* (pow x 5) 2/945) |
| 33.0ms | (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945)) |
| 22.0ms | (fma 1/45 (* x x) 1/3) |
11 calls. Slowest were:
| 70.0ms | (+ (* 1/3 x) (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5)))) |
| 63.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)))) |
5 alts after pruning (5 fresh and 0 done)
Merged error: 0.3b
Found 4 expressions with local error:
| 0.4b | (fma (log (exp (fma 1/45 (* x x) 1/3))) x (* (pow x 5) 2/945)) |
| 0.1b | (* (pow x 5) 2/945) |
| 0.0b | (log (exp (fma 1/45 (* x x) 1/3))) |
| 0.0b | (fma 1/45 (* x x) 1/3) |
4 calls. Slowest were:
| 2.0ms | (* (pow x 5) 2/945) |
| 2.0ms | (log (exp (fma 1/45 (* x x) 1/3))) |
| 0.0ms | (fma (log (exp (fma 1/45 (* x x) 1/3))) x (* (pow x 5) 2/945)) |
4 calls. Slowest were:
| 39.0ms | (fma (log (exp (fma 1/45 (* x x) 1/3))) x (* (pow x 5) 2/945)) |
| 37.0ms | (log (exp (fma 1/45 (* x x) 1/3))) |
| 35.0ms | (* (pow x 5) 2/945) |
| 34.0ms | (fma 1/45 (* x x) 1/3) |
21 calls. Slowest were:
| 91.0ms | (+ (* 1/3 x) (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5)))) |
| 61.0ms | (+ (* 1/3 x) (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5)))) |
| 56.0ms | (+ (* 1/3 x) (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5)))) |
5 alts after pruning (4 fresh and 1 done)
Merged error: 0.3b
Found 4 expressions with local error:
| 1.0b | (* (cbrt (log (exp (fma 1/45 (* x x) 1/3)))) (cbrt (log (exp (fma 1/45 (* x x) 1/3))))) |
| 0.4b | (fma (* (* (cbrt (log (exp (fma 1/45 (* x x) 1/3)))) (cbrt (log (exp (fma 1/45 (* x x) 1/3))))) (cbrt (log (exp (fma 1/45 (* x x) 1/3))))) x (* (pow x 5) 2/945)) |
| 0.1b | (* (pow x 5) 2/945) |
| 0.0b | (log (exp (fma 1/45 (* x x) 1/3))) |
4 calls. Slowest were:
| 14.0ms | (* (cbrt (log (exp (fma 1/45 (* x x) 1/3)))) (cbrt (log (exp (fma 1/45 (* x x) 1/3))))) |
| 4.0ms | (* (pow x 5) 2/945) |
| 4.0ms | (log (exp (fma 1/45 (* x x) 1/3))) |
4 calls. Slowest were:
| 175.0ms | (* (cbrt (log (exp (fma 1/45 (* x x) 1/3)))) (cbrt (log (exp (fma 1/45 (* x x) 1/3))))) |
| 44.0ms | (fma (* (* (cbrt (log (exp (fma 1/45 (* x x) 1/3)))) (cbrt (log (exp (fma 1/45 (* x x) 1/3))))) (cbrt (log (exp (fma 1/45 (* x x) 1/3))))) x (* (pow x 5) 2/945)) |
| 32.0ms | (log (exp (fma 1/45 (* x x) 1/3))) |
| 19.0ms | (* (pow x 5) 2/945) |
49 calls. Slowest were:
| 306.0ms | (- (+ (pow 1/9 1/3) (* 2/45 (* (pow x 2) (pow 1/9 1/3)))) (* 1/2025 (* (pow x 4) (pow 1/9 1/3)))) |
| 282.0ms | (* (log (exp (fma 1/45 (* x x) 1/3))) (log (exp (fma 1/45 (* x x) 1/3)))) |
| 282.0ms | (* (log (exp (fma 1/45 (* x x) 1/3))) (log (exp (fma 1/45 (* x x) 1/3)))) |
7 alts after pruning (5 fresh and 2 done)
Merged error: 0.1b
0% (0.3b remaining)
Error of 0.3b against oracle of 0.1b and baseline of 0.3b