Average Error: 15.5 → 15.1
Time: 8.2s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{1 \cdot \left(1 - \left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\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{1 \cdot \left(1 - \left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 0.5\right)\right)}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}
double f(double x) {
        double r237542 = 1.0;
        double r237543 = 0.5;
        double r237544 = x;
        double r237545 = hypot(r237542, r237544);
        double r237546 = r237542 / r237545;
        double r237547 = r237542 + r237546;
        double r237548 = r237543 * r237547;
        double r237549 = sqrt(r237548);
        double r237550 = r237542 - r237549;
        return r237550;
}

double f(double x) {
        double r237551 = 1.0;
        double r237552 = 0.5;
        double r237553 = x;
        double r237554 = hypot(r237551, r237553);
        double r237555 = r237552 / r237554;
        double r237556 = r237555 + r237552;
        double r237557 = r237551 - r237556;
        double r237558 = r237551 * r237557;
        double r237559 = r237551 / r237554;
        double r237560 = r237551 + r237559;
        double r237561 = r237552 * r237560;
        double r237562 = sqrt(r237561);
        double r237563 = r237551 + r237562;
        double r237564 = r237558 / r237563;
        return r237564;
}

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.6

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

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

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

Reproduce

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