\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}}6 \cdot \frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}(FPCore (x) :precision binary64 (/ (* 6.0 (- x 1.0)) (+ (+ x 1.0) (* 4.0 (sqrt x)))))
(FPCore (x) :precision binary64 (* 6.0 (/ (- x 1.0) (+ (+ x 1.0) (* 4.0 (sqrt x))))))
double code(double x) {
return (6.0 * (x - 1.0)) / ((x + 1.0) + (4.0 * sqrt(x)));
}
double code(double x) {
return 6.0 * ((x - 1.0) / ((x + 1.0) + (4.0 * sqrt(x))));
}











Bits error versus x
Results
| Original | 0.2 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
| Alternative 1 | |
|---|---|
| Error | 0.1 |
| Cost | 7232 |
| Alternative 2 | |
|---|---|
| Error | 1.6 |
| Cost | 7425 |
| Alternative 3 | |
|---|---|
| Error | 2.2 |
| Cost | 7297 |
| Alternative 4 | |
|---|---|
| Error | 3.0 |
| Cost | 385 |
| Alternative 5 | |
|---|---|
| Error | 28.7 |
| Cost | 385 |
| Alternative 6 | |
|---|---|
| Error | 53.3 |
| Cost | 385 |
| Alternative 7 | |
|---|---|
| Error | 58.0 |
| Cost | 64 |

Initial program 0.2
rmApplied *-un-lft-identity_binary64_242890.2
Applied times-frac_binary64_242950.0
Simplified0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2021044
(FPCore (x)
:name "Data.Approximate.Numerics:blog from approximate-0.2.2.1"
:precision binary64
:herbie-target
(/ 6.0 (/ (+ (+ x 1.0) (* 4.0 (sqrt x))) (- x 1.0)))
(/ (* 6.0 (- x 1.0)) (+ (+ x 1.0) (* 4.0 (sqrt x)))))