Average Error: 15.1 → 14.6
Time: 28.7s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\sqrt{1 \cdot \left(1 \cdot 1\right) - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \cdot \left(0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right)} \cdot \sqrt{1 \cdot \left(1 \cdot 1\right) - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \cdot \left(0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right)}}{1 \cdot \left(1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right) + 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{\sqrt{1 \cdot \left(1 \cdot 1\right) - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \cdot \left(0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right)} \cdot \sqrt{1 \cdot \left(1 \cdot 1\right) - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \cdot \left(0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right)}}{1 \cdot \left(1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right) + 0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
double f(double x) {
        double r6654625 = 1.0;
        double r6654626 = 0.5;
        double r6654627 = x;
        double r6654628 = hypot(r6654625, r6654627);
        double r6654629 = r6654625 / r6654628;
        double r6654630 = r6654625 + r6654629;
        double r6654631 = r6654626 * r6654630;
        double r6654632 = sqrt(r6654631);
        double r6654633 = r6654625 - r6654632;
        return r6654633;
}

double f(double x) {
        double r6654634 = 1.0;
        double r6654635 = r6654634 * r6654634;
        double r6654636 = r6654634 * r6654635;
        double r6654637 = 0.5;
        double r6654638 = x;
        double r6654639 = hypot(r6654634, r6654638);
        double r6654640 = r6654634 / r6654639;
        double r6654641 = r6654634 + r6654640;
        double r6654642 = r6654637 * r6654641;
        double r6654643 = sqrt(r6654642);
        double r6654644 = r6654643 * r6654642;
        double r6654645 = r6654636 - r6654644;
        double r6654646 = sqrt(r6654645);
        double r6654647 = r6654646 * r6654646;
        double r6654648 = r6654634 + r6654643;
        double r6654649 = r6654634 * r6654648;
        double r6654650 = r6654649 + r6654642;
        double r6654651 = r6654647 / r6654650;
        return r6654651;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.1

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

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

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

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

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

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

Reproduce

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