Average Error: 15.2 → 15.2
Time: 15.0s
Precision: 64
\[1 - \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\left(\sqrt{\frac{1}{2}} + \frac{\sqrt{\frac{1}{2}}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \log \left(e^{\sqrt{\frac{1}{2}} - \frac{\sqrt{\frac{1}{2}}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}}\right)}{\sqrt{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}} + 1}\]
1 - \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{\left(\sqrt{\frac{1}{2}} + \frac{\sqrt{\frac{1}{2}}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \log \left(e^{\sqrt{\frac{1}{2}} - \frac{\sqrt{\frac{1}{2}}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}}\right)}{\sqrt{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}} + 1}
double f(double x) {
        double r1692064 = 1.0;
        double r1692065 = 0.5;
        double r1692066 = x;
        double r1692067 = hypot(r1692064, r1692066);
        double r1692068 = r1692064 / r1692067;
        double r1692069 = r1692064 + r1692068;
        double r1692070 = r1692065 * r1692069;
        double r1692071 = sqrt(r1692070);
        double r1692072 = r1692064 - r1692071;
        return r1692072;
}

double f(double x) {
        double r1692073 = 0.5;
        double r1692074 = sqrt(r1692073);
        double r1692075 = 1.0;
        double r1692076 = x;
        double r1692077 = hypot(r1692075, r1692076);
        double r1692078 = sqrt(r1692077);
        double r1692079 = r1692074 / r1692078;
        double r1692080 = r1692074 + r1692079;
        double r1692081 = r1692074 - r1692079;
        double r1692082 = exp(r1692081);
        double r1692083 = log(r1692082);
        double r1692084 = r1692080 * r1692083;
        double r1692085 = r1692073 / r1692077;
        double r1692086 = r1692085 + r1692073;
        double r1692087 = sqrt(r1692086);
        double r1692088 = r1692087 + r1692075;
        double r1692089 = r1692084 / r1692088;
        return r1692089;
}

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

    \[\leadsto \color{blue}{1 - \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\]
  3. Using strategy rm
  4. Applied flip--15.2

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

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

    \[\leadsto \frac{\frac{1}{2} - \frac{\frac{1}{2}}{\color{blue}{\sqrt{\mathsf{hypot}\left(1, x\right)} \cdot \sqrt{\mathsf{hypot}\left(1, x\right)}}}}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\]
  8. Applied add-sqr-sqrt30.4

    \[\leadsto \frac{\frac{1}{2} - \frac{\color{blue}{\sqrt{\frac{1}{2}} \cdot \sqrt{\frac{1}{2}}}}{\sqrt{\mathsf{hypot}\left(1, x\right)} \cdot \sqrt{\mathsf{hypot}\left(1, x\right)}}}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\]
  9. Applied times-frac30.4

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

    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2}} \cdot \sqrt{\frac{1}{2}}} - \frac{\sqrt{\frac{1}{2}}}{\sqrt{\mathsf{hypot}\left(1, x\right)}} \cdot \frac{\sqrt{\frac{1}{2}}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\]
  11. Applied difference-of-squares15.2

    \[\leadsto \frac{\color{blue}{\left(\sqrt{\frac{1}{2}} + \frac{\sqrt{\frac{1}{2}}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \left(\sqrt{\frac{1}{2}} - \frac{\sqrt{\frac{1}{2}}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}\right)}}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\]
  12. Using strategy rm
  13. Applied add-log-exp15.2

    \[\leadsto \frac{\left(\sqrt{\frac{1}{2}} + \frac{\sqrt{\frac{1}{2}}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \left(\sqrt{\frac{1}{2}} - \color{blue}{\log \left(e^{\frac{\sqrt{\frac{1}{2}}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}}\right)}\right)}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\]
  14. Applied add-log-exp15.2

    \[\leadsto \frac{\left(\sqrt{\frac{1}{2}} + \frac{\sqrt{\frac{1}{2}}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \left(\color{blue}{\log \left(e^{\sqrt{\frac{1}{2}}}\right)} - \log \left(e^{\frac{\sqrt{\frac{1}{2}}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}}\right)\right)}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\]
  15. Applied diff-log15.2

    \[\leadsto \frac{\left(\sqrt{\frac{1}{2}} + \frac{\sqrt{\frac{1}{2}}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \color{blue}{\log \left(\frac{e^{\sqrt{\frac{1}{2}}}}{e^{\frac{\sqrt{\frac{1}{2}}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}}}\right)}}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\]
  16. Simplified15.2

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

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

Reproduce

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