



Bits error versus re




Bits error versus im
| Original | 37.5 |
|---|---|
| Target | 32.7 |
| Herbie | 13.0 |
if re < -4.834562283134786e+206Initial program 62.3
Simplified43.7
rmApplied add-sqr-sqrt43.7
rmApplied add-sqr-sqrt43.7
Applied sqrt-prod43.7
Applied associate-*r*43.7
rmApplied pow143.7
Applied add-sqr-sqrt43.7
Applied pow343.7
Applied pow-prod-up43.7
Simplified43.7
Taylor expanded around -inf 37.0
Simplified37.0
if -4.834562283134786e+206 < re Initial program 35.3
Simplified10.8
Final simplification13.0
herbie shell --seed 2019002 +o rules:numerics
(FPCore (re im)
:name "math.sqrt on complex, real part"
:herbie-target
(if (< re 0) (* 0.5 (* (sqrt 2) (sqrt (/ (* im im) (- (sqrt (+ (* re re) (* im im))) re))))) (* 0.5 (sqrt (* 2.0 (+ (sqrt (+ (* re re) (* im im))) re)))))
(* 0.5 (sqrt (* 2.0 (+ (sqrt (+ (* re re) (* im im))) re)))))
Time bar (total: 13.4s)Debug log
1 calls. Slowest were:
| 24.0ms | (* 0.5 (sqrt (* 2.0 (+ (sqrt (+ (* re re) (* im im))) re)))) |
2 alts after pruning (2 fresh and 0 done)
Merged error: 14.0b
Found 3 expressions with local error:
| 0.2b | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 0.1b | (fma (hypot re im) 2.0 (* re 2.0)) |
| 0.0b | (hypot re im) |
3 calls. Slowest were:
| 2.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 0.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
| 0.0ms | (hypot re im) |
3 calls. Slowest were:
| 171.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 33.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
| 32.0ms | (hypot re im) |
13 calls. Slowest were:
| 15.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 14.0ms | (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) |
| 10.0ms | (sqrt (* (cbrt (fma (hypot re im) 2.0 (* re 2.0))) (cbrt (fma (hypot re im) 2.0 (* re 2.0))))) |
10 alts after pruning (9 fresh and 1 done)
Merged error: 13.8b
Found 4 expressions with local error:
| 0.4b | (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) |
| 0.2b | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 0.2b | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 0.1b | (fma (hypot re im) 2.0 (* re 2.0)) |
4 calls. Slowest were:
| 6.0ms | (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) |
| 1.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 1.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
4 calls. Slowest were:
| 136.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 134.0ms | (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) |
| 133.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 57.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
48 calls. Slowest were:
| 90.0ms | (* (* (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (* (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) |
| 21.0ms | (+ (log (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (log (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) |
| 20.0ms | (sqrt (sqrt (* (cbrt (fma (hypot re im) 2.0 (* re 2.0))) (cbrt (fma (hypot re im) 2.0 (* re 2.0)))))) |
10 alts after pruning (9 fresh and 1 done)
Merged error: 13.8b
Found 4 expressions with local error:
| 0.3b | (* (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) |
| 0.3b | (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) |
| 0.2b | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 0.2b | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
4 calls. Slowest were:
| 34.0ms | (* (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) |
| 12.0ms | (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) |
| 1.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
4 calls. Slowest were:
| 284.0ms | (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) |
| 167.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 136.0ms | (* (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) |
| 121.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
82 calls. Slowest were:
| 283.0ms | (exp (* 1/8 (- (+ (* 3 (log (/ -1 re))) (log 1.0)) (* 6 (log (/ -1 im)))))) |
| 210.0ms | (exp (* 1/8 (- (log 64.0) (* 3 (log (/ 1 re)))))) |
| 166.0ms | (* (* (* (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))))) (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))))) (* (* (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))))) |
11 alts after pruning (10 fresh and 1 done)
Merged error: 13.8b
Found 4 expressions with local error:
| 0.7b | (pow (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) 4) |
| 0.2b | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 0.1b | (fma (hypot re im) 2.0 (* re 2.0)) |
| 0.1b | (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) |
4 calls. Slowest were:
| 2.0ms | (pow (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) 4) |
| 1.0ms | (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) |
| 1.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
4 calls. Slowest were:
| 179.0ms | (pow (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) 4) |
| 176.0ms | (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) |
| 168.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 49.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
39 calls. Slowest were:
| 257.0ms | (+ (* 0.03125 (* (pow re 2) (exp (* 1/4 (- (log 2.0) (* 7 (log im))))))) (+ (* 0.25 (* re (exp (* 1/4 (- (log 2.0) (* 3 (log im))))))) (exp (* 1/4 (+ (log im) (log 2.0)))))) |
| 120.0ms | (exp (* 1/4 (- (+ (log (/ -1 re)) (log 1.0)) (* 2 (log (/ -1 im)))))) |
| 113.0ms | (pow (exp (* 1/8 (- (+ (log (/ -1 re)) (log 1.0)) (* 2 (log (/ -1 im)))))) 4) |
13 alts after pruning (11 fresh and 2 done)
Merged error: 8.5b
9.3% (5.5b remaining)
Error of 13.0b against oracle of 7.5b and baseline of 13.6b