Average Error: 0.0 → 0.0
Time: 2.0s
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 r64380 = 1.0;
        double r64381 = x;
        double r64382 = r64380 / r64381;
        double r64383 = r64381 * r64381;
        double r64384 = r64380 - r64383;
        double r64385 = sqrt(r64384);
        double r64386 = r64385 / r64381;
        double r64387 = r64382 + r64386;
        double r64388 = log(r64387);
        return r64388;
}

double f(double x) {
        double r64389 = 1.0;
        double r64390 = x;
        double r64391 = r64389 / r64390;
        double r64392 = r64390 * r64390;
        double r64393 = r64389 - r64392;
        double r64394 = sqrt(r64393);
        double r64395 = r64394 / r64390;
        double r64396 = r64391 + r64395;
        double r64397 = log(r64396);
        return r64397;
}

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