\sqrt{x - 1} \cdot \sqrt{x}x - \left(\frac{0.125}{x} + \left(0.5 + \frac{0.0625}{x \cdot x}\right)\right)(FPCore (x) :precision binary64 (* (sqrt (- x 1.0)) (sqrt x)))
(FPCore (x) :precision binary64 (- x (+ (/ 0.125 x) (+ 0.5 (/ 0.0625 (* x x))))))
double code(double x) {
return sqrt(x - 1.0) * sqrt(x);
}
double code(double x) {
return x - ((0.125 / x) + (0.5 + (0.0625 / (x * x))));
}




















Bits error versus x
Results
| Alternative 1 | |
|---|---|
| Error | 1.3 |
| Cost | 58688 |
| Alternative 2 | |
|---|---|
| Error | 1.3 |
| Cost | 45632 |
| Alternative 3 | |
|---|---|
| Error | 1.3 |
| Cost | 45376 |
| Alternative 4 | |
|---|---|
| Error | 0.9 |
| Cost | 39232 |
| Alternative 5 | |
|---|---|
| Error | 0.7 |
| Cost | 32576 |
| Alternative 6 | |
|---|---|
| Error | 0.9 |
| Cost | 32448 |
| Alternative 7 | |
|---|---|
| Error | 0.7 |
| Cost | 32448 |
| Alternative 8 | |
|---|---|
| Error | 5.8 |
| Cost | 25920 |
| Alternative 9 | |
|---|---|
| Error | 0.5 |
| Cost | 13120 |
| Alternative 10 | |
|---|---|
| Error | 32.1 |
| Cost | 6784 |
| Alternative 11 | |
|---|---|
| Error | 32.1 |
| Cost | 6720 |
| Alternative 12 | |
|---|---|
| Error | 0.4 |
| Cost | 448 |
| Alternative 13 | |
|---|---|
| Error | 0.6 |
| Cost | 192 |
| Alternative 14 | |
|---|---|
| Error | 1.3 |
| Cost | 64 |
| Alternative 15 | |
|---|---|
| Error | 60.6 |
| Cost | 64 |
| Alternative 16 | |
|---|---|
| Error | 62.6 |
| Cost | 64 |
| Alternative 17 | |
|---|---|
| Error | 63.3 |
| Cost | 64 |

Initial program 0.5
Taylor expanded around inf 0.3
Simplified0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2021042
(FPCore (x)
:name "sqrt times"
:precision binary64
(* (sqrt (- x 1.0)) (sqrt x)))