



Bits error versus re




Bits error versus im
| Original | 43.5 |
|---|---|
| Target | 0.3 |
| Herbie | 0.8 |
Initial program 43.5
Taylor expanded around 0 0.8
Simplified0.9
Taylor expanded around inf 0.8
Simplified0.8
Final simplification0.8
herbie shell --seed 2018362 +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: 21.5s)Debug log
2 alts after pruning (2 fresh and 0 done)
Merged error: 45.7b
Found 2 expressions with local error:
| 5.4b | (- (exp (- im)) (exp im)) |
| 0.0b | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
2 calls. Slowest were:
| 27.0ms | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
| 12.0ms | (- (exp (- im)) (exp im)) |
2 calls. Slowest were:
| 121.0ms | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
| 57.0ms | (- (exp (- im)) (exp im)) |
62 calls. Slowest were:
| 356.0ms | (* (* 0.5 (sin re)) (fma (- (exp im)) 1 (* (exp im) 1))) |
| 332.0ms | (* (* 0.5 (sin re)) (fma (- (exp im)) 1 (* (exp im) 1))) |
| 311.0ms | (* (* 0.5 (sin re)) (fma (- (cbrt (exp im))) (* (cbrt (exp im)) (cbrt (exp im))) (* (cbrt (exp im)) (* (cbrt (exp im)) (cbrt (exp im)))))) |
3 alts after pruning (3 fresh and 0 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:
| 8.0ms | (* (* 0.5 (sin re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 4.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:
| 143.0ms | (* (* 0.5 (sin re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 32.0ms | (* (pow im 5) -1/60) |
| 23.0ms | (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60)) |
19 calls. Slowest were:
| 504.0ms | (* (* 0.5 (sin re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 336.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
| 283.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
9 alts after pruning (9 fresh and 0 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 (* im im) (* im 0.16666666666666666) (* 1.0 im)) |
3 calls. Slowest were:
| 10.0ms | (* (- (sin re)) (fma (* im im) (* im 0.16666666666666666) (* 1.0 im))) |
| 9.0ms | (* (- (sin re)) (pow im 5)) |
| 0.0ms | (fma (* im im) (* im 0.16666666666666666) (* 1.0 im)) |
3 calls. Slowest were:
| 138.0ms | (* (- (sin re)) (pow im 5)) |
| 125.0ms | (* (- (sin re)) (fma (* im im) (* im 0.16666666666666666) (* 1.0 im))) |
| 59.0ms | (fma (* im im) (* im 0.16666666666666666) (* 1.0 im)) |
39 calls. Slowest were:
| 361.0ms | (- (+ (* 0.16666666666666666 (* (sin re) (pow im 3))) (* 1.0 (* (sin re) im)))) |
| 303.0ms | (- (+ (* 0.16666666666666666 (* (sin re) (pow im 3))) (* 1.0 (* (sin re) im)))) |
| 298.0ms | (* (- (sin re)) (fma (* im im) (* im 0.16666666666666666) (* 1.0 im))) |
8 alts after pruning (7 fresh and 1 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:
| 8.0ms | (* (cbrt (- (sin re))) (cbrt (- (sin re)))) |
| 2.0ms | (cbrt (- (sin re))) |
| 2.0ms | (cbrt (- (sin re))) |
4 calls. Slowest were:
| 249.0ms | (* (cbrt (- (sin re))) (cbrt (- (sin re)))) |
| 226.0ms | (cbrt (- (sin re))) |
| 208.0ms | (cbrt (- (sin re))) |
| 195.0ms | (cbrt (- (sin re))) |
76 calls. Slowest were:
| 432.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))))) |
| 402.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))))) |
| 386.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))))) |
8 alts after pruning (7 fresh and 1 done)
Merged error: 0.0b
0% (0.8b remaining)
Error of 0.8b against oracle of 0.1b and baseline of 0.8b