Average Error: 15.6 → 15.1
Time: 3.6s
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 r225972 = 1.0;
        double r225973 = 0.5;
        double r225974 = x;
        double r225975 = hypot(r225972, r225974);
        double r225976 = r225972 / r225975;
        double r225977 = r225972 + r225976;
        double r225978 = r225973 * r225977;
        double r225979 = sqrt(r225978);
        double r225980 = r225972 - r225979;
        return r225980;
}

double f(double x) {
        double r225981 = 1.0;
        double r225982 = 0.5;
        double r225983 = r225981 - r225982;
        double r225984 = r225981 * r225983;
        double r225985 = x;
        double r225986 = hypot(r225981, r225985);
        double r225987 = r225981 / r225986;
        double r225988 = r225982 * r225987;
        double r225989 = r225984 - r225988;
        double r225990 = exp(r225989);
        double r225991 = log(r225990);
        double r225992 = r225981 + r225987;
        double r225993 = r225982 * r225992;
        double r225994 = sqrt(r225993);
        double r225995 = r225981 + r225994;
        double r225996 = r225991 / r225995;
        return r225996;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.6

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

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

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

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

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

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

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

    \[\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 2020039 
(FPCore (x)
  :name "Given's Rotation SVD example, simplified"
  :precision binary64
  (- 1 (sqrt (* 0.5 (+ 1 (/ 1 (hypot 1 x)))))))