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

Derivation

  1. Initial program 15.6

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

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

    \[\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.1

    \[\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 add-sqr-sqrt_binary6415.6

    \[\leadsto \frac{\color{blue}{\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)}}}\]
  8. Using strategy rm
  9. Applied add-log-exp_binary6415.6

    \[\leadsto \frac{\sqrt{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{0.5 - \color{blue}{\log \left(e^{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
  10. Applied add-log-exp_binary6415.6

    \[\leadsto \frac{\sqrt{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{\color{blue}{\log \left(e^{0.5}\right)} - \log \left(e^{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
  11. Applied diff-log_binary6415.6

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

    \[\leadsto \frac{\sqrt{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{\log \color{blue}{\left(e^{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)}}}\]
  13. Using strategy rm
  14. Applied add-sqr-sqrt_binary6415.6

    \[\leadsto \frac{\sqrt{0.5 - \frac{0.5}{\color{blue}{\sqrt{\mathsf{hypot}\left(1, x\right)} \cdot \sqrt{\mathsf{hypot}\left(1, x\right)}}}} \cdot \sqrt{\log \left(e^{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)}}}\]
  15. Applied add-sqr-sqrt_binary6432.4

    \[\leadsto \frac{\sqrt{0.5 - \frac{\color{blue}{\sqrt{0.5} \cdot \sqrt{0.5}}}{\sqrt{\mathsf{hypot}\left(1, x\right)} \cdot \sqrt{\mathsf{hypot}\left(1, x\right)}}} \cdot \sqrt{\log \left(e^{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)}}}\]
  16. Applied times-frac_binary6432.4

    \[\leadsto \frac{\sqrt{0.5 - \color{blue}{\frac{\sqrt{0.5}}{\sqrt{\mathsf{hypot}\left(1, x\right)}} \cdot \frac{\sqrt{0.5}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}}} \cdot \sqrt{\log \left(e^{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)}}}\]
  17. Applied add-sqr-sqrt_binary6415.6

    \[\leadsto \frac{\sqrt{\color{blue}{\sqrt{0.5} \cdot \sqrt{0.5}} - \frac{\sqrt{0.5}}{\sqrt{\mathsf{hypot}\left(1, x\right)}} \cdot \frac{\sqrt{0.5}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}} \cdot \sqrt{\log \left(e^{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)}}}\]
  18. Applied difference-of-squares_binary6415.6

    \[\leadsto \frac{\sqrt{\color{blue}{\left(\sqrt{0.5} + \frac{\sqrt{0.5}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \left(\sqrt{0.5} - \frac{\sqrt{0.5}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}\right)}} \cdot \sqrt{\log \left(e^{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)}}}\]
  19. Final simplification15.6

    \[\leadsto \frac{\sqrt{\left(\sqrt{0.5} + \frac{\sqrt{0.5}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \left(\sqrt{0.5} - \frac{\sqrt{0.5}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}\right)} \cdot \sqrt{\log \left(e^{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)}}}\]

Reproduce

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