Average Error: 0.0 → 0.0
Time: 13.3s
Precision: 64
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\[\log \left(\frac{1}{x} \cdot \left(1 + \sqrt{1 - x \cdot x}\right)\right)\]
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log \left(\frac{1}{x} \cdot \left(1 + \sqrt{1 - x \cdot x}\right)\right)
double f(double x) {
        double r61289 = 1.0;
        double r61290 = x;
        double r61291 = r61289 / r61290;
        double r61292 = r61290 * r61290;
        double r61293 = r61289 - r61292;
        double r61294 = sqrt(r61293);
        double r61295 = r61294 / r61290;
        double r61296 = r61291 + r61295;
        double r61297 = log(r61296);
        return r61297;
}

double f(double x) {
        double r61298 = 1.0;
        double r61299 = x;
        double r61300 = r61298 / r61299;
        double r61301 = 1.0;
        double r61302 = r61299 * r61299;
        double r61303 = r61301 - r61302;
        double r61304 = sqrt(r61303);
        double r61305 = r61301 + r61304;
        double r61306 = r61300 * r61305;
        double r61307 = log(r61306);
        return r61307;
}

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. Using strategy rm
  3. Applied div-inv0.0

    \[\leadsto \log \left(\frac{1}{x} + \color{blue}{\sqrt{1 - x \cdot x} \cdot \frac{1}{x}}\right)\]
  4. Applied div-inv0.0

    \[\leadsto \log \left(\color{blue}{1 \cdot \frac{1}{x}} + \sqrt{1 - x \cdot x} \cdot \frac{1}{x}\right)\]
  5. Applied distribute-rgt-out0.0

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

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

Reproduce

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