



Bits error versus i




Bits error versus n
| Original | 47.7 |
|---|---|
| Target | 47.0 |
| Herbie | 14.5 |
if (/ (+ (* (/ (/ 100 i) i) (+ 1/2 (/ 1/6 i))) (* i 100)) (/ i n)) < -1.2963324730749592e+173 or 2.9110133691956703e+52 < (/ (+ (* (/ (/ 100 i) i) (+ 1/2 (/ 1/6 i))) (* i 100)) (/ i n)) Initial program 57.8
Taylor expanded around 0 28.5
rmApplied associate-/r/13.6
Applied simplify13.6
rmApplied add-sqr-sqrt13.6
Taylor expanded around 0 13.6
if -1.2963324730749592e+173 < (/ (+ (* (/ (/ 100 i) i) (+ 1/2 (/ 1/6 i))) (* i 100)) (/ i n)) < -5.923350227596516e-309Initial program 20.4
rmApplied div-inv20.5
Applied add-cube-cbrt20.5
Applied times-frac20.5
if -5.923350227596516e-309 < (/ (+ (* (/ (/ 100 i) i) (+ 1/2 (/ 1/6 i))) (* i 100)) (/ i n)) < 0.0Initial program 31.1
Taylor expanded around 0 55.1
Taylor expanded around inf 0.0
Applied simplify0.0
if 0.0 < (/ (+ (* (/ (/ 100 i) i) (+ 1/2 (/ 1/6 i))) (* i 100)) (/ i n)) < 2.9110133691956703e+52Initial program 28.3
rmApplied flip3--28.3
Applied simplify28.3
Applied simplify28.3
Time bar (total: 6.0m)Debug log
herbie shell --seed '#(991339738 1419949195 2842012120 4157638069 1320221275 2092628673)'
(FPCore (i n)
:name "Compound Interest"
:herbie-target
(* 100 (/ (- (exp (* n (if (== (+ 1 (/ i n)) 1) (/ i n) (/ (* (/ i n) (log (+ 1 (/ i n)))) (- (+ (/ i n) 1) 1))))) 1) (/ i n)))
(* 100 (/ (- (pow (+ 1 (/ i n)) n) 1) (/ i n))))