Average Error: 15.8 → 15.4
Time: 6.5s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\log \left(e^{1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \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)}}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{\log \left(e^{1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \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)}}
double f(double x) {
        double r202071 = 1.0;
        double r202072 = 0.5;
        double r202073 = x;
        double r202074 = hypot(r202071, r202073);
        double r202075 = r202071 / r202074;
        double r202076 = r202071 + r202075;
        double r202077 = r202072 * r202076;
        double r202078 = sqrt(r202077);
        double r202079 = r202071 - r202078;
        return r202079;
}

double f(double x) {
        double r202080 = 1.0;
        double r202081 = 0.5;
        double r202082 = r202080 - r202081;
        double r202083 = r202080 * r202082;
        double r202084 = x;
        double r202085 = hypot(r202080, r202084);
        double r202086 = r202080 / r202085;
        double r202087 = r202081 * r202086;
        double r202088 = r202083 - r202087;
        double r202089 = exp(r202088);
        double r202090 = log(r202089);
        double r202091 = r202080 + r202086;
        double r202092 = r202081 * r202091;
        double r202093 = sqrt(r202092);
        double r202094 = r202080 + r202093;
        double r202095 = r202090 / r202094;
        return r202095;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.8

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

    \[\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 \left(1 - 0.5\right) - 0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  5. Using strategy rm
  6. Applied add-log-exp15.4

    \[\leadsto \frac{1 \cdot \left(1 - 0.5\right) - \color{blue}{\log \left(e^{0.5 \cdot \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)}}\]
  7. Applied add-log-exp15.4

    \[\leadsto \frac{\color{blue}{\log \left(e^{1 \cdot \left(1 - 0.5\right)}\right)} - \log \left(e^{0.5 \cdot \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)}}\]
  8. Applied diff-log15.4

    \[\leadsto \frac{\color{blue}{\log \left(\frac{e^{1 \cdot \left(1 - 0.5\right)}}{e^{0.5 \cdot \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)}}\]
  9. Simplified15.4

    \[\leadsto \frac{\log \color{blue}{\left(e^{1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \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)}}\]
  10. Final simplification15.4

    \[\leadsto \frac{\log \left(e^{1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \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)}}\]

Reproduce

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