\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt{\left(4 \cdot p\right) \cdot p + x \cdot x}}\right)}\sqrt[3]{{\left(\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt{\left(4 \cdot p\right) \cdot p + x \cdot x}}\right)}\right)}^{3}}double code(double p, double x) {
return sqrt((0.5 * (1.0 + (x / sqrt((((4.0 * p) * p) + (x * x)))))));
}
double code(double p, double x) {
return cbrt(pow(sqrt((0.5 * (1.0 + (x / sqrt((((4.0 * p) * p) + (x * x))))))), 3.0));
}




Bits error versus p




Bits error versus x
Results
| Original | 13.3 |
|---|---|
| Target | 13.3 |
| Herbie | 13.3 |
Initial program 13.3
rmApplied add-log-exp13.3
rmApplied add-cbrt-cube13.3
Simplified13.3
Final simplification13.3
herbie shell --seed 2020075
(FPCore (p x)
:name "Given's Rotation SVD example"
:precision binary64
:pre (< 1e-150 (fabs x) 1e+150)
:herbie-target
(sqrt (+ 0.5 (/ (copysign 0.5 x) (hypot 1 (/ (* 2 p) x)))))
(sqrt (* 0.5 (+ 1 (/ x (sqrt (+ (* (* 4 p) p) (* x x))))))))