Average Error: 15.4 → 15.0
Time: 5.9s
Precision: binary64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[{\left(1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{-0.5} \cdot \left(\frac{0.5}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} - \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\right)\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
{\left(1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{-0.5} \cdot \left(\frac{0.5}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} - \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\right)
(FPCore (x)
 :precision binary64
 (- 1.0 (sqrt (* 0.5 (+ 1.0 (/ 1.0 (hypot 1.0 x)))))))
(FPCore (x)
 :precision binary64
 (*
  (pow (+ 1.0 (sqrt (+ 0.5 (/ 0.5 (hypot 1.0 x))))) -0.5)
  (-
   (/ 0.5 (sqrt (+ 1.0 (sqrt (+ 0.5 (/ 0.5 (hypot 1.0 x)))))))
   (/
    (/ 0.5 (hypot 1.0 x))
    (sqrt (+ 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 pow((1.0 + sqrt(0.5 + (0.5 / hypot(1.0, x)))), -0.5) * ((0.5 / sqrt(1.0 + sqrt(0.5 + (0.5 / hypot(1.0, x))))) - ((0.5 / hypot(1.0, x)) / sqrt(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

Derivation

  1. Initial program 15.4

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

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

    \[\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. Simplified14.9

    \[\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_binary6415.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. Using strategy rm
  9. Applied add-sqr-sqrt_binary6430.3

    \[\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)}}{\color{blue}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \cdot \sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}}\]
  10. Applied *-un-lft-identity_binary6430.3

    \[\leadsto \frac{0.5}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} - \frac{\color{blue}{1 \cdot \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \cdot \sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\]
  11. Applied times-frac_binary6430.3

    \[\leadsto \frac{0.5}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} - \color{blue}{\frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}}\]
  12. Applied add-sqr-sqrt_binary6415.4

    \[\leadsto \frac{0.5}{\color{blue}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \cdot \sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}} - \frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\]
  13. Applied *-un-lft-identity_binary6415.4

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

    \[\leadsto \color{blue}{\frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \frac{0.5}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}} - \frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\]
  15. Applied distribute-lft-out--_binary6415.0

    \[\leadsto \color{blue}{\frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \left(\frac{0.5}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} - \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\right)}\]
  16. Using strategy rm
  17. Applied pow1/2_binary6415.0

    \[\leadsto \frac{1}{\color{blue}{{\left(1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{0.5}}} \cdot \left(\frac{0.5}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} - \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\right)\]
  18. Applied pow-flip_binary6415.0

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

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

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

Reproduce

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