



Bits error versus re




Bits error versus im
| Original | 57.9 |
|---|---|
| Target | 0.3 |
| Herbie | 0.8 |
Initial program 57.9
Taylor expanded around 0 0.8
Simplified0.8
Final simplification0.8
herbie shell --seed 2018362 +o rules:numerics
(FPCore (re im)
:name "math.sin on complex, imaginary part"
:herbie-target
(if (< (fabs im) 1) (- (* (cos re) (+ (+ im (* (* (* 1/6 im) im) im)) (* (* (* (* (* 1/120 im) im) im) im) im)))) (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))))
(* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))))
Time bar (total: 23.9s)Debug log
2 alts after pruning (2 fresh and 0 done)
Merged error: 57.9b
Found 2 expressions with local error:
| 5.4b | (- (exp (- 0 im)) (exp im)) |
| 0.0b | (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))) |
2 calls. Slowest were:
| 16.0ms | (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))) |
| 12.0ms | (- (exp (- 0 im)) (exp im)) |
2 calls. Slowest were:
| 118.0ms | (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im))) |
| 67.0ms | (- (exp (- 0 im)) (exp im)) |
88 calls. Slowest were:
| 711.0ms | (* (fma (- (cbrt (exp im))) (* (cbrt (exp im)) (cbrt (exp im))) (* (cbrt (exp im)) (* (cbrt (exp im)) (cbrt (exp im))))) (* 0.5 (cos re))) |
| 377.0ms | (* (* 0.5 (cos re)) (fma (- (exp im)) 1 (* (exp im) 1))) |
| 354.0ms | (* (* 0.5 (cos re)) (fma (- (exp im)) 1 (* (exp im) 1))) |
3 alts after pruning (3 fresh and 0 done)
Merged error: 0.1b
Found 3 expressions with local error:
| 0.1b | (* (* 0.5 (cos 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 (cos 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:
| 154.0ms | (* (* 0.5 (cos 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)) |
| 34.0ms | (* (pow im 5) -1/60) |
19 calls. Slowest were:
| 516.0ms | (* (* 0.5 (cos re)) (fma im (fma -1/3 (* im im) -2) (* (pow im 5) -1/60))) |
| 318.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
| 257.0ms | (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) |
9 alts after pruning (8 fresh and 1 done)
Merged error: 0.1b
Found 3 expressions with local error:
| 0.1b | (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)))) |
| 0.0b | (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))) |
| 0.0b | (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)) |
3 calls. Slowest were:
| 5.0ms | (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)))) |
| 0.0ms | (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))) |
| 0.0ms | (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)) |
3 calls. Slowest were:
| 139.0ms | (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)))) |
| 42.0ms | (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))) |
| 37.0ms | (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)) |
25 calls. Slowest were:
| 327.0ms | (* (- (cos re)) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)))) |
| 262.0ms | (* (cos re) (fma 0.008333333333333333 (pow im 5) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im)))) |
| 261.0ms | (* (- (cos re)) (fma (* im im) (* 0.16666666666666666 im) (* 1.0 im))) |
10 alts after pruning (9 fresh and 1 done)
Merged error: 0.0b
Found 4 expressions with local error:
| 0.3b | (cbrt (cos re)) |
| 0.3b | (cbrt (cos re)) |
| 0.3b | (cbrt (cos re)) |
| 0.3b | (* (cbrt (cos re)) (cbrt (cos re))) |
4 calls. Slowest were:
| 5.0ms | (* (cbrt (cos re)) (cbrt (cos re))) |
| 1.0ms | (cbrt (cos re)) |
| 1.0ms | (cbrt (cos re)) |
4 calls. Slowest were:
| 230.0ms | (* (cbrt (cos re)) (cbrt (cos re))) |
| 201.0ms | (cbrt (cos re)) |
| 155.0ms | (cbrt (cos re)) |
| 154.0ms | (cbrt (cos re)) |
41 calls. Slowest were:
| 120.0ms | (- 1 (+ (* 1/405 (pow re 6)) (* 1/3 (pow re 2)))) |
| 118.0ms | (- 1 (+ (* 1/6 (pow re 2)) (* 1/72 (pow re 4)))) |
| 115.0ms | (- 1 (+ (* 1/6 (pow re 2)) (* 1/72 (pow re 4)))) |
10 alts after pruning (8 fresh and 2 done)
Merged error: 0.0b
0% (0.7b remaining)
Error of 0.8b against oracle of 0.1b and baseline of 0.8b