Average Error: 15.6 → 15.2
Time: 20.7s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\sqrt{\frac{1 \cdot \left(1 \cdot 1\right) - \sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)} \cdot \left(0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)\right)}{\left(1 + \sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)}\right) \cdot 1 + 0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)}} \cdot \sqrt{\frac{1 \cdot \left(1 \cdot 1\right) - \sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)} \cdot \left(0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)\right)}{\left(1 + \sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)}\right) \cdot 1 + 0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)}}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\sqrt{\frac{1 \cdot \left(1 \cdot 1\right) - \sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)} \cdot \left(0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)\right)}{\left(1 + \sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)}\right) \cdot 1 + 0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)}} \cdot \sqrt{\frac{1 \cdot \left(1 \cdot 1\right) - \sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)} \cdot \left(0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)\right)}{\left(1 + \sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)}\right) \cdot 1 + 0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)}}
double f(double x) {
        double r4803999 = 1.0;
        double r4804000 = 0.5;
        double r4804001 = x;
        double r4804002 = hypot(r4803999, r4804001);
        double r4804003 = r4803999 / r4804002;
        double r4804004 = r4803999 + r4804003;
        double r4804005 = r4804000 * r4804004;
        double r4804006 = sqrt(r4804005);
        double r4804007 = r4803999 - r4804006;
        return r4804007;
}

double f(double x) {
        double r4804008 = 1.0;
        double r4804009 = r4804008 * r4804008;
        double r4804010 = r4804008 * r4804009;
        double r4804011 = 0.5;
        double r4804012 = x;
        double r4804013 = hypot(r4804008, r4804012);
        double r4804014 = r4804008 / r4804013;
        double r4804015 = r4804014 + r4804008;
        double r4804016 = r4804011 * r4804015;
        double r4804017 = sqrt(r4804016);
        double r4804018 = r4804017 * r4804016;
        double r4804019 = r4804010 - r4804018;
        double r4804020 = r4804008 + r4804017;
        double r4804021 = r4804020 * r4804008;
        double r4804022 = r4804021 + r4804016;
        double r4804023 = r4804019 / r4804022;
        double r4804024 = sqrt(r4804023);
        double r4804025 = r4804024 * r4804024;
        return r4804025;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.6

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

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

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

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

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

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

Reproduce

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