| Alternative 1 | |
|---|---|
| Error | 0.0 |
| Cost | 13376 |
\[\log \left(\frac{1 + \sqrt{1 - x \cdot x}}{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)
Results
Initial program 0.0
Applied egg-rr0.0
Simplified0.0
[Start]0.0 | \[ \log \left(\frac{\sqrt{1 - x \cdot x}}{x} + {x}^{-1}\right) + 0
\] |
|---|---|
+-rgt-identity [=>]0.0 | \[ \color{blue}{\log \left(\frac{\sqrt{1 - x \cdot x}}{x} + {x}^{-1}\right)}
\] |
*-lft-identity [<=]0.0 | \[ \log \left(\color{blue}{1 \cdot \frac{\sqrt{1 - x \cdot x}}{x}} + {x}^{-1}\right)
\] |
*-commutative [<=]0.0 | \[ \log \left(\color{blue}{\frac{\sqrt{1 - x \cdot x}}{x} \cdot 1} + {x}^{-1}\right)
\] |
associate-*l/ [=>]0.0 | \[ \log \left(\color{blue}{\frac{\sqrt{1 - x \cdot x} \cdot 1}{x}} + {x}^{-1}\right)
\] |
associate-*r/ [<=]0.0 | \[ \log \left(\color{blue}{\sqrt{1 - x \cdot x} \cdot \frac{1}{x}} + {x}^{-1}\right)
\] |
unpow-1 [<=]0.0 | \[ \log \left(\sqrt{1 - x \cdot x} \cdot \color{blue}{{x}^{-1}} + {x}^{-1}\right)
\] |
distribute-lft1-in [=>]0.0 | \[ \log \color{blue}{\left(\left(\sqrt{1 - x \cdot x} + 1\right) \cdot {x}^{-1}\right)}
\] |
+-commutative [<=]0.0 | \[ \log \left(\color{blue}{\left(1 + \sqrt{1 - x \cdot x}\right)} \cdot {x}^{-1}\right)
\] |
unpow-1 [=>]0.0 | \[ \log \left(\left(1 + \sqrt{1 - x \cdot x}\right) \cdot \color{blue}{\frac{1}{x}}\right)
\] |
associate-*r/ [=>]0.0 | \[ \log \color{blue}{\left(\frac{\left(1 + \sqrt{1 - x \cdot x}\right) \cdot 1}{x}\right)}
\] |
+-commutative [=>]0.0 | \[ \log \left(\frac{\color{blue}{\left(\sqrt{1 - x \cdot x} + 1\right)} \cdot 1}{x}\right)
\] |
distribute-rgt1-in [<=]0.0 | \[ \log \left(\frac{\color{blue}{1 + \sqrt{1 - x \cdot x} \cdot 1}}{x}\right)
\] |
*-rgt-identity [=>]0.0 | \[ \log \left(\frac{1 + \color{blue}{\sqrt{1 - x \cdot x}}}{x}\right)
\] |
Applied egg-rr0.0
Final simplification0.0
| Alternative 1 | |
|---|---|
| Error | 0.0 |
| Cost | 13376 |
| Alternative 2 | |
|---|---|
| Error | 0.3 |
| Cost | 7040 |
| Alternative 3 | |
|---|---|
| Error | 0.4 |
| Cost | 6976 |
| Alternative 4 | |
|---|---|
| Error | 0.4 |
| Cost | 6976 |
| Alternative 5 | |
|---|---|
| Error | 0.6 |
| Cost | 6656 |
| Alternative 6 | |
|---|---|
| Error | 0.7 |
| Cost | 6592 |
herbie shell --seed 2023056
(FPCore (x)
:name "Hyperbolic arc-(co)secant"
:precision binary64
(log (+ (/ 1.0 x) (/ (sqrt (- 1.0 (* x x))) x))))