Average Error: 15.5 → 15.0
Time: 7.6s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{1 - \frac{1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}}{2}}{1 + \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}} \cdot 1\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{1 - \frac{1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}}{2}}{1 + \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}} \cdot 1
double f(double x) {
        double r132458 = 1.0;
        double r132459 = 0.5;
        double r132460 = x;
        double r132461 = hypot(r132458, r132460);
        double r132462 = r132458 / r132461;
        double r132463 = r132458 + r132462;
        double r132464 = r132459 * r132463;
        double r132465 = sqrt(r132464);
        double r132466 = r132458 - r132465;
        return r132466;
}

double f(double x) {
        double r132467 = 1.0;
        double r132468 = x;
        double r132469 = hypot(r132467, r132468);
        double r132470 = r132467 / r132469;
        double r132471 = r132467 + r132470;
        double r132472 = 2.0;
        double r132473 = r132471 / r132472;
        double r132474 = r132467 - r132473;
        double r132475 = r132467 / r132472;
        double r132476 = r132475 * r132471;
        double r132477 = sqrt(r132476);
        double r132478 = r132467 + r132477;
        double r132479 = r132474 / r132478;
        double r132480 = r132479 * r132467;
        return r132480;
}

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. Simplified15.5

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

    \[\leadsto \color{blue}{\frac{1 \cdot 1 - \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \cdot \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}{1 + \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}}\]
  5. Simplified15.0

    \[\leadsto \frac{\color{blue}{1 \cdot \left(1 - \frac{1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}}{2}\right)}}{1 + \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  6. Using strategy rm
  7. Applied add-log-exp15.0

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

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

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

    \[\leadsto \frac{1 \cdot \log \color{blue}{\left(e^{1 - \frac{1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}}{2}}\right)}}{1 + \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  11. Using strategy rm
  12. Applied add-cube-cbrt15.0

    \[\leadsto \frac{1 \cdot \log \left(e^{1 - \frac{1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}}{2}}\right)}{\color{blue}{\left(\sqrt[3]{1 + \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}} \cdot \sqrt[3]{1 + \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\right) \cdot \sqrt[3]{1 + \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}}}\]
  13. Applied times-frac15.0

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

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

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)))))))