



Bits error versus re




Bits error versus im
Results
| Original | 43.5 |
|---|---|
| Target | 0.3 |
| Herbie | 0.8 |
Initial program 43.5
Taylor expanded around 0 0.8
Final simplification0.8
herbie shell --seed 2018362
(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: 30.1s)Debug log
1 alts after pruning (1 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:
| 31.0ms | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
| 7.0ms | (- (exp (- im)) (exp im)) |
2 calls. Slowest were:
| 131.0ms | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
| 45.0ms | (- (exp (- im)) (exp im)) |
24 calls. Slowest were:
| 193.0ms | (* 0.5 (* (sin re) (- (exp (* -1 im)) (exp im)))) |
| 182.0ms | (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))) |
| 155.0ms | (* 0.5 (* (sin re) (- (exp (- im)) (exp im)))) |
3 alts after pruning (3 fresh and 0 done)
Merged error: 0.1b
Found 4 expressions with local error:
| 0.1b | (* 1/3 (pow im 3)) |
| 0.1b | (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
| 0.1b | (* 1/60 (pow im 5)) |
| 0.0b | (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))) |
4 calls. Slowest were:
| 43.0ms | (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
| 12.0ms | (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))) |
| 2.0ms | (* 1/3 (pow im 3)) |
4 calls. Slowest were:
| 128.0ms | (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
| 28.0ms | (* 1/3 (pow im 3)) |
| 25.0ms | (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))) |
| 20.0ms | (* 1/60 (pow im 5)) |
39 calls. Slowest were:
| 391.0ms | (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
| 347.0ms | (* (* 0.5 (sin re)) (- (+ (* 1/60 (pow im 5)) (* 2 im)))) |
| 328.0ms | (* (* (* (* 0.5 (sin re)) (* 0.5 (sin re))) (* 0.5 (sin re))) (* (* (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
8 alts after pruning (7 fresh and 1 done)
Merged error: 0.0b
Found 4 expressions with local error:
| 12.2b | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 12.2b | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 12.2b | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 0.5b | (* (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))))) |
4 calls. Slowest were:
| 41.0ms | (* (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))))) |
| 21.0ms | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 11.0ms | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
4 calls. Slowest were:
| 451.0ms | (* (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))))) |
| 359.0ms | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 336.0ms | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 315.0ms | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
49 calls. Slowest were:
| 743.0ms | (* (cbrt (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))))) (cbrt (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))))) |
| 415.0ms | (+ (* 20/3 (/ (* (cbrt -0.5) (exp (* 1/3 (- (log (* 1/60 (sin re))) (* 5 (log (/ 1 im))))))) (pow im 2))) (* (cbrt -0.5) (exp (* 1/3 (- (log (* 1/60 (sin re))) (* 5 (log (/ 1 im)))))))) |
| 368.0ms | (- (+ (* (cbrt -0.5) (exp (* 1/3 (+ (log 2) (+ (log im) (log re)))))) (* 1/18 (* (pow im 2) (* (cbrt -0.5) (exp (* 1/3 (+ (log 2) (+ (log im) (log re))))))))) (* 1/18 (* (pow re 2) (* (cbrt -0.5) (exp (* 1/3 (+ (log 2) (+ (log im) (log re))))))))) |
9 alts after pruning (7 fresh and 2 done)
Merged error: 0.0b
Found 4 expressions with local error:
| 12.2b | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 12.2b | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 0.6b | (cbrt (* 0.5 (sin re))) |
| 0.6b | (cbrt (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
4 calls. Slowest were:
| 25.0ms | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 21.0ms | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 15.0ms | (cbrt (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
4 calls. Slowest were:
| 327.0ms | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 313.0ms | (cbrt (* (* 0.5 (sin re)) (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
| 220.0ms | (cbrt (* 0.5 (sin re))) |
| 157.0ms | (cbrt (- (+ (* 1/3 (pow im 3)) (+ (* 1/60 (pow im 5)) (* 2 im))))) |
31 calls. Slowest were:
| 423.0ms | (cbrt (- (+ (pow (* 1/3 (pow im 3)) 3) (pow (+ (* 1/60 (pow im 5)) (* 2 im)) 3)))) |
| 419.0ms | (+ (* 20/3 (/ (* (cbrt -0.5) (exp (* 1/3 (- (log (* 1/60 (sin re))) (* 5 (log (/ 1 im))))))) (pow im 2))) (* (cbrt -0.5) (exp (* 1/3 (- (log (* 1/60 (sin re))) (* 5 (log (/ 1 im)))))))) |
| 400.0ms | (cbrt (- (- (* (* 1/3 (pow im 3)) (* 1/3 (pow im 3))) (* (+ (* 1/60 (pow im 5)) (* 2 im)) (+ (* 1/60 (pow im 5)) (* 2 im)))))) |
10 alts after pruning (7 fresh and 3 done)
Merged error: 0.0b
0% (0.7b remaining)
Error of 0.8b against oracle of 0.2b and baseline of 0.8b