Average Error: 15.2 → 14.7
Time: 14.7s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \log \left(e^{\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)}}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \log \left(e^{\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)}}
double f(double x) {
        double r101300 = 1.0;
        double r101301 = 0.5;
        double r101302 = x;
        double r101303 = hypot(r101300, r101302);
        double r101304 = r101300 / r101303;
        double r101305 = r101300 + r101304;
        double r101306 = r101301 * r101305;
        double r101307 = sqrt(r101306);
        double r101308 = r101300 - r101307;
        return r101308;
}

double f(double x) {
        double r101309 = 1.0;
        double r101310 = 0.5;
        double r101311 = r101309 - r101310;
        double r101312 = r101309 * r101311;
        double r101313 = x;
        double r101314 = hypot(r101309, r101313);
        double r101315 = r101309 / r101314;
        double r101316 = exp(r101315);
        double r101317 = log(r101316);
        double r101318 = r101310 * r101317;
        double r101319 = r101312 - r101318;
        double r101320 = r101309 + r101315;
        double r101321 = r101310 * r101320;
        double r101322 = sqrt(r101321);
        double r101323 = r101309 + r101322;
        double r101324 = r101319 / r101323;
        return r101324;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.2

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

    \[\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 distribute-lft-in14.7

    \[\leadsto \frac{1 \cdot 1 - \color{blue}{\left(0.5 \cdot 1 + 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)}}\]
  7. Applied associate--r+14.7

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

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

    \[\leadsto \frac{1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \color{blue}{\log \left(e^{\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. Final simplification14.7

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

Reproduce

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