Average Error: 15.5 → 15.0
Time: 17.3s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\log \left(e^{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)}}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{\log \left(e^{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)}}
double f(double x) {
        double r97847 = 1.0;
        double r97848 = 0.5;
        double r97849 = x;
        double r97850 = hypot(r97847, r97849);
        double r97851 = r97847 / r97850;
        double r97852 = r97847 + r97851;
        double r97853 = r97848 * r97852;
        double r97854 = sqrt(r97853);
        double r97855 = r97847 - r97854;
        return r97855;
}

double f(double x) {
        double r97856 = 0.5;
        double r97857 = 1.0;
        double r97858 = x;
        double r97859 = hypot(r97857, r97858);
        double r97860 = r97856 / r97859;
        double r97861 = r97856 - r97860;
        double r97862 = exp(r97861);
        double r97863 = log(r97862);
        double r97864 = r97857 / r97859;
        double r97865 = r97857 + r97864;
        double r97866 = r97856 * r97865;
        double r97867 = sqrt(r97866);
        double r97868 = r97857 + r97867;
        double r97869 = r97863 / r97868;
        return r97869;
}

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.0

    \[\leadsto \frac{\color{blue}{1 \cdot 1 - 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)}}\]
  5. Using strategy rm
  6. Applied add-log-exp15.0

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

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

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

    \[\leadsto \frac{\log \color{blue}{\left(e^{1 \cdot 1 - 0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  10. Taylor expanded around 0 15.0

    \[\leadsto \frac{\log \left(e^{\color{blue}{0.5 - 0.5 \cdot \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)}}\]
  11. Simplified15.0

    \[\leadsto \frac{\log \left(e^{\color{blue}{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)}}\]
  12. Final simplification15.0

    \[\leadsto \frac{\log \left(e^{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)}}\]

Reproduce

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