Average Error: 0.0 → 0.0
Time: 2.5s
Precision: 64
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
double f(double x) {
        double r99899 = 1.0;
        double r99900 = x;
        double r99901 = r99899 / r99900;
        double r99902 = r99900 * r99900;
        double r99903 = r99899 - r99902;
        double r99904 = sqrt(r99903);
        double r99905 = r99904 / r99900;
        double r99906 = r99901 + r99905;
        double r99907 = log(r99906);
        return r99907;
}

double f(double x) {
        double r99908 = 1.0;
        double r99909 = x;
        double r99910 = r99908 / r99909;
        double r99911 = r99909 * r99909;
        double r99912 = r99908 - r99911;
        double r99913 = sqrt(r99912);
        double r99914 = r99913 / r99909;
        double r99915 = r99910 + r99914;
        double r99916 = log(r99915);
        return r99916;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
  2. Final simplification0.0

    \[\leadsto \log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]

Reproduce

herbie shell --seed 2020002 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  :precision binary64
  (log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x))))