Average Error: 0.1 → 0.1
Time: 3.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 r92478 = 1.0;
        double r92479 = x;
        double r92480 = r92478 / r92479;
        double r92481 = r92479 * r92479;
        double r92482 = r92478 - r92481;
        double r92483 = sqrt(r92482);
        double r92484 = r92483 / r92479;
        double r92485 = r92480 + r92484;
        double r92486 = log(r92485);
        return r92486;
}

double f(double x) {
        double r92487 = 1.0;
        double r92488 = x;
        double r92489 = r92487 / r92488;
        double r92490 = r92488 * r92488;
        double r92491 = r92487 - r92490;
        double r92492 = sqrt(r92491);
        double r92493 = r92492 / r92488;
        double r92494 = r92489 + r92493;
        double r92495 = log(r92494);
        return r92495;
}

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 2020003 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  :precision binary64
  (log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x))))