Average Error: 15.4 → 15.0
Time: 3.6s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \frac{\frac{1}{\sqrt[3]{\mathsf{hypot}\left(1, x\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(1, x\right)}}}{\sqrt[3]{\mathsf{hypot}\left(1, x\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 - 0.5\right) - 0.5 \cdot \frac{\frac{1}{\sqrt[3]{\mathsf{hypot}\left(1, x\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(1, x\right)}}}{\sqrt[3]{\mathsf{hypot}\left(1, x\right)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}
double f(double x) {
        double r210328 = 1.0;
        double r210329 = 0.5;
        double r210330 = x;
        double r210331 = hypot(r210328, r210330);
        double r210332 = r210328 / r210331;
        double r210333 = r210328 + r210332;
        double r210334 = r210329 * r210333;
        double r210335 = sqrt(r210334);
        double r210336 = r210328 - r210335;
        return r210336;
}

double f(double x) {
        double r210337 = 1.0;
        double r210338 = 0.5;
        double r210339 = r210337 - r210338;
        double r210340 = r210337 * r210339;
        double r210341 = x;
        double r210342 = hypot(r210337, r210341);
        double r210343 = cbrt(r210342);
        double r210344 = r210343 * r210343;
        double r210345 = r210337 / r210344;
        double r210346 = r210345 / r210343;
        double r210347 = r210338 * r210346;
        double r210348 = r210340 - r210347;
        double r210349 = r210337 / r210342;
        double r210350 = r210337 + r210349;
        double r210351 = r210338 * r210350;
        double r210352 = sqrt(r210351);
        double r210353 = r210337 + r210352;
        double r210354 = r210348 / r210353;
        return r210354;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.4

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

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

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

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

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

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

Reproduce

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