
(FPCore (x n) :precision binary64 (- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))
double code(double x, double n) {
return pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n));
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
code = ((x + 1.0d0) ** (1.0d0 / n)) - (x ** (1.0d0 / n))
end function
public static double code(double x, double n) {
return Math.pow((x + 1.0), (1.0 / n)) - Math.pow(x, (1.0 / n));
}
def code(x, n): return math.pow((x + 1.0), (1.0 / n)) - math.pow(x, (1.0 / n))
function code(x, n) return Float64((Float64(x + 1.0) ^ Float64(1.0 / n)) - (x ^ Float64(1.0 / n))) end
function tmp = code(x, n) tmp = ((x + 1.0) ^ (1.0 / n)) - (x ^ (1.0 / n)); end
code[x_, n_] := N[(N[Power[N[(x + 1.0), $MachinePrecision], N[(1.0 / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x n) :precision binary64 (- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))
double code(double x, double n) {
return pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n));
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
code = ((x + 1.0d0) ** (1.0d0 / n)) - (x ** (1.0d0 / n))
end function
public static double code(double x, double n) {
return Math.pow((x + 1.0), (1.0 / n)) - Math.pow(x, (1.0 / n));
}
def code(x, n): return math.pow((x + 1.0), (1.0 / n)) - math.pow(x, (1.0 / n))
function code(x, n) return Float64((Float64(x + 1.0) ^ Float64(1.0 / n)) - (x ^ Float64(1.0 / n))) end
function tmp = code(x, n) tmp = ((x + 1.0) ^ (1.0 / n)) - (x ^ (1.0 / n)); end
code[x_, n_] := N[(N[Power[N[(x + 1.0), $MachinePrecision], N[(1.0 / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (cbrt (- (pow x (/ 1.0 n))))))
(if (<= (/ 1.0 n) -1e-173)
(/ (exp (/ (log x) n)) (* x n))
(if (<= (/ 1.0 n) 5e-13)
(/
(+
(log1p x)
(- (* 0.5 (/ (- (pow (log1p x) 2.0) (pow (log x) 2.0)) n)) (log x)))
n)
(fma (* t_0 t_0) t_0 (exp (/ (log1p x) n)))))))
double code(double x, double n) {
double t_0 = cbrt(-pow(x, (1.0 / n)));
double tmp;
if ((1.0 / n) <= -1e-173) {
tmp = exp((log(x) / n)) / (x * n);
} else if ((1.0 / n) <= 5e-13) {
tmp = (log1p(x) + ((0.5 * ((pow(log1p(x), 2.0) - pow(log(x), 2.0)) / n)) - log(x))) / n;
} else {
tmp = fma((t_0 * t_0), t_0, exp((log1p(x) / n)));
}
return tmp;
}
function code(x, n) t_0 = cbrt(Float64(-(x ^ Float64(1.0 / n)))) tmp = 0.0 if (Float64(1.0 / n) <= -1e-173) tmp = Float64(exp(Float64(log(x) / n)) / Float64(x * n)); elseif (Float64(1.0 / n) <= 5e-13) tmp = Float64(Float64(log1p(x) + Float64(Float64(0.5 * Float64(Float64((log1p(x) ^ 2.0) - (log(x) ^ 2.0)) / n)) - log(x))) / n); else tmp = fma(Float64(t_0 * t_0), t_0, exp(Float64(log1p(x) / n))); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Power[(-N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), 1/3], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-173], N[(N[Exp[N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-13], N[(N[(N[Log[1 + x], $MachinePrecision] + N[(N[(0.5 * N[(N[(N[Power[N[Log[1 + x], $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[(t$95$0 * t$95$0), $MachinePrecision] * t$95$0 + N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{-{x}^{\left(\frac{1}{n}\right)}}\\
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-173}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-13}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}{n}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0 \cdot t\_0, t\_0, e^{\frac{\mathsf{log1p}\left(x\right)}{n}}\right)\\
\end{array}
\end{array}
if (/.f64 1 n) < -1e-173Initial program 72.1%
Taylor expanded in x around inf 85.8%
mul-1-neg85.8%
log-rec85.8%
mul-1-neg85.8%
distribute-neg-frac85.8%
mul-1-neg85.8%
remove-double-neg85.8%
*-commutative85.8%
Simplified85.8%
if -1e-173 < (/.f64 1 n) < 4.9999999999999999e-13Initial program 39.2%
Taylor expanded in n around inf 85.7%
associate--l+85.7%
log1p-define85.7%
+-commutative85.7%
associate--r+85.7%
distribute-lft-out--85.7%
div-sub85.7%
log1p-define85.7%
Simplified85.7%
if 4.9999999999999999e-13 < (/.f64 1 n) Initial program 49.6%
sub-neg49.6%
+-commutative49.6%
add-cube-cbrt49.6%
fma-define49.8%
pow-to-exp49.8%
un-div-inv49.8%
+-commutative49.8%
log1p-define99.4%
Applied egg-rr99.4%
Final simplification87.4%
(FPCore (x n)
:precision binary64
(if (<= x 0.052)
(/
(-
(+
(log1p x)
(/
(+
(* 0.5 (- (pow (log1p x) 2.0) (pow (log x) 2.0)))
(*
0.16666666666666666
(/ (- (pow (log1p x) 3.0) (pow (log x) 3.0)) n)))
n))
(log x))
n)
(/ (exp (/ (log x) n)) (* x n))))
double code(double x, double n) {
double tmp;
if (x <= 0.052) {
tmp = ((log1p(x) + (((0.5 * (pow(log1p(x), 2.0) - pow(log(x), 2.0))) + (0.16666666666666666 * ((pow(log1p(x), 3.0) - pow(log(x), 3.0)) / n))) / n)) - log(x)) / n;
} else {
tmp = exp((log(x) / n)) / (x * n);
}
return tmp;
}
public static double code(double x, double n) {
double tmp;
if (x <= 0.052) {
tmp = ((Math.log1p(x) + (((0.5 * (Math.pow(Math.log1p(x), 2.0) - Math.pow(Math.log(x), 2.0))) + (0.16666666666666666 * ((Math.pow(Math.log1p(x), 3.0) - Math.pow(Math.log(x), 3.0)) / n))) / n)) - Math.log(x)) / n;
} else {
tmp = Math.exp((Math.log(x) / n)) / (x * n);
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 0.052: tmp = ((math.log1p(x) + (((0.5 * (math.pow(math.log1p(x), 2.0) - math.pow(math.log(x), 2.0))) + (0.16666666666666666 * ((math.pow(math.log1p(x), 3.0) - math.pow(math.log(x), 3.0)) / n))) / n)) - math.log(x)) / n else: tmp = math.exp((math.log(x) / n)) / (x * n) return tmp
function code(x, n) tmp = 0.0 if (x <= 0.052) tmp = Float64(Float64(Float64(log1p(x) + Float64(Float64(Float64(0.5 * Float64((log1p(x) ^ 2.0) - (log(x) ^ 2.0))) + Float64(0.16666666666666666 * Float64(Float64((log1p(x) ^ 3.0) - (log(x) ^ 3.0)) / n))) / n)) - log(x)) / n); else tmp = Float64(exp(Float64(log(x) / n)) / Float64(x * n)); end return tmp end
code[x_, n_] := If[LessEqual[x, 0.052], N[(N[(N[(N[Log[1 + x], $MachinePrecision] + N[(N[(N[(0.5 * N[(N[Power[N[Log[1 + x], $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.16666666666666666 * N[(N[(N[Power[N[Log[1 + x], $MachinePrecision], 3.0], $MachinePrecision] - N[Power[N[Log[x], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[Exp[N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.052:\\
\;\;\;\;\frac{\left(\mathsf{log1p}\left(x\right) + \frac{0.5 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}\right) + 0.16666666666666666 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}}{n}}{n}\right) - \log x}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{x \cdot n}\\
\end{array}
\end{array}
if x < 0.0519999999999999976Initial program 45.2%
Taylor expanded in n around -inf 76.7%
Simplified76.7%
if 0.0519999999999999976 < x Initial program 70.5%
Taylor expanded in x around inf 96.6%
mul-1-neg96.6%
log-rec96.6%
mul-1-neg96.6%
distribute-neg-frac96.6%
mul-1-neg96.6%
remove-double-neg96.6%
*-commutative96.6%
Simplified96.6%
Final simplification86.1%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -1e-173)
(/ (exp (/ (log x) n)) (* x n))
(if (<= (/ 1.0 n) 5e-15)
(/
(+
(log1p x)
(- (* 0.5 (/ (- (pow (log1p x) 2.0) (pow (log x) 2.0)) n)) (log x)))
n)
(pow
(pow (cbrt (cbrt (- (exp (/ (log1p x) n)) (pow x (/ 1.0 n))))) 3.0)
3.0))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e-173) {
tmp = exp((log(x) / n)) / (x * n);
} else if ((1.0 / n) <= 5e-15) {
tmp = (log1p(x) + ((0.5 * ((pow(log1p(x), 2.0) - pow(log(x), 2.0)) / n)) - log(x))) / n;
} else {
tmp = pow(pow(cbrt(cbrt((exp((log1p(x) / n)) - pow(x, (1.0 / n))))), 3.0), 3.0);
}
return tmp;
}
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e-173) {
tmp = Math.exp((Math.log(x) / n)) / (x * n);
} else if ((1.0 / n) <= 5e-15) {
tmp = (Math.log1p(x) + ((0.5 * ((Math.pow(Math.log1p(x), 2.0) - Math.pow(Math.log(x), 2.0)) / n)) - Math.log(x))) / n;
} else {
tmp = Math.pow(Math.pow(Math.cbrt(Math.cbrt((Math.exp((Math.log1p(x) / n)) - Math.pow(x, (1.0 / n))))), 3.0), 3.0);
}
return tmp;
}
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -1e-173) tmp = Float64(exp(Float64(log(x) / n)) / Float64(x * n)); elseif (Float64(1.0 / n) <= 5e-15) tmp = Float64(Float64(log1p(x) + Float64(Float64(0.5 * Float64(Float64((log1p(x) ^ 2.0) - (log(x) ^ 2.0)) / n)) - log(x))) / n); else tmp = (cbrt(cbrt(Float64(exp(Float64(log1p(x) / n)) - (x ^ Float64(1.0 / n))))) ^ 3.0) ^ 3.0; end return tmp end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-173], N[(N[Exp[N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-15], N[(N[(N[Log[1 + x], $MachinePrecision] + N[(N[(0.5 * N[(N[(N[Power[N[Log[1 + x], $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[Power[N[Power[N[Power[N[Power[N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision], 3.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-173}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-15}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}{n}\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(\sqrt[3]{\sqrt[3]{e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)}}}\right)}^{3}\right)}^{3}\\
\end{array}
\end{array}
if (/.f64 1 n) < -1e-173Initial program 72.1%
Taylor expanded in x around inf 85.8%
mul-1-neg85.8%
log-rec85.8%
mul-1-neg85.8%
distribute-neg-frac85.8%
mul-1-neg85.8%
remove-double-neg85.8%
*-commutative85.8%
Simplified85.8%
if -1e-173 < (/.f64 1 n) < 4.99999999999999999e-15Initial program 39.5%
Taylor expanded in n around inf 86.6%
associate--l+86.6%
log1p-define86.6%
+-commutative86.6%
associate--r+86.6%
distribute-lft-out--86.6%
div-sub86.6%
log1p-define86.6%
Simplified86.6%
if 4.99999999999999999e-15 < (/.f64 1 n) Initial program 48.3%
add-cube-cbrt48.3%
pow348.3%
pow-to-exp48.3%
un-div-inv48.3%
+-commutative48.3%
log1p-define96.3%
Applied egg-rr96.3%
add-cube-cbrt96.4%
pow396.4%
Applied egg-rr96.4%
Final simplification87.4%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -1e-173)
(/ (exp (/ (log x) n)) (* x n))
(if (<= (/ 1.0 n) 5e-15)
(/
(+
(log1p x)
(- (* 0.5 (/ (- (pow (log1p x) 2.0) (pow (log x) 2.0)) n)) (log x)))
n)
(pow (cbrt (- (exp (/ (log1p x) n)) (pow x (/ 1.0 n)))) 3.0))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e-173) {
tmp = exp((log(x) / n)) / (x * n);
} else if ((1.0 / n) <= 5e-15) {
tmp = (log1p(x) + ((0.5 * ((pow(log1p(x), 2.0) - pow(log(x), 2.0)) / n)) - log(x))) / n;
} else {
tmp = pow(cbrt((exp((log1p(x) / n)) - pow(x, (1.0 / n)))), 3.0);
}
return tmp;
}
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e-173) {
tmp = Math.exp((Math.log(x) / n)) / (x * n);
} else if ((1.0 / n) <= 5e-15) {
tmp = (Math.log1p(x) + ((0.5 * ((Math.pow(Math.log1p(x), 2.0) - Math.pow(Math.log(x), 2.0)) / n)) - Math.log(x))) / n;
} else {
tmp = Math.pow(Math.cbrt((Math.exp((Math.log1p(x) / n)) - Math.pow(x, (1.0 / n)))), 3.0);
}
return tmp;
}
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -1e-173) tmp = Float64(exp(Float64(log(x) / n)) / Float64(x * n)); elseif (Float64(1.0 / n) <= 5e-15) tmp = Float64(Float64(log1p(x) + Float64(Float64(0.5 * Float64(Float64((log1p(x) ^ 2.0) - (log(x) ^ 2.0)) / n)) - log(x))) / n); else tmp = cbrt(Float64(exp(Float64(log1p(x) / n)) - (x ^ Float64(1.0 / n)))) ^ 3.0; end return tmp end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-173], N[(N[Exp[N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-15], N[(N[(N[Log[1 + x], $MachinePrecision] + N[(N[(0.5 * N[(N[(N[Power[N[Log[1 + x], $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[Power[N[Power[N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-173}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-15}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}{n}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)}}\right)}^{3}\\
\end{array}
\end{array}
if (/.f64 1 n) < -1e-173Initial program 72.1%
Taylor expanded in x around inf 85.8%
mul-1-neg85.8%
log-rec85.8%
mul-1-neg85.8%
distribute-neg-frac85.8%
mul-1-neg85.8%
remove-double-neg85.8%
*-commutative85.8%
Simplified85.8%
if -1e-173 < (/.f64 1 n) < 4.99999999999999999e-15Initial program 39.5%
Taylor expanded in n around inf 86.6%
associate--l+86.6%
log1p-define86.6%
+-commutative86.6%
associate--r+86.6%
distribute-lft-out--86.6%
div-sub86.6%
log1p-define86.6%
Simplified86.6%
if 4.99999999999999999e-15 < (/.f64 1 n) Initial program 48.3%
add-cube-cbrt48.3%
pow348.3%
pow-to-exp48.3%
un-div-inv48.3%
+-commutative48.3%
log1p-define96.3%
Applied egg-rr96.3%
Final simplification87.4%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -1e-173)
(/ (exp (/ (log x) n)) (* x n))
(if (<= (/ 1.0 n) 5e-15)
(/ (log (/ (+ x 1.0) x)) n)
(pow (cbrt (- (exp (/ (log1p x) n)) (pow x (/ 1.0 n)))) 3.0))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e-173) {
tmp = exp((log(x) / n)) / (x * n);
} else if ((1.0 / n) <= 5e-15) {
tmp = log(((x + 1.0) / x)) / n;
} else {
tmp = pow(cbrt((exp((log1p(x) / n)) - pow(x, (1.0 / n)))), 3.0);
}
return tmp;
}
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e-173) {
tmp = Math.exp((Math.log(x) / n)) / (x * n);
} else if ((1.0 / n) <= 5e-15) {
tmp = Math.log(((x + 1.0) / x)) / n;
} else {
tmp = Math.pow(Math.cbrt((Math.exp((Math.log1p(x) / n)) - Math.pow(x, (1.0 / n)))), 3.0);
}
return tmp;
}
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -1e-173) tmp = Float64(exp(Float64(log(x) / n)) / Float64(x * n)); elseif (Float64(1.0 / n) <= 5e-15) tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n); else tmp = cbrt(Float64(exp(Float64(log1p(x) / n)) - (x ^ Float64(1.0 / n)))) ^ 3.0; end return tmp end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-173], N[(N[Exp[N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-15], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], N[Power[N[Power[N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-173}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-15}:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)}}\right)}^{3}\\
\end{array}
\end{array}
if (/.f64 1 n) < -1e-173Initial program 72.1%
Taylor expanded in x around inf 85.8%
mul-1-neg85.8%
log-rec85.8%
mul-1-neg85.8%
distribute-neg-frac85.8%
mul-1-neg85.8%
remove-double-neg85.8%
*-commutative85.8%
Simplified85.8%
if -1e-173 < (/.f64 1 n) < 4.99999999999999999e-15Initial program 39.5%
Taylor expanded in n around inf 86.2%
diff-log86.4%
+-commutative86.4%
Applied egg-rr86.4%
if 4.99999999999999999e-15 < (/.f64 1 n) Initial program 48.3%
add-cube-cbrt48.3%
pow348.3%
pow-to-exp48.3%
un-div-inv48.3%
+-commutative48.3%
log1p-define96.3%
Applied egg-rr96.3%
Final simplification87.3%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -1e-173)
(/ (exp (/ (log x) n)) (* x n))
(if (<= (/ 1.0 n) 5e-13)
(/ (log (/ (+ x 1.0) x)) n)
(pow (cbrt (- (exp (/ x n)) (pow x (/ 1.0 n)))) 3.0))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e-173) {
tmp = exp((log(x) / n)) / (x * n);
} else if ((1.0 / n) <= 5e-13) {
tmp = log(((x + 1.0) / x)) / n;
} else {
tmp = pow(cbrt((exp((x / n)) - pow(x, (1.0 / n)))), 3.0);
}
return tmp;
}
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e-173) {
tmp = Math.exp((Math.log(x) / n)) / (x * n);
} else if ((1.0 / n) <= 5e-13) {
tmp = Math.log(((x + 1.0) / x)) / n;
} else {
tmp = Math.pow(Math.cbrt((Math.exp((x / n)) - Math.pow(x, (1.0 / n)))), 3.0);
}
return tmp;
}
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -1e-173) tmp = Float64(exp(Float64(log(x) / n)) / Float64(x * n)); elseif (Float64(1.0 / n) <= 5e-13) tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n); else tmp = cbrt(Float64(exp(Float64(x / n)) - (x ^ Float64(1.0 / n)))) ^ 3.0; end return tmp end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-173], N[(N[Exp[N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-13], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], N[Power[N[Power[N[(N[Exp[N[(x / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-173}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-13}:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{e^{\frac{x}{n}} - {x}^{\left(\frac{1}{n}\right)}}\right)}^{3}\\
\end{array}
\end{array}
if (/.f64 1 n) < -1e-173Initial program 72.1%
Taylor expanded in x around inf 85.8%
mul-1-neg85.8%
log-rec85.8%
mul-1-neg85.8%
distribute-neg-frac85.8%
mul-1-neg85.8%
remove-double-neg85.8%
*-commutative85.8%
Simplified85.8%
if -1e-173 < (/.f64 1 n) < 4.9999999999999999e-13Initial program 39.2%
Taylor expanded in n around inf 85.3%
diff-log85.5%
+-commutative85.5%
Applied egg-rr85.5%
if 4.9999999999999999e-13 < (/.f64 1 n) Initial program 49.6%
add-cube-cbrt49.6%
pow349.6%
pow-to-exp49.6%
un-div-inv49.6%
+-commutative49.6%
log1p-define99.3%
Applied egg-rr99.3%
Taylor expanded in x around 0 99.3%
Final simplification87.3%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -1e-173)
(/ (exp (/ (log x) n)) (* x n))
(if (<= (/ 1.0 n) 5e-15)
(/ (log (/ (+ x 1.0) x)) n)
(- (exp (/ (log1p x) n)) (pow x (/ 1.0 n))))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e-173) {
tmp = exp((log(x) / n)) / (x * n);
} else if ((1.0 / n) <= 5e-15) {
tmp = log(((x + 1.0) / x)) / n;
} else {
tmp = exp((log1p(x) / n)) - pow(x, (1.0 / n));
}
return tmp;
}
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e-173) {
tmp = Math.exp((Math.log(x) / n)) / (x * n);
} else if ((1.0 / n) <= 5e-15) {
tmp = Math.log(((x + 1.0) / x)) / n;
} else {
tmp = Math.exp((Math.log1p(x) / n)) - Math.pow(x, (1.0 / n));
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -1e-173: tmp = math.exp((math.log(x) / n)) / (x * n) elif (1.0 / n) <= 5e-15: tmp = math.log(((x + 1.0) / x)) / n else: tmp = math.exp((math.log1p(x) / n)) - math.pow(x, (1.0 / n)) return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -1e-173) tmp = Float64(exp(Float64(log(x) / n)) / Float64(x * n)); elseif (Float64(1.0 / n) <= 5e-15) tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n); else tmp = Float64(exp(Float64(log1p(x) / n)) - (x ^ Float64(1.0 / n))); end return tmp end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-173], N[(N[Exp[N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-15], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-173}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-15}:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)}\\
\end{array}
\end{array}
if (/.f64 1 n) < -1e-173Initial program 72.1%
Taylor expanded in x around inf 85.8%
mul-1-neg85.8%
log-rec85.8%
mul-1-neg85.8%
distribute-neg-frac85.8%
mul-1-neg85.8%
remove-double-neg85.8%
*-commutative85.8%
Simplified85.8%
if -1e-173 < (/.f64 1 n) < 4.99999999999999999e-15Initial program 39.5%
Taylor expanded in n around inf 86.2%
diff-log86.4%
+-commutative86.4%
Applied egg-rr86.4%
if 4.99999999999999999e-15 < (/.f64 1 n) Initial program 48.3%
Taylor expanded in n around 0 48.3%
log1p-define96.3%
Simplified96.3%
Final simplification87.3%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -1e-173)
(/ (exp (/ (log x) n)) (* x n))
(if (<= (/ 1.0 n) 5e-13)
(/ (log (/ (+ x 1.0) x)) n)
(-
(+
1.0
(*
x
(+
(/ 1.0 n)
(* x (+ (* 0.5 (/ 1.0 (pow n 2.0))) (* 0.5 (/ -1.0 n)))))))
(pow x (/ 1.0 n))))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e-173) {
tmp = exp((log(x) / n)) / (x * n);
} else if ((1.0 / n) <= 5e-13) {
tmp = log(((x + 1.0) / x)) / n;
} else {
tmp = (1.0 + (x * ((1.0 / n) + (x * ((0.5 * (1.0 / pow(n, 2.0))) + (0.5 * (-1.0 / n))))))) - pow(x, (1.0 / n));
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if ((1.0d0 / n) <= (-1d-173)) then
tmp = exp((log(x) / n)) / (x * n)
else if ((1.0d0 / n) <= 5d-13) then
tmp = log(((x + 1.0d0) / x)) / n
else
tmp = (1.0d0 + (x * ((1.0d0 / n) + (x * ((0.5d0 * (1.0d0 / (n ** 2.0d0))) + (0.5d0 * ((-1.0d0) / n))))))) - (x ** (1.0d0 / n))
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e-173) {
tmp = Math.exp((Math.log(x) / n)) / (x * n);
} else if ((1.0 / n) <= 5e-13) {
tmp = Math.log(((x + 1.0) / x)) / n;
} else {
tmp = (1.0 + (x * ((1.0 / n) + (x * ((0.5 * (1.0 / Math.pow(n, 2.0))) + (0.5 * (-1.0 / n))))))) - Math.pow(x, (1.0 / n));
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -1e-173: tmp = math.exp((math.log(x) / n)) / (x * n) elif (1.0 / n) <= 5e-13: tmp = math.log(((x + 1.0) / x)) / n else: tmp = (1.0 + (x * ((1.0 / n) + (x * ((0.5 * (1.0 / math.pow(n, 2.0))) + (0.5 * (-1.0 / n))))))) - math.pow(x, (1.0 / n)) return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -1e-173) tmp = Float64(exp(Float64(log(x) / n)) / Float64(x * n)); elseif (Float64(1.0 / n) <= 5e-13) tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n); else tmp = Float64(Float64(1.0 + Float64(x * Float64(Float64(1.0 / n) + Float64(x * Float64(Float64(0.5 * Float64(1.0 / (n ^ 2.0))) + Float64(0.5 * Float64(-1.0 / n))))))) - (x ^ Float64(1.0 / n))); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -1e-173) tmp = exp((log(x) / n)) / (x * n); elseif ((1.0 / n) <= 5e-13) tmp = log(((x + 1.0) / x)) / n; else tmp = (1.0 + (x * ((1.0 / n) + (x * ((0.5 * (1.0 / (n ^ 2.0))) + (0.5 * (-1.0 / n))))))) - (x ^ (1.0 / n)); end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-173], N[(N[Exp[N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-13], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], N[(N[(1.0 + N[(x * N[(N[(1.0 / n), $MachinePrecision] + N[(x * N[(N[(0.5 * N[(1.0 / N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(-1.0 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-173}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-13}:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x \cdot \left(\frac{1}{n} + x \cdot \left(0.5 \cdot \frac{1}{{n}^{2}} + 0.5 \cdot \frac{-1}{n}\right)\right)\right) - {x}^{\left(\frac{1}{n}\right)}\\
\end{array}
\end{array}
if (/.f64 1 n) < -1e-173Initial program 72.1%
Taylor expanded in x around inf 85.8%
mul-1-neg85.8%
log-rec85.8%
mul-1-neg85.8%
distribute-neg-frac85.8%
mul-1-neg85.8%
remove-double-neg85.8%
*-commutative85.8%
Simplified85.8%
if -1e-173 < (/.f64 1 n) < 4.9999999999999999e-13Initial program 39.2%
Taylor expanded in n around inf 85.3%
diff-log85.5%
+-commutative85.5%
Applied egg-rr85.5%
if 4.9999999999999999e-13 < (/.f64 1 n) Initial program 49.6%
Taylor expanded in x around 0 81.0%
Final simplification85.1%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))) (t_1 (/ (log (/ (+ x 1.0) x)) n)))
(if (<= (/ 1.0 n) -1e+252)
t_1
(if (<= (/ 1.0 n) -1e+208)
(- 1.0 t_0)
(if (<= (/ 1.0 n) -4e+161)
0.0
(if (<= (/ 1.0 n) -1e-173)
(log1p (expm1 (/ (/ 1.0 x) n)))
(if (<= (/ 1.0 n) 5e-13)
t_1
(if (<= (/ 1.0 n) 2e+130)
(- (+ 1.0 (/ x n)) t_0)
(/
(+
(/ 1.0 n)
(/
(/
(- (* n 0.3333333333333333) (* 0.5 (* x n)))
(* n (* x n)))
x))
x)))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double t_1 = log(((x + 1.0) / x)) / n;
double tmp;
if ((1.0 / n) <= -1e+252) {
tmp = t_1;
} else if ((1.0 / n) <= -1e+208) {
tmp = 1.0 - t_0;
} else if ((1.0 / n) <= -4e+161) {
tmp = 0.0;
} else if ((1.0 / n) <= -1e-173) {
tmp = log1p(expm1(((1.0 / x) / n)));
} else if ((1.0 / n) <= 5e-13) {
tmp = t_1;
} else if ((1.0 / n) <= 2e+130) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x;
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double t_1 = Math.log(((x + 1.0) / x)) / n;
double tmp;
if ((1.0 / n) <= -1e+252) {
tmp = t_1;
} else if ((1.0 / n) <= -1e+208) {
tmp = 1.0 - t_0;
} else if ((1.0 / n) <= -4e+161) {
tmp = 0.0;
} else if ((1.0 / n) <= -1e-173) {
tmp = Math.log1p(Math.expm1(((1.0 / x) / n)));
} else if ((1.0 / n) <= 5e-13) {
tmp = t_1;
} else if ((1.0 / n) <= 2e+130) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) t_1 = math.log(((x + 1.0) / x)) / n tmp = 0 if (1.0 / n) <= -1e+252: tmp = t_1 elif (1.0 / n) <= -1e+208: tmp = 1.0 - t_0 elif (1.0 / n) <= -4e+161: tmp = 0.0 elif (1.0 / n) <= -1e-173: tmp = math.log1p(math.expm1(((1.0 / x) / n))) elif (1.0 / n) <= 5e-13: tmp = t_1 elif (1.0 / n) <= 2e+130: tmp = (1.0 + (x / n)) - t_0 else: tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) t_1 = Float64(log(Float64(Float64(x + 1.0) / x)) / n) tmp = 0.0 if (Float64(1.0 / n) <= -1e+252) tmp = t_1; elseif (Float64(1.0 / n) <= -1e+208) tmp = Float64(1.0 - t_0); elseif (Float64(1.0 / n) <= -4e+161) tmp = 0.0; elseif (Float64(1.0 / n) <= -1e-173) tmp = log1p(expm1(Float64(Float64(1.0 / x) / n))); elseif (Float64(1.0 / n) <= 5e-13) tmp = t_1; elseif (Float64(1.0 / n) <= 2e+130) tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0); else tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(n * 0.3333333333333333) - Float64(0.5 * Float64(x * n))) / Float64(n * Float64(x * n))) / x)) / x); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+252], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+208], N[(1.0 - t$95$0), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], -4e+161], 0.0, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-173], N[Log[1 + N[(Exp[N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-13], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e+130], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(n * 0.3333333333333333), $MachinePrecision] - N[(0.5 * N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+252}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{+208}:\\
\;\;\;\;1 - t\_0\\
\mathbf{elif}\;\frac{1}{n} \leq -4 \cdot 10^{+161}:\\
\;\;\;\;0\\
\mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{-173}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\frac{1}{x}}{n}\right)\right)\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+130}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{n} + \frac{\frac{n \cdot 0.3333333333333333 - 0.5 \cdot \left(x \cdot n\right)}{n \cdot \left(x \cdot n\right)}}{x}}{x}\\
\end{array}
\end{array}
if (/.f64 1 n) < -1.0000000000000001e252 or -1e-173 < (/.f64 1 n) < 4.9999999999999999e-13Initial program 46.5%
Taylor expanded in n around inf 83.7%
diff-log83.9%
+-commutative83.9%
Applied egg-rr83.9%
if -1.0000000000000001e252 < (/.f64 1 n) < -9.9999999999999998e207Initial program 100.0%
Taylor expanded in x around 0 73.6%
if -9.9999999999999998e207 < (/.f64 1 n) < -4.0000000000000002e161Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
add-cube-cbrt100.0%
fma-define100.0%
pow-to-exp100.0%
un-div-inv100.0%
+-commutative100.0%
log1p-define100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 84.6%
rem-cube-cbrt84.6%
distribute-rgt1-in84.6%
metadata-eval84.6%
mul0-lft84.9%
Simplified84.9%
if -4.0000000000000002e161 < (/.f64 1 n) < -1e-173Initial program 60.9%
Taylor expanded in n around inf 46.6%
Taylor expanded in x around -inf 30.9%
Taylor expanded in x around inf 39.6%
*-commutative39.6%
Simplified39.6%
log1p-expm1-u59.8%
associate-/r*61.2%
Applied egg-rr61.2%
if 4.9999999999999999e-13 < (/.f64 1 n) < 2.0000000000000001e130Initial program 75.1%
Taylor expanded in x around 0 75.2%
if 2.0000000000000001e130 < (/.f64 1 n) Initial program 22.5%
Taylor expanded in n around inf 6.1%
Taylor expanded in x around -inf 80.8%
associate-*r/80.8%
mul-1-neg80.8%
associate-*r/80.8%
mul-1-neg80.8%
associate-*r/80.8%
metadata-eval80.8%
*-commutative80.8%
associate-*r/80.8%
metadata-eval80.8%
Simplified80.8%
frac-sub87.1%
Applied egg-rr87.1%
Final simplification74.9%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -1e-173)
(/ (exp (/ (log x) n)) (* x n))
(if (<= (/ 1.0 n) 5e-13)
(/ (log (/ (+ x 1.0) x)) n)
(if (<= (/ 1.0 n) 2e+130)
(- (+ 1.0 (/ x n)) (pow x (/ 1.0 n)))
(/
(+
(/ 1.0 n)
(/ (/ (- (* n 0.3333333333333333) (* 0.5 (* x n))) (* n (* x n))) x))
x)))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e-173) {
tmp = exp((log(x) / n)) / (x * n);
} else if ((1.0 / n) <= 5e-13) {
tmp = log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 2e+130) {
tmp = (1.0 + (x / n)) - pow(x, (1.0 / n));
} else {
tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if ((1.0d0 / n) <= (-1d-173)) then
tmp = exp((log(x) / n)) / (x * n)
else if ((1.0d0 / n) <= 5d-13) then
tmp = log(((x + 1.0d0) / x)) / n
else if ((1.0d0 / n) <= 2d+130) then
tmp = (1.0d0 + (x / n)) - (x ** (1.0d0 / n))
else
tmp = ((1.0d0 / n) + ((((n * 0.3333333333333333d0) - (0.5d0 * (x * n))) / (n * (x * n))) / x)) / x
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e-173) {
tmp = Math.exp((Math.log(x) / n)) / (x * n);
} else if ((1.0 / n) <= 5e-13) {
tmp = Math.log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 2e+130) {
tmp = (1.0 + (x / n)) - Math.pow(x, (1.0 / n));
} else {
tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x;
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -1e-173: tmp = math.exp((math.log(x) / n)) / (x * n) elif (1.0 / n) <= 5e-13: tmp = math.log(((x + 1.0) / x)) / n elif (1.0 / n) <= 2e+130: tmp = (1.0 + (x / n)) - math.pow(x, (1.0 / n)) else: tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -1e-173) tmp = Float64(exp(Float64(log(x) / n)) / Float64(x * n)); elseif (Float64(1.0 / n) <= 5e-13) tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n); elseif (Float64(1.0 / n) <= 2e+130) tmp = Float64(Float64(1.0 + Float64(x / n)) - (x ^ Float64(1.0 / n))); else tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(n * 0.3333333333333333) - Float64(0.5 * Float64(x * n))) / Float64(n * Float64(x * n))) / x)) / x); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -1e-173) tmp = exp((log(x) / n)) / (x * n); elseif ((1.0 / n) <= 5e-13) tmp = log(((x + 1.0) / x)) / n; elseif ((1.0 / n) <= 2e+130) tmp = (1.0 + (x / n)) - (x ^ (1.0 / n)); else tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-173], N[(N[Exp[N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-13], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e+130], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(n * 0.3333333333333333), $MachinePrecision] - N[(0.5 * N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-173}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-13}:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+130}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{n} + \frac{\frac{n \cdot 0.3333333333333333 - 0.5 \cdot \left(x \cdot n\right)}{n \cdot \left(x \cdot n\right)}}{x}}{x}\\
\end{array}
\end{array}
if (/.f64 1 n) < -1e-173Initial program 72.1%
Taylor expanded in x around inf 85.8%
mul-1-neg85.8%
log-rec85.8%
mul-1-neg85.8%
distribute-neg-frac85.8%
mul-1-neg85.8%
remove-double-neg85.8%
*-commutative85.8%
Simplified85.8%
if -1e-173 < (/.f64 1 n) < 4.9999999999999999e-13Initial program 39.2%
Taylor expanded in n around inf 85.3%
diff-log85.5%
+-commutative85.5%
Applied egg-rr85.5%
if 4.9999999999999999e-13 < (/.f64 1 n) < 2.0000000000000001e130Initial program 75.1%
Taylor expanded in x around 0 75.2%
if 2.0000000000000001e130 < (/.f64 1 n) Initial program 22.5%
Taylor expanded in n around inf 6.1%
Taylor expanded in x around -inf 80.8%
associate-*r/80.8%
mul-1-neg80.8%
associate-*r/80.8%
mul-1-neg80.8%
associate-*r/80.8%
metadata-eval80.8%
*-commutative80.8%
associate-*r/80.8%
metadata-eval80.8%
Simplified80.8%
frac-sub87.1%
Applied egg-rr87.1%
Final simplification85.1%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n)))
(t_1 (- 1.0 t_0))
(t_2 (/ (log (/ (+ x 1.0) x)) n)))
(if (<= (/ 1.0 n) -1e+252)
t_2
(if (<= (/ 1.0 n) -1e+208)
t_1
(if (<= (/ 1.0 n) -4e+161)
0.0
(if (<= (/ 1.0 n) -10000.0)
t_1
(if (<= (/ 1.0 n) 5e-13)
t_2
(if (<= (/ 1.0 n) 2e+130)
(- (+ 1.0 (/ x n)) t_0)
(/
(+
(/ 1.0 n)
(/
(/
(- (* n 0.3333333333333333) (* 0.5 (* x n)))
(* n (* x n)))
x))
x)))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double t_1 = 1.0 - t_0;
double t_2 = log(((x + 1.0) / x)) / n;
double tmp;
if ((1.0 / n) <= -1e+252) {
tmp = t_2;
} else if ((1.0 / n) <= -1e+208) {
tmp = t_1;
} else if ((1.0 / n) <= -4e+161) {
tmp = 0.0;
} else if ((1.0 / n) <= -10000.0) {
tmp = t_1;
} else if ((1.0 / n) <= 5e-13) {
tmp = t_2;
} else if ((1.0 / n) <= 2e+130) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x ** (1.0d0 / n)
t_1 = 1.0d0 - t_0
t_2 = log(((x + 1.0d0) / x)) / n
if ((1.0d0 / n) <= (-1d+252)) then
tmp = t_2
else if ((1.0d0 / n) <= (-1d+208)) then
tmp = t_1
else if ((1.0d0 / n) <= (-4d+161)) then
tmp = 0.0d0
else if ((1.0d0 / n) <= (-10000.0d0)) then
tmp = t_1
else if ((1.0d0 / n) <= 5d-13) then
tmp = t_2
else if ((1.0d0 / n) <= 2d+130) then
tmp = (1.0d0 + (x / n)) - t_0
else
tmp = ((1.0d0 / n) + ((((n * 0.3333333333333333d0) - (0.5d0 * (x * n))) / (n * (x * n))) / x)) / x
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double t_1 = 1.0 - t_0;
double t_2 = Math.log(((x + 1.0) / x)) / n;
double tmp;
if ((1.0 / n) <= -1e+252) {
tmp = t_2;
} else if ((1.0 / n) <= -1e+208) {
tmp = t_1;
} else if ((1.0 / n) <= -4e+161) {
tmp = 0.0;
} else if ((1.0 / n) <= -10000.0) {
tmp = t_1;
} else if ((1.0 / n) <= 5e-13) {
tmp = t_2;
} else if ((1.0 / n) <= 2e+130) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) t_1 = 1.0 - t_0 t_2 = math.log(((x + 1.0) / x)) / n tmp = 0 if (1.0 / n) <= -1e+252: tmp = t_2 elif (1.0 / n) <= -1e+208: tmp = t_1 elif (1.0 / n) <= -4e+161: tmp = 0.0 elif (1.0 / n) <= -10000.0: tmp = t_1 elif (1.0 / n) <= 5e-13: tmp = t_2 elif (1.0 / n) <= 2e+130: tmp = (1.0 + (x / n)) - t_0 else: tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) t_1 = Float64(1.0 - t_0) t_2 = Float64(log(Float64(Float64(x + 1.0) / x)) / n) tmp = 0.0 if (Float64(1.0 / n) <= -1e+252) tmp = t_2; elseif (Float64(1.0 / n) <= -1e+208) tmp = t_1; elseif (Float64(1.0 / n) <= -4e+161) tmp = 0.0; elseif (Float64(1.0 / n) <= -10000.0) tmp = t_1; elseif (Float64(1.0 / n) <= 5e-13) tmp = t_2; elseif (Float64(1.0 / n) <= 2e+130) tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0); else tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(n * 0.3333333333333333) - Float64(0.5 * Float64(x * n))) / Float64(n * Float64(x * n))) / x)) / x); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); t_1 = 1.0 - t_0; t_2 = log(((x + 1.0) / x)) / n; tmp = 0.0; if ((1.0 / n) <= -1e+252) tmp = t_2; elseif ((1.0 / n) <= -1e+208) tmp = t_1; elseif ((1.0 / n) <= -4e+161) tmp = 0.0; elseif ((1.0 / n) <= -10000.0) tmp = t_1; elseif ((1.0 / n) <= 5e-13) tmp = t_2; elseif ((1.0 / n) <= 2e+130) tmp = (1.0 + (x / n)) - t_0; else tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+252], t$95$2, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+208], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], -4e+161], 0.0, If[LessEqual[N[(1.0 / n), $MachinePrecision], -10000.0], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-13], t$95$2, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e+130], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(n * 0.3333333333333333), $MachinePrecision] - N[(0.5 * N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
t_1 := 1 - t\_0\\
t_2 := \frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+252}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{+208}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq -4 \cdot 10^{+161}:\\
\;\;\;\;0\\
\mathbf{elif}\;\frac{1}{n} \leq -10000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-13}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+130}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{n} + \frac{\frac{n \cdot 0.3333333333333333 - 0.5 \cdot \left(x \cdot n\right)}{n \cdot \left(x \cdot n\right)}}{x}}{x}\\
\end{array}
\end{array}
if (/.f64 1 n) < -1.0000000000000001e252 or -1e4 < (/.f64 1 n) < 4.9999999999999999e-13Initial program 40.1%
Taylor expanded in n around inf 74.3%
diff-log74.6%
+-commutative74.6%
Applied egg-rr74.6%
if -1.0000000000000001e252 < (/.f64 1 n) < -9.9999999999999998e207 or -4.0000000000000002e161 < (/.f64 1 n) < -1e4Initial program 100.0%
Taylor expanded in x around 0 66.5%
if -9.9999999999999998e207 < (/.f64 1 n) < -4.0000000000000002e161Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
add-cube-cbrt100.0%
fma-define100.0%
pow-to-exp100.0%
un-div-inv100.0%
+-commutative100.0%
log1p-define100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 84.6%
rem-cube-cbrt84.6%
distribute-rgt1-in84.6%
metadata-eval84.6%
mul0-lft84.9%
Simplified84.9%
if 4.9999999999999999e-13 < (/.f64 1 n) < 2.0000000000000001e130Initial program 75.1%
Taylor expanded in x around 0 75.2%
if 2.0000000000000001e130 < (/.f64 1 n) Initial program 22.5%
Taylor expanded in n around inf 6.1%
Taylor expanded in x around -inf 80.8%
associate-*r/80.8%
mul-1-neg80.8%
associate-*r/80.8%
mul-1-neg80.8%
associate-*r/80.8%
metadata-eval80.8%
*-commutative80.8%
associate-*r/80.8%
metadata-eval80.8%
Simplified80.8%
frac-sub87.1%
Applied egg-rr87.1%
Final simplification74.2%
(FPCore (x n)
:precision binary64
(let* ((t_0 (- 1.0 (pow x (/ 1.0 n)))) (t_1 (/ (log (/ (+ x 1.0) x)) n)))
(if (<= (/ 1.0 n) -1e+252)
t_1
(if (<= (/ 1.0 n) -1e+208)
t_0
(if (<= (/ 1.0 n) -4e+161)
0.0
(if (<= (/ 1.0 n) -10000.0)
t_0
(if (<= (/ 1.0 n) 5e-13)
t_1
(if (<= (/ 1.0 n) 2e+130)
t_0
(/
(+
(/ 1.0 n)
(/
(/
(- (* n 0.3333333333333333) (* 0.5 (* x n)))
(* n (* x n)))
x))
x)))))))))
double code(double x, double n) {
double t_0 = 1.0 - pow(x, (1.0 / n));
double t_1 = log(((x + 1.0) / x)) / n;
double tmp;
if ((1.0 / n) <= -1e+252) {
tmp = t_1;
} else if ((1.0 / n) <= -1e+208) {
tmp = t_0;
} else if ((1.0 / n) <= -4e+161) {
tmp = 0.0;
} else if ((1.0 / n) <= -10000.0) {
tmp = t_0;
} else if ((1.0 / n) <= 5e-13) {
tmp = t_1;
} else if ((1.0 / n) <= 2e+130) {
tmp = t_0;
} else {
tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - (x ** (1.0d0 / n))
t_1 = log(((x + 1.0d0) / x)) / n
if ((1.0d0 / n) <= (-1d+252)) then
tmp = t_1
else if ((1.0d0 / n) <= (-1d+208)) then
tmp = t_0
else if ((1.0d0 / n) <= (-4d+161)) then
tmp = 0.0d0
else if ((1.0d0 / n) <= (-10000.0d0)) then
tmp = t_0
else if ((1.0d0 / n) <= 5d-13) then
tmp = t_1
else if ((1.0d0 / n) <= 2d+130) then
tmp = t_0
else
tmp = ((1.0d0 / n) + ((((n * 0.3333333333333333d0) - (0.5d0 * (x * n))) / (n * (x * n))) / x)) / x
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = 1.0 - Math.pow(x, (1.0 / n));
double t_1 = Math.log(((x + 1.0) / x)) / n;
double tmp;
if ((1.0 / n) <= -1e+252) {
tmp = t_1;
} else if ((1.0 / n) <= -1e+208) {
tmp = t_0;
} else if ((1.0 / n) <= -4e+161) {
tmp = 0.0;
} else if ((1.0 / n) <= -10000.0) {
tmp = t_0;
} else if ((1.0 / n) <= 5e-13) {
tmp = t_1;
} else if ((1.0 / n) <= 2e+130) {
tmp = t_0;
} else {
tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x;
}
return tmp;
}
def code(x, n): t_0 = 1.0 - math.pow(x, (1.0 / n)) t_1 = math.log(((x + 1.0) / x)) / n tmp = 0 if (1.0 / n) <= -1e+252: tmp = t_1 elif (1.0 / n) <= -1e+208: tmp = t_0 elif (1.0 / n) <= -4e+161: tmp = 0.0 elif (1.0 / n) <= -10000.0: tmp = t_0 elif (1.0 / n) <= 5e-13: tmp = t_1 elif (1.0 / n) <= 2e+130: tmp = t_0 else: tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x return tmp
function code(x, n) t_0 = Float64(1.0 - (x ^ Float64(1.0 / n))) t_1 = Float64(log(Float64(Float64(x + 1.0) / x)) / n) tmp = 0.0 if (Float64(1.0 / n) <= -1e+252) tmp = t_1; elseif (Float64(1.0 / n) <= -1e+208) tmp = t_0; elseif (Float64(1.0 / n) <= -4e+161) tmp = 0.0; elseif (Float64(1.0 / n) <= -10000.0) tmp = t_0; elseif (Float64(1.0 / n) <= 5e-13) tmp = t_1; elseif (Float64(1.0 / n) <= 2e+130) tmp = t_0; else tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(n * 0.3333333333333333) - Float64(0.5 * Float64(x * n))) / Float64(n * Float64(x * n))) / x)) / x); end return tmp end
function tmp_2 = code(x, n) t_0 = 1.0 - (x ^ (1.0 / n)); t_1 = log(((x + 1.0) / x)) / n; tmp = 0.0; if ((1.0 / n) <= -1e+252) tmp = t_1; elseif ((1.0 / n) <= -1e+208) tmp = t_0; elseif ((1.0 / n) <= -4e+161) tmp = 0.0; elseif ((1.0 / n) <= -10000.0) tmp = t_0; elseif ((1.0 / n) <= 5e-13) tmp = t_1; elseif ((1.0 / n) <= 2e+130) tmp = t_0; else tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+252], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+208], t$95$0, If[LessEqual[N[(1.0 / n), $MachinePrecision], -4e+161], 0.0, If[LessEqual[N[(1.0 / n), $MachinePrecision], -10000.0], t$95$0, If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-13], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e+130], t$95$0, N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(n * 0.3333333333333333), $MachinePrecision] - N[(0.5 * N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+252}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{+208}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\frac{1}{n} \leq -4 \cdot 10^{+161}:\\
\;\;\;\;0\\
\mathbf{elif}\;\frac{1}{n} \leq -10000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+130}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{n} + \frac{\frac{n \cdot 0.3333333333333333 - 0.5 \cdot \left(x \cdot n\right)}{n \cdot \left(x \cdot n\right)}}{x}}{x}\\
\end{array}
\end{array}
if (/.f64 1 n) < -1.0000000000000001e252 or -1e4 < (/.f64 1 n) < 4.9999999999999999e-13Initial program 40.1%
Taylor expanded in n around inf 74.3%
diff-log74.6%
+-commutative74.6%
Applied egg-rr74.6%
if -1.0000000000000001e252 < (/.f64 1 n) < -9.9999999999999998e207 or -4.0000000000000002e161 < (/.f64 1 n) < -1e4 or 4.9999999999999999e-13 < (/.f64 1 n) < 2.0000000000000001e130Initial program 94.4%
Taylor expanded in x around 0 68.5%
if -9.9999999999999998e207 < (/.f64 1 n) < -4.0000000000000002e161Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
add-cube-cbrt100.0%
fma-define100.0%
pow-to-exp100.0%
un-div-inv100.0%
+-commutative100.0%
log1p-define100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 84.6%
rem-cube-cbrt84.6%
distribute-rgt1-in84.6%
metadata-eval84.6%
mul0-lft84.9%
Simplified84.9%
if 2.0000000000000001e130 < (/.f64 1 n) Initial program 22.5%
Taylor expanded in n around inf 6.1%
Taylor expanded in x around -inf 80.8%
associate-*r/80.8%
mul-1-neg80.8%
associate-*r/80.8%
mul-1-neg80.8%
associate-*r/80.8%
metadata-eval80.8%
*-commutative80.8%
associate-*r/80.8%
metadata-eval80.8%
Simplified80.8%
frac-sub87.1%
Applied egg-rr87.1%
Final simplification74.2%
(FPCore (x n)
:precision binary64
(let* ((t_0 (- 1.0 (pow x (/ 1.0 n)))) (t_1 (/ (log x) (- n))))
(if (<= x 1.75e-302)
t_0
(if (<= x 3.8e-211)
t_1
(if (<= x 6.4e-163)
t_0
(if (<= x 1.1e-108)
t_1
(if (<= x 4e-70)
(/
(+
(/ 1.0 n)
(/
(/ (- (* n 0.3333333333333333) (* 0.5 (* x n))) (* n (* x n)))
x))
x)
(if (<= x 0.9)
(- (/ x n) (/ (log x) n))
(if (<= x 4.3e+40)
(/
(/
(+
1.0
(/
(- (/ (+ 0.3333333333333333 (* 0.25 (/ -1.0 x))) x) 0.5)
x))
x)
n)
0.0)))))))))
double code(double x, double n) {
double t_0 = 1.0 - pow(x, (1.0 / n));
double t_1 = log(x) / -n;
double tmp;
if (x <= 1.75e-302) {
tmp = t_0;
} else if (x <= 3.8e-211) {
tmp = t_1;
} else if (x <= 6.4e-163) {
tmp = t_0;
} else if (x <= 1.1e-108) {
tmp = t_1;
} else if (x <= 4e-70) {
tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x;
} else if (x <= 0.9) {
tmp = (x / n) - (log(x) / n);
} else if (x <= 4.3e+40) {
tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - (x ** (1.0d0 / n))
t_1 = log(x) / -n
if (x <= 1.75d-302) then
tmp = t_0
else if (x <= 3.8d-211) then
tmp = t_1
else if (x <= 6.4d-163) then
tmp = t_0
else if (x <= 1.1d-108) then
tmp = t_1
else if (x <= 4d-70) then
tmp = ((1.0d0 / n) + ((((n * 0.3333333333333333d0) - (0.5d0 * (x * n))) / (n * (x * n))) / x)) / x
else if (x <= 0.9d0) then
tmp = (x / n) - (log(x) / n)
else if (x <= 4.3d+40) then
tmp = ((1.0d0 + ((((0.3333333333333333d0 + (0.25d0 * ((-1.0d0) / x))) / x) - 0.5d0) / x)) / x) / n
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = 1.0 - Math.pow(x, (1.0 / n));
double t_1 = Math.log(x) / -n;
double tmp;
if (x <= 1.75e-302) {
tmp = t_0;
} else if (x <= 3.8e-211) {
tmp = t_1;
} else if (x <= 6.4e-163) {
tmp = t_0;
} else if (x <= 1.1e-108) {
tmp = t_1;
} else if (x <= 4e-70) {
tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x;
} else if (x <= 0.9) {
tmp = (x / n) - (Math.log(x) / n);
} else if (x <= 4.3e+40) {
tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): t_0 = 1.0 - math.pow(x, (1.0 / n)) t_1 = math.log(x) / -n tmp = 0 if x <= 1.75e-302: tmp = t_0 elif x <= 3.8e-211: tmp = t_1 elif x <= 6.4e-163: tmp = t_0 elif x <= 1.1e-108: tmp = t_1 elif x <= 4e-70: tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x elif x <= 0.9: tmp = (x / n) - (math.log(x) / n) elif x <= 4.3e+40: tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n else: tmp = 0.0 return tmp
function code(x, n) t_0 = Float64(1.0 - (x ^ Float64(1.0 / n))) t_1 = Float64(log(x) / Float64(-n)) tmp = 0.0 if (x <= 1.75e-302) tmp = t_0; elseif (x <= 3.8e-211) tmp = t_1; elseif (x <= 6.4e-163) tmp = t_0; elseif (x <= 1.1e-108) tmp = t_1; elseif (x <= 4e-70) tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(n * 0.3333333333333333) - Float64(0.5 * Float64(x * n))) / Float64(n * Float64(x * n))) / x)) / x); elseif (x <= 0.9) tmp = Float64(Float64(x / n) - Float64(log(x) / n)); elseif (x <= 4.3e+40) tmp = Float64(Float64(Float64(1.0 + Float64(Float64(Float64(Float64(0.3333333333333333 + Float64(0.25 * Float64(-1.0 / x))) / x) - 0.5) / x)) / x) / n); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) t_0 = 1.0 - (x ^ (1.0 / n)); t_1 = log(x) / -n; tmp = 0.0; if (x <= 1.75e-302) tmp = t_0; elseif (x <= 3.8e-211) tmp = t_1; elseif (x <= 6.4e-163) tmp = t_0; elseif (x <= 1.1e-108) tmp = t_1; elseif (x <= 4e-70) tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x; elseif (x <= 0.9) tmp = (x / n) - (log(x) / n); elseif (x <= 4.3e+40) tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Log[x], $MachinePrecision] / (-n)), $MachinePrecision]}, If[LessEqual[x, 1.75e-302], t$95$0, If[LessEqual[x, 3.8e-211], t$95$1, If[LessEqual[x, 6.4e-163], t$95$0, If[LessEqual[x, 1.1e-108], t$95$1, If[LessEqual[x, 4e-70], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(n * 0.3333333333333333), $MachinePrecision] - N[(0.5 * N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 0.9], N[(N[(x / n), $MachinePrecision] - N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.3e+40], N[(N[(N[(1.0 + N[(N[(N[(N[(0.3333333333333333 + N[(0.25 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 0.5), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision], 0.0]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{\log x}{-n}\\
\mathbf{if}\;x \leq 1.75 \cdot 10^{-302}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-211}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 6.4 \cdot 10^{-163}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-70}:\\
\;\;\;\;\frac{\frac{1}{n} + \frac{\frac{n \cdot 0.3333333333333333 - 0.5 \cdot \left(x \cdot n\right)}{n \cdot \left(x \cdot n\right)}}{x}}{x}\\
\mathbf{elif}\;x \leq 0.9:\\
\;\;\;\;\frac{x}{n} - \frac{\log x}{n}\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{+40}:\\
\;\;\;\;\frac{\frac{1 + \frac{\frac{0.3333333333333333 + 0.25 \cdot \frac{-1}{x}}{x} - 0.5}{x}}{x}}{n}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 1.7500000000000001e-302 or 3.80000000000000012e-211 < x < 6.39999999999999976e-163Initial program 76.2%
Taylor expanded in x around 0 76.2%
if 1.7500000000000001e-302 < x < 3.80000000000000012e-211 or 6.39999999999999976e-163 < x < 1.1000000000000001e-108Initial program 38.9%
Taylor expanded in n around inf 64.0%
Taylor expanded in x around 0 64.0%
neg-mul-164.0%
Simplified64.0%
if 1.1000000000000001e-108 < x < 3.99999999999999998e-70Initial program 38.4%
Taylor expanded in n around inf 33.2%
Taylor expanded in x around -inf 60.7%
associate-*r/60.7%
mul-1-neg60.7%
associate-*r/60.7%
mul-1-neg60.7%
associate-*r/60.7%
metadata-eval60.7%
*-commutative60.7%
associate-*r/60.7%
metadata-eval60.7%
Simplified60.7%
frac-sub61.0%
Applied egg-rr61.0%
if 3.99999999999999998e-70 < x < 0.900000000000000022Initial program 40.7%
Taylor expanded in n around inf 44.0%
Taylor expanded in x around 0 42.3%
neg-mul-142.3%
distribute-neg-frac42.3%
log-rec42.3%
+-commutative42.3%
log-rec42.3%
distribute-neg-frac42.3%
unsub-neg42.3%
Simplified42.3%
if 0.900000000000000022 < x < 4.3000000000000002e40Initial program 29.6%
Taylor expanded in n around inf 29.1%
Taylor expanded in x around -inf 75.8%
if 4.3000000000000002e40 < x Initial program 77.6%
sub-neg77.6%
+-commutative77.6%
add-cube-cbrt77.6%
fma-define77.6%
pow-to-exp77.6%
un-div-inv77.6%
+-commutative77.6%
log1p-define77.6%
Applied egg-rr77.6%
Taylor expanded in x around inf 77.6%
rem-cube-cbrt77.6%
distribute-rgt1-in77.6%
metadata-eval77.6%
mul0-lft77.6%
Simplified77.6%
Final simplification68.8%
(FPCore (x n)
:precision binary64
(let* ((t_0 (- 1.0 (pow x (/ 1.0 n)))) (t_1 (/ (log x) (- n))))
(if (<= x 4.4e-302)
t_0
(if (<= x 6.4e-207)
t_1
(if (<= x 2.8e-162)
t_0
(if (<= x 1.65e-107)
t_1
(if (<= x 3.2e-70)
(/
(+
(/ 1.0 n)
(/
(/ (- (* n 0.3333333333333333) (* 0.5 (* x n))) (* n (* x n)))
x))
x)
(if (<= x 0.9)
(/ (- x (log x)) n)
(if (<= x 2.15e+40)
(/
(/
(+
1.0
(/
(- (/ (+ 0.3333333333333333 (* 0.25 (/ -1.0 x))) x) 0.5)
x))
x)
n)
0.0)))))))))
double code(double x, double n) {
double t_0 = 1.0 - pow(x, (1.0 / n));
double t_1 = log(x) / -n;
double tmp;
if (x <= 4.4e-302) {
tmp = t_0;
} else if (x <= 6.4e-207) {
tmp = t_1;
} else if (x <= 2.8e-162) {
tmp = t_0;
} else if (x <= 1.65e-107) {
tmp = t_1;
} else if (x <= 3.2e-70) {
tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x;
} else if (x <= 0.9) {
tmp = (x - log(x)) / n;
} else if (x <= 2.15e+40) {
tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - (x ** (1.0d0 / n))
t_1 = log(x) / -n
if (x <= 4.4d-302) then
tmp = t_0
else if (x <= 6.4d-207) then
tmp = t_1
else if (x <= 2.8d-162) then
tmp = t_0
else if (x <= 1.65d-107) then
tmp = t_1
else if (x <= 3.2d-70) then
tmp = ((1.0d0 / n) + ((((n * 0.3333333333333333d0) - (0.5d0 * (x * n))) / (n * (x * n))) / x)) / x
else if (x <= 0.9d0) then
tmp = (x - log(x)) / n
else if (x <= 2.15d+40) then
tmp = ((1.0d0 + ((((0.3333333333333333d0 + (0.25d0 * ((-1.0d0) / x))) / x) - 0.5d0) / x)) / x) / n
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = 1.0 - Math.pow(x, (1.0 / n));
double t_1 = Math.log(x) / -n;
double tmp;
if (x <= 4.4e-302) {
tmp = t_0;
} else if (x <= 6.4e-207) {
tmp = t_1;
} else if (x <= 2.8e-162) {
tmp = t_0;
} else if (x <= 1.65e-107) {
tmp = t_1;
} else if (x <= 3.2e-70) {
tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x;
} else if (x <= 0.9) {
tmp = (x - Math.log(x)) / n;
} else if (x <= 2.15e+40) {
tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): t_0 = 1.0 - math.pow(x, (1.0 / n)) t_1 = math.log(x) / -n tmp = 0 if x <= 4.4e-302: tmp = t_0 elif x <= 6.4e-207: tmp = t_1 elif x <= 2.8e-162: tmp = t_0 elif x <= 1.65e-107: tmp = t_1 elif x <= 3.2e-70: tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x elif x <= 0.9: tmp = (x - math.log(x)) / n elif x <= 2.15e+40: tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n else: tmp = 0.0 return tmp
function code(x, n) t_0 = Float64(1.0 - (x ^ Float64(1.0 / n))) t_1 = Float64(log(x) / Float64(-n)) tmp = 0.0 if (x <= 4.4e-302) tmp = t_0; elseif (x <= 6.4e-207) tmp = t_1; elseif (x <= 2.8e-162) tmp = t_0; elseif (x <= 1.65e-107) tmp = t_1; elseif (x <= 3.2e-70) tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(n * 0.3333333333333333) - Float64(0.5 * Float64(x * n))) / Float64(n * Float64(x * n))) / x)) / x); elseif (x <= 0.9) tmp = Float64(Float64(x - log(x)) / n); elseif (x <= 2.15e+40) tmp = Float64(Float64(Float64(1.0 + Float64(Float64(Float64(Float64(0.3333333333333333 + Float64(0.25 * Float64(-1.0 / x))) / x) - 0.5) / x)) / x) / n); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) t_0 = 1.0 - (x ^ (1.0 / n)); t_1 = log(x) / -n; tmp = 0.0; if (x <= 4.4e-302) tmp = t_0; elseif (x <= 6.4e-207) tmp = t_1; elseif (x <= 2.8e-162) tmp = t_0; elseif (x <= 1.65e-107) tmp = t_1; elseif (x <= 3.2e-70) tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x; elseif (x <= 0.9) tmp = (x - log(x)) / n; elseif (x <= 2.15e+40) tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Log[x], $MachinePrecision] / (-n)), $MachinePrecision]}, If[LessEqual[x, 4.4e-302], t$95$0, If[LessEqual[x, 6.4e-207], t$95$1, If[LessEqual[x, 2.8e-162], t$95$0, If[LessEqual[x, 1.65e-107], t$95$1, If[LessEqual[x, 3.2e-70], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(n * 0.3333333333333333), $MachinePrecision] - N[(0.5 * N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 0.9], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 2.15e+40], N[(N[(N[(1.0 + N[(N[(N[(N[(0.3333333333333333 + N[(0.25 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 0.5), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision], 0.0]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{\log x}{-n}\\
\mathbf{if}\;x \leq 4.4 \cdot 10^{-302}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 6.4 \cdot 10^{-207}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-162}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-107}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-70}:\\
\;\;\;\;\frac{\frac{1}{n} + \frac{\frac{n \cdot 0.3333333333333333 - 0.5 \cdot \left(x \cdot n\right)}{n \cdot \left(x \cdot n\right)}}{x}}{x}\\
\mathbf{elif}\;x \leq 0.9:\\
\;\;\;\;\frac{x - \log x}{n}\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{+40}:\\
\;\;\;\;\frac{\frac{1 + \frac{\frac{0.3333333333333333 + 0.25 \cdot \frac{-1}{x}}{x} - 0.5}{x}}{x}}{n}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 4.40000000000000015e-302 or 6.4000000000000006e-207 < x < 2.80000000000000022e-162Initial program 76.2%
Taylor expanded in x around 0 76.2%
if 4.40000000000000015e-302 < x < 6.4000000000000006e-207 or 2.80000000000000022e-162 < x < 1.65000000000000002e-107Initial program 38.9%
Taylor expanded in n around inf 64.0%
Taylor expanded in x around 0 64.0%
neg-mul-164.0%
Simplified64.0%
if 1.65000000000000002e-107 < x < 3.1999999999999997e-70Initial program 38.4%
Taylor expanded in n around inf 33.2%
Taylor expanded in x around -inf 60.7%
associate-*r/60.7%
mul-1-neg60.7%
associate-*r/60.7%
mul-1-neg60.7%
associate-*r/60.7%
metadata-eval60.7%
*-commutative60.7%
associate-*r/60.7%
metadata-eval60.7%
Simplified60.7%
frac-sub61.0%
Applied egg-rr61.0%
if 3.1999999999999997e-70 < x < 0.900000000000000022Initial program 40.7%
Taylor expanded in n around inf 44.0%
Taylor expanded in x around 0 42.2%
if 0.900000000000000022 < x < 2.1500000000000001e40Initial program 29.6%
Taylor expanded in n around inf 29.1%
Taylor expanded in x around -inf 75.8%
if 2.1500000000000001e40 < x Initial program 77.6%
sub-neg77.6%
+-commutative77.6%
add-cube-cbrt77.6%
fma-define77.6%
pow-to-exp77.6%
un-div-inv77.6%
+-commutative77.6%
log1p-define77.6%
Applied egg-rr77.6%
Taylor expanded in x around inf 77.6%
rem-cube-cbrt77.6%
distribute-rgt1-in77.6%
metadata-eval77.6%
mul0-lft77.6%
Simplified77.6%
Final simplification68.8%
(FPCore (x n)
:precision binary64
(let* ((t_0 (/ (log x) (- n))))
(if (<= x 1.35e-179)
t_0
(if (<= x 1.05e-162)
(/ -1.0 (/ n (/ (+ -1.0 (/ (+ 0.5 (/ -0.3333333333333333 x)) x)) x)))
(if (<= x 1.2e-107)
t_0
(if (<= x 3.2e-70)
(/
(+
(/ 1.0 n)
(/
(/ (- (* n 0.3333333333333333) (* 0.5 (* x n))) (* n (* x n)))
x))
x)
(if (<= x 0.86)
(/ (- x (log x)) n)
(if (<= x 2.95e+40)
(/
(/
(+
1.0
(/
(- (/ (+ 0.3333333333333333 (* 0.25 (/ -1.0 x))) x) 0.5)
x))
x)
n)
0.0))))))))
double code(double x, double n) {
double t_0 = log(x) / -n;
double tmp;
if (x <= 1.35e-179) {
tmp = t_0;
} else if (x <= 1.05e-162) {
tmp = -1.0 / (n / ((-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / x));
} else if (x <= 1.2e-107) {
tmp = t_0;
} else if (x <= 3.2e-70) {
tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x;
} else if (x <= 0.86) {
tmp = (x - log(x)) / n;
} else if (x <= 2.95e+40) {
tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = log(x) / -n
if (x <= 1.35d-179) then
tmp = t_0
else if (x <= 1.05d-162) then
tmp = (-1.0d0) / (n / (((-1.0d0) + ((0.5d0 + ((-0.3333333333333333d0) / x)) / x)) / x))
else if (x <= 1.2d-107) then
tmp = t_0
else if (x <= 3.2d-70) then
tmp = ((1.0d0 / n) + ((((n * 0.3333333333333333d0) - (0.5d0 * (x * n))) / (n * (x * n))) / x)) / x
else if (x <= 0.86d0) then
tmp = (x - log(x)) / n
else if (x <= 2.95d+40) then
tmp = ((1.0d0 + ((((0.3333333333333333d0 + (0.25d0 * ((-1.0d0) / x))) / x) - 0.5d0) / x)) / x) / n
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.log(x) / -n;
double tmp;
if (x <= 1.35e-179) {
tmp = t_0;
} else if (x <= 1.05e-162) {
tmp = -1.0 / (n / ((-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / x));
} else if (x <= 1.2e-107) {
tmp = t_0;
} else if (x <= 3.2e-70) {
tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x;
} else if (x <= 0.86) {
tmp = (x - Math.log(x)) / n;
} else if (x <= 2.95e+40) {
tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): t_0 = math.log(x) / -n tmp = 0 if x <= 1.35e-179: tmp = t_0 elif x <= 1.05e-162: tmp = -1.0 / (n / ((-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / x)) elif x <= 1.2e-107: tmp = t_0 elif x <= 3.2e-70: tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x elif x <= 0.86: tmp = (x - math.log(x)) / n elif x <= 2.95e+40: tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n else: tmp = 0.0 return tmp
function code(x, n) t_0 = Float64(log(x) / Float64(-n)) tmp = 0.0 if (x <= 1.35e-179) tmp = t_0; elseif (x <= 1.05e-162) tmp = Float64(-1.0 / Float64(n / Float64(Float64(-1.0 + Float64(Float64(0.5 + Float64(-0.3333333333333333 / x)) / x)) / x))); elseif (x <= 1.2e-107) tmp = t_0; elseif (x <= 3.2e-70) tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(n * 0.3333333333333333) - Float64(0.5 * Float64(x * n))) / Float64(n * Float64(x * n))) / x)) / x); elseif (x <= 0.86) tmp = Float64(Float64(x - log(x)) / n); elseif (x <= 2.95e+40) tmp = Float64(Float64(Float64(1.0 + Float64(Float64(Float64(Float64(0.3333333333333333 + Float64(0.25 * Float64(-1.0 / x))) / x) - 0.5) / x)) / x) / n); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) t_0 = log(x) / -n; tmp = 0.0; if (x <= 1.35e-179) tmp = t_0; elseif (x <= 1.05e-162) tmp = -1.0 / (n / ((-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / x)); elseif (x <= 1.2e-107) tmp = t_0; elseif (x <= 3.2e-70) tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x; elseif (x <= 0.86) tmp = (x - log(x)) / n; elseif (x <= 2.95e+40) tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(N[Log[x], $MachinePrecision] / (-n)), $MachinePrecision]}, If[LessEqual[x, 1.35e-179], t$95$0, If[LessEqual[x, 1.05e-162], N[(-1.0 / N[(n / N[(N[(-1.0 + N[(N[(0.5 + N[(-0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.2e-107], t$95$0, If[LessEqual[x, 3.2e-70], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(n * 0.3333333333333333), $MachinePrecision] - N[(0.5 * N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 0.86], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 2.95e+40], N[(N[(N[(1.0 + N[(N[(N[(N[(0.3333333333333333 + N[(0.25 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 0.5), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision], 0.0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\log x}{-n}\\
\mathbf{if}\;x \leq 1.35 \cdot 10^{-179}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-162}:\\
\;\;\;\;\frac{-1}{\frac{n}{\frac{-1 + \frac{0.5 + \frac{-0.3333333333333333}{x}}{x}}{x}}}\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-107}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-70}:\\
\;\;\;\;\frac{\frac{1}{n} + \frac{\frac{n \cdot 0.3333333333333333 - 0.5 \cdot \left(x \cdot n\right)}{n \cdot \left(x \cdot n\right)}}{x}}{x}\\
\mathbf{elif}\;x \leq 0.86:\\
\;\;\;\;\frac{x - \log x}{n}\\
\mathbf{elif}\;x \leq 2.95 \cdot 10^{+40}:\\
\;\;\;\;\frac{\frac{1 + \frac{\frac{0.3333333333333333 + 0.25 \cdot \frac{-1}{x}}{x} - 0.5}{x}}{x}}{n}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 1.34999999999999994e-179 or 1.05e-162 < x < 1.19999999999999997e-107Initial program 47.0%
Taylor expanded in n around inf 56.7%
Taylor expanded in x around 0 56.7%
neg-mul-156.7%
Simplified56.7%
if 1.34999999999999994e-179 < x < 1.05e-162Initial program 67.8%
Taylor expanded in n around inf 16.0%
clear-num15.9%
inv-pow15.9%
log1p-define15.9%
Applied egg-rr15.9%
unpow-115.9%
Simplified15.9%
Taylor expanded in x around -inf 78.4%
mul-1-neg78.4%
distribute-neg-frac278.4%
sub-neg78.4%
associate-*r/78.4%
sub-neg78.4%
metadata-eval78.4%
distribute-lft-in78.4%
neg-mul-178.4%
associate-*r/78.4%
metadata-eval78.4%
distribute-neg-frac78.4%
metadata-eval78.4%
metadata-eval78.4%
metadata-eval78.4%
Simplified78.4%
if 1.19999999999999997e-107 < x < 3.1999999999999997e-70Initial program 38.4%
Taylor expanded in n around inf 33.2%
Taylor expanded in x around -inf 60.7%
associate-*r/60.7%
mul-1-neg60.7%
associate-*r/60.7%
mul-1-neg60.7%
associate-*r/60.7%
metadata-eval60.7%
*-commutative60.7%
associate-*r/60.7%
metadata-eval60.7%
Simplified60.7%
frac-sub61.0%
Applied egg-rr61.0%
if 3.1999999999999997e-70 < x < 0.859999999999999987Initial program 40.7%
Taylor expanded in n around inf 44.0%
Taylor expanded in x around 0 42.2%
if 0.859999999999999987 < x < 2.94999999999999995e40Initial program 29.6%
Taylor expanded in n around inf 29.1%
Taylor expanded in x around -inf 75.8%
if 2.94999999999999995e40 < x Initial program 77.6%
sub-neg77.6%
+-commutative77.6%
add-cube-cbrt77.6%
fma-define77.6%
pow-to-exp77.6%
un-div-inv77.6%
+-commutative77.6%
log1p-define77.6%
Applied egg-rr77.6%
Taylor expanded in x around inf 77.6%
rem-cube-cbrt77.6%
distribute-rgt1-in77.6%
metadata-eval77.6%
mul0-lft77.6%
Simplified77.6%
Final simplification65.8%
(FPCore (x n)
:precision binary64
(let* ((t_0 (/ (log x) (- n))))
(if (<= x 9e-180)
t_0
(if (<= x 6.9e-164)
(/ -1.0 (/ n (/ (+ -1.0 (/ (+ 0.5 (/ -0.3333333333333333 x)) x)) x)))
(if (<= x 1.95e-107)
t_0
(if (<= x 4e+40)
(/
(+
(/ 1.0 n)
(/
(/ (- (* n 0.3333333333333333) (* 0.5 (* x n))) (* n (* x n)))
x))
x)
0.0))))))
double code(double x, double n) {
double t_0 = log(x) / -n;
double tmp;
if (x <= 9e-180) {
tmp = t_0;
} else if (x <= 6.9e-164) {
tmp = -1.0 / (n / ((-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / x));
} else if (x <= 1.95e-107) {
tmp = t_0;
} else if (x <= 4e+40) {
tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = log(x) / -n
if (x <= 9d-180) then
tmp = t_0
else if (x <= 6.9d-164) then
tmp = (-1.0d0) / (n / (((-1.0d0) + ((0.5d0 + ((-0.3333333333333333d0) / x)) / x)) / x))
else if (x <= 1.95d-107) then
tmp = t_0
else if (x <= 4d+40) then
tmp = ((1.0d0 / n) + ((((n * 0.3333333333333333d0) - (0.5d0 * (x * n))) / (n * (x * n))) / x)) / x
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.log(x) / -n;
double tmp;
if (x <= 9e-180) {
tmp = t_0;
} else if (x <= 6.9e-164) {
tmp = -1.0 / (n / ((-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / x));
} else if (x <= 1.95e-107) {
tmp = t_0;
} else if (x <= 4e+40) {
tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): t_0 = math.log(x) / -n tmp = 0 if x <= 9e-180: tmp = t_0 elif x <= 6.9e-164: tmp = -1.0 / (n / ((-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / x)) elif x <= 1.95e-107: tmp = t_0 elif x <= 4e+40: tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x else: tmp = 0.0 return tmp
function code(x, n) t_0 = Float64(log(x) / Float64(-n)) tmp = 0.0 if (x <= 9e-180) tmp = t_0; elseif (x <= 6.9e-164) tmp = Float64(-1.0 / Float64(n / Float64(Float64(-1.0 + Float64(Float64(0.5 + Float64(-0.3333333333333333 / x)) / x)) / x))); elseif (x <= 1.95e-107) tmp = t_0; elseif (x <= 4e+40) tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(n * 0.3333333333333333) - Float64(0.5 * Float64(x * n))) / Float64(n * Float64(x * n))) / x)) / x); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) t_0 = log(x) / -n; tmp = 0.0; if (x <= 9e-180) tmp = t_0; elseif (x <= 6.9e-164) tmp = -1.0 / (n / ((-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / x)); elseif (x <= 1.95e-107) tmp = t_0; elseif (x <= 4e+40) tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(N[Log[x], $MachinePrecision] / (-n)), $MachinePrecision]}, If[LessEqual[x, 9e-180], t$95$0, If[LessEqual[x, 6.9e-164], N[(-1.0 / N[(n / N[(N[(-1.0 + N[(N[(0.5 + N[(-0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.95e-107], t$95$0, If[LessEqual[x, 4e+40], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(n * 0.3333333333333333), $MachinePrecision] - N[(0.5 * N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\log x}{-n}\\
\mathbf{if}\;x \leq 9 \cdot 10^{-180}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 6.9 \cdot 10^{-164}:\\
\;\;\;\;\frac{-1}{\frac{n}{\frac{-1 + \frac{0.5 + \frac{-0.3333333333333333}{x}}{x}}{x}}}\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{-107}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+40}:\\
\;\;\;\;\frac{\frac{1}{n} + \frac{\frac{n \cdot 0.3333333333333333 - 0.5 \cdot \left(x \cdot n\right)}{n \cdot \left(x \cdot n\right)}}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 9.00000000000000019e-180 or 6.89999999999999995e-164 < x < 1.95e-107Initial program 47.0%
Taylor expanded in n around inf 56.7%
Taylor expanded in x around 0 56.7%
neg-mul-156.7%
Simplified56.7%
if 9.00000000000000019e-180 < x < 6.89999999999999995e-164Initial program 67.8%
Taylor expanded in n around inf 16.0%
clear-num15.9%
inv-pow15.9%
log1p-define15.9%
Applied egg-rr15.9%
unpow-115.9%
Simplified15.9%
Taylor expanded in x around -inf 78.4%
mul-1-neg78.4%
distribute-neg-frac278.4%
sub-neg78.4%
associate-*r/78.4%
sub-neg78.4%
metadata-eval78.4%
distribute-lft-in78.4%
neg-mul-178.4%
associate-*r/78.4%
metadata-eval78.4%
distribute-neg-frac78.4%
metadata-eval78.4%
metadata-eval78.4%
metadata-eval78.4%
Simplified78.4%
if 1.95e-107 < x < 4.00000000000000012e40Initial program 36.8%
Taylor expanded in n around inf 36.7%
Taylor expanded in x around -inf 47.0%
associate-*r/47.0%
mul-1-neg47.0%
associate-*r/47.0%
mul-1-neg47.0%
associate-*r/47.0%
metadata-eval47.0%
*-commutative47.0%
associate-*r/47.0%
metadata-eval47.0%
Simplified47.0%
frac-sub49.9%
Applied egg-rr49.9%
if 4.00000000000000012e40 < x Initial program 77.6%
sub-neg77.6%
+-commutative77.6%
add-cube-cbrt77.6%
fma-define77.6%
pow-to-exp77.6%
un-div-inv77.6%
+-commutative77.6%
log1p-define77.6%
Applied egg-rr77.6%
Taylor expanded in x around inf 77.6%
rem-cube-cbrt77.6%
distribute-rgt1-in77.6%
metadata-eval77.6%
mul0-lft77.6%
Simplified77.6%
Final simplification63.9%
(FPCore (x n)
:precision binary64
(if (<= x 4.3e+40)
(/
(+
(/ 1.0 n)
(/ (/ (- (* n 0.3333333333333333) (* 0.5 (* x n))) (* n (* x n))) x))
x)
0.0))
double code(double x, double n) {
double tmp;
if (x <= 4.3e+40) {
tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 4.3d+40) then
tmp = ((1.0d0 / n) + ((((n * 0.3333333333333333d0) - (0.5d0 * (x * n))) / (n * (x * n))) / x)) / x
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 4.3e+40) {
tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 4.3e+40: tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x else: tmp = 0.0 return tmp
function code(x, n) tmp = 0.0 if (x <= 4.3e+40) tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(n * 0.3333333333333333) - Float64(0.5 * Float64(x * n))) / Float64(n * Float64(x * n))) / x)) / x); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 4.3e+40) tmp = ((1.0 / n) + ((((n * 0.3333333333333333) - (0.5 * (x * n))) / (n * (x * n))) / x)) / x; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 4.3e+40], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(n * 0.3333333333333333), $MachinePrecision] - N[(0.5 * N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.3 \cdot 10^{+40}:\\
\;\;\;\;\frac{\frac{1}{n} + \frac{\frac{n \cdot 0.3333333333333333 - 0.5 \cdot \left(x \cdot n\right)}{n \cdot \left(x \cdot n\right)}}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 4.3000000000000002e40Initial program 44.0%
Taylor expanded in n around inf 46.2%
Taylor expanded in x around -inf 40.2%
associate-*r/40.2%
mul-1-neg40.2%
associate-*r/40.2%
mul-1-neg40.2%
associate-*r/40.2%
metadata-eval40.2%
*-commutative40.2%
associate-*r/40.2%
metadata-eval40.2%
Simplified40.2%
frac-sub41.4%
Applied egg-rr41.4%
if 4.3000000000000002e40 < x Initial program 77.6%
sub-neg77.6%
+-commutative77.6%
add-cube-cbrt77.6%
fma-define77.6%
pow-to-exp77.6%
un-div-inv77.6%
+-commutative77.6%
log1p-define77.6%
Applied egg-rr77.6%
Taylor expanded in x around inf 77.6%
rem-cube-cbrt77.6%
distribute-rgt1-in77.6%
metadata-eval77.6%
mul0-lft77.6%
Simplified77.6%
Final simplification55.6%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -1e+252)
0.0
(if (<= (/ 1.0 n) -1e+224)
(/ 1.0 (* x n))
(if (<= (/ 1.0 n) -5.0) 0.0 (/ (/ 1.0 n) x)))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e+252) {
tmp = 0.0;
} else if ((1.0 / n) <= -1e+224) {
tmp = 1.0 / (x * n);
} else if ((1.0 / n) <= -5.0) {
tmp = 0.0;
} else {
tmp = (1.0 / n) / x;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if ((1.0d0 / n) <= (-1d+252)) then
tmp = 0.0d0
else if ((1.0d0 / n) <= (-1d+224)) then
tmp = 1.0d0 / (x * n)
else if ((1.0d0 / n) <= (-5.0d0)) then
tmp = 0.0d0
else
tmp = (1.0d0 / n) / x
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e+252) {
tmp = 0.0;
} else if ((1.0 / n) <= -1e+224) {
tmp = 1.0 / (x * n);
} else if ((1.0 / n) <= -5.0) {
tmp = 0.0;
} else {
tmp = (1.0 / n) / x;
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -1e+252: tmp = 0.0 elif (1.0 / n) <= -1e+224: tmp = 1.0 / (x * n) elif (1.0 / n) <= -5.0: tmp = 0.0 else: tmp = (1.0 / n) / x return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -1e+252) tmp = 0.0; elseif (Float64(1.0 / n) <= -1e+224) tmp = Float64(1.0 / Float64(x * n)); elseif (Float64(1.0 / n) <= -5.0) tmp = 0.0; else tmp = Float64(Float64(1.0 / n) / x); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -1e+252) tmp = 0.0; elseif ((1.0 / n) <= -1e+224) tmp = 1.0 / (x * n); elseif ((1.0 / n) <= -5.0) tmp = 0.0; else tmp = (1.0 / n) / x; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+252], 0.0, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+224], N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], -5.0], 0.0, N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+252}:\\
\;\;\;\;0\\
\mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{+224}:\\
\;\;\;\;\frac{1}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq -5:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{n}}{x}\\
\end{array}
\end{array}
if (/.f64 1 n) < -1.0000000000000001e252 or -9.9999999999999997e223 < (/.f64 1 n) < -5Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
add-cube-cbrt100.0%
fma-define100.0%
pow-to-exp100.0%
un-div-inv100.0%
+-commutative100.0%
log1p-define100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 52.6%
rem-cube-cbrt52.6%
distribute-rgt1-in52.6%
metadata-eval52.6%
mul0-lft53.4%
Simplified53.4%
if -1.0000000000000001e252 < (/.f64 1 n) < -9.9999999999999997e223Initial program 100.0%
Taylor expanded in n around inf 19.9%
Taylor expanded in x around inf 86.1%
if -5 < (/.f64 1 n) Initial program 36.6%
Taylor expanded in n around inf 62.2%
Taylor expanded in x around inf 48.4%
associate-/r*49.7%
Simplified49.7%
Final simplification51.8%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -1e+252)
0.0
(if (<= (/ 1.0 n) -1e+224)
(/ 1.0 (* x n))
(if (<= (/ 1.0 n) -5.0) 0.0 (/ (/ 1.0 x) n)))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e+252) {
tmp = 0.0;
} else if ((1.0 / n) <= -1e+224) {
tmp = 1.0 / (x * n);
} else if ((1.0 / n) <= -5.0) {
tmp = 0.0;
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if ((1.0d0 / n) <= (-1d+252)) then
tmp = 0.0d0
else if ((1.0d0 / n) <= (-1d+224)) then
tmp = 1.0d0 / (x * n)
else if ((1.0d0 / n) <= (-5.0d0)) then
tmp = 0.0d0
else
tmp = (1.0d0 / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e+252) {
tmp = 0.0;
} else if ((1.0 / n) <= -1e+224) {
tmp = 1.0 / (x * n);
} else if ((1.0 / n) <= -5.0) {
tmp = 0.0;
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -1e+252: tmp = 0.0 elif (1.0 / n) <= -1e+224: tmp = 1.0 / (x * n) elif (1.0 / n) <= -5.0: tmp = 0.0 else: tmp = (1.0 / x) / n return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -1e+252) tmp = 0.0; elseif (Float64(1.0 / n) <= -1e+224) tmp = Float64(1.0 / Float64(x * n)); elseif (Float64(1.0 / n) <= -5.0) tmp = 0.0; else tmp = Float64(Float64(1.0 / x) / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -1e+252) tmp = 0.0; elseif ((1.0 / n) <= -1e+224) tmp = 1.0 / (x * n); elseif ((1.0 / n) <= -5.0) tmp = 0.0; else tmp = (1.0 / x) / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+252], 0.0, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+224], N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], -5.0], 0.0, N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+252}:\\
\;\;\;\;0\\
\mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{+224}:\\
\;\;\;\;\frac{1}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq -5:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\end{array}
\end{array}
if (/.f64 1 n) < -1.0000000000000001e252 or -9.9999999999999997e223 < (/.f64 1 n) < -5Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
add-cube-cbrt100.0%
fma-define100.0%
pow-to-exp100.0%
un-div-inv100.0%
+-commutative100.0%
log1p-define100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 52.6%
rem-cube-cbrt52.6%
distribute-rgt1-in52.6%
metadata-eval52.6%
mul0-lft53.4%
Simplified53.4%
if -1.0000000000000001e252 < (/.f64 1 n) < -9.9999999999999997e223Initial program 100.0%
Taylor expanded in n around inf 19.9%
Taylor expanded in x around inf 86.1%
if -5 < (/.f64 1 n) Initial program 36.6%
Taylor expanded in n around inf 62.2%
Taylor expanded in x around inf 49.8%
Final simplification51.8%
(FPCore (x n)
:precision binary64
(if (<= x 3.8e+40)
(/
(+ (/ 1.0 n) (/ (- (/ 1.0 (* x (/ n 0.3333333333333333))) (/ 0.5 n)) x))
x)
0.0))
double code(double x, double n) {
double tmp;
if (x <= 3.8e+40) {
tmp = ((1.0 / n) + (((1.0 / (x * (n / 0.3333333333333333))) - (0.5 / n)) / x)) / x;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 3.8d+40) then
tmp = ((1.0d0 / n) + (((1.0d0 / (x * (n / 0.3333333333333333d0))) - (0.5d0 / n)) / x)) / x
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 3.8e+40) {
tmp = ((1.0 / n) + (((1.0 / (x * (n / 0.3333333333333333))) - (0.5 / n)) / x)) / x;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 3.8e+40: tmp = ((1.0 / n) + (((1.0 / (x * (n / 0.3333333333333333))) - (0.5 / n)) / x)) / x else: tmp = 0.0 return tmp
function code(x, n) tmp = 0.0 if (x <= 3.8e+40) tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(1.0 / Float64(x * Float64(n / 0.3333333333333333))) - Float64(0.5 / n)) / x)) / x); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 3.8e+40) tmp = ((1.0 / n) + (((1.0 / (x * (n / 0.3333333333333333))) - (0.5 / n)) / x)) / x; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 3.8e+40], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(1.0 / N[(x * N[(n / 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.5 / n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.8 \cdot 10^{+40}:\\
\;\;\;\;\frac{\frac{1}{n} + \frac{\frac{1}{x \cdot \frac{n}{0.3333333333333333}} - \frac{0.5}{n}}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 3.80000000000000004e40Initial program 44.0%
Taylor expanded in n around inf 46.2%
Taylor expanded in x around -inf 40.2%
associate-*r/40.2%
mul-1-neg40.2%
associate-*r/40.2%
mul-1-neg40.2%
associate-*r/40.2%
metadata-eval40.2%
*-commutative40.2%
associate-*r/40.2%
metadata-eval40.2%
Simplified40.2%
clear-num40.2%
inv-pow40.2%
Applied egg-rr40.2%
unpow-140.2%
associate-/l*40.2%
Simplified40.2%
if 3.80000000000000004e40 < x Initial program 77.6%
sub-neg77.6%
+-commutative77.6%
add-cube-cbrt77.6%
fma-define77.6%
pow-to-exp77.6%
un-div-inv77.6%
+-commutative77.6%
log1p-define77.6%
Applied egg-rr77.6%
Taylor expanded in x around inf 77.6%
rem-cube-cbrt77.6%
distribute-rgt1-in77.6%
metadata-eval77.6%
mul0-lft77.6%
Simplified77.6%
Final simplification54.8%
(FPCore (x n) :precision binary64 (if (<= x 4e+40) (/ -1.0 (/ n (/ (+ -1.0 (/ (+ 0.5 (/ -0.3333333333333333 x)) x)) x))) 0.0))
double code(double x, double n) {
double tmp;
if (x <= 4e+40) {
tmp = -1.0 / (n / ((-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / x));
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 4d+40) then
tmp = (-1.0d0) / (n / (((-1.0d0) + ((0.5d0 + ((-0.3333333333333333d0) / x)) / x)) / x))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 4e+40) {
tmp = -1.0 / (n / ((-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / x));
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 4e+40: tmp = -1.0 / (n / ((-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / x)) else: tmp = 0.0 return tmp
function code(x, n) tmp = 0.0 if (x <= 4e+40) tmp = Float64(-1.0 / Float64(n / Float64(Float64(-1.0 + Float64(Float64(0.5 + Float64(-0.3333333333333333 / x)) / x)) / x))); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 4e+40) tmp = -1.0 / (n / ((-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / x)); else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 4e+40], N[(-1.0 / N[(n / N[(N[(-1.0 + N[(N[(0.5 + N[(-0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4 \cdot 10^{+40}:\\
\;\;\;\;\frac{-1}{\frac{n}{\frac{-1 + \frac{0.5 + \frac{-0.3333333333333333}{x}}{x}}{x}}}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 4.00000000000000012e40Initial program 44.0%
Taylor expanded in n around inf 46.2%
clear-num46.1%
inv-pow46.1%
log1p-define46.1%
Applied egg-rr46.1%
unpow-146.1%
Simplified46.1%
Taylor expanded in x around -inf 39.7%
mul-1-neg39.7%
distribute-neg-frac239.7%
sub-neg39.7%
associate-*r/39.7%
sub-neg39.7%
metadata-eval39.7%
distribute-lft-in39.7%
neg-mul-139.7%
associate-*r/39.7%
metadata-eval39.7%
distribute-neg-frac39.7%
metadata-eval39.7%
metadata-eval39.7%
metadata-eval39.7%
Simplified39.7%
if 4.00000000000000012e40 < x Initial program 77.6%
sub-neg77.6%
+-commutative77.6%
add-cube-cbrt77.6%
fma-define77.6%
pow-to-exp77.6%
un-div-inv77.6%
+-commutative77.6%
log1p-define77.6%
Applied egg-rr77.6%
Taylor expanded in x around inf 77.6%
rem-cube-cbrt77.6%
distribute-rgt1-in77.6%
metadata-eval77.6%
mul0-lft77.6%
Simplified77.6%
Final simplification54.5%
(FPCore (x n) :precision binary64 (if (<= x 2.12e+40) (/ (- (/ 1.0 n) (/ (+ 0.5 (/ -0.3333333333333333 x)) (* x n))) x) 0.0))
double code(double x, double n) {
double tmp;
if (x <= 2.12e+40) {
tmp = ((1.0 / n) - ((0.5 + (-0.3333333333333333 / x)) / (x * n))) / x;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 2.12d+40) then
tmp = ((1.0d0 / n) - ((0.5d0 + ((-0.3333333333333333d0) / x)) / (x * n))) / x
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 2.12e+40) {
tmp = ((1.0 / n) - ((0.5 + (-0.3333333333333333 / x)) / (x * n))) / x;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 2.12e+40: tmp = ((1.0 / n) - ((0.5 + (-0.3333333333333333 / x)) / (x * n))) / x else: tmp = 0.0 return tmp
function code(x, n) tmp = 0.0 if (x <= 2.12e+40) tmp = Float64(Float64(Float64(1.0 / n) - Float64(Float64(0.5 + Float64(-0.3333333333333333 / x)) / Float64(x * n))) / x); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 2.12e+40) tmp = ((1.0 / n) - ((0.5 + (-0.3333333333333333 / x)) / (x * n))) / x; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 2.12e+40], N[(N[(N[(1.0 / n), $MachinePrecision] - N[(N[(0.5 + N[(-0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.12 \cdot 10^{+40}:\\
\;\;\;\;\frac{\frac{1}{n} - \frac{0.5 + \frac{-0.3333333333333333}{x}}{x \cdot n}}{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 2.11999999999999991e40Initial program 44.0%
Taylor expanded in n around inf 46.2%
Taylor expanded in x around -inf 40.2%
associate-*r/40.2%
mul-1-neg40.2%
associate-*r/40.2%
mul-1-neg40.2%
associate-*r/40.2%
metadata-eval40.2%
*-commutative40.2%
associate-*r/40.2%
metadata-eval40.2%
Simplified40.2%
Taylor expanded in x around -inf 40.2%
Simplified40.2%
if 2.11999999999999991e40 < x Initial program 77.6%
sub-neg77.6%
+-commutative77.6%
add-cube-cbrt77.6%
fma-define77.6%
pow-to-exp77.6%
un-div-inv77.6%
+-commutative77.6%
log1p-define77.6%
Applied egg-rr77.6%
Taylor expanded in x around inf 77.6%
rem-cube-cbrt77.6%
distribute-rgt1-in77.6%
metadata-eval77.6%
mul0-lft77.6%
Simplified77.6%
Final simplification54.8%
(FPCore (x n) :precision binary64 (if (<= x 2.9e+40) (/ 1.0 (* x n)) 0.0))
double code(double x, double n) {
double tmp;
if (x <= 2.9e+40) {
tmp = 1.0 / (x * n);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 2.9d+40) then
tmp = 1.0d0 / (x * n)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 2.9e+40) {
tmp = 1.0 / (x * n);
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 2.9e+40: tmp = 1.0 / (x * n) else: tmp = 0.0 return tmp
function code(x, n) tmp = 0.0 if (x <= 2.9e+40) tmp = Float64(1.0 / Float64(x * n)); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 2.9e+40) tmp = 1.0 / (x * n); else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 2.9e+40], N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.9 \cdot 10^{+40}:\\
\;\;\;\;\frac{1}{x \cdot n}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 2.90000000000000017e40Initial program 44.0%
Taylor expanded in n around inf 46.2%
Taylor expanded in x around inf 28.6%
if 2.90000000000000017e40 < x Initial program 77.6%
sub-neg77.6%
+-commutative77.6%
add-cube-cbrt77.6%
fma-define77.6%
pow-to-exp77.6%
un-div-inv77.6%
+-commutative77.6%
log1p-define77.6%
Applied egg-rr77.6%
Taylor expanded in x around inf 77.6%
rem-cube-cbrt77.6%
distribute-rgt1-in77.6%
metadata-eval77.6%
mul0-lft77.6%
Simplified77.6%
Final simplification47.7%
(FPCore (x n) :precision binary64 0.0)
double code(double x, double n) {
return 0.0;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
code = 0.0d0
end function
public static double code(double x, double n) {
return 0.0;
}
def code(x, n): return 0.0
function code(x, n) return 0.0 end
function tmp = code(x, n) tmp = 0.0; end
code[x_, n_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 57.1%
sub-neg57.1%
+-commutative57.1%
add-cube-cbrt57.1%
fma-define57.1%
pow-to-exp57.1%
un-div-inv57.1%
+-commutative57.1%
log1p-define63.1%
Applied egg-rr63.1%
Taylor expanded in x around inf 33.8%
rem-cube-cbrt33.8%
distribute-rgt1-in33.8%
metadata-eval33.8%
mul0-lft34.1%
Simplified34.1%
Final simplification34.1%
herbie shell --seed 2024055
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))