Average Error: 15.5 → 15.0
Time: 1.7min
Precision: binary64
Cost: 59712
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + {\left(\sqrt{0.5 - \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{3}} \cdot \left(1 + \left({\left(\sqrt{0.5 - \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{2} - \sqrt{0.5 - \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}\right)\right)\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + {\left(\sqrt{0.5 - \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{3}} \cdot \left(1 + \left({\left(\sqrt{0.5 - \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{2} - \sqrt{0.5 - \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}\right)\right)
(FPCore (x)
 :precision binary64
 (- 1.0 (sqrt (* 0.5 (+ 1.0 (/ 1.0 (hypot 1.0 x)))))))
(FPCore (x)
 :precision binary64
 (*
  (/
   (+ 0.5 (/ -0.5 (hypot 1.0 x)))
   (+ 1.0 (pow (sqrt (- 0.5 (/ -0.5 (hypot 1.0 x)))) 3.0)))
  (+
   1.0
   (-
    (pow (sqrt (- 0.5 (/ -0.5 (hypot 1.0 x)))) 2.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 + (-0.5 / hypot(1.0, x))) / (1.0 + pow(sqrt(0.5 - (-0.5 / hypot(1.0, x))), 3.0))) * (1.0 + (pow(sqrt(0.5 - (-0.5 / hypot(1.0, x))), 2.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.0
Cost53376
\[\frac{0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + {\left(\sqrt{0.5 - \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{3}} \cdot \left(1 + \sqrt{0.5 - \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \left(\sqrt{0.5 - \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}} + -1\right)\right)\]
Alternative 2
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 3
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 4
Error15.5
Cost13312
\[1 - \sqrt{0.5 - \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}\]
Alternative 5
Error41.5
Cost706
\[\begin{array}{l} \mathbf{if}\;x \leq -2.990867059748371 \cdot 10^{-77}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 3.009781794805557 \cdot 10^{-77}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]
Alternative 6
Error57.1
Cost64
\[1\]

Error

Time

Derivation

  1. Initial program 15.5

    \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
  2. Using strategy rm
  3. Applied flip--_binary64_141715.5

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

    \[\leadsto \frac{\color{blue}{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)}}\]
  5. Simplified15.0

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

    \[\leadsto \frac{0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}{\color{blue}{\frac{{1}^{3} + {\left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{3}}{1 \cdot 1 + \left(\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 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}}}\]
  8. Applied associate-/r/_binary64_138815.0

    \[\leadsto \color{blue}{\frac{0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}{{1}^{3} + {\left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{3}} \cdot \left(1 \cdot 1 + \left(\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 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)\right)}\]
  9. Simplified15.0

    \[\leadsto \color{blue}{\frac{0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + {\left(\sqrt{0.5 - \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{3}}} \cdot \left(1 \cdot 1 + \left(\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 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)\right)\]
  10. Using strategy rm
  11. Applied pow2_binary64_152315.0

    \[\leadsto \frac{0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + {\left(\sqrt{0.5 - \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{3}} \cdot \left(1 \cdot 1 + \left(\color{blue}{{\left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{2}} - 1 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)\right)\]
  12. Using strategy rm
  13. Applied sub-neg_binary64_143515.0

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

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

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

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

Reproduce

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