Average Error: 14.9 → 14.5
Time: 3.8s
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 \left(\log \left(\sqrt{e^{\frac{1}{\mathsf{hypot}\left(1, x\right)}}}\right) + \log \left(\sqrt{e^{\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)}}\]
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 \left(\log \left(\sqrt{e^{\frac{1}{\mathsf{hypot}\left(1, x\right)}}}\right) + \log \left(\sqrt{e^{\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)}}
double f(double x) {
        double r138636 = 1.0;
        double r138637 = 0.5;
        double r138638 = x;
        double r138639 = hypot(r138636, r138638);
        double r138640 = r138636 / r138639;
        double r138641 = r138636 + r138640;
        double r138642 = r138637 * r138641;
        double r138643 = sqrt(r138642);
        double r138644 = r138636 - r138643;
        return r138644;
}

double f(double x) {
        double r138645 = 1.0;
        double r138646 = 0.5;
        double r138647 = r138645 - r138646;
        double r138648 = r138645 * r138647;
        double r138649 = x;
        double r138650 = hypot(r138645, r138649);
        double r138651 = r138645 / r138650;
        double r138652 = exp(r138651);
        double r138653 = sqrt(r138652);
        double r138654 = log(r138653);
        double r138655 = r138654 + r138654;
        double r138656 = r138646 * r138655;
        double r138657 = r138648 - r138656;
        double r138658 = r138645 + r138651;
        double r138659 = r138646 * r138658;
        double r138660 = sqrt(r138659);
        double r138661 = r138645 + r138660;
        double r138662 = r138657 / r138661;
        return r138662;
}

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--15.0

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

    \[\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-log-exp14.5

    \[\leadsto \frac{1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \color{blue}{\log \left(e^{\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-sqr-sqrt14.5

    \[\leadsto \frac{1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \log \color{blue}{\left(\sqrt{e^{\frac{1}{\mathsf{hypot}\left(1, x\right)}}} \cdot \sqrt{e^{\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)}}\]
  9. Applied log-prod14.5

    \[\leadsto \frac{1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \color{blue}{\left(\log \left(\sqrt{e^{\frac{1}{\mathsf{hypot}\left(1, x\right)}}}\right) + \log \left(\sqrt{e^{\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)}}\]
  10. Final simplification14.5

    \[\leadsto \frac{1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \left(\log \left(\sqrt{e^{\frac{1}{\mathsf{hypot}\left(1, x\right)}}}\right) + \log \left(\sqrt{e^{\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)}}\]

Reproduce

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