Average Error: 15.3 → 14.8
Time: 12.5s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\left(\left(1 \cdot \left(1 - 0.5\right)\right) \cdot \frac{1 \cdot \left(1 - 0.5\right)}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\right) \cdot \left(1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right) - \left(0.5 \cdot 0.5\right) \cdot \frac{1 \cdot 1}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{2}}}{\left(\frac{1 \cdot \left(1 - 0.5\right)}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}} + \frac{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)}}\right) \cdot \left(\left(1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right) \cdot \left(1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)\right)}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{\left(\left(1 \cdot \left(1 - 0.5\right)\right) \cdot \frac{1 \cdot \left(1 - 0.5\right)}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\right) \cdot \left(1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right) - \left(0.5 \cdot 0.5\right) \cdot \frac{1 \cdot 1}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{2}}}{\left(\frac{1 \cdot \left(1 - 0.5\right)}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}} + \frac{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)}}\right) \cdot \left(\left(1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right) \cdot \left(1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)\right)}
double f(double x) {
        double r150583 = 1.0;
        double r150584 = 0.5;
        double r150585 = x;
        double r150586 = hypot(r150583, r150585);
        double r150587 = r150583 / r150586;
        double r150588 = r150583 + r150587;
        double r150589 = r150584 * r150588;
        double r150590 = sqrt(r150589);
        double r150591 = r150583 - r150590;
        return r150591;
}

double f(double x) {
        double r150592 = 1.0;
        double r150593 = 0.5;
        double r150594 = r150592 - r150593;
        double r150595 = r150592 * r150594;
        double r150596 = x;
        double r150597 = hypot(r150592, r150596);
        double r150598 = r150592 / r150597;
        double r150599 = r150592 + r150598;
        double r150600 = r150593 * r150599;
        double r150601 = sqrt(r150600);
        double r150602 = r150592 + r150601;
        double r150603 = r150595 / r150602;
        double r150604 = r150595 * r150603;
        double r150605 = r150604 * r150602;
        double r150606 = r150593 * r150593;
        double r150607 = r150592 * r150592;
        double r150608 = 2.0;
        double r150609 = pow(r150597, r150608);
        double r150610 = r150607 / r150609;
        double r150611 = r150606 * r150610;
        double r150612 = r150605 - r150611;
        double r150613 = r150593 * r150598;
        double r150614 = r150613 / r150602;
        double r150615 = r150603 + r150614;
        double r150616 = r150602 * r150602;
        double r150617 = r150615 * r150616;
        double r150618 = r150612 / r150617;
        return r150618;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.3

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

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

    \[\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 div-sub14.8

    \[\leadsto \color{blue}{\frac{1 \cdot \left(1 - 0.5\right)}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}} - \frac{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)}}}\]
  7. Using strategy rm
  8. Applied flip--14.8

    \[\leadsto \color{blue}{\frac{\frac{1 \cdot \left(1 - 0.5\right)}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}} \cdot \frac{1 \cdot \left(1 - 0.5\right)}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}} - \frac{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)}} \cdot \frac{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)}}}{\frac{1 \cdot \left(1 - 0.5\right)}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}} + \frac{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)}}}}\]
  9. Using strategy rm
  10. Applied frac-times14.8

    \[\leadsto \frac{\frac{1 \cdot \left(1 - 0.5\right)}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}} \cdot \frac{1 \cdot \left(1 - 0.5\right)}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}} - \color{blue}{\frac{\left(0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}{\left(1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right) \cdot \left(1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)}}}{\frac{1 \cdot \left(1 - 0.5\right)}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}} + \frac{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)}}}\]
  11. Applied associate-*r/14.8

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

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

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

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

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

Reproduce

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