



Bits error versus re




Bits error versus im
| Original | 37.8 |
|---|---|
| Target | 33.1 |
| Herbie | 13.4 |
if re < -79426894.0267396Initial program 55.9
rmApplied flip-+55.9
Applied associate-*r/55.9
Applied sqrt-div55.9
Simplified38.9
if -79426894.0267396 < re Initial program 31.9
Simplified5.1
Final simplification13.4
herbie shell --seed 2019007 +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: 12.9s)Debug log
1 calls. Slowest were:
| 25.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 2 expressions with local error:
| 0.5b | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 0.0b | (fma (hypot re im) 2.0 (* re 2.0)) |
2 calls. Slowest were:
| 1.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 0.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
2 calls. Slowest were:
| 104.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 52.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
10 calls. Slowest were:
| 18.0ms | (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) |
| 17.0ms | (sqrt (* (cbrt (fma (hypot re im) 2.0 (* re 2.0))) (cbrt (fma (hypot re im) 2.0 (* re 2.0))))) |
| 15.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
5 alts after pruning (4 fresh and 1 done)
Merged error: 14.6b
Found 4 expressions with local error:
| 0.5b | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 0.5b | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 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.1b | (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) |
4 calls. Slowest were:
| 9.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 (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) |
4 calls. Slowest were:
| 161.0ms | (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) |
| 150.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 140.0ms | (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) |
| 132.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
56 calls. Slowest were:
| 265.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)))))) |
| 106.0ms | (exp (* 1/4 (- (+ (log (/ -1 re)) (log 1.0)) (* 2 (log (/ -1 im)))))) |
| 79.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)))))) |
5 alts after pruning (3 fresh and 2 done)
Merged error: 14.6b
Found 4 expressions with local error:
| 0.9b | (cbrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 0.9b | (cbrt (fma (hypot re im) 2.0 (* 2.0 re))) |
| 0.5b | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 0.3b | (* (sqrt (sqrt (cbrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) |
4 calls. Slowest were:
| 7.0ms | (* (sqrt (sqrt (cbrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) |
| 5.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 1.0ms | (cbrt (fma (hypot re im) 2.0 (* re 2.0))) |
4 calls. Slowest were:
| 157.0ms | (cbrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 150.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 148.0ms | (cbrt (fma (hypot re im) 2.0 (* 2.0 re))) |
| 129.0ms | (* (sqrt (sqrt (cbrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) |
47 calls. Slowest were:
| 174.0ms | (+ (exp (* 1/3 (+ (log im) (log 2.0)))) (+ (* 0.3333333333333333 (* re (exp (* 1/3 (- (log 2.0) (* 2 (log im))))))) (* 0.05555555555555555 (* (pow re 2) (exp (* 1/3 (- (log 2.0) (* 5 (log im))))))))) |
| 172.0ms | (+ (exp (* 1/3 (+ (log im) (log 2.0)))) (+ (* 0.3333333333333333 (* re (exp (* 1/3 (- (log 2.0) (* 2 (log im))))))) (* 0.05555555555555555 (* (pow re 2) (exp (* 1/3 (- (log 2.0) (* 5 (log im))))))))) |
| 168.0ms | (+ (exp (* 1/3 (+ (log im) (log 2.0)))) (+ (* 0.3333333333333333 (* re (exp (* 1/3 (- (log 2.0) (* 2 (log im))))))) (* 0.05555555555555555 (* (pow re 2) (exp (* 1/3 (- (log 2.0) (* 5 (log im))))))))) |
5 alts after pruning (2 fresh and 3 done)
Merged error: 14.6b
Found 4 expressions with local error:
| 31.1b | (sqrt (+ (* re re) (* im im))) |
| 0.5b | (sqrt (* 2.0 (+ (sqrt (+ (* re re) (* im im))) re))) |
| 0.0b | (+ (sqrt (+ (* re re) (* im im))) re) |
| 0.0b | (+ (* re re) (* im im)) |
4 calls. Slowest were:
| 9.0ms | (+ (sqrt (+ (* re re) (* im im))) re) |
| 2.0ms | (+ (* re re) (* im im)) |
| 2.0ms | (sqrt (+ (* re re) (* im im))) |
4 calls. Slowest were:
| 115.0ms | (sqrt (* 2.0 (+ (sqrt (+ (* re re) (* im im))) re))) |
| 29.0ms | (+ (sqrt (+ (* re re) (* im im))) re) |
| 20.0ms | (+ (* re re) (* im im)) |
| 20.0ms | (sqrt (+ (* re re) (* im im))) |
27 calls. Slowest were:
| 411.0ms | (sqrt (* 2.0 (- (* (sqrt (+ (* re re) (* im im))) (sqrt (+ (* re re) (* im im)))) (* re re)))) |
| 198.0ms | (sqrt (* 2.0 (+ (pow (sqrt (+ (* re re) (* im im))) 3) (pow re 3)))) |
| 178.0ms | (sqrt (- (* (* re re) (* re re)) (* (* im im) (* im im)))) |
8 alts after pruning (6 fresh and 2 done)
Merged error: 10.9b
-4.9% (3.8b remaining)
Error of 13.4b against oracle of 9.5b and baseline of 13.2b