Average Error: 15.5 → 15.0
Time: 16.4s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\frac{{0.5}^{3} \cdot {0.5}^{3} - {\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}}{\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} + {\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}\right)} \cdot 1}{1 + \sqrt{0.5} \cdot \sqrt{1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}}}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{\frac{{0.5}^{3} \cdot {0.5}^{3} - {\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}}{\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} + {\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}\right)} \cdot 1}{1 + \sqrt{0.5} \cdot \sqrt{1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}}}
double f(double x) {
        double r25015 = 1.0;
        double r25016 = 0.5;
        double r25017 = x;
        double r25018 = hypot(r25015, r25017);
        double r25019 = r25015 / r25018;
        double r25020 = r25015 + r25019;
        double r25021 = r25016 * r25020;
        double r25022 = sqrt(r25021);
        double r25023 = r25015 - r25022;
        return r25023;
}

double f(double x) {
        double r25024 = 0.5;
        double r25025 = 3.0;
        double r25026 = pow(r25024, r25025);
        double r25027 = r25026 * r25026;
        double r25028 = 1.0;
        double r25029 = x;
        double r25030 = hypot(r25028, r25029);
        double r25031 = r25024 / r25030;
        double r25032 = pow(r25031, r25025);
        double r25033 = r25032 * r25032;
        double r25034 = r25027 - r25033;
        double r25035 = r25024 * r25024;
        double r25036 = r25024 + r25031;
        double r25037 = r25031 * r25036;
        double r25038 = r25035 + r25037;
        double r25039 = r25026 + r25032;
        double r25040 = r25038 * r25039;
        double r25041 = r25034 / r25040;
        double r25042 = r25041 * r25028;
        double r25043 = sqrt(r25024);
        double r25044 = r25028 / r25030;
        double r25045 = r25028 + r25044;
        double r25046 = sqrt(r25045);
        double r25047 = r25043 * r25046;
        double r25048 = r25028 + r25047;
        double r25049 = r25042 / r25048;
        return r25049;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.5

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

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

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

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

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

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

    \[\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)}} \cdot 1}{1 + \sqrt{0.5} \cdot \sqrt{1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}}}\]
  10. Using strategy rm
  11. Applied flip--15.0

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

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

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

Reproduce

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