Average Error: 14.9 → 14.4
Time: 4.4s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{{e}^{\left(\log \left(1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \left(\sqrt{\frac{1}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{\frac{1}{\mathsf{hypot}\left(1, x\right)}}\right)\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{{e}^{\left(\log \left(1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \left(\sqrt{\frac{1}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{\frac{1}{\mathsf{hypot}\left(1, x\right)}}\right)\right)\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}
double f(double x) {
        double r289051 = 1.0;
        double r289052 = 0.5;
        double r289053 = x;
        double r289054 = hypot(r289051, r289053);
        double r289055 = r289051 / r289054;
        double r289056 = r289051 + r289055;
        double r289057 = r289052 * r289056;
        double r289058 = sqrt(r289057);
        double r289059 = r289051 - r289058;
        return r289059;
}

double f(double x) {
        double r289060 = exp(1.0);
        double r289061 = 1.0;
        double r289062 = 0.5;
        double r289063 = r289061 - r289062;
        double r289064 = r289061 * r289063;
        double r289065 = x;
        double r289066 = hypot(r289061, r289065);
        double r289067 = r289061 / r289066;
        double r289068 = sqrt(r289067);
        double r289069 = r289068 * r289068;
        double r289070 = r289062 * r289069;
        double r289071 = r289064 - r289070;
        double r289072 = log(r289071);
        double r289073 = pow(r289060, r289072);
        double r289074 = r289061 + r289067;
        double r289075 = r289062 * r289074;
        double r289076 = sqrt(r289075);
        double r289077 = r289061 + r289076;
        double r289078 = r289073 / r289077;
        return r289078;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.9

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

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

    \[\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-sqr-sqrt14.4

    \[\leadsto \frac{1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \color{blue}{\left(\sqrt{\frac{1}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{\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)}}\]
  7. Using strategy rm
  8. Applied add-exp-log14.4

    \[\leadsto \frac{\color{blue}{e^{\log \left(1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \left(\sqrt{\frac{1}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{\frac{1}{\mathsf{hypot}\left(1, x\right)}}\right)\right)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  9. Using strategy rm
  10. Applied pow114.4

    \[\leadsto \frac{e^{\log \color{blue}{\left({\left(1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \left(\sqrt{\frac{1}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{\frac{1}{\mathsf{hypot}\left(1, x\right)}}\right)\right)}^{1}\right)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  11. Applied log-pow14.4

    \[\leadsto \frac{e^{\color{blue}{1 \cdot \log \left(1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \left(\sqrt{\frac{1}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{\frac{1}{\mathsf{hypot}\left(1, x\right)}}\right)\right)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  12. Applied exp-prod14.4

    \[\leadsto \frac{\color{blue}{{\left(e^{1}\right)}^{\left(\log \left(1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \left(\sqrt{\frac{1}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{\frac{1}{\mathsf{hypot}\left(1, x\right)}}\right)\right)\right)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  13. Simplified14.4

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

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

Reproduce

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