Average Error: 15.5 → 15.0
Time: 6.3s
Precision: binary64
Cost: 33536
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{0.5}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} - \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{0.5}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} - \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}
(FPCore (x)
 :precision binary64
 (- 1.0 (sqrt (* 0.5 (+ 1.0 (/ 1.0 (hypot 1.0 x)))))))
(FPCore (x)
 :precision binary64
 (-
  (/ 0.5 (+ 1.0 (sqrt (+ 0.5 (/ 0.5 (hypot 1.0 x))))))
  (/ (/ 0.5 (hypot 1.0 x)) (+ 1.0 (sqrt (+ 0.5 (/ 0.5 (hypot 1.0 x))))))))
double code(double x) {
	return 1.0 - sqrt(0.5 * (1.0 + (1.0 / hypot(1.0, x))));
}
double code(double x) {
	return (0.5 / (1.0 + sqrt(0.5 + (0.5 / hypot(1.0, x))))) - ((0.5 / hypot(1.0, x)) / (1.0 + sqrt(0.5 + (0.5 / hypot(1.0, x)))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error15.5
Cost53056
\[\frac{\sqrt[3]{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \left(\sqrt[3]{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt[3]{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
Alternative 2
Error30.4
Cost52800
\[\frac{0.5 - \sqrt[3]{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \left(\sqrt[3]{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt[3]{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
Alternative 3
Error30.4
Cost39872
\[\frac{\frac{0.25 - {\left(\sqrt{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{4}}{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
Alternative 4
Error30.4
Cost33088
\[\frac{0.5 - \frac{\sqrt{0.5}}{\frac{\mathsf{hypot}\left(1, x\right)}{\sqrt{0.5}}}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
Alternative 5
Error29.9
Cost33024
\[\frac{0.5 - \sqrt[3]{{\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
Alternative 6
Error29.9
Cost26560
\[\frac{0.5 - \frac{\sqrt[3]{0.125}}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
Alternative 7
Error15.8
Cost26176
\[\sqrt[3]{{\left(1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{3}}\]
Alternative 8
Error15.5
Cost26112
\[e^{\log \left(1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}\]
Alternative 9
Error15.5
Cost26112
\[\log \left(e^{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\right)\]
Alternative 10
Error15.0
Cost20288
\[\left(0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \frac{1}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
Alternative 11
Error15.0
Cost20160
\[\frac{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
Alternative 12
Error15.5
Cost13440
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
Alternative 13
Error15.5
Cost13312
\[1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\]
Alternative 14
Error57.0
Cost64
\[1\]
Alternative 15
Error46.7
Cost64
\[0\]
Alternative 16
Error62.6
Cost64
\[-1\]

Error

Derivation

  1. Initial program 15.5

    \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
  2. Simplified15.5

    \[\leadsto \color{blue}{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
  3. Using strategy rm
  4. Applied flip--_binary64_137815.5

    \[\leadsto \color{blue}{\frac{1 \cdot 1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\]
  5. Simplified15.0

    \[\leadsto \frac{\color{blue}{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
  6. Using strategy rm
  7. Applied div-sub_binary64_140815.0

    \[\leadsto \color{blue}{\frac{0.5}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} - \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\]
  8. Simplified15.0

    \[\leadsto \color{blue}{\frac{0.5}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} - \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\]
  9. Final simplification15.0

    \[\leadsto \frac{0.5}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} - \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]

Reproduce

herbie shell --seed 2021042 
(FPCore (x)
  :name "Given's Rotation SVD example, simplified"
  :precision binary64
  (- 1.0 (sqrt (* 0.5 (+ 1.0 (/ 1.0 (hypot 1.0 x)))))))