Average Error: 15.3 → 14.8
Time: 7.1s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[e^{\log \left(\frac{1 \cdot 1 - 0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}{1 + \sqrt{\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5}}\right)}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
e^{\log \left(\frac{1 \cdot 1 - 0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}{1 + \sqrt{\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5}}\right)}
double f(double x) {
        double r193120 = 1.0;
        double r193121 = 0.5;
        double r193122 = x;
        double r193123 = hypot(r193120, r193122);
        double r193124 = r193120 / r193123;
        double r193125 = r193120 + r193124;
        double r193126 = r193121 * r193125;
        double r193127 = sqrt(r193126);
        double r193128 = r193120 - r193127;
        return r193128;
}

double f(double x) {
        double r193129 = 1.0;
        double r193130 = r193129 * r193129;
        double r193131 = 0.5;
        double r193132 = x;
        double r193133 = hypot(r193129, r193132);
        double r193134 = r193129 / r193133;
        double r193135 = r193129 + r193134;
        double r193136 = r193131 * r193135;
        double r193137 = r193130 - r193136;
        double r193138 = r193135 * r193131;
        double r193139 = sqrt(r193138);
        double r193140 = r193129 + r193139;
        double r193141 = r193137 / r193140;
        double r193142 = log(r193141);
        double r193143 = exp(r193142);
        return r193143;
}

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. Simplified14.8

    \[\leadsto \frac{1 \cdot 1 - 0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}{\color{blue}{1 + \sqrt{\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5}}}\]
  6. Using strategy rm
  7. Applied add-exp-log14.8

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

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

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

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

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

Reproduce

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