?

Average Accuracy: 99.9% → 100.0%
Time: 4.8s
Precision: binary64
Cost: 13440

?

\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right) \]
\[-\log \left(\frac{x}{1 + \sqrt{1 - x \cdot x}}\right) \]
(FPCore (x)
 :precision binary64
 (log (+ (/ 1.0 x) (/ (sqrt (- 1.0 (* x x))) x))))
(FPCore (x) :precision binary64 (- (log (/ x (+ 1.0 (sqrt (- 1.0 (* x x))))))))
double code(double x) {
	return log(((1.0 / x) + (sqrt((1.0 - (x * x))) / x)));
}
double code(double x) {
	return -log((x / (1.0 + sqrt((1.0 - (x * x))))));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = log(((1.0d0 / x) + (sqrt((1.0d0 - (x * x))) / x)))
end function
real(8) function code(x)
    real(8), intent (in) :: x
    code = -log((x / (1.0d0 + sqrt((1.0d0 - (x * x))))))
end function
public static double code(double x) {
	return Math.log(((1.0 / x) + (Math.sqrt((1.0 - (x * x))) / x)));
}
public static double code(double x) {
	return -Math.log((x / (1.0 + Math.sqrt((1.0 - (x * x))))));
}
def code(x):
	return math.log(((1.0 / x) + (math.sqrt((1.0 - (x * x))) / x)))
def code(x):
	return -math.log((x / (1.0 + math.sqrt((1.0 - (x * x))))))
function code(x)
	return log(Float64(Float64(1.0 / x) + Float64(sqrt(Float64(1.0 - Float64(x * x))) / x)))
end
function code(x)
	return Float64(-log(Float64(x / Float64(1.0 + sqrt(Float64(1.0 - Float64(x * x)))))))
end
function tmp = code(x)
	tmp = log(((1.0 / x) + (sqrt((1.0 - (x * x))) / x)));
end
function tmp = code(x)
	tmp = -log((x / (1.0 + sqrt((1.0 - (x * x))))));
end
code[x_] := N[Log[N[(N[(1.0 / x), $MachinePrecision] + N[(N[Sqrt[N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
code[x_] := (-N[Log[N[(x / N[(1.0 + N[Sqrt[N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
-\log \left(\frac{x}{1 + \sqrt{1 - x \cdot x}}\right)

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 99.9%

    \[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right) \]
  2. Applied egg-rr99.9%

    \[\leadsto \color{blue}{\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right) + 0} \]
  3. Simplified99.9%

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

    [Start]99.9

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

    +-rgt-identity [=>]99.9

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

    *-lft-identity [<=]99.9

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

    distribute-lft-in [=>]99.9

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

    associate-*r/ [=>]99.9

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

    associate-*l/ [<=]99.9

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

    *-commutative [=>]99.9

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

    distribute-rgt-in [<=]99.9

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

    associate-*l/ [=>]99.9

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

    *-lft-identity [=>]99.9

    \[ \log \left(\frac{\color{blue}{1 + \sqrt{1 - x \cdot x}}}{x}\right) \]
  4. Applied egg-rr100.0%

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

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

Alternatives

Alternative 1
Accuracy99.9%
Cost13376
\[\log \left(\frac{1 + \sqrt{1 - x \cdot x}}{x}\right) \]
Alternative 2
Accuracy99.6%
Cost7040
\[-\log \left(\frac{x}{2 + \left(x \cdot x\right) \cdot -0.5}\right) \]
Alternative 3
Accuracy99.6%
Cost6976
\[\log \left(x \cdot -0.5 + 2 \cdot \frac{1}{x}\right) \]
Alternative 4
Accuracy99.1%
Cost6592
\[\log \left(\frac{2}{x}\right) \]
Alternative 5
Accuracy2.7%
Cost320
\[x \cdot \left(x \cdot -0.25\right) \]

Error

Reproduce?

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