Average Error: 15.1 → 14.7
Time: 9.6s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\frac{\log \left(e^{1 \cdot 1 - 0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)}{\sqrt{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}}}{\sqrt{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{\frac{\log \left(e^{1 \cdot 1 - 0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)}{\sqrt{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}}}{\sqrt{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}}
double f(double x) {
        double r292380 = 1.0;
        double r292381 = 0.5;
        double r292382 = x;
        double r292383 = hypot(r292380, r292382);
        double r292384 = r292380 / r292383;
        double r292385 = r292380 + r292384;
        double r292386 = r292381 * r292385;
        double r292387 = sqrt(r292386);
        double r292388 = r292380 - r292387;
        return r292388;
}

double f(double x) {
        double r292389 = 1.0;
        double r292390 = r292389 * r292389;
        double r292391 = 0.5;
        double r292392 = x;
        double r292393 = hypot(r292389, r292392);
        double r292394 = r292389 / r292393;
        double r292395 = r292389 + r292394;
        double r292396 = r292391 * r292395;
        double r292397 = r292390 - r292396;
        double r292398 = exp(r292397);
        double r292399 = log(r292398);
        double r292400 = sqrt(r292396);
        double r292401 = r292389 + r292400;
        double r292402 = sqrt(r292401);
        double r292403 = r292399 / r292402;
        double r292404 = r292403 / r292402;
        return r292404;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.1

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

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

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

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

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

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

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

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

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

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

Reproduce

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