Average Error: 15.6 → 15.2
Time: 20.6s
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 r4803997 = 1.0;
        double r4803998 = 0.5;
        double r4803999 = x;
        double r4804000 = hypot(r4803997, r4803999);
        double r4804001 = r4803997 / r4804000;
        double r4804002 = r4803997 + r4804001;
        double r4804003 = r4803998 * r4804002;
        double r4804004 = sqrt(r4804003);
        double r4804005 = r4803997 - r4804004;
        return r4804005;
}

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

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