



Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
| Original | 26.0 |
|---|---|
| Target | 0.4 |
| Herbie | 13.0 |
if c < -5.958224986118704e+172Initial program 43.4
Simplified43.4
rmApplied add-sqr-sqrt43.4
Applied *-un-lft-identity43.4
Applied times-frac43.4
Simplified43.4
Simplified30.3
rmApplied associate-*l/30.2
Simplified30.2
Taylor expanded around -inf 11.7
Simplified11.7
if -5.958224986118704e+172 < c < 6.6100911784357434e+81Initial program 20.0
Simplified20.0
rmApplied add-sqr-sqrt20.0
Applied *-un-lft-identity20.0
Applied times-frac20.0
Simplified20.0
Simplified12.2
rmApplied associate-*l/12.0
Simplified12.0
if 6.6100911784357434e+81 < c Initial program 37.4
Simplified37.4
rmApplied add-sqr-sqrt37.4
Applied *-un-lft-identity37.4
Applied times-frac37.4
Simplified37.4
Simplified24.7
rmApplied associate-*l/24.6
Simplified24.6
Taylor expanded around inf 17.1
Final simplification13.0
herbie shell --seed 2019008 +o rules:numerics
(FPCore (a b c d)
:name "Complex division, real part"
:herbie-target
(if (< (fabs d) (fabs c)) (/ (+ a (* b (/ d c))) (+ c (* d (/ d c)))) (/ (+ b (* a (/ c d))) (+ d (* c (/ c d)))))
(/ (+ (* a c) (* b d)) (+ (* c c) (* d d))))
Time bar (total: 17.5s)Debug log
1 calls. Slowest were:
| 7.0ms | (/ (+ (* a c) (* b d)) (+ (* c c) (* d d))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 28.3b
Found 3 expressions with local error:
| 28.3b | (/ (fma a c (* b d)) (fma d d (* c c))) |
| 0.0b | (fma d d (* c c)) |
| 0.0b | (fma a c (* b d)) |
3 calls. Slowest were:
| 3.0ms | (/ (fma a c (* b d)) (fma d d (* c c))) |
| 0.0ms | (fma d d (* c c)) |
| 0.0ms | (fma a c (* b d)) |
3 calls. Slowest were:
| 61.0ms | (/ (fma a c (* b d)) (fma d d (* c c))) |
| 41.0ms | (fma a c (* b d)) |
| 18.0ms | (fma d d (* c c)) |
34 calls. Slowest were:
| 216.0ms | (/ (* (* (fma a c (* b d)) (fma a c (* b d))) (fma a c (* b d))) (* (* (fma d d (* c c)) (fma d d (* c c))) (fma d d (* c c)))) |
| 24.0ms | (/ (* (cbrt (fma a c (* b d))) (cbrt (fma a c (* b d)))) (* (cbrt (fma d d (* c c))) (cbrt (fma d d (* c c))))) |
| 19.0ms | (- (log (fma a c (* b d))) (log (fma d d (* c c)))) |
8 alts after pruning (8 fresh and 0 done)
Merged error: 17.5b
Found 4 expressions with local error:
| 17.2b | (/ (fma d b (* a c)) (hypot d c)) |
| 0.2b | (* (/ 1 (hypot d c)) (/ (fma d b (* a c)) (hypot d c))) |
| 0.0b | (/ 1 (hypot d c)) |
| 0.0b | (hypot d c) |
4 calls. Slowest were:
| 6.0ms | (* (/ 1 (hypot d c)) (/ (fma d b (* a c)) (hypot d c))) |
| 3.0ms | (/ (fma d b (* a c)) (hypot d c)) |
| 1.0ms | (/ 1 (hypot d c)) |
4 calls. Slowest were:
| 120.0ms | (* (/ 1 (hypot d c)) (/ (fma d b (* a c)) (hypot d c))) |
| 110.0ms | (/ (fma d b (* a c)) (hypot d c)) |
| 31.0ms | (/ 1 (hypot d c)) |
| 28.0ms | (hypot d c) |
67 calls. Slowest were:
| 467.0ms | (* (* (* (/ 1 (hypot d c)) (/ 1 (hypot d c))) (/ 1 (hypot d c))) (* (* (/ (fma d b (* a c)) (hypot d c)) (/ (fma d b (* a c)) (hypot d c))) (/ (fma d b (* a c)) (hypot d c)))) |
| 226.0ms | (* (/ 1 (hypot d c)) (/ (fma d b (* a c)) (hypot d c))) |
| 115.0ms | (/ (* (* (fma d b (* a c)) (fma d b (* a c))) (fma d b (* a c))) (* (* (hypot d c) (hypot d c)) (hypot d c))) |
10 alts after pruning (10 fresh and 0 done)
Merged error: 7.1b
Found 4 expressions with local error:
| 17.2b | (/ (fma c a (* b d)) (hypot d c)) |
| 0.1b | (/ (/ (fma c a (* b d)) (hypot d c)) (hypot d c)) |
| 0.0b | (fma c a (* b d)) |
| 0.0b | (hypot d c) |
4 calls. Slowest were:
| 6.0ms | (/ (/ (fma c a (* b d)) (hypot d c)) (hypot d c)) |
| 3.0ms | (/ (fma c a (* b d)) (hypot d c)) |
| 0.0ms | (fma c a (* b d)) |
4 calls. Slowest were:
| 77.0ms | (/ (/ (fma c a (* b d)) (hypot d c)) (hypot d c)) |
| 64.0ms | (/ (fma c a (* b d)) (hypot d c)) |
| 44.0ms | (fma c a (* b d)) |
| 38.0ms | (hypot d c) |
135 calls. Slowest were:
| 272.0ms | (/ (/ (* (* (fma c a (* b d)) (fma c a (* b d))) (fma c a (* b d))) (* (* (hypot d c) (hypot d c)) (hypot d c))) (* (* (hypot d c) (hypot d c)) (hypot d c))) |
| 223.0ms | (/ (/ (* (cbrt (fma c a (* b d))) (cbrt (fma c a (* b d)))) (* (cbrt (hypot d c)) (cbrt (hypot d c)))) 1) |
| 195.0ms | (/ (* (* (/ (fma c a (* b d)) (hypot d c)) (/ (fma c a (* b d)) (hypot d c))) (/ (fma c a (* b d)) (hypot d c))) (* (* (hypot d c) (hypot d c)) (hypot d c))) |
10 alts after pruning (9 fresh and 1 done)
Merged error: 1.9b
Found 4 expressions with local error:
| 17.3b | (/ (hypot d c) (fma c a (* b d))) |
| 0.2b | (/ 1 (/ (hypot d c) (fma c a (* b d)))) |
| 0.1b | (/ (/ 1 (/ (hypot d c) (fma c a (* b d)))) (hypot d c)) |
| 0.0b | (fma c a (* b d)) |
4 calls. Slowest were:
| 4.0ms | (/ (/ 1 (/ (hypot d c) (fma c a (* b d)))) (hypot d c)) |
| 4.0ms | (/ (hypot d c) (fma c a (* b d))) |
| 1.0ms | (/ 1 (/ (hypot d c) (fma c a (* b d)))) |
4 calls. Slowest were:
| 129.0ms | (/ 1 (/ (hypot d c) (fma c a (* b d)))) |
| 104.0ms | (/ (/ 1 (/ (hypot d c) (fma c a (* b d)))) (hypot d c)) |
| 70.0ms | (/ (hypot d c) (fma c a (* b d))) |
| 25.0ms | (fma c a (* b d)) |
92 calls. Slowest were:
| 461.0ms | (/ (/ 1 (/ (hypot d c) (fma c a (* b d)))) (cbrt (hypot d c))) |
| 404.0ms | (/ (/ 1 (/ (hypot d c) (fma c a (* b d)))) (sqrt (hypot d c))) |
| 400.0ms | (/ (/ 1 (/ (hypot d c) (fma c a (* b d)))) (cbrt (hypot d c))) |
11 alts after pruning (9 fresh and 2 done)
Merged error: 1.9b
25% (10.6b remaining)
Error of 13.0b against oracle of 2.4b and baseline of 16.5b