Average Error: 15.2 → 14.7
Time: 21.9s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\frac{1 \cdot \left(1 \cdot 1\right) - \left(\left(\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \sqrt{\left(\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}}{\left(\left(\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) + 1 \cdot 1\right) + 1 \cdot \sqrt{\left(\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}}}{1 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} + \left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 1.5\right)}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{\frac{1 \cdot \left(1 \cdot 1\right) - \left(\left(\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \sqrt{\left(\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}}{\left(\left(\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) + 1 \cdot 1\right) + 1 \cdot \sqrt{\left(\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}}}{1 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} + \left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 1.5\right)}
double f(double x) {
        double r8400003 = 1.0;
        double r8400004 = 0.5;
        double r8400005 = x;
        double r8400006 = hypot(r8400003, r8400005);
        double r8400007 = r8400003 / r8400006;
        double r8400008 = r8400003 + r8400007;
        double r8400009 = r8400004 * r8400008;
        double r8400010 = sqrt(r8400009);
        double r8400011 = r8400003 - r8400010;
        return r8400011;
}

double f(double x) {
        double r8400012 = 1.0;
        double r8400013 = r8400012 * r8400012;
        double r8400014 = r8400012 * r8400013;
        double r8400015 = 0.5;
        double r8400016 = x;
        double r8400017 = hypot(r8400012, r8400016);
        double r8400018 = r8400015 / r8400017;
        double r8400019 = r8400015 + r8400018;
        double r8400020 = r8400019 * r8400019;
        double r8400021 = r8400020 * r8400019;
        double r8400022 = sqrt(r8400021);
        double r8400023 = r8400021 * r8400022;
        double r8400024 = r8400014 - r8400023;
        double r8400025 = r8400021 + r8400013;
        double r8400026 = r8400012 * r8400022;
        double r8400027 = r8400025 + r8400026;
        double r8400028 = r8400024 / r8400027;
        double r8400029 = sqrt(r8400019);
        double r8400030 = r8400012 * r8400029;
        double r8400031 = 1.5;
        double r8400032 = r8400018 + r8400031;
        double r8400033 = r8400030 + r8400032;
        double r8400034 = r8400028 / r8400033;
        return r8400034;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.2

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

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

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

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

    \[\leadsto \color{blue}{\frac{1 - \sqrt{{\left(0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)} + 0.5\right)}^{3}}}{0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)} + \left(1 \cdot \sqrt{0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)} + 0.5} + 1.5\right)}}\]
  7. Simplified14.7

    \[\leadsto \color{blue}{\frac{1 - \sqrt{\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right)}}{\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 1.5\right) + 1 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\]
  8. Using strategy rm
  9. Applied flip3--15.1

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

    \[\leadsto \frac{\frac{\color{blue}{1 \cdot \left(1 \cdot 1\right) - \sqrt{\left(\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\right) \cdot \left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\right)\right) \cdot \left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\right)} \cdot \left(\left(\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\right) \cdot \left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\right)\right) \cdot \left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\right)\right)}}{1 \cdot 1 + \left(\sqrt{\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right)} \cdot \sqrt{\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right)} + 1 \cdot \sqrt{\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right)}\right)}}{\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 1.5\right) + 1 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
  11. Simplified14.7

    \[\leadsto \frac{\frac{1 \cdot \left(1 \cdot 1\right) - \sqrt{\left(\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\right) \cdot \left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\right)\right) \cdot \left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\right)} \cdot \left(\left(\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\right) \cdot \left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\right)\right) \cdot \left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\right)\right)}{\color{blue}{\left(1 \cdot 1 + \left(\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\right) \cdot \left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\right)\right) \cdot \left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\right)\right) + \sqrt{\left(\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\right) \cdot \left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\right)\right) \cdot \left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\right)} \cdot 1}}}{\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 1.5\right) + 1 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
  12. Final simplification14.7

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

Reproduce

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