


Bits error versus re



Bits error versus im
Results
Initial program 37.4
Simplified13.1
Final simplification13.1
herbie shell --seed 2019016 +o rules:numerics
(FPCore (re im)
:name "math.sqrt on complex, imaginary part, im greater than 0 branch"
(* 0.5 (sqrt (* 2.0 (- (sqrt (+ (* re re) (* im im))) re)))))
Time bar (total: 8.3s)Debug log
| 256× | (pre true 80) |
| 208× | (body real 80) |
| 22× | (body real 2560) |
| 11× | (body real 1280) |
| 5× | (body real 320) |
| 5× | (body real 640) |
| 4× | (body real 5120) |
| 1× | (body real 160) |
| 59.0ms | (* 0.5 (sqrt (* 2.0 (- (sqrt (+ (* re re) (* im im))) re)))) |
2 alts after pruning (2 fresh and 0 done)
Merged error: 10.5b
Found 2 expressions with local error:
| 0.5b | (- (hypot re im) re) |
| 0.0b | (hypot re im) |
| 3× | add-cube-cbrt |
| 3× | fma-neg |
| 3× | *-un-lft-identity |
| 3× | add-sqr-sqrt |
| 2× | add-log-exp |
| 2× | log1p-expm1-u |
| 2× | add-exp-log |
| 2× | add-cbrt-cube |
| 2× | pow1 |
| 2× | expm1-log1p-u |
| 1× | flip-- |
| 1× | flip3-- |
| 1× | sub-neg |
| 1× | hypot-udef |
| 8.0ms | (- (hypot re im) re) |
| 0.0ms | (hypot re im) |
| 59.0ms | (- (hypot re im) re) |
| 48.0ms | (hypot re im) |
| 3.0ms | (- im re) |
| 2.0ms | (* -1 re) |
| 2.0ms | (* -2 re) |
| 2.0ms | (* (cbrt (hypot re im)) (cbrt (hypot re im))) |
| 1.0ms | (sqrt (hypot re im)) |
5 alts after pruning (4 fresh and 1 done)
Merged error: 10.4b
Found 3 expressions with local error:
| 11.7b | (fma (sqrt (hypot re im)) (sqrt (hypot re im)) (- re)) |
| 0.0b | (hypot re im) |
| 0.0b | (hypot re im) |
| 3× | add-log-exp |
| 3× | log1p-expm1-u |
| 3× | add-cube-cbrt |
| 3× | add-exp-log |
| 3× | add-cbrt-cube |
| 3× | *-un-lft-identity |
| 3× | pow1 |
| 3× | expm1-log1p-u |
| 3× | add-sqr-sqrt |
| 2× | hypot-udef |
| 1× | fma-udef |
| 0.0ms | (fma (sqrt (hypot re im)) (sqrt (hypot re im)) (- re)) |
| 0.0ms | (hypot re im) |
| 0.0ms | (hypot re im) |
| 98.0ms | (fma (sqrt (hypot re im)) (sqrt (hypot re im)) (- re)) |
| 38.0ms | (hypot re im) |
| 26.0ms | (hypot re im) |
| 2.0ms | (- im re) |
| 1.0ms | (* -1 re) |
| 1.0ms | (* -1 re) |
| 1.0ms | im |
| 0.0ms | im |
10 alts after pruning (8 fresh and 2 done)
Merged error: 10.4b
Found 4 expressions with local error:
| 11.7b | (fma (sqrt (* (* (cbrt (hypot re im)) (cbrt (hypot re im))) (cbrt (hypot re im)))) (sqrt (hypot re im)) (- re)) |
| 0.6b | (cbrt (hypot re im)) |
| 0.6b | (cbrt (hypot re im)) |
| 0.6b | (cbrt (hypot re im)) |
| 9× | cbrt-prod |
| 7× | add-cube-cbrt |
| 7× | *-un-lft-identity |
| 7× | add-sqr-sqrt |
| 4× | add-log-exp |
| 4× | log1p-expm1-u |
| 4× | add-exp-log |
| 4× | add-cbrt-cube |
| 4× | pow1 |
| 4× | expm1-log1p-u |
| 3× | pow1/3 |
| 1× | fma-udef |
| 1.0ms | (cbrt (hypot re im)) |
| 1.0ms | (cbrt (hypot re im)) |
| 1.0ms | (cbrt (hypot re im)) |
| 0.0ms | (fma (sqrt (* (* (cbrt (hypot re im)) (cbrt (hypot re im))) (cbrt (hypot re im)))) (sqrt (hypot re im)) (- re)) |
| 121.0ms | (cbrt (hypot re im)) |
| 121.0ms | (fma (sqrt (* (* (cbrt (hypot re im)) (cbrt (hypot re im))) (cbrt (hypot re im)))) (sqrt (hypot re im)) (- re)) |
| 116.0ms | (cbrt (hypot re im)) |
| 111.0ms | (cbrt (hypot re im)) |
| 51.0ms | (+ (* 1/6 (* (pow re 2) (pow (/ 1 (pow im 5)) 1/3))) (pow im 1/3)) |
| 48.0ms | (+ (* 1/6 (* (pow re 2) (pow (/ 1 (pow im 5)) 1/3))) (pow im 1/3)) |
| 28.0ms | (+ (* 1/6 (* (pow re 2) (pow (/ 1 (pow im 5)) 1/3))) (pow im 1/3)) |
| 4.0ms | (pow (/ 1 re) -1/3) |
| 4.0ms | (pow (/ 1 re) -1/3) |
11 alts after pruning (10 fresh and 1 done)
Merged error: 10.4b
Found 4 expressions with local error:
| 8.0b | (+ (* (sqrt (* (* (cbrt (hypot re im)) (cbrt (hypot re im))) (cbrt (hypot re im)))) (sqrt (hypot re im))) (- re)) |
| 0.6b | (cbrt (hypot re im)) |
| 0.6b | (cbrt (hypot re im)) |
| 0.6b | (cbrt (hypot re im)) |
| 9× | cbrt-prod |
| 7× | add-cube-cbrt |
| 7× | *-un-lft-identity |
| 7× | add-sqr-sqrt |
| 6× | add-log-exp |
| 4× | log1p-expm1-u |
| 4× | add-exp-log |
| 4× | add-cbrt-cube |
| 4× | pow1 |
| 4× | expm1-log1p-u |
| 3× | pow1/3 |
| 1× | flip-+ |
| 1× | unsub-neg |
| 1× | flip3-+ |
| 1× | fma-def |
| 1× | sum-log |
| 1× | associate-+r- |
| 1× | +-commutative |
| 1× | neg-sub0 |
| 26.0ms | (+ (* (sqrt (* (* (cbrt (hypot re im)) (cbrt (hypot re im))) (cbrt (hypot re im)))) (sqrt (hypot re im))) (- re)) |
| 1.0ms | (cbrt (hypot re im)) |
| 1.0ms | (cbrt (hypot re im)) |
| 1.0ms | (cbrt (hypot re im)) |
| 99.0ms | (cbrt (hypot re im)) |
| 98.0ms | (cbrt (hypot re im)) |
| 86.0ms | (cbrt (hypot re im)) |
| 30.0ms | (+ (* (sqrt (* (* (cbrt (hypot re im)) (cbrt (hypot re im))) (cbrt (hypot re im)))) (sqrt (hypot re im))) (- re)) |
| 62.0ms | (* (exp (* (sqrt (* (* (cbrt (hypot re im)) (cbrt (hypot re im))) (cbrt (hypot re im)))) (sqrt (hypot re im)))) (exp (- re))) |
| 52.0ms | (+ (* 1/6 (* (pow re 2) (pow (/ 1 (pow im 5)) 1/3))) (pow im 1/3)) |
| 49.0ms | (+ (* 1/6 (* (pow re 2) (pow (/ 1 (pow im 5)) 1/3))) (pow im 1/3)) |
| 25.0ms | (+ (* 1/6 (* (pow re 2) (pow (/ 1 (pow im 5)) 1/3))) (pow im 1/3)) |
| 4.0ms | (sqrt (* (* (cbrt (hypot re im)) (cbrt (hypot re im))) (cbrt (hypot re im)))) |
11 alts after pruning (10 fresh and 1 done)
Merged error: 10.4b
0% (0.2b remaining)
Error of 13.1b against oracle of 12.9b and baseline of 13.1b
| 8000× | (pre true 80) |
| 6040× | (body real 80) |
| 680× | (body real 2560) |
| 480× | (body real 1280) |
| 281× | (body real 640) |
| 281× | (body real 5120) |
| 158× | (body real 320) |
| 80× | (body real 160) |