\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}\frac{x}{y} + \left(2 \cdot \frac{\frac{1}{z} + 1}{t} - 2\right)(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
(FPCore (x y z t) :precision binary64 (+ (/ x y) (- (* 2.0 (/ (+ (/ 1.0 z) 1.0) t)) 2.0)))
double code(double x, double y, double z, double t) {
return ((double) ((x / y) + (((double) (2.0 + ((double) (((double) (z * 2.0)) * ((double) (1.0 - t)))))) / ((double) (t * z)))));
}
double code(double x, double y, double z, double t) {
return ((double) ((x / y) + ((double) (((double) (2.0 * (((double) ((1.0 / z) + 1.0)) / t))) - 2.0))));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 9.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program Error: 9.1 bits
SimplifiedError: 0.1 bits
rmApplied div-invError: 0.1 bits
Applied associate-*l*Error: 0.1 bits
SimplifiedError: 0.1 bits
Final simplificationError: 0.1 bits
herbie shell --seed 2020204
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:herbie-target
(- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))