Average Error: 15.7 → 15.3
Time: 4.4s
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 r231165 = 1.0;
        double r231166 = 0.5;
        double r231167 = x;
        double r231168 = hypot(r231165, r231167);
        double r231169 = r231165 / r231168;
        double r231170 = r231165 + r231169;
        double r231171 = r231166 * r231170;
        double r231172 = sqrt(r231171);
        double r231173 = r231165 - r231172;
        return r231173;
}

double f(double x) {
        double r231174 = 1.0;
        double r231175 = 0.5;
        double r231176 = r231174 - r231175;
        double r231177 = r231174 * r231176;
        double r231178 = x;
        double r231179 = hypot(r231174, r231178);
        double r231180 = r231174 / r231179;
        double r231181 = r231175 * r231180;
        double r231182 = r231177 - r231181;
        double r231183 = exp(r231182);
        double r231184 = log(r231183);
        double r231185 = r231174 + r231180;
        double r231186 = r231175 * r231185;
        double r231187 = sqrt(r231186);
        double r231188 = r231174 + r231187;
        double r231189 = r231184 / r231188;
        return r231189;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.7

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

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

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

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

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

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

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