\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt{\left(4 \cdot p\right) \cdot p + x \cdot x}}\right)}\sqrt{0.5 \cdot \frac{\log \left(\sqrt{e^{1 + {\left(\frac{x}{\sqrt{p \cdot \left(p \cdot 4\right) + x \cdot x}}\right)}^{3}}}\right) + \log \left(\sqrt{e^{1 + {\left(\frac{x}{\sqrt{p \cdot \left(p \cdot 4\right) + x \cdot x}}\right)}^{3}}}\right)}{1 + \left(\frac{x \cdot x}{p \cdot \left(p \cdot 4\right) + x \cdot x} - \frac{x}{\sqrt{p \cdot \left(p \cdot 4\right) + x \cdot x}}\right)}}(FPCore (p x) :precision binary64 (sqrt (* 0.5 (+ 1.0 (/ x (sqrt (+ (* (* 4.0 p) p) (* x x))))))))
(FPCore (p x)
:precision binary64
(sqrt
(*
0.5
(/
(+
(log
(sqrt (exp (+ 1.0 (pow (/ x (sqrt (+ (* p (* p 4.0)) (* x x)))) 3.0)))))
(log
(sqrt (exp (+ 1.0 (pow (/ x (sqrt (+ (* p (* p 4.0)) (* x x)))) 3.0))))))
(+
1.0
(-
(/ (* x x) (+ (* p (* p 4.0)) (* x x)))
(/ x (sqrt (+ (* p (* p 4.0)) (* x x))))))))))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 sqrt(0.5 * ((log(sqrt(exp(1.0 + pow((x / sqrt((p * (p * 4.0)) + (x * x))), 3.0)))) + log(sqrt(exp(1.0 + pow((x / sqrt((p * (p * 4.0)) + (x * x))), 3.0))))) / (1.0 + (((x * x) / ((p * (p * 4.0)) + (x * x))) - (x / sqrt((p * (p * 4.0)) + (x * x)))))));
}




Bits error versus p




Bits error versus x
Results
| Original | 13.1 |
|---|---|
| Target | 13.1 |
| Herbie | 13.1 |
Initial program 13.1
rmApplied flip3-+_binary64_280913.1
Simplified13.1
Simplified13.1
rmApplied add-log-exp_binary64_284513.1
Applied add-log-exp_binary64_284513.1
Applied sum-log_binary64_289713.1
Simplified13.1
rmApplied add-sqr-sqrt_binary64_282813.1
Applied log-prod_binary64_289213.1
Final simplification13.1
herbie shell --seed 2020342
(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.0 (/ (* 2.0 p) x)))))
(sqrt (* 0.5 (+ 1.0 (/ x (sqrt (+ (* (* 4.0 p) p) (* x x))))))))