Average Error: 15.2 → 14.8
Time: 17.1s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\log \left(e^{{0.5}^{3} - {\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}}\right)}{\left(1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right) \cdot \left(0.5 \cdot 0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)} \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right)}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{\log \left(e^{{0.5}^{3} - {\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}}\right)}{\left(1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right) \cdot \left(0.5 \cdot 0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)} \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right)}
double f(double x) {
        double r99496 = 1.0;
        double r99497 = 0.5;
        double r99498 = x;
        double r99499 = hypot(r99496, r99498);
        double r99500 = r99496 / r99499;
        double r99501 = r99496 + r99500;
        double r99502 = r99497 * r99501;
        double r99503 = sqrt(r99502);
        double r99504 = r99496 - r99503;
        return r99504;
}

double f(double x) {
        double r99505 = 0.5;
        double r99506 = 3.0;
        double r99507 = pow(r99505, r99506);
        double r99508 = 1.0;
        double r99509 = x;
        double r99510 = hypot(r99508, r99509);
        double r99511 = r99505 / r99510;
        double r99512 = pow(r99511, r99506);
        double r99513 = r99507 - r99512;
        double r99514 = exp(r99513);
        double r99515 = log(r99514);
        double r99516 = r99508 / r99510;
        double r99517 = r99508 + r99516;
        double r99518 = r99505 * r99517;
        double r99519 = sqrt(r99518);
        double r99520 = r99508 + r99519;
        double r99521 = r99505 * r99505;
        double r99522 = r99505 + r99511;
        double r99523 = r99511 * r99522;
        double r99524 = r99521 + r99523;
        double r99525 = r99520 * r99524;
        double r99526 = r99515 / r99525;
        return r99526;
}

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

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

    \[\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. Taylor expanded around 0 14.8

    \[\leadsto \frac{\color{blue}{0.5 - 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)}}\]
  6. Simplified14.8

    \[\leadsto \frac{\color{blue}{0.5 - \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. Using strategy rm
  8. Applied flip3--14.8

    \[\leadsto \frac{\color{blue}{\frac{{0.5}^{3} - {\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}}{0.5 \cdot 0.5 + \left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5 \cdot \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)}}\]
  9. Applied associate-/l/14.8

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

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

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

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

    \[\leadsto \frac{\color{blue}{\log \left(\frac{e^{{0.5}^{3}}}{e^{{\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}}}\right)}}{\left(1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right) \cdot \left(0.5 \cdot 0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)} \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right)}\]
  15. Simplified14.8

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

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

Reproduce

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