Average Error: 15.4 → 15.7
Time: 10.4s
Precision: 64
\[1 - \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[{e}^{\left(\log \left(\sqrt{1 - \sqrt{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}}}\right)\right)} \cdot {e}^{\left(\log \left(\sqrt{1 - \sqrt{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}}}\right)\right)}\]
1 - \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
{e}^{\left(\log \left(\sqrt{1 - \sqrt{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}}}\right)\right)} \cdot {e}^{\left(\log \left(\sqrt{1 - \sqrt{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}}}\right)\right)}
double f(double x) {
        double r1978361 = 1.0;
        double r1978362 = 0.5;
        double r1978363 = x;
        double r1978364 = hypot(r1978361, r1978363);
        double r1978365 = r1978361 / r1978364;
        double r1978366 = r1978361 + r1978365;
        double r1978367 = r1978362 * r1978366;
        double r1978368 = sqrt(r1978367);
        double r1978369 = r1978361 - r1978368;
        return r1978369;
}

double f(double x) {
        double r1978370 = exp(1.0);
        double r1978371 = 1.0;
        double r1978372 = 0.5;
        double r1978373 = x;
        double r1978374 = hypot(r1978371, r1978373);
        double r1978375 = r1978372 / r1978374;
        double r1978376 = r1978375 + r1978372;
        double r1978377 = sqrt(r1978376);
        double r1978378 = r1978371 - r1978377;
        double r1978379 = sqrt(r1978378);
        double r1978380 = log(r1978379);
        double r1978381 = pow(r1978370, r1978380);
        double r1978382 = r1978381 * r1978381;
        return r1978382;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.4

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

    \[\leadsto \color{blue}{1 - \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\]
  3. Using strategy rm
  4. Applied add-exp-log15.4

    \[\leadsto \color{blue}{e^{\log \left(1 - \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}\right)}}\]
  5. Using strategy rm
  6. Applied pow115.4

    \[\leadsto e^{\log \color{blue}{\left({\left(1 - \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}\right)}^{1}\right)}}\]
  7. Applied log-pow15.4

    \[\leadsto e^{\color{blue}{1 \cdot \log \left(1 - \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}\right)}}\]
  8. Applied exp-prod15.4

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

    \[\leadsto {\color{blue}{e}}^{\left(\log \left(1 - \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}\right)\right)}\]
  10. Using strategy rm
  11. Applied add-sqr-sqrt15.7

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

    \[\leadsto {e}^{\color{blue}{\left(\log \left(\sqrt{1 - \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\right) + \log \left(\sqrt{1 - \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\right)\right)}}\]
  13. Applied unpow-prod-up15.7

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

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

Reproduce

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