Average Error: 15.9 → 15.5
Time: 16.2s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{1 \cdot \left(1 \cdot 1\right) - \sqrt{\frac{0.5 \cdot 1}{\mathsf{hypot}\left(1, x\right)} + 0.5 \cdot 1} \cdot \left(\frac{0.5 \cdot 1}{\mathsf{hypot}\left(1, x\right)} + 0.5 \cdot 1\right)}{\left(0.5 \cdot 1 + \log \left(e^{\frac{0.5 \cdot 1}{\mathsf{hypot}\left(1, x\right)}}\right)\right) + 1 \cdot \left(\sqrt{0.5 \cdot 1 + \log \left(e^{\frac{0.5 \cdot 1}{\mathsf{hypot}\left(1, x\right)}}\right)} + 1\right)}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{1 \cdot \left(1 \cdot 1\right) - \sqrt{\frac{0.5 \cdot 1}{\mathsf{hypot}\left(1, x\right)} + 0.5 \cdot 1} \cdot \left(\frac{0.5 \cdot 1}{\mathsf{hypot}\left(1, x\right)} + 0.5 \cdot 1\right)}{\left(0.5 \cdot 1 + \log \left(e^{\frac{0.5 \cdot 1}{\mathsf{hypot}\left(1, x\right)}}\right)\right) + 1 \cdot \left(\sqrt{0.5 \cdot 1 + \log \left(e^{\frac{0.5 \cdot 1}{\mathsf{hypot}\left(1, x\right)}}\right)} + 1\right)}
double f(double x) {
        double r8449085 = 1.0;
        double r8449086 = 0.5;
        double r8449087 = x;
        double r8449088 = hypot(r8449085, r8449087);
        double r8449089 = r8449085 / r8449088;
        double r8449090 = r8449085 + r8449089;
        double r8449091 = r8449086 * r8449090;
        double r8449092 = sqrt(r8449091);
        double r8449093 = r8449085 - r8449092;
        return r8449093;
}

double f(double x) {
        double r8449094 = 1.0;
        double r8449095 = r8449094 * r8449094;
        double r8449096 = r8449094 * r8449095;
        double r8449097 = 0.5;
        double r8449098 = r8449097 * r8449094;
        double r8449099 = x;
        double r8449100 = hypot(r8449094, r8449099);
        double r8449101 = r8449098 / r8449100;
        double r8449102 = r8449101 + r8449098;
        double r8449103 = sqrt(r8449102);
        double r8449104 = r8449103 * r8449102;
        double r8449105 = r8449096 - r8449104;
        double r8449106 = exp(r8449101);
        double r8449107 = log(r8449106);
        double r8449108 = r8449098 + r8449107;
        double r8449109 = sqrt(r8449108);
        double r8449110 = r8449109 + r8449094;
        double r8449111 = r8449094 * r8449110;
        double r8449112 = r8449108 + r8449111;
        double r8449113 = r8449105 / r8449112;
        return r8449113;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.9

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

    \[\leadsto \color{blue}{\frac{{1}^{3} - {\left(\sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)}^{3}}{1 \cdot 1 + \left(\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 \cdot \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)}}\]
  4. Simplified15.9

    \[\leadsto \frac{\color{blue}{\left(1 \cdot 1\right) \cdot 1 - \sqrt{\frac{1 \cdot 0.5}{\mathsf{hypot}\left(1, x\right)} + 1 \cdot 0.5} \cdot \left(\frac{1 \cdot 0.5}{\mathsf{hypot}\left(1, x\right)} + 1 \cdot 0.5\right)}}{1 \cdot 1 + \left(\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 \cdot \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)}\]
  5. Simplified15.5

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

    \[\leadsto \frac{\left(1 \cdot 1\right) \cdot 1 - \sqrt{\frac{1 \cdot 0.5}{\mathsf{hypot}\left(1, x\right)} + 1 \cdot 0.5} \cdot \left(\frac{1 \cdot 0.5}{\mathsf{hypot}\left(1, x\right)} + 1 \cdot 0.5\right)}{1 \cdot \left(1 + \sqrt{\frac{1 \cdot 0.5}{\mathsf{hypot}\left(1, x\right)} + 1 \cdot 0.5}\right) + \left(\color{blue}{\log \left(e^{\frac{1 \cdot 0.5}{\mathsf{hypot}\left(1, x\right)}}\right)} + 1 \cdot 0.5\right)}\]
  8. Using strategy rm
  9. Applied add-log-exp15.5

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

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

Reproduce

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