



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 fma-udef0.3
Final simplification0.3
herbie shell --seed 2019007 +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: 20.8s)Debug log
1 calls. Slowest were:
| 9.0ms | (- (/ 1 x) (/ 1 (tan x))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 59.7b
Found 2 expressions with local error:
| 3.1b | (- (/ 1 x) (/ 1 (tan x))) |
| 0.0b | (/ 1 (tan x)) |
2 calls. Slowest were:
| 7.0ms | (- (/ 1 x) (/ 1 (tan x))) |
| 1.0ms | (/ 1 (tan x)) |
2 calls. Slowest were:
| 69.0ms | (- (/ 1 x) (/ 1 (tan x))) |
| 35.0ms | (/ 1 (tan x)) |
62 calls. Slowest were:
| 190.0ms | (- (/ 1 x) (+ (* 1/3 x) (* 1/45 (pow x 3)))) |
| 102.0ms | (fma 1 (/ 1 x) (- (* (cos x) (/ 1 (sin x))))) |
| 90.0ms | (fma (- (cos x)) (/ 1 (sin x)) (* (cos x) (/ 1 (sin x)))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 0.3b
Found 3 expressions with local error:
| 0.3b | (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:
| 4.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:
| 32.0ms | (fma (fma 1/45 (* x x) 1/3) x (* (pow x 5) 2/945)) |
| 29.0ms | (fma 1/45 (* x x) 1/3) |
| 23.0ms | (* (pow x 5) 2/945) |
11 calls. Slowest were:
| 85.0ms | (+ (* 1/3 x) (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5)))) |
| 81.0ms | (+ (* 1/3 x) (+ (* 1/45 (pow x 3)) (* 2/945 (pow x 5)))) |
| 59.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.2b
Found 3 expressions with local error:
| 0.3b | (* (fma 1/45 (* x x) 1/3) x) |
| 0.1b | (* (pow x 5) 2/945) |
| 0.0b | (fma 1/45 (* x x) 1/3) |
3 calls. Slowest were:
| 2.0ms | (* (fma 1/45 (* x x) 1/3) x) |
| 2.0ms | (* (pow x 5) 2/945) |
| 0.0ms | (fma 1/45 (* x x) 1/3) |
3 calls. Slowest were:
| 34.0ms | (* (fma 1/45 (* x x) 1/3) x) |
| 21.0ms | (* (pow x 5) 2/945) |
| 21.0ms | (fma 1/45 (* x x) 1/3) |
13 calls. Slowest were:
| 40.0ms | (+ (* 1/3 x) (* 1/45 (pow x 3))) |
| 39.0ms | (+ (* 1/3 x) (* 1/45 (pow x 3))) |
| 38.0ms | (+ (* 1/3 x) (* 1/45 (pow x 3))) |
5 alts after pruning (4 fresh and 1 done)
Merged error: 0.2b
Found 4 expressions with local error:
| 0.3b | (* (log (exp (fma 1/45 (* x x) 1/3))) x) |
| 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:
| 4.0ms | (* (log (exp (fma 1/45 (* x x) 1/3))) x) |
| 2.0ms | (* (pow x 5) 2/945) |
| 2.0ms | (log (exp (fma 1/45 (* x x) 1/3))) |
4 calls. Slowest were:
| 34.0ms | (log (exp (fma 1/45 (* x x) 1/3))) |
| 32.0ms | (* (log (exp (fma 1/45 (* x x) 1/3))) x) |
| 26.0ms | (* (pow x 5) 2/945) |
| 20.0ms | (fma 1/45 (* x x) 1/3) |
26 calls. Slowest were:
| 46.0ms | (* (cbrt (log (exp (fma 1/45 (* x x) 1/3)))) (cbrt (log (exp (fma 1/45 (* x x) 1/3))))) |
| 45.0ms | (sqrt (log (exp (fma 1/45 (* x x) 1/3)))) |
| 37.0ms | (+ (* 1/3 x) (* 1/45 (pow x 3))) |
5 alts after pruning (3 fresh and 2 done)
Merged error: 0.2b
0% (0.1b remaining)
Error of 0.3b against oracle of 0.3b and baseline of 0.3b