Average Error: 15.5 → 15.1
Time: 45.0s
Precision: binary64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{1 \cdot \frac{\left(1 - 0.5\right) \cdot \left(1 - 0.5\right) - \frac{0.5}{\mathsf{hypot}\left(1, x\right) \cdot \sqrt{\mathsf{hypot}\left(1, x\right)}} \cdot \frac{0.5}{\sqrt{\mathsf{hypot}\left(1, x\right)}}}{\left(1 - 0.5\right) + \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)}}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{1 \cdot \frac{\left(1 - 0.5\right) \cdot \left(1 - 0.5\right) - \frac{0.5}{\mathsf{hypot}\left(1, x\right) \cdot \sqrt{\mathsf{hypot}\left(1, x\right)}} \cdot \frac{0.5}{\sqrt{\mathsf{hypot}\left(1, x\right)}}}{\left(1 - 0.5\right) + \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)}}
double code(double x) {
	return ((double) (1.0 - ((double) sqrt(((double) (0.5 * ((double) (1.0 + (1.0 / ((double) hypot(1.0, x)))))))))));
}
double code(double x) {
	return (((double) (1.0 * (((double) (((double) (((double) (1.0 - 0.5)) * ((double) (1.0 - 0.5)))) - ((double) ((0.5 / ((double) (((double) hypot(1.0, x)) * ((double) sqrt(((double) hypot(1.0, x))))))) * (0.5 / ((double) sqrt(((double) hypot(1.0, x))))))))) / ((double) (((double) (1.0 - 0.5)) + (0.5 / ((double) hypot(1.0, x)))))))) / ((double) (1.0 + ((double) sqrt(((double) (0.5 * ((double) (1.0 + (1.0 / ((double) 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.5

    \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
  2. Using strategy rm
  3. Applied flip--15.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.1

    \[\leadsto \frac{\color{blue}{1 \cdot \left(\left(1 - 0.5\right) - \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)}}\]
  5. Using strategy rm
  6. Applied flip--15.1

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

    \[\leadsto \frac{1 \cdot \frac{\left(1 - 0.5\right) \cdot \left(1 - 0.5\right) - \frac{0.5}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\color{blue}{\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + \left(1 - 0.5\right)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  8. Using strategy rm
  9. Applied add-sqr-sqrt15.1

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

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

    \[\leadsto \frac{1 \cdot \frac{\left(1 - 0.5\right) \cdot \left(1 - 0.5\right) - \frac{0.5}{\mathsf{hypot}\left(1, x\right)} \cdot \color{blue}{\left(\frac{1}{\sqrt{\mathsf{hypot}\left(1, x\right)}} \cdot \frac{0.5}{\sqrt{\mathsf{hypot}\left(1, x\right)}}\right)}}{\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + \left(1 - 0.5\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  12. Applied associate-*r*15.1

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

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

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

Reproduce

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