Average Error: 14.9 → 14.4
Time: 3.5s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{e^{\log \left(1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \left(\frac{1}{\sqrt{\mathsf{hypot}\left(1, x\right)}} \cdot \frac{1}{\sqrt{\mathsf{hypot}\left(1, x\right)}}\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{e^{\log \left(1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \left(\frac{1}{\sqrt{\mathsf{hypot}\left(1, x\right)}} \cdot \frac{1}{\sqrt{\mathsf{hypot}\left(1, x\right)}}\right)\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}
double f(double x) {
        double r249747 = 1.0;
        double r249748 = 0.5;
        double r249749 = x;
        double r249750 = hypot(r249747, r249749);
        double r249751 = r249747 / r249750;
        double r249752 = r249747 + r249751;
        double r249753 = r249748 * r249752;
        double r249754 = sqrt(r249753);
        double r249755 = r249747 - r249754;
        return r249755;
}

double f(double x) {
        double r249756 = 1.0;
        double r249757 = 0.5;
        double r249758 = r249756 - r249757;
        double r249759 = r249756 * r249758;
        double r249760 = 1.0;
        double r249761 = x;
        double r249762 = hypot(r249756, r249761);
        double r249763 = sqrt(r249762);
        double r249764 = r249760 / r249763;
        double r249765 = r249756 / r249763;
        double r249766 = r249764 * r249765;
        double r249767 = r249757 * r249766;
        double r249768 = r249759 - r249767;
        double r249769 = log(r249768);
        double r249770 = exp(r249769);
        double r249771 = r249756 / r249762;
        double r249772 = r249756 + r249771;
        double r249773 = r249757 * r249772;
        double r249774 = sqrt(r249773);
        double r249775 = r249756 + r249774;
        double r249776 = r249770 / r249775;
        return r249776;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.9

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

    \[\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. Simplified14.4

    \[\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-sqr-sqrt14.4

    \[\leadsto \frac{1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \frac{1}{\color{blue}{\sqrt{\mathsf{hypot}\left(1, x\right)} \cdot \sqrt{\mathsf{hypot}\left(1, x\right)}}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  7. Applied *-un-lft-identity14.4

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

    \[\leadsto \frac{1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \color{blue}{\left(\frac{1}{\sqrt{\mathsf{hypot}\left(1, x\right)}} \cdot \frac{1}{\sqrt{\mathsf{hypot}\left(1, x\right)}}\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  9. Using strategy rm
  10. Applied add-exp-log14.4

    \[\leadsto \frac{\color{blue}{e^{\log \left(1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \left(\frac{1}{\sqrt{\mathsf{hypot}\left(1, x\right)}} \cdot \frac{1}{\sqrt{\mathsf{hypot}\left(1, x\right)}}\right)\right)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  11. Final simplification14.4

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

Reproduce

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