Average Error: 0.1 → 0.1
Time: 5.2s
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 r81184 = 1.0;
        double r81185 = x;
        double r81186 = r81184 / r81185;
        double r81187 = r81185 * r81185;
        double r81188 = r81184 - r81187;
        double r81189 = sqrt(r81188);
        double r81190 = r81189 / r81185;
        double r81191 = r81186 + r81190;
        double r81192 = log(r81191);
        return r81192;
}

double f(double x) {
        double r81193 = 1.0;
        double r81194 = x;
        double r81195 = r81193 / r81194;
        double r81196 = r81194 * r81194;
        double r81197 = r81193 - r81196;
        double r81198 = sqrt(r81197);
        double r81199 = r81198 / r81194;
        double r81200 = r81195 + r81199;
        double r81201 = log(r81200);
        return r81201;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

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

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

Reproduce

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