Average Error: 0.0 → 0.0
Time: 2.1s
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 r68701 = 1.0;
        double r68702 = x;
        double r68703 = r68701 / r68702;
        double r68704 = r68702 * r68702;
        double r68705 = r68701 - r68704;
        double r68706 = sqrt(r68705);
        double r68707 = r68706 / r68702;
        double r68708 = r68703 + r68707;
        double r68709 = log(r68708);
        return r68709;
}

double f(double x) {
        double r68710 = 1.0;
        double r68711 = x;
        double r68712 = r68710 / r68711;
        double r68713 = r68711 * r68711;
        double r68714 = r68710 - r68713;
        double r68715 = sqrt(r68714);
        double r68716 = r68715 / r68711;
        double r68717 = r68712 + r68716;
        double r68718 = log(r68717);
        return r68718;
}

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