



Bits error versus re




Bits error versus im
| Original | 43.4 |
|---|---|
| Target | 0.3 |
| Herbie | 0.7 |
Initial program 43.4
Taylor expanded around 0 0.7
Simplified0.7
Final simplification0.7
herbie shell --seed 2019008 +o rules:numerics
(FPCore (re im)
:name "math.cos on complex, imaginary part"
:herbie-target
(if (< (fabs im) 1) (- (* (sin re) (+ (+ im (* (* (* 1/6 im) im) im)) (* (* (* (* (* 1/120 im) im) im) im) im)))) (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))
(* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))
Time bar (total: 32.4s)Debug log
1 calls. Slowest were:
| 234.0ms | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 45.6b
Found 2 expressions with local error:
| 5.0b | (- (exp (- im)) (exp im)) |
| 0.0b | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
2 calls. Slowest were:
| 16.0ms | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
| 13.0ms | (- (exp (- im)) (exp im)) |
2 calls. Slowest were:
| 129.0ms | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
| 61.0ms | (- (exp (- im)) (exp im)) |
62 calls. Slowest were:
| 320.0ms | (* (fma (- (exp im)) 1 (* (exp im) 1)) (* 0.5 (sin re))) |
| 318.0ms | (* (* 0.5 (sin re)) (fma (- (exp im)) 1 (* (exp im) 1))) |
| 305.0ms | (* (* 0.5 (sin re)) (fma (- (cbrt (exp im))) (* (cbrt (exp im)) (cbrt (exp im))) (* (cbrt (exp im)) (* (cbrt (exp im)) (cbrt (exp im)))))) |
2 alts after pruning (1 fresh and 1 done)
Merged error: 0.1b
Found 3 expressions with local error:
| 0.1b | (* (* 0.5 (sin re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 0.1b | (* (pow im 5) -1/60) |
| 0.0b | (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)) |
3 calls. Slowest were:
| 5.0ms | (* (* 0.5 (sin re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 2.0ms | (* (pow im 5) -1/60) |
| 0.0ms | (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)) |
3 calls. Slowest were:
| 164.0ms | (* (* 0.5 (sin re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 40.0ms | (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)) |
| 36.0ms | (* (pow im 5) -1/60) |
19 calls. Slowest were:
| 519.0ms | (* (* 0.5 (sin re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 268.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
| 262.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
10 alts after pruning (8 fresh and 2 done)
Merged error: 0.0b
Found 3 expressions with local error:
| 0.1b | (* (- (sin re)) (fma (* im im) (* im 0.16666666666666666) (* 1.0 im))) |
| 0.0b | (* (- (sin re)) (pow im 5)) |
| 0.0b | (fma (* (- (sin re)) (pow im 5)) 0.008333333333333333 (* (- (sin re)) (fma (* im im) (* im 0.16666666666666666) (* 1.0 im)))) |
3 calls. Slowest were:
| 5.0ms | (* (- (sin re)) (fma (* im im) (* im 0.16666666666666666) (* 1.0 im))) |
| 5.0ms | (* (- (sin re)) (pow im 5)) |
| 0.0ms | (fma (* (- (sin re)) (pow im 5)) 0.008333333333333333 (* (- (sin re)) (fma (* im im) (* im 0.16666666666666666) (* 1.0 im)))) |
3 calls. Slowest were:
| 177.0ms | (fma (* (- (sin re)) (pow im 5)) 0.008333333333333333 (* (- (sin re)) (fma (* im im) (* im 0.16666666666666666) (* 1.0 im)))) |
| 115.0ms | (* (- (sin re)) (fma (* im im) (* im 0.16666666666666666) (* 1.0 im))) |
| 112.0ms | (* (- (sin re)) (pow im 5)) |
39 calls. Slowest were:
| 305.0ms | (- (+ (* 0.16666666666666666 (* (sin re) (pow im 3))) (* 1.0 (* (sin re) im)))) |
| 299.0ms | (- (+ (* 0.16666666666666666 (* (sin re) (pow im 3))) (+ (* 1.0 (* (sin re) im)) (* 0.008333333333333333 (* (sin re) (pow im 5)))))) |
| 272.0ms | (- (+ (* 0.16666666666666666 (* (sin re) (pow im 3))) (* 1.0 (* (sin re) im)))) |
11 alts after pruning (9 fresh and 2 done)
Merged error: 0.0b
Found 4 expressions with local error:
| 0.6b | (cbrt (- (sin re))) |
| 0.6b | (cbrt (- (sin re))) |
| 0.6b | (cbrt (- (sin re))) |
| 0.5b | (* (cbrt (- (sin re))) (cbrt (- (sin re)))) |
4 calls. Slowest were:
| 10.0ms | (* (cbrt (- (sin re))) (cbrt (- (sin re)))) |
| 4.0ms | (cbrt (- (sin re))) |
| 1.0ms | (cbrt (- (sin re))) |
4 calls. Slowest were:
| 556.0ms | (cbrt (- (sin re))) |
| 265.0ms | (* (cbrt (- (sin re))) (cbrt (- (sin re)))) |
| 222.0ms | (cbrt (- (sin re))) |
| 215.0ms | (cbrt (- (sin re))) |
76 calls. Slowest were:
| 470.0ms | (- (* (pow re 1/3) (cbrt -1)) (+ (* 1/3240 (* (pow (pow re 13) 1/3) (cbrt -1))) (* 1/18 (* (pow (pow re 7) 1/3) (cbrt -1))))) |
| 423.0ms | (- (* (pow re 1/3) (cbrt -1)) (+ (* 1/3240 (* (pow (pow re 13) 1/3) (cbrt -1))) (* 1/18 (* (pow (pow re 7) 1/3) (cbrt -1))))) |
| 382.0ms | (- (* (pow re 1/3) (cbrt -1)) (+ (* 1/3240 (* (pow (pow re 13) 1/3) (cbrt -1))) (* 1/18 (* (pow (pow re 7) 1/3) (cbrt -1))))) |
10 alts after pruning (8 fresh and 2 done)
Merged error: 0b
0% (0.6b remaining)
Error of 0.7b against oracle of 0.1b and baseline of 0.7b