Average Error: 16.0 → 15.5
Time: 27.6s
Precision: 64
\[1 - \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\frac{1}{2} - \log \left(e^{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}\right)}{\sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}} + 1}\]
1 - \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{\frac{1}{2} - \log \left(e^{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}\right)}{\sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}} + 1}
double f(double x) {
        double r7521489 = 1.0;
        double r7521490 = 0.5;
        double r7521491 = x;
        double r7521492 = hypot(r7521489, r7521491);
        double r7521493 = r7521489 / r7521492;
        double r7521494 = r7521489 + r7521493;
        double r7521495 = r7521490 * r7521494;
        double r7521496 = sqrt(r7521495);
        double r7521497 = r7521489 - r7521496;
        return r7521497;
}

double f(double x) {
        double r7521498 = 0.5;
        double r7521499 = 1.0;
        double r7521500 = x;
        double r7521501 = hypot(r7521499, r7521500);
        double r7521502 = r7521498 / r7521501;
        double r7521503 = exp(r7521502);
        double r7521504 = log(r7521503);
        double r7521505 = r7521498 - r7521504;
        double r7521506 = r7521498 + r7521502;
        double r7521507 = sqrt(r7521506);
        double r7521508 = r7521507 + r7521499;
        double r7521509 = r7521505 / r7521508;
        return r7521509;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 16.0

    \[1 - \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
  2. Simplified16.0

    \[\leadsto \color{blue}{1 - \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\]
  3. Using strategy rm
  4. Applied flip--16.0

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

    \[\leadsto \frac{\color{blue}{\frac{1}{2} - \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\]
  6. Using strategy rm
  7. Applied add-log-exp15.5

    \[\leadsto \frac{\frac{1}{2} - \color{blue}{\log \left(e^{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}\right)}}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\]
  8. Final simplification15.5

    \[\leadsto \frac{\frac{1}{2} - \log \left(e^{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}\right)}{\sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}} + 1}\]

Reproduce

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