


Bits error versus re



Bits error versus im
Results
Initial program 37.2
Simplified13.0
Final simplification13.0
herbie shell --seed 2019022 +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: 7.9s)Debug log
| 21.0ms | 188× | body | 80 | valid |
| 13.0ms | 21× | body | 2560 | valid |
| 11.0ms | 21× | body | 1280 | valid |
| 9.0ms | 12× | body | 5120 | valid |
| 2.0ms | 7× | body | 640 | valid |
| 1.0ms | 4× | body | 320 | valid |
| 0.0ms | 3× | body | 160 | valid |
| 65.0ms | (* 0.5 (sqrt (* 2.0 (- (sqrt (+ (* re re) (* im im))) re)))) |
2 alts after pruning (2 fresh and 0 done)
Merged error: 14.6b
Found 3 expressions with local error:
| 0.6b | (- (hypot re im) re) |
| 0.0b | (hypot re im) |
| 0.0b | (sqrt (* (- (hypot re im) re) 2.0)) |
| 4× | add-cube-cbrt |
| 4× | *-un-lft-identity |
| 4× | add-sqr-sqrt |
| 3× | add-log-exp |
| 3× | log1p-expm1-u |
| 3× | add-exp-log |
| 3× | fma-neg |
| 3× | add-cbrt-cube |
| 3× | pow1 |
| 3× | expm1-log1p-u |
| 2× | flip-- |
| 2× | associate-*l/ |
| 2× | sqrt-div |
| 2× | flip3-- |
| 1× | sqrt-prod |
| 1× | pow1/2 |
| 1× | sub-neg |
| 1× | hypot-udef |
| 9.0ms | (- (hypot re im) re) |
| 6.0ms | (sqrt (* (- (hypot re im) re) 2.0)) |
| 0.0ms | (hypot re im) |
| 104.0ms | (sqrt (* (- (hypot re im) re) 2.0)) |
| 69.0ms | (- (hypot re im) re) |
| 31.0ms | (hypot re im) |
| 181.0ms | (sqrt (* (- (* (hypot re im) (hypot re im)) (* re re)) 2.0)) |
| 76.0ms | (sqrt (* (- (pow (hypot re im) 3) (pow re 3)) 2.0)) |
| 6.0ms | (sqrt (- (hypot re im) re)) |
| 3.0ms | (- im re) |
| 2.0ms | (* -1 re) |
7 alts after pruning (6 fresh and 1 done)
Merged error: 14.4b
Found 4 expressions with local error:
| 12.1b | (- (* (* (cbrt (hypot re im)) (cbrt (hypot re im))) (cbrt (hypot re im))) re) |
| 0.5b | (* (cbrt (hypot re im)) (cbrt (hypot re im))) |
| 0.5b | (cbrt (hypot re im)) |
| 0.5b | (cbrt (hypot re im)) |
| 12× | cbrt-prod |
| 10× | add-cube-cbrt |
| 10× | *-un-lft-identity |
| 10× | add-sqr-sqrt |
| 9× | pow1 |
| 6× | add-exp-log |
| 6× | associate-*l* |
| 6× | associate-*r* |
| 6× | pow1/3 |
| 4× | add-log-exp |
| 4× | log1p-expm1-u |
| 4× | add-cbrt-cube |
| 4× | expm1-log1p-u |
| 2× | pow-prod-up |
| 2× | pow-prod-down |
| 1× | flip-- |
| 1× | cbrt-unprod |
| 1× | *-commutative |
| 1× | prod-exp |
| 1× | fma-neg |
| 1× | flip3-- |
| 1× | pow-plus |
| 1× | sub-neg |
| 1× | pow2 |
| 15.0ms | (- (* (* (cbrt (hypot re im)) (cbrt (hypot re im))) (cbrt (hypot re im))) re) |
| 5.0ms | (* (cbrt (hypot re im)) (cbrt (hypot re im))) |
| 1.0ms | (cbrt (hypot re im)) |
| 1.0ms | (cbrt (hypot re im)) |
| 154.0ms | (* (cbrt (hypot re im)) (cbrt (hypot re im))) |
| 105.0ms | (cbrt (hypot re im)) |
| 94.0ms | (cbrt (hypot re im)) |
| 48.0ms | (- (* (* (cbrt (hypot re im)) (cbrt (hypot re im))) (cbrt (hypot re im))) re) |
| 50.0ms | (+ (* 1/6 (* (pow re 2) (pow (/ 1 (pow im 5)) 1/3))) (pow im 1/3)) |
| 33.0ms | (+ (pow im 2/3) (* 1/3 (* (pow re 2) (pow (/ 1 (pow im 4)) 1/3)))) |
| 30.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) |
12 alts after pruning (11 fresh and 1 done)
Merged error: 14.4b
Found 4 expressions with local error:
| 16.6b | (fma (sqrt (hypot re im)) (sqrt (hypot re im)) (- re)) |
| 0.0b | (sqrt (* (fma (sqrt (hypot re im)) (sqrt (hypot re im)) (- re)) 2.0)) |
| 0.0b | (hypot re im) |
| 0.0b | (hypot re im) |
| 4× | add-log-exp |
| 4× | log1p-expm1-u |
| 4× | add-cube-cbrt |
| 4× | add-exp-log |
| 4× | add-cbrt-cube |
| 4× | *-un-lft-identity |
| 4× | pow1 |
| 4× | expm1-log1p-u |
| 4× | add-sqr-sqrt |
| 2× | hypot-udef |
| 1× | fma-udef |
| 1× | sqrt-prod |
| 1× | pow1/2 |
| 1.0ms | (sqrt (* (fma (sqrt (hypot re im)) (sqrt (hypot re im)) (- re)) 2.0)) |
| 0.0ms | (fma (sqrt (hypot re im)) (sqrt (hypot re im)) (- re)) |
| 0.0ms | (hypot re im) |
| 0.0ms | (hypot re im) |
| 114.0ms | (sqrt (* (fma (sqrt (hypot re im)) (sqrt (hypot re im)) (- re)) 2.0)) |
| 77.0ms | (fma (sqrt (hypot re im)) (sqrt (hypot re im)) (- re)) |
| 29.0ms | (hypot re im) |
| 28.0ms | (hypot re im) |
| 7.0ms | (sqrt (fma (sqrt (hypot re im)) (sqrt (hypot re im)) (- re))) |
| 2.0ms | (- im re) |
| 1.0ms | (* -1 re) |
| 1.0ms | (* -1 re) |
| 0.0ms | re |
17 alts after pruning (16 fresh and 1 done)
Merged error: 14.4b
Found 4 expressions with local error:
| 12.1b | (- (* (* (* (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im)))) (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im))))) (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im))))) (cbrt (hypot re im))) re) |
| 0.5b | (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im)))) |
| 0.5b | (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im)))) |
| 0.5b | (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im)))) |
| 4× | add-log-exp |
| 4× | log1p-expm1-u |
| 4× | add-cube-cbrt |
| 4× | add-exp-log |
| 4× | add-cbrt-cube |
| 4× | *-un-lft-identity |
| 4× | pow1 |
| 4× | expm1-log1p-u |
| 4× | add-sqr-sqrt |
| 3× | pow1/3 |
| 3× | cbrt-prod |
| 1× | flip-- |
| 1× | fma-neg |
| 1× | flip3-- |
| 1× | sub-neg |
| 117.0ms | (- (* (* (* (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im)))) (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im))))) (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im))))) (cbrt (hypot re im))) re) |
| 5.0ms | (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im)))) |
| 5.0ms | (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im)))) |
| 5.0ms | (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im)))) |
| 101.0ms | (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im)))) |
| 94.0ms | (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im)))) |
| 90.0ms | (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im)))) |
| 42.0ms | (- (* (* (* (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im)))) (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im))))) (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im))))) (cbrt (hypot re im))) re) |
| 28.0ms | (+ (* 1/9 (* (pow re 2) (pow (/ 1 (pow im 16)) 1/9))) (pow im 2/9)) |
| 25.0ms | (+ (* 1/9 (* (pow re 2) (pow (/ 1 (pow im 16)) 1/9))) (pow im 2/9)) |
| 23.0ms | (+ (* 1/9 (* (pow re 2) (pow (/ 1 (pow im 16)) 1/9))) (pow im 2/9)) |
| 4.0ms | (* (* (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im)))) (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im))))) (cbrt (* (cbrt (hypot re im)) (cbrt (hypot re im))))) |
| 2.0ms | (pow (/ 1 re) -2/9) |
19 alts after pruning (18 fresh and 1 done)
Merged error: 14.4b
0% (0.2b remaining)
Error of 13.0b against oracle of 12.8b and baseline of 13.0b
| 933.0ms | 6069× | body | 80 | valid |
| 675.0ms | 468× | body | 1280 | valid |
| 494.0ms | 685× | body | 2560 | valid |
| 285.0ms | 301× | body | 5120 | valid |
| 116.0ms | 275× | body | 640 | valid |
| 72.0ms | 138× | body | 320 | valid |
| 13.0ms | 64× | body | 160 | valid |