Average Error: 15.3 → 14.8
Time: 10.2s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\left(1 \cdot \left(1 - 0.5\right) - \frac{\frac{1}{\sqrt{\mathsf{hypot}\left(1, x\right)}}}{\sqrt{\mathsf{hypot}\left(1, x\right)}} \cdot 0.5\right) \cdot \frac{1}{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)}
\left(1 \cdot \left(1 - 0.5\right) - \frac{\frac{1}{\sqrt{\mathsf{hypot}\left(1, x\right)}}}{\sqrt{\mathsf{hypot}\left(1, x\right)}} \cdot 0.5\right) \cdot \frac{1}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}
double f(double x) {
        double r253619 = 1.0;
        double r253620 = 0.5;
        double r253621 = x;
        double r253622 = hypot(r253619, r253621);
        double r253623 = r253619 / r253622;
        double r253624 = r253619 + r253623;
        double r253625 = r253620 * r253624;
        double r253626 = sqrt(r253625);
        double r253627 = r253619 - r253626;
        return r253627;
}

double f(double x) {
        double r253628 = 1.0;
        double r253629 = 0.5;
        double r253630 = r253628 - r253629;
        double r253631 = r253628 * r253630;
        double r253632 = x;
        double r253633 = hypot(r253628, r253632);
        double r253634 = sqrt(r253633);
        double r253635 = r253628 / r253634;
        double r253636 = r253635 / r253634;
        double r253637 = r253636 * r253629;
        double r253638 = r253631 - r253637;
        double r253639 = 1.0;
        double r253640 = r253628 / r253633;
        double r253641 = r253628 + r253640;
        double r253642 = r253629 * r253641;
        double r253643 = sqrt(r253642);
        double r253644 = r253628 + r253643;
        double r253645 = r253639 / r253644;
        double r253646 = r253638 * r253645;
        return r253646;
}

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 1 - 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)}}\]
  5. Using strategy rm
  6. Applied add-sqr-sqrt14.9

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

    \[\leadsto \frac{1 \cdot 1 - 0.5 \cdot \left(1 + \color{blue}{\frac{\frac{1}{\sqrt{\mathsf{hypot}\left(1, x\right)}}}{\sqrt{\mathsf{hypot}\left(1, x\right)}}}\right)}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  8. Using strategy rm
  9. Applied distribute-rgt-in14.8

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

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

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

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

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

Reproduce

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