Average Error: 15.0 → 14.5
Time: 9.4s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\frac{\left(0.875 - \left(\frac{0.375}{\mathsf{hypot}\left(1, x\right)} + \frac{0.375}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{2}}\right)\right) - \log \left(e^{\frac{0.125}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}}\right)}{1.75 + \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + \frac{0.25}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{2}}\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{\frac{\left(0.875 - \left(\frac{0.375}{\mathsf{hypot}\left(1, x\right)} + \frac{0.375}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{2}}\right)\right) - \log \left(e^{\frac{0.125}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}}\right)}{1.75 + \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + \frac{0.25}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{2}}\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}
double f(double x) {
        double r174582 = 1.0;
        double r174583 = 0.5;
        double r174584 = x;
        double r174585 = hypot(r174582, r174584);
        double r174586 = r174582 / r174585;
        double r174587 = r174582 + r174586;
        double r174588 = r174583 * r174587;
        double r174589 = sqrt(r174588);
        double r174590 = r174582 - r174589;
        return r174590;
}

double f(double x) {
        double r174591 = 0.875;
        double r174592 = 0.375;
        double r174593 = 1.0;
        double r174594 = x;
        double r174595 = hypot(r174593, r174594);
        double r174596 = r174592 / r174595;
        double r174597 = 2.0;
        double r174598 = pow(r174595, r174597);
        double r174599 = r174592 / r174598;
        double r174600 = r174596 + r174599;
        double r174601 = r174591 - r174600;
        double r174602 = 0.125;
        double r174603 = 3.0;
        double r174604 = pow(r174595, r174603);
        double r174605 = r174602 / r174604;
        double r174606 = exp(r174605);
        double r174607 = log(r174606);
        double r174608 = r174601 - r174607;
        double r174609 = 1.75;
        double r174610 = r174593 / r174595;
        double r174611 = 0.25;
        double r174612 = r174611 / r174598;
        double r174613 = r174610 + r174612;
        double r174614 = r174609 + r174613;
        double r174615 = r174608 / r174614;
        double r174616 = 0.5;
        double r174617 = r174593 + r174610;
        double r174618 = r174616 * r174617;
        double r174619 = sqrt(r174618);
        double r174620 = r174593 + r174619;
        double r174621 = r174615 / r174620;
        return r174621;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.0

    \[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 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. Using strategy rm
  6. Applied flip3--14.5

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

    \[\leadsto \frac{\frac{\color{blue}{{1}^{6} - {\left(0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right)}^{3}}}{\left(1 \cdot 1\right) \cdot \left(1 \cdot 1\right) + \left(\left(0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \left(0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right) + \left(1 \cdot 1\right) \cdot \left(0.5 \cdot \left(1 + \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)}}\]
  8. Simplified14.5

    \[\leadsto \frac{\frac{{1}^{6} - {\left(0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right)}^{3}}{\color{blue}{{1}^{4} + \left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right) \cdot \left(1 \cdot 1 + 0.5 \cdot \left(1 + \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. Taylor expanded around 0 14.5

    \[\leadsto \frac{\color{blue}{\frac{0.875 - \left(0.375 \cdot \frac{1}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{2}} + \left(0.375 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)} + 0.125 \cdot \frac{1}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}\right)\right)}{1.75 + \left(1 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)} + 0.25 \cdot \frac{1}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{2}}\right)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  10. Simplified14.5

    \[\leadsto \frac{\color{blue}{\frac{\left(0.875 - \left(\frac{0.375}{\mathsf{hypot}\left(1, x\right)} + \frac{0.375}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{2}}\right)\right) - \frac{0.125}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}}{1.75 + \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + \frac{0.25}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{2}}\right)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  11. Using strategy rm
  12. Applied add-log-exp14.5

    \[\leadsto \frac{\frac{\left(0.875 - \left(\frac{0.375}{\mathsf{hypot}\left(1, x\right)} + \frac{0.375}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{2}}\right)\right) - \color{blue}{\log \left(e^{\frac{0.125}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}}\right)}}{1.75 + \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + \frac{0.25}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{2}}\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  13. Final simplification14.5

    \[\leadsto \frac{\frac{\left(0.875 - \left(\frac{0.375}{\mathsf{hypot}\left(1, x\right)} + \frac{0.375}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{2}}\right)\right) - \log \left(e^{\frac{0.125}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}}\right)}{1.75 + \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + \frac{0.25}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{2}}\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]

Reproduce

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