Average Error: 15.5 → 15.2
Time: 3.5s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\frac{1 \cdot \left(\left(\left(\left(1 \cdot 1\right) \cdot \left(1 \cdot 1\right) - \left(0.5 \cdot 0.5\right) \cdot \left(0.5 \cdot 0.5\right)\right) \cdot \mathsf{hypot}\left(1, x\right)\right) \cdot \left(0.5 - 1\right) - \left(1 \cdot 1 + 0.5 \cdot 0.5\right) \cdot \left(0.5 \cdot \left(0.5 \cdot 0.5 - 1 \cdot 1\right)\right)\right)}{\left(\left(1 + 0.5\right) \cdot \mathsf{hypot}\left(1, x\right)\right) \cdot \left(\left(1 \cdot 1 + 0.5 \cdot 0.5\right) \cdot \left(0.5 - 1\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{\frac{1 \cdot \left(\left(\left(\left(1 \cdot 1\right) \cdot \left(1 \cdot 1\right) - \left(0.5 \cdot 0.5\right) \cdot \left(0.5 \cdot 0.5\right)\right) \cdot \mathsf{hypot}\left(1, x\right)\right) \cdot \left(0.5 - 1\right) - \left(1 \cdot 1 + 0.5 \cdot 0.5\right) \cdot \left(0.5 \cdot \left(0.5 \cdot 0.5 - 1 \cdot 1\right)\right)\right)}{\left(\left(1 + 0.5\right) \cdot \mathsf{hypot}\left(1, x\right)\right) \cdot \left(\left(1 \cdot 1 + 0.5 \cdot 0.5\right) \cdot \left(0.5 - 1\right)\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}
double f(double x) {
        double r258130 = 1.0;
        double r258131 = 0.5;
        double r258132 = x;
        double r258133 = hypot(r258130, r258132);
        double r258134 = r258130 / r258133;
        double r258135 = r258130 + r258134;
        double r258136 = r258131 * r258135;
        double r258137 = sqrt(r258136);
        double r258138 = r258130 - r258137;
        return r258138;
}

double f(double x) {
        double r258139 = 1.0;
        double r258140 = r258139 * r258139;
        double r258141 = r258140 * r258140;
        double r258142 = 0.5;
        double r258143 = r258142 * r258142;
        double r258144 = r258143 * r258143;
        double r258145 = r258141 - r258144;
        double r258146 = x;
        double r258147 = hypot(r258139, r258146);
        double r258148 = r258145 * r258147;
        double r258149 = r258142 - r258139;
        double r258150 = r258148 * r258149;
        double r258151 = r258140 + r258143;
        double r258152 = r258143 - r258140;
        double r258153 = r258142 * r258152;
        double r258154 = r258151 * r258153;
        double r258155 = r258150 - r258154;
        double r258156 = r258139 * r258155;
        double r258157 = r258139 + r258142;
        double r258158 = r258157 * r258147;
        double r258159 = r258151 * r258149;
        double r258160 = r258158 * r258159;
        double r258161 = r258156 / r258160;
        double r258162 = r258139 / r258147;
        double r258163 = r258139 + r258162;
        double r258164 = r258142 * r258163;
        double r258165 = sqrt(r258164);
        double r258166 = r258139 + r258165;
        double r258167 = r258161 / r258166;
        return r258167;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.5

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

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

    \[\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 associate-*r/15.0

    \[\leadsto \frac{1 \cdot \left(1 - 0.5\right) - \color{blue}{\frac{0.5 \cdot 1}{\mathsf{hypot}\left(1, x\right)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  7. Applied flip--15.0

    \[\leadsto \frac{1 \cdot \color{blue}{\frac{1 \cdot 1 - 0.5 \cdot 0.5}{1 + 0.5}} - \frac{0.5 \cdot 1}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  8. Applied associate-*r/15.0

    \[\leadsto \frac{\color{blue}{\frac{1 \cdot \left(1 \cdot 1 - 0.5 \cdot 0.5\right)}{1 + 0.5}} - \frac{0.5 \cdot 1}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  9. Applied frac-sub15.0

    \[\leadsto \frac{\color{blue}{\frac{\left(1 \cdot \left(1 \cdot 1 - 0.5 \cdot 0.5\right)\right) \cdot \mathsf{hypot}\left(1, x\right) - \left(1 + 0.5\right) \cdot \left(0.5 \cdot 1\right)}{\left(1 + 0.5\right) \cdot \mathsf{hypot}\left(1, x\right)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  10. Simplified15.0

    \[\leadsto \frac{\frac{\color{blue}{1 \cdot \left(\left(1 \cdot 1 - 0.5 \cdot 0.5\right) \cdot \mathsf{hypot}\left(1, x\right) - 0.5 \cdot \left(0.5 + 1\right)\right)}}{\left(1 + 0.5\right) \cdot \mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  11. Using strategy rm
  12. Applied flip-+15.0

    \[\leadsto \frac{\frac{1 \cdot \left(\left(1 \cdot 1 - 0.5 \cdot 0.5\right) \cdot \mathsf{hypot}\left(1, x\right) - 0.5 \cdot \color{blue}{\frac{0.5 \cdot 0.5 - 1 \cdot 1}{0.5 - 1}}\right)}{\left(1 + 0.5\right) \cdot \mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  13. Applied associate-*r/15.0

    \[\leadsto \frac{\frac{1 \cdot \left(\left(1 \cdot 1 - 0.5 \cdot 0.5\right) \cdot \mathsf{hypot}\left(1, x\right) - \color{blue}{\frac{0.5 \cdot \left(0.5 \cdot 0.5 - 1 \cdot 1\right)}{0.5 - 1}}\right)}{\left(1 + 0.5\right) \cdot \mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  14. Applied flip--15.0

    \[\leadsto \frac{\frac{1 \cdot \left(\color{blue}{\frac{\left(1 \cdot 1\right) \cdot \left(1 \cdot 1\right) - \left(0.5 \cdot 0.5\right) \cdot \left(0.5 \cdot 0.5\right)}{1 \cdot 1 + 0.5 \cdot 0.5}} \cdot \mathsf{hypot}\left(1, x\right) - \frac{0.5 \cdot \left(0.5 \cdot 0.5 - 1 \cdot 1\right)}{0.5 - 1}\right)}{\left(1 + 0.5\right) \cdot \mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  15. Applied associate-*l/15.2

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

    \[\leadsto \frac{\frac{1 \cdot \color{blue}{\frac{\left(\left(\left(1 \cdot 1\right) \cdot \left(1 \cdot 1\right) - \left(0.5 \cdot 0.5\right) \cdot \left(0.5 \cdot 0.5\right)\right) \cdot \mathsf{hypot}\left(1, x\right)\right) \cdot \left(0.5 - 1\right) - \left(1 \cdot 1 + 0.5 \cdot 0.5\right) \cdot \left(0.5 \cdot \left(0.5 \cdot 0.5 - 1 \cdot 1\right)\right)}{\left(1 \cdot 1 + 0.5 \cdot 0.5\right) \cdot \left(0.5 - 1\right)}}}{\left(1 + 0.5\right) \cdot \mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  17. Applied associate-*r/15.1

    \[\leadsto \frac{\frac{\color{blue}{\frac{1 \cdot \left(\left(\left(\left(1 \cdot 1\right) \cdot \left(1 \cdot 1\right) - \left(0.5 \cdot 0.5\right) \cdot \left(0.5 \cdot 0.5\right)\right) \cdot \mathsf{hypot}\left(1, x\right)\right) \cdot \left(0.5 - 1\right) - \left(1 \cdot 1 + 0.5 \cdot 0.5\right) \cdot \left(0.5 \cdot \left(0.5 \cdot 0.5 - 1 \cdot 1\right)\right)\right)}{\left(1 \cdot 1 + 0.5 \cdot 0.5\right) \cdot \left(0.5 - 1\right)}}}{\left(1 + 0.5\right) \cdot \mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  18. Applied associate-/l/15.2

    \[\leadsto \frac{\color{blue}{\frac{1 \cdot \left(\left(\left(\left(1 \cdot 1\right) \cdot \left(1 \cdot 1\right) - \left(0.5 \cdot 0.5\right) \cdot \left(0.5 \cdot 0.5\right)\right) \cdot \mathsf{hypot}\left(1, x\right)\right) \cdot \left(0.5 - 1\right) - \left(1 \cdot 1 + 0.5 \cdot 0.5\right) \cdot \left(0.5 \cdot \left(0.5 \cdot 0.5 - 1 \cdot 1\right)\right)\right)}{\left(\left(1 + 0.5\right) \cdot \mathsf{hypot}\left(1, x\right)\right) \cdot \left(\left(1 \cdot 1 + 0.5 \cdot 0.5\right) \cdot \left(0.5 - 1\right)\right)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  19. Final simplification15.2

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

Reproduce

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