Average Error: 0.0 → 0.2
Time: 1.7s
Precision: binary64
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\[\log \left(\frac{1}{\sqrt{x}} + \frac{\sqrt{1 - x \cdot x}}{\sqrt{x}}\right) - \log \left(\sqrt{x}\right)\]
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log \left(\frac{1}{\sqrt{x}} + \frac{\sqrt{1 - x \cdot x}}{\sqrt{x}}\right) - \log \left(\sqrt{x}\right)
(FPCore (x)
 :precision binary64
 (log (+ (/ 1.0 x) (/ (sqrt (- 1.0 (* x x))) x))))
(FPCore (x)
 :precision binary64
 (-
  (log (+ (/ 1.0 (sqrt x)) (/ (sqrt (- 1.0 (* x x))) (sqrt x))))
  (log (sqrt x))))
double code(double x) {
	return ((double) log(((double) ((1.0 / x) + (((double) sqrt(((double) (1.0 - ((double) (x * x)))))) / x)))));
}
double code(double x) {
	return ((double) (((double) log(((double) ((1.0 / ((double) sqrt(x))) + (((double) sqrt(((double) (1.0 - ((double) (x * x)))))) / ((double) sqrt(x))))))) - ((double) log(((double) sqrt(x))))));
}

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 add-sqr-sqrt0.0

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

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

    \[\leadsto \log \left(\frac{1}{x} + \color{blue}{\frac{1}{\sqrt{x}} \cdot \frac{\sqrt{1 - x \cdot x}}{\sqrt{x}}}\right)\]
  6. Applied add-sqr-sqrt0.0

    \[\leadsto \log \left(\frac{1}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}} + \frac{1}{\sqrt{x}} \cdot \frac{\sqrt{1 - x \cdot x}}{\sqrt{x}}\right)\]
  7. Applied *-un-lft-identity0.0

    \[\leadsto \log \left(\frac{\color{blue}{1 \cdot 1}}{\sqrt{x} \cdot \sqrt{x}} + \frac{1}{\sqrt{x}} \cdot \frac{\sqrt{1 - x \cdot x}}{\sqrt{x}}\right)\]
  8. Applied times-frac0.0

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

    \[\leadsto \log \color{blue}{\left(\frac{1}{\sqrt{x}} \cdot \left(\frac{1}{\sqrt{x}} + \frac{\sqrt{1 - x \cdot x}}{\sqrt{x}}\right)\right)}\]
  10. Applied log-prod0.2

    \[\leadsto \color{blue}{\log \left(\frac{1}{\sqrt{x}}\right) + \log \left(\frac{1}{\sqrt{x}} + \frac{\sqrt{1 - x \cdot x}}{\sqrt{x}}\right)}\]
  11. Simplified0.2

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

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

Reproduce

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