Average Error: 15.7 → 15.2
Time: 10.9s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\frac{\left(1 \cdot \left(1 \cdot 1 - 0.5 \cdot 0.5\right)\right) \cdot \mathsf{hypot}\left(1, x\right) - \left(1 + 0.5\right) \cdot \left(1 \cdot 0.5\right)}{\left(1 + 0.5\right) \cdot \mathsf{hypot}\left(1, x\right)}}{\sqrt{1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{0.5} + 1}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{\frac{\left(1 \cdot \left(1 \cdot 1 - 0.5 \cdot 0.5\right)\right) \cdot \mathsf{hypot}\left(1, x\right) - \left(1 + 0.5\right) \cdot \left(1 \cdot 0.5\right)}{\left(1 + 0.5\right) \cdot \mathsf{hypot}\left(1, x\right)}}{\sqrt{1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{0.5} + 1}
double f(double x) {
        double r105982 = 1.0;
        double r105983 = 0.5;
        double r105984 = x;
        double r105985 = hypot(r105982, r105984);
        double r105986 = r105982 / r105985;
        double r105987 = r105982 + r105986;
        double r105988 = r105983 * r105987;
        double r105989 = sqrt(r105988);
        double r105990 = r105982 - r105989;
        return r105990;
}

double f(double x) {
        double r105991 = 1.0;
        double r105992 = r105991 * r105991;
        double r105993 = 0.5;
        double r105994 = r105993 * r105993;
        double r105995 = r105992 - r105994;
        double r105996 = r105991 * r105995;
        double r105997 = x;
        double r105998 = hypot(r105991, r105997);
        double r105999 = r105996 * r105998;
        double r106000 = r105991 + r105993;
        double r106001 = r105991 * r105993;
        double r106002 = r106000 * r106001;
        double r106003 = r105999 - r106002;
        double r106004 = r106000 * r105998;
        double r106005 = r106003 / r106004;
        double r106006 = r105991 / r105998;
        double r106007 = r105991 + r106006;
        double r106008 = sqrt(r106007);
        double r106009 = sqrt(r105993);
        double r106010 = r106008 * r106009;
        double r106011 = r106010 + r105991;
        double r106012 = r106005 / r106011;
        return r106012;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.7

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

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

    \[\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. Using strategy rm
  6. Applied distribute-rgt-in15.3

    \[\leadsto \frac{1 \cdot 1 - \color{blue}{\left(1 \cdot 0.5 + \frac{1}{\mathsf{hypot}\left(1, x\right)} \cdot 0.5\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  7. Applied associate--r+15.2

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

    \[\leadsto \frac{\color{blue}{1 \cdot \left(1 - 0.5\right)} - \frac{1}{\mathsf{hypot}\left(1, x\right)} \cdot 0.5}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  9. Taylor expanded around 0 15.2

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

    \[\leadsto \frac{1 \cdot \left(1 - 0.5\right) - \frac{1}{\mathsf{hypot}\left(1, x\right)} \cdot 0.5}{\color{blue}{\sqrt{1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{0.5} + 1}}\]
  11. Using strategy rm
  12. Applied associate-*l/15.2

    \[\leadsto \frac{1 \cdot \left(1 - 0.5\right) - \color{blue}{\frac{1 \cdot 0.5}{\mathsf{hypot}\left(1, x\right)}}}{\sqrt{1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{0.5} + 1}\]
  13. Applied flip--15.2

    \[\leadsto \frac{1 \cdot \color{blue}{\frac{1 \cdot 1 - 0.5 \cdot 0.5}{1 + 0.5}} - \frac{1 \cdot 0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{0.5} + 1}\]
  14. Applied associate-*r/15.2

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

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

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

Reproduce

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