Average Error: 15.9 → 15.4
Time: 18.2s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\frac{{\left({0.5}^{3}\right)}^{3} - {\left({\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}\right)}^{3}}{\left(\left({0.5}^{6} + {\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{6}\right) + \frac{{0.5}^{6}}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}\right) \cdot \left(0.5 \cdot 0.5 + \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \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)}}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{\frac{{\left({0.5}^{3}\right)}^{3} - {\left({\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}\right)}^{3}}{\left(\left({0.5}^{6} + {\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{6}\right) + \frac{{0.5}^{6}}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}\right) \cdot \left(0.5 \cdot 0.5 + \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \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)}}
double f(double x) {
        double r134676 = 1.0;
        double r134677 = 0.5;
        double r134678 = x;
        double r134679 = hypot(r134676, r134678);
        double r134680 = r134676 / r134679;
        double r134681 = r134676 + r134680;
        double r134682 = r134677 * r134681;
        double r134683 = sqrt(r134682);
        double r134684 = r134676 - r134683;
        return r134684;
}

double f(double x) {
        double r134685 = 0.5;
        double r134686 = 3.0;
        double r134687 = pow(r134685, r134686);
        double r134688 = pow(r134687, r134686);
        double r134689 = 1.0;
        double r134690 = x;
        double r134691 = hypot(r134689, r134690);
        double r134692 = r134685 / r134691;
        double r134693 = pow(r134692, r134686);
        double r134694 = pow(r134693, r134686);
        double r134695 = r134688 - r134694;
        double r134696 = 6.0;
        double r134697 = pow(r134685, r134696);
        double r134698 = pow(r134692, r134696);
        double r134699 = r134697 + r134698;
        double r134700 = pow(r134691, r134686);
        double r134701 = r134697 / r134700;
        double r134702 = r134699 + r134701;
        double r134703 = r134685 * r134685;
        double r134704 = r134685 + r134692;
        double r134705 = r134704 * r134692;
        double r134706 = r134703 + r134705;
        double r134707 = r134702 * r134706;
        double r134708 = r134695 / r134707;
        double r134709 = r134689 / r134691;
        double r134710 = r134689 + r134709;
        double r134711 = r134685 * r134710;
        double r134712 = sqrt(r134711);
        double r134713 = r134689 + r134712;
        double r134714 = r134708 / r134713;
        return r134714;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.9

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

    \[\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. Simplified15.4

    \[\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 15.4

    \[\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. Simplified15.4

    \[\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--15.4

    \[\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. Simplified15.4

    \[\leadsto \frac{\frac{{0.5}^{3} - {\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}}{\color{blue}{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)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  10. Using strategy rm
  11. Applied flip3--15.4

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

    \[\leadsto \frac{\color{blue}{\frac{{\left({0.5}^{3}\right)}^{3} - {\left({\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}\right)}^{3}}{\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) \cdot \left({0.5}^{3} \cdot {0.5}^{3} + \left({\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3} \cdot {\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3} + {0.5}^{3} \cdot {\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}\right)\right)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  13. Simplified15.4

    \[\leadsto \frac{\frac{{\left({0.5}^{3}\right)}^{3} - {\left({\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}\right)}^{3}}{\color{blue}{\left(\left({0.5}^{6} + {\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{6}\right) + \frac{{0.5}^{6}}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}\right) \cdot \left(0.5 \cdot 0.5 + \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \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)}}\]
  14. Final simplification15.4

    \[\leadsto \frac{\frac{{\left({0.5}^{3}\right)}^{3} - {\left({\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}\right)}^{3}}{\left(\left({0.5}^{6} + {\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{6}\right) + \frac{{0.5}^{6}}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}\right) \cdot \left(0.5 \cdot 0.5 + \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \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)}}\]

Reproduce

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