
(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 16 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 (log (+ 1.0 x))) (t_1 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -2e-71)
(/ t_1 (* n x))
(if (<= (/ 1.0 n) 4e-7)
(-
(+
(/ (- t_0 (log x)) n)
(+
(/
(-
(* -0.16666666666666666 (pow (log x) 3.0))
(* -0.16666666666666666 (pow t_0 3.0)))
(pow n 3.0))
(+
(* 0.041666666666666664 (/ (pow t_0 4.0) (pow n 4.0)))
(* 0.5 (/ (pow t_0 2.0) (pow n 2.0))))))
(+
(* 0.041666666666666664 (/ (pow (log x) 4.0) (pow n 4.0)))
(* 0.5 (/ (pow (log x) 2.0) (pow n 2.0)))))
(- (exp (/ (log1p x) n)) t_1)))))
double code(double x, double n) {
double t_0 = log((1.0 + x));
double t_1 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-71) {
tmp = t_1 / (n * x);
} else if ((1.0 / n) <= 4e-7) {
tmp = (((t_0 - log(x)) / n) + ((((-0.16666666666666666 * pow(log(x), 3.0)) - (-0.16666666666666666 * pow(t_0, 3.0))) / pow(n, 3.0)) + ((0.041666666666666664 * (pow(t_0, 4.0) / pow(n, 4.0))) + (0.5 * (pow(t_0, 2.0) / pow(n, 2.0)))))) - ((0.041666666666666664 * (pow(log(x), 4.0) / pow(n, 4.0))) + (0.5 * (pow(log(x), 2.0) / pow(n, 2.0))));
} else {
tmp = exp((log1p(x) / n)) - t_1;
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.log((1.0 + x));
double t_1 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-71) {
tmp = t_1 / (n * x);
} else if ((1.0 / n) <= 4e-7) {
tmp = (((t_0 - Math.log(x)) / n) + ((((-0.16666666666666666 * Math.pow(Math.log(x), 3.0)) - (-0.16666666666666666 * Math.pow(t_0, 3.0))) / Math.pow(n, 3.0)) + ((0.041666666666666664 * (Math.pow(t_0, 4.0) / Math.pow(n, 4.0))) + (0.5 * (Math.pow(t_0, 2.0) / Math.pow(n, 2.0)))))) - ((0.041666666666666664 * (Math.pow(Math.log(x), 4.0) / Math.pow(n, 4.0))) + (0.5 * (Math.pow(Math.log(x), 2.0) / Math.pow(n, 2.0))));
} else {
tmp = Math.exp((Math.log1p(x) / n)) - t_1;
}
return tmp;
}
def code(x, n): t_0 = math.log((1.0 + x)) t_1 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -2e-71: tmp = t_1 / (n * x) elif (1.0 / n) <= 4e-7: tmp = (((t_0 - math.log(x)) / n) + ((((-0.16666666666666666 * math.pow(math.log(x), 3.0)) - (-0.16666666666666666 * math.pow(t_0, 3.0))) / math.pow(n, 3.0)) + ((0.041666666666666664 * (math.pow(t_0, 4.0) / math.pow(n, 4.0))) + (0.5 * (math.pow(t_0, 2.0) / math.pow(n, 2.0)))))) - ((0.041666666666666664 * (math.pow(math.log(x), 4.0) / math.pow(n, 4.0))) + (0.5 * (math.pow(math.log(x), 2.0) / math.pow(n, 2.0)))) else: tmp = math.exp((math.log1p(x) / n)) - t_1 return tmp
function code(x, n) t_0 = log(Float64(1.0 + x)) t_1 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-71) tmp = Float64(t_1 / Float64(n * x)); elseif (Float64(1.0 / n) <= 4e-7) tmp = Float64(Float64(Float64(Float64(t_0 - log(x)) / n) + Float64(Float64(Float64(Float64(-0.16666666666666666 * (log(x) ^ 3.0)) - Float64(-0.16666666666666666 * (t_0 ^ 3.0))) / (n ^ 3.0)) + Float64(Float64(0.041666666666666664 * Float64((t_0 ^ 4.0) / (n ^ 4.0))) + Float64(0.5 * Float64((t_0 ^ 2.0) / (n ^ 2.0)))))) - Float64(Float64(0.041666666666666664 * Float64((log(x) ^ 4.0) / (n ^ 4.0))) + Float64(0.5 * Float64((log(x) ^ 2.0) / (n ^ 2.0))))); else tmp = Float64(exp(Float64(log1p(x) / n)) - t_1); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Log[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-71], N[(t$95$1 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 4e-7], N[(N[(N[(N[(t$95$0 - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] + N[(N[(N[(N[(-0.16666666666666666 * N[Power[N[Log[x], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] - N[(-0.16666666666666666 * N[Power[t$95$0, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[n, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[(0.041666666666666664 * N[(N[Power[t$95$0, 4.0], $MachinePrecision] / N[Power[n, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[Power[t$95$0, 2.0], $MachinePrecision] / N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(0.041666666666666664 * N[(N[Power[N[Log[x], $MachinePrecision], 4.0], $MachinePrecision] / N[Power[n, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(1 + x\right)\\
t_1 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-71}:\\
\;\;\;\;\frac{t_1}{n \cdot x}\\
\mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{-7}:\\
\;\;\;\;\left(\frac{t_0 - \log x}{n} + \left(\frac{-0.16666666666666666 \cdot {\log x}^{3} - -0.16666666666666666 \cdot {t_0}^{3}}{{n}^{3}} + \left(0.041666666666666664 \cdot \frac{{t_0}^{4}}{{n}^{4}} + 0.5 \cdot \frac{{t_0}^{2}}{{n}^{2}}\right)\right)\right) - \left(0.041666666666666664 \cdot \frac{{\log x}^{4}}{{n}^{4}} + 0.5 \cdot \frac{{\log x}^{2}}{{n}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t_1\\
\end{array}
\end{array}
if (/.f64 1 n) < -1.9999999999999998e-71Initial program 89.7%
Taylor expanded in n around 0 89.7%
log1p-def89.7%
Simplified89.7%
Taylor expanded in x around inf 95.0%
log-rec95.0%
mul-1-neg95.0%
associate-*r/95.0%
neg-mul-195.0%
mul-1-neg95.0%
remove-double-neg95.0%
*-rgt-identity95.0%
associate-*r/95.0%
exp-to-pow95.0%
*-commutative95.0%
Simplified95.0%
if -1.9999999999999998e-71 < (/.f64 1 n) < 3.9999999999999998e-7Initial program 33.7%
Taylor expanded in n around -inf 80.9%
if 3.9999999999999998e-7 < (/.f64 1 n) Initial program 45.0%
Taylor expanded in n around 0 45.0%
log1p-def94.8%
Simplified94.8%
Final simplification88.2%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -2e-71)
(/ t_0 (* n x))
(if (<= (/ 1.0 n) 4e-7)
(+
(/ (- (log1p x) (log x)) n)
(+
(/
0.16666666666666666
(/ (pow n 3.0) (- (pow (log1p x) 3.0) (pow (log x) 3.0))))
(*
0.5
(-
(/ (pow (log1p x) 2.0) (pow n 2.0))
(/ (pow (log x) 2.0) (pow n 2.0))))))
(- (exp (/ (log1p x) n)) t_0)))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-71) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 4e-7) {
tmp = ((log1p(x) - log(x)) / n) + ((0.16666666666666666 / (pow(n, 3.0) / (pow(log1p(x), 3.0) - pow(log(x), 3.0)))) + (0.5 * ((pow(log1p(x), 2.0) / pow(n, 2.0)) - (pow(log(x), 2.0) / pow(n, 2.0)))));
} else {
tmp = exp((log1p(x) / n)) - t_0;
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-71) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 4e-7) {
tmp = ((Math.log1p(x) - Math.log(x)) / n) + ((0.16666666666666666 / (Math.pow(n, 3.0) / (Math.pow(Math.log1p(x), 3.0) - Math.pow(Math.log(x), 3.0)))) + (0.5 * ((Math.pow(Math.log1p(x), 2.0) / Math.pow(n, 2.0)) - (Math.pow(Math.log(x), 2.0) / Math.pow(n, 2.0)))));
} else {
tmp = Math.exp((Math.log1p(x) / n)) - t_0;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -2e-71: tmp = t_0 / (n * x) elif (1.0 / n) <= 4e-7: tmp = ((math.log1p(x) - math.log(x)) / n) + ((0.16666666666666666 / (math.pow(n, 3.0) / (math.pow(math.log1p(x), 3.0) - math.pow(math.log(x), 3.0)))) + (0.5 * ((math.pow(math.log1p(x), 2.0) / math.pow(n, 2.0)) - (math.pow(math.log(x), 2.0) / math.pow(n, 2.0))))) else: tmp = math.exp((math.log1p(x) / n)) - t_0 return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-71) tmp = Float64(t_0 / Float64(n * x)); elseif (Float64(1.0 / n) <= 4e-7) tmp = Float64(Float64(Float64(log1p(x) - log(x)) / n) + Float64(Float64(0.16666666666666666 / Float64((n ^ 3.0) / Float64((log1p(x) ^ 3.0) - (log(x) ^ 3.0)))) + Float64(0.5 * Float64(Float64((log1p(x) ^ 2.0) / (n ^ 2.0)) - Float64((log(x) ^ 2.0) / (n ^ 2.0)))))); else tmp = Float64(exp(Float64(log1p(x) / n)) - t_0); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-71], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 4e-7], N[(N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] + N[(N[(0.16666666666666666 / N[(N[Power[n, 3.0], $MachinePrecision] / N[(N[Power[N[Log[1 + x], $MachinePrecision], 3.0], $MachinePrecision] - N[Power[N[Log[x], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[(N[Power[N[Log[1 + x], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision] - N[(N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-71}:\\
\;\;\;\;\frac{t_0}{n \cdot x}\\
\mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{-7}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(x\right) - \log x}{n} + \left(\frac{0.16666666666666666}{\frac{{n}^{3}}{{\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}}} + 0.5 \cdot \left(\frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2}}{{n}^{2}} - \frac{{\log x}^{2}}{{n}^{2}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t_0\\
\end{array}
\end{array}
if (/.f64 1 n) < -1.9999999999999998e-71Initial program 89.7%
Taylor expanded in n around 0 89.7%
log1p-def89.7%
Simplified89.7%
Taylor expanded in x around inf 95.0%
log-rec95.0%
mul-1-neg95.0%
associate-*r/95.0%
neg-mul-195.0%
mul-1-neg95.0%
remove-double-neg95.0%
*-rgt-identity95.0%
associate-*r/95.0%
exp-to-pow95.0%
*-commutative95.0%
Simplified95.0%
if -1.9999999999999998e-71 < (/.f64 1 n) < 3.9999999999999998e-7Initial program 33.7%
Taylor expanded in n around -inf 80.8%
associate--l+80.8%
associate-*r/80.8%
distribute-lft-out--80.8%
associate-*r*80.8%
metadata-eval80.8%
*-lft-identity80.8%
log1p-def80.8%
associate--l+80.8%
Simplified80.8%
if 3.9999999999999998e-7 < (/.f64 1 n) Initial program 45.0%
Taylor expanded in n around 0 45.0%
log1p-def94.8%
Simplified94.8%
Final simplification88.2%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -2e-71)
(/ t_0 (* n x))
(if (<= (/ 1.0 n) 2e-18)
(+
(/ (- (log1p x) (log x)) n)
(*
0.5
(-
(/ (pow (log1p x) 2.0) (pow n 2.0))
(/ (pow (log x) 2.0) (pow n 2.0)))))
(- (exp (/ (log1p x) n)) t_0)))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-71) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 2e-18) {
tmp = ((log1p(x) - log(x)) / n) + (0.5 * ((pow(log1p(x), 2.0) / pow(n, 2.0)) - (pow(log(x), 2.0) / pow(n, 2.0))));
} else {
tmp = exp((log1p(x) / n)) - t_0;
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-71) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 2e-18) {
tmp = ((Math.log1p(x) - Math.log(x)) / n) + (0.5 * ((Math.pow(Math.log1p(x), 2.0) / Math.pow(n, 2.0)) - (Math.pow(Math.log(x), 2.0) / Math.pow(n, 2.0))));
} else {
tmp = Math.exp((Math.log1p(x) / n)) - t_0;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -2e-71: tmp = t_0 / (n * x) elif (1.0 / n) <= 2e-18: tmp = ((math.log1p(x) - math.log(x)) / n) + (0.5 * ((math.pow(math.log1p(x), 2.0) / math.pow(n, 2.0)) - (math.pow(math.log(x), 2.0) / math.pow(n, 2.0)))) else: tmp = math.exp((math.log1p(x) / n)) - t_0 return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-71) tmp = Float64(t_0 / Float64(n * x)); elseif (Float64(1.0 / n) <= 2e-18) tmp = Float64(Float64(Float64(log1p(x) - log(x)) / n) + Float64(0.5 * Float64(Float64((log1p(x) ^ 2.0) / (n ^ 2.0)) - Float64((log(x) ^ 2.0) / (n ^ 2.0))))); else tmp = Float64(exp(Float64(log1p(x) / n)) - t_0); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-71], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-18], N[(N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] + N[(0.5 * N[(N[(N[Power[N[Log[1 + x], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision] - N[(N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-71}:\\
\;\;\;\;\frac{t_0}{n \cdot x}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-18}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(x\right) - \log x}{n} + 0.5 \cdot \left(\frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2}}{{n}^{2}} - \frac{{\log x}^{2}}{{n}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t_0\\
\end{array}
\end{array}
if (/.f64 1 n) < -1.9999999999999998e-71Initial program 89.7%
Taylor expanded in n around 0 89.7%
log1p-def89.7%
Simplified89.7%
Taylor expanded in x around inf 95.0%
log-rec95.0%
mul-1-neg95.0%
associate-*r/95.0%
neg-mul-195.0%
mul-1-neg95.0%
remove-double-neg95.0%
*-rgt-identity95.0%
associate-*r/95.0%
exp-to-pow95.0%
*-commutative95.0%
Simplified95.0%
if -1.9999999999999998e-71 < (/.f64 1 n) < 2.0000000000000001e-18Initial program 33.5%
Taylor expanded in n around inf 81.3%
associate--l+76.0%
+-commutative76.0%
associate--r+81.3%
div-sub81.3%
remove-double-neg81.3%
mul-1-neg81.3%
distribute-lft-out--81.3%
mul-1-neg81.3%
associate-*r/81.3%
Simplified81.3%
if 2.0000000000000001e-18 < (/.f64 1 n) Initial program 45.0%
Taylor expanded in n around 0 45.0%
log1p-def92.5%
Simplified92.5%
Final simplification88.2%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -2e-71)
(/ t_0 (* n x))
(if (<= (/ 1.0 n) 2e-18)
(/ (- (log1p x) (log x)) n)
(- (exp (/ (log1p x) n)) t_0)))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-71) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 2e-18) {
tmp = (log1p(x) - log(x)) / n;
} else {
tmp = exp((log1p(x) / n)) - t_0;
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-71) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 2e-18) {
tmp = (Math.log1p(x) - Math.log(x)) / n;
} else {
tmp = Math.exp((Math.log1p(x) / n)) - t_0;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -2e-71: tmp = t_0 / (n * x) elif (1.0 / n) <= 2e-18: tmp = (math.log1p(x) - math.log(x)) / n else: tmp = math.exp((math.log1p(x) / n)) - t_0 return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-71) tmp = Float64(t_0 / Float64(n * x)); elseif (Float64(1.0 / n) <= 2e-18) tmp = Float64(Float64(log1p(x) - log(x)) / n); else tmp = Float64(exp(Float64(log1p(x) / n)) - t_0); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-71], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-18], N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-71}:\\
\;\;\;\;\frac{t_0}{n \cdot x}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-18}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(x\right) - \log x}{n}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t_0\\
\end{array}
\end{array}
if (/.f64 1 n) < -1.9999999999999998e-71Initial program 89.7%
Taylor expanded in n around 0 89.7%
log1p-def89.7%
Simplified89.7%
Taylor expanded in x around inf 95.0%
log-rec95.0%
mul-1-neg95.0%
associate-*r/95.0%
neg-mul-195.0%
mul-1-neg95.0%
remove-double-neg95.0%
*-rgt-identity95.0%
associate-*r/95.0%
exp-to-pow95.0%
*-commutative95.0%
Simplified95.0%
if -1.9999999999999998e-71 < (/.f64 1 n) < 2.0000000000000001e-18Initial program 33.5%
Taylor expanded in n around inf 81.3%
log1p-def81.3%
Simplified81.3%
if 2.0000000000000001e-18 < (/.f64 1 n) Initial program 45.0%
Taylor expanded in n around 0 45.0%
log1p-def92.5%
Simplified92.5%
Final simplification88.1%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))) (t_1 (/ (- (log x)) n)))
(if (<= x 4.1e-305)
(- 1.0 t_0)
(if (<= x 5.5e-235)
t_1
(if (<= x 3.5e-173)
(- (+ 1.0 (/ x n)) t_0)
(if (<= x 6.3e-71)
t_1
(if (<= x 0.0105)
(log1p (expm1 (/ (/ 1.0 x) n)))
(/ (/ t_0 x) n))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double t_1 = -log(x) / n;
double tmp;
if (x <= 4.1e-305) {
tmp = 1.0 - t_0;
} else if (x <= 5.5e-235) {
tmp = t_1;
} else if (x <= 3.5e-173) {
tmp = (1.0 + (x / n)) - t_0;
} else if (x <= 6.3e-71) {
tmp = t_1;
} else if (x <= 0.0105) {
tmp = log1p(expm1(((1.0 / x) / n)));
} else {
tmp = (t_0 / x) / n;
}
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) / n;
double tmp;
if (x <= 4.1e-305) {
tmp = 1.0 - t_0;
} else if (x <= 5.5e-235) {
tmp = t_1;
} else if (x <= 3.5e-173) {
tmp = (1.0 + (x / n)) - t_0;
} else if (x <= 6.3e-71) {
tmp = t_1;
} else if (x <= 0.0105) {
tmp = Math.log1p(Math.expm1(((1.0 / x) / n)));
} else {
tmp = (t_0 / x) / n;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) t_1 = -math.log(x) / n tmp = 0 if x <= 4.1e-305: tmp = 1.0 - t_0 elif x <= 5.5e-235: tmp = t_1 elif x <= 3.5e-173: tmp = (1.0 + (x / n)) - t_0 elif x <= 6.3e-71: tmp = t_1 elif x <= 0.0105: tmp = math.log1p(math.expm1(((1.0 / x) / n))) else: tmp = (t_0 / x) / n return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) t_1 = Float64(Float64(-log(x)) / n) tmp = 0.0 if (x <= 4.1e-305) tmp = Float64(1.0 - t_0); elseif (x <= 5.5e-235) tmp = t_1; elseif (x <= 3.5e-173) tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0); elseif (x <= 6.3e-71) tmp = t_1; elseif (x <= 0.0105) tmp = log1p(expm1(Float64(Float64(1.0 / x) / n))); else tmp = Float64(Float64(t_0 / x) / n); 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[x], $MachinePrecision]) / n), $MachinePrecision]}, If[LessEqual[x, 4.1e-305], N[(1.0 - t$95$0), $MachinePrecision], If[LessEqual[x, 5.5e-235], t$95$1, If[LessEqual[x, 3.5e-173], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x, 6.3e-71], t$95$1, If[LessEqual[x, 0.0105], N[Log[1 + N[(Exp[N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{-\log x}{n}\\
\mathbf{if}\;x \leq 4.1 \cdot 10^{-305}:\\
\;\;\;\;1 - t_0\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-235}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-173}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - t_0\\
\mathbf{elif}\;x \leq 6.3 \cdot 10^{-71}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 0.0105:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\frac{1}{x}}{n}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t_0}{x}}{n}\\
\end{array}
\end{array}
if x < 4.1000000000000002e-305Initial program 100.0%
Taylor expanded in x around 0 100.0%
if 4.1000000000000002e-305 < x < 5.4999999999999998e-235 or 3.50000000000000014e-173 < x < 6.3000000000000003e-71Initial program 35.4%
Taylor expanded in x around 0 35.4%
Taylor expanded in n around inf 59.0%
associate-*r/59.0%
mul-1-neg59.0%
Simplified59.0%
if 5.4999999999999998e-235 < x < 3.50000000000000014e-173Initial program 65.1%
Taylor expanded in x around 0 65.2%
if 6.3000000000000003e-71 < x < 0.0105000000000000007Initial program 40.8%
Taylor expanded in x around inf 36.7%
mul-1-neg36.7%
log-rec36.7%
mul-1-neg36.7%
distribute-neg-frac36.7%
mul-1-neg36.7%
remove-double-neg36.7%
*-commutative36.7%
Simplified36.7%
Taylor expanded in n around inf 19.5%
*-commutative19.5%
Simplified19.5%
log1p-expm1-u61.9%
associate-/r*61.9%
Applied egg-rr61.9%
if 0.0105000000000000007 < x Initial program 69.4%
Taylor expanded in x around inf 96.1%
mul-1-neg96.1%
log-rec96.1%
mul-1-neg96.1%
distribute-neg-frac96.1%
mul-1-neg96.1%
remove-double-neg96.1%
*-commutative96.1%
Simplified96.1%
expm1-log1p-u96.1%
expm1-udef69.4%
associate-/r*69.4%
div-inv69.4%
pow-to-exp69.4%
pow169.4%
pow-div69.4%
Applied egg-rr69.4%
expm1-def97.5%
expm1-log1p97.5%
sub-neg97.5%
metadata-eval97.5%
Simplified97.5%
pow-prod-up97.7%
inv-pow97.7%
Applied egg-rr97.7%
*-commutative97.7%
associate-*l/97.7%
*-lft-identity97.7%
Simplified97.7%
Final simplification77.6%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -2e-71)
(/ t_0 (* n x))
(if (<= (/ 1.0 n) 2e-16)
(/ (- (log1p x) (log x)) n)
(if (<= (/ 1.0 n) 1e+154)
(- (+ 1.0 (/ x n)) t_0)
(sqrt (pow (* n x) -2.0)))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-71) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 2e-16) {
tmp = (log1p(x) - log(x)) / n;
} else if ((1.0 / n) <= 1e+154) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = sqrt(pow((n * x), -2.0));
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-71) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 2e-16) {
tmp = (Math.log1p(x) - Math.log(x)) / n;
} else if ((1.0 / n) <= 1e+154) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = Math.sqrt(Math.pow((n * x), -2.0));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -2e-71: tmp = t_0 / (n * x) elif (1.0 / n) <= 2e-16: tmp = (math.log1p(x) - math.log(x)) / n elif (1.0 / n) <= 1e+154: tmp = (1.0 + (x / n)) - t_0 else: tmp = math.sqrt(math.pow((n * x), -2.0)) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-71) tmp = Float64(t_0 / Float64(n * x)); elseif (Float64(1.0 / n) <= 2e-16) tmp = Float64(Float64(log1p(x) - log(x)) / n); elseif (Float64(1.0 / n) <= 1e+154) tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0); else tmp = sqrt((Float64(n * x) ^ -2.0)); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-71], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-16], N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+154], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[Sqrt[N[Power[N[(n * x), $MachinePrecision], -2.0], $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-71}:\\
\;\;\;\;\frac{t_0}{n \cdot x}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-16}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(x\right) - \log x}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+154}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{{\left(n \cdot x\right)}^{-2}}\\
\end{array}
\end{array}
if (/.f64 1 n) < -1.9999999999999998e-71Initial program 89.7%
Taylor expanded in n around 0 89.7%
log1p-def89.7%
Simplified89.7%
Taylor expanded in x around inf 95.0%
log-rec95.0%
mul-1-neg95.0%
associate-*r/95.0%
neg-mul-195.0%
mul-1-neg95.0%
remove-double-neg95.0%
*-rgt-identity95.0%
associate-*r/95.0%
exp-to-pow95.0%
*-commutative95.0%
Simplified95.0%
if -1.9999999999999998e-71 < (/.f64 1 n) < 2e-16Initial program 33.2%
Taylor expanded in n around inf 80.7%
log1p-def80.7%
Simplified80.7%
if 2e-16 < (/.f64 1 n) < 1.00000000000000004e154Initial program 71.8%
Taylor expanded in x around 0 67.3%
if 1.00000000000000004e154 < (/.f64 1 n) Initial program 17.6%
Taylor expanded in x around inf 0.4%
mul-1-neg0.4%
log-rec0.4%
mul-1-neg0.4%
distribute-neg-frac0.4%
mul-1-neg0.4%
remove-double-neg0.4%
*-commutative0.4%
Simplified0.4%
Taylor expanded in n around inf 55.3%
*-commutative55.3%
Simplified55.3%
add-sqr-sqrt55.3%
sqrt-unprod79.8%
inv-pow79.8%
inv-pow79.8%
pow-prod-up79.8%
metadata-eval79.8%
Applied egg-rr79.8%
Final simplification84.8%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))) (t_1 (/ (- (log x)) n)))
(if (<= n -3e+95)
(/ (/ 1.0 n) x)
(if (<= n -1.65e+71)
t_1
(if (<= n -2e-312)
(/ t_0 (* n x))
(if (<= n 1.35e-160)
(sqrt (pow (* n x) -2.0))
(if (<= n 42000.0)
(- (+ 1.0 (/ x n)) t_0)
(if (<= n 1.02e+180) (/ (/ t_0 x) n) t_1))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double t_1 = -log(x) / n;
double tmp;
if (n <= -3e+95) {
tmp = (1.0 / n) / x;
} else if (n <= -1.65e+71) {
tmp = t_1;
} else if (n <= -2e-312) {
tmp = t_0 / (n * x);
} else if (n <= 1.35e-160) {
tmp = sqrt(pow((n * x), -2.0));
} else if (n <= 42000.0) {
tmp = (1.0 + (x / n)) - t_0;
} else if (n <= 1.02e+180) {
tmp = (t_0 / x) / n;
} else {
tmp = t_1;
}
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 = x ** (1.0d0 / n)
t_1 = -log(x) / n
if (n <= (-3d+95)) then
tmp = (1.0d0 / n) / x
else if (n <= (-1.65d+71)) then
tmp = t_1
else if (n <= (-2d-312)) then
tmp = t_0 / (n * x)
else if (n <= 1.35d-160) then
tmp = sqrt(((n * x) ** (-2.0d0)))
else if (n <= 42000.0d0) then
tmp = (1.0d0 + (x / n)) - t_0
else if (n <= 1.02d+180) then
tmp = (t_0 / x) / n
else
tmp = t_1
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 = -Math.log(x) / n;
double tmp;
if (n <= -3e+95) {
tmp = (1.0 / n) / x;
} else if (n <= -1.65e+71) {
tmp = t_1;
} else if (n <= -2e-312) {
tmp = t_0 / (n * x);
} else if (n <= 1.35e-160) {
tmp = Math.sqrt(Math.pow((n * x), -2.0));
} else if (n <= 42000.0) {
tmp = (1.0 + (x / n)) - t_0;
} else if (n <= 1.02e+180) {
tmp = (t_0 / x) / n;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) t_1 = -math.log(x) / n tmp = 0 if n <= -3e+95: tmp = (1.0 / n) / x elif n <= -1.65e+71: tmp = t_1 elif n <= -2e-312: tmp = t_0 / (n * x) elif n <= 1.35e-160: tmp = math.sqrt(math.pow((n * x), -2.0)) elif n <= 42000.0: tmp = (1.0 + (x / n)) - t_0 elif n <= 1.02e+180: tmp = (t_0 / x) / n else: tmp = t_1 return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) t_1 = Float64(Float64(-log(x)) / n) tmp = 0.0 if (n <= -3e+95) tmp = Float64(Float64(1.0 / n) / x); elseif (n <= -1.65e+71) tmp = t_1; elseif (n <= -2e-312) tmp = Float64(t_0 / Float64(n * x)); elseif (n <= 1.35e-160) tmp = sqrt((Float64(n * x) ^ -2.0)); elseif (n <= 42000.0) tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0); elseif (n <= 1.02e+180) tmp = Float64(Float64(t_0 / x) / n); else tmp = t_1; end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); t_1 = -log(x) / n; tmp = 0.0; if (n <= -3e+95) tmp = (1.0 / n) / x; elseif (n <= -1.65e+71) tmp = t_1; elseif (n <= -2e-312) tmp = t_0 / (n * x); elseif (n <= 1.35e-160) tmp = sqrt(((n * x) ^ -2.0)); elseif (n <= 42000.0) tmp = (1.0 + (x / n)) - t_0; elseif (n <= 1.02e+180) tmp = (t_0 / x) / n; else tmp = t_1; 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[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision]}, If[LessEqual[n, -3e+95], N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[n, -1.65e+71], t$95$1, If[LessEqual[n, -2e-312], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.35e-160], N[Sqrt[N[Power[N[(n * x), $MachinePrecision], -2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[n, 42000.0], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[n, 1.02e+180], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{-\log x}{n}\\
\mathbf{if}\;n \leq -3 \cdot 10^{+95}:\\
\;\;\;\;\frac{\frac{1}{n}}{x}\\
\mathbf{elif}\;n \leq -1.65 \cdot 10^{+71}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;n \leq -2 \cdot 10^{-312}:\\
\;\;\;\;\frac{t_0}{n \cdot x}\\
\mathbf{elif}\;n \leq 1.35 \cdot 10^{-160}:\\
\;\;\;\;\sqrt{{\left(n \cdot x\right)}^{-2}}\\
\mathbf{elif}\;n \leq 42000:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - t_0\\
\mathbf{elif}\;n \leq 1.02 \cdot 10^{+180}:\\
\;\;\;\;\frac{\frac{t_0}{x}}{n}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if n < -2.99999999999999991e95Initial program 46.1%
Taylor expanded in x around inf 62.8%
mul-1-neg62.8%
log-rec62.8%
mul-1-neg62.8%
distribute-neg-frac62.8%
mul-1-neg62.8%
remove-double-neg62.8%
*-commutative62.8%
Simplified62.8%
expm1-log1p-u62.4%
expm1-udef45.5%
associate-/r*45.5%
div-inv45.5%
pow-to-exp45.5%
pow145.5%
pow-div45.5%
Applied egg-rr45.5%
expm1-def63.2%
expm1-log1p63.6%
sub-neg63.6%
metadata-eval63.6%
Simplified63.6%
Taylor expanded in n around inf 62.8%
associate-/r*63.7%
Simplified63.7%
if -2.99999999999999991e95 < n < -1.6499999999999999e71 or 1.02e180 < n Initial program 25.8%
Taylor expanded in x around 0 25.8%
Taylor expanded in n around inf 74.7%
associate-*r/74.7%
mul-1-neg74.7%
Simplified74.7%
if -1.6499999999999999e71 < n < -2.0000000000019e-312Initial program 89.7%
Taylor expanded in n around 0 89.7%
log1p-def89.7%
Simplified89.7%
Taylor expanded in x around inf 95.0%
log-rec95.0%
mul-1-neg95.0%
associate-*r/95.0%
neg-mul-195.0%
mul-1-neg95.0%
remove-double-neg95.0%
*-rgt-identity95.0%
associate-*r/95.0%
exp-to-pow95.0%
*-commutative95.0%
Simplified95.0%
if -2.0000000000019e-312 < n < 1.35000000000000005e-160Initial program 17.6%
Taylor expanded in x around inf 0.4%
mul-1-neg0.4%
log-rec0.4%
mul-1-neg0.4%
distribute-neg-frac0.4%
mul-1-neg0.4%
remove-double-neg0.4%
*-commutative0.4%
Simplified0.4%
Taylor expanded in n around inf 55.3%
*-commutative55.3%
Simplified55.3%
add-sqr-sqrt55.3%
sqrt-unprod79.8%
inv-pow79.8%
inv-pow79.8%
pow-prod-up79.8%
metadata-eval79.8%
Applied egg-rr79.8%
if 1.35000000000000005e-160 < n < 42000Initial program 78.5%
Taylor expanded in x around 0 73.2%
if 42000 < n < 1.02e180Initial program 22.0%
Taylor expanded in x around inf 55.6%
mul-1-neg55.6%
log-rec55.6%
mul-1-neg55.6%
distribute-neg-frac55.6%
mul-1-neg55.6%
remove-double-neg55.6%
*-commutative55.6%
Simplified55.6%
expm1-log1p-u55.6%
expm1-udef19.7%
associate-/r*19.7%
div-inv19.7%
pow-to-exp19.7%
pow119.7%
pow-div19.7%
Applied egg-rr19.7%
expm1-def56.9%
expm1-log1p56.9%
sub-neg56.9%
metadata-eval56.9%
Simplified56.9%
pow-prod-up57.5%
inv-pow57.5%
Applied egg-rr57.5%
*-commutative57.5%
associate-*l/57.5%
*-lft-identity57.5%
Simplified57.5%
Final simplification77.5%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -2e-71)
(/ t_0 (* n x))
(if (<= (/ 1.0 n) 2e-16)
(/ (- (log1p x) (log x)) n)
(- (exp (/ x n)) t_0)))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-71) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 2e-16) {
tmp = (log1p(x) - log(x)) / n;
} else {
tmp = exp((x / n)) - t_0;
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-71) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 2e-16) {
tmp = (Math.log1p(x) - Math.log(x)) / n;
} else {
tmp = Math.exp((x / n)) - t_0;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -2e-71: tmp = t_0 / (n * x) elif (1.0 / n) <= 2e-16: tmp = (math.log1p(x) - math.log(x)) / n else: tmp = math.exp((x / n)) - t_0 return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-71) tmp = Float64(t_0 / Float64(n * x)); elseif (Float64(1.0 / n) <= 2e-16) tmp = Float64(Float64(log1p(x) - log(x)) / n); else tmp = Float64(exp(Float64(x / n)) - t_0); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-71], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-16], N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[Exp[N[(x / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-71}:\\
\;\;\;\;\frac{t_0}{n \cdot x}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-16}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(x\right) - \log x}{n}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{x}{n}} - t_0\\
\end{array}
\end{array}
if (/.f64 1 n) < -1.9999999999999998e-71Initial program 89.7%
Taylor expanded in n around 0 89.7%
log1p-def89.7%
Simplified89.7%
Taylor expanded in x around inf 95.0%
log-rec95.0%
mul-1-neg95.0%
associate-*r/95.0%
neg-mul-195.0%
mul-1-neg95.0%
remove-double-neg95.0%
*-rgt-identity95.0%
associate-*r/95.0%
exp-to-pow95.0%
*-commutative95.0%
Simplified95.0%
if -1.9999999999999998e-71 < (/.f64 1 n) < 2e-16Initial program 33.2%
Taylor expanded in n around inf 80.7%
log1p-def80.7%
Simplified80.7%
if 2e-16 < (/.f64 1 n) Initial program 46.0%
Taylor expanded in n around 0 46.0%
log1p-def94.7%
Simplified94.7%
Taylor expanded in x around 0 94.6%
Final simplification88.1%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))) (t_1 (- 1.0 t_0)) (t_2 (/ (- (log x)) n)))
(if (<= x 4.2e-305)
t_1
(if (<= x 2e-235)
t_2
(if (<= x 1.4e-172)
t_1
(if (<= x 2.4e-45)
t_2
(if (<= x 8.2e-24) t_1 (if (<= x 0.0106) t_2 (/ (/ t_0 x) n)))))))))
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) / n;
double tmp;
if (x <= 4.2e-305) {
tmp = t_1;
} else if (x <= 2e-235) {
tmp = t_2;
} else if (x <= 1.4e-172) {
tmp = t_1;
} else if (x <= 2.4e-45) {
tmp = t_2;
} else if (x <= 8.2e-24) {
tmp = t_1;
} else if (x <= 0.0106) {
tmp = t_2;
} else {
tmp = (t_0 / x) / n;
}
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) / n
if (x <= 4.2d-305) then
tmp = t_1
else if (x <= 2d-235) then
tmp = t_2
else if (x <= 1.4d-172) then
tmp = t_1
else if (x <= 2.4d-45) then
tmp = t_2
else if (x <= 8.2d-24) then
tmp = t_1
else if (x <= 0.0106d0) then
tmp = t_2
else
tmp = (t_0 / x) / n
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) / n;
double tmp;
if (x <= 4.2e-305) {
tmp = t_1;
} else if (x <= 2e-235) {
tmp = t_2;
} else if (x <= 1.4e-172) {
tmp = t_1;
} else if (x <= 2.4e-45) {
tmp = t_2;
} else if (x <= 8.2e-24) {
tmp = t_1;
} else if (x <= 0.0106) {
tmp = t_2;
} else {
tmp = (t_0 / x) / n;
}
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) / n tmp = 0 if x <= 4.2e-305: tmp = t_1 elif x <= 2e-235: tmp = t_2 elif x <= 1.4e-172: tmp = t_1 elif x <= 2.4e-45: tmp = t_2 elif x <= 8.2e-24: tmp = t_1 elif x <= 0.0106: tmp = t_2 else: tmp = (t_0 / x) / n return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) t_1 = Float64(1.0 - t_0) t_2 = Float64(Float64(-log(x)) / n) tmp = 0.0 if (x <= 4.2e-305) tmp = t_1; elseif (x <= 2e-235) tmp = t_2; elseif (x <= 1.4e-172) tmp = t_1; elseif (x <= 2.4e-45) tmp = t_2; elseif (x <= 8.2e-24) tmp = t_1; elseif (x <= 0.0106) tmp = t_2; else tmp = Float64(Float64(t_0 / x) / n); 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) / n; tmp = 0.0; if (x <= 4.2e-305) tmp = t_1; elseif (x <= 2e-235) tmp = t_2; elseif (x <= 1.4e-172) tmp = t_1; elseif (x <= 2.4e-45) tmp = t_2; elseif (x <= 8.2e-24) tmp = t_1; elseif (x <= 0.0106) tmp = t_2; else tmp = (t_0 / x) / n; 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[x], $MachinePrecision]) / n), $MachinePrecision]}, If[LessEqual[x, 4.2e-305], t$95$1, If[LessEqual[x, 2e-235], t$95$2, If[LessEqual[x, 1.4e-172], t$95$1, If[LessEqual[x, 2.4e-45], t$95$2, If[LessEqual[x, 8.2e-24], t$95$1, If[LessEqual[x, 0.0106], t$95$2, N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
t_1 := 1 - t_0\\
t_2 := \frac{-\log x}{n}\\
\mathbf{if}\;x \leq 4.2 \cdot 10^{-305}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-235}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-172}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-45}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 0.0106:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t_0}{x}}{n}\\
\end{array}
\end{array}
if x < 4.2e-305 or 1.9999999999999999e-235 < x < 1.40000000000000006e-172 or 2.3999999999999999e-45 < x < 8.20000000000000029e-24Initial program 70.1%
Taylor expanded in x around 0 70.1%
if 4.2e-305 < x < 1.9999999999999999e-235 or 1.40000000000000006e-172 < x < 2.3999999999999999e-45 or 8.20000000000000029e-24 < x < 0.0106Initial program 33.7%
Taylor expanded in x around 0 32.8%
Taylor expanded in n around inf 57.4%
associate-*r/57.4%
mul-1-neg57.4%
Simplified57.4%
if 0.0106 < x Initial program 70.0%
Taylor expanded in x around inf 96.8%
mul-1-neg96.8%
log-rec96.8%
mul-1-neg96.8%
distribute-neg-frac96.8%
mul-1-neg96.8%
remove-double-neg96.8%
*-commutative96.8%
Simplified96.8%
expm1-log1p-u96.8%
expm1-udef70.0%
associate-/r*70.0%
div-inv70.0%
pow-to-exp70.0%
pow170.0%
pow-div70.0%
Applied egg-rr70.0%
expm1-def98.2%
expm1-log1p98.2%
sub-neg98.2%
metadata-eval98.2%
Simplified98.2%
pow-prod-up98.5%
inv-pow98.5%
Applied egg-rr98.5%
*-commutative98.5%
associate-*l/98.4%
*-lft-identity98.4%
Simplified98.4%
Final simplification77.3%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n)))
(t_1 (- (+ 1.0 (/ x n)) t_0))
(t_2 (/ (- (log x)) n)))
(if (<= x 4.1e-305)
(- 1.0 t_0)
(if (<= x 6.8e-236)
t_2
(if (<= x 3.1e-173)
t_1
(if (<= x 1.95e-45)
t_2
(if (<= x 1.6e-24) t_1 (if (<= x 0.0112) t_2 (/ (/ t_0 x) n)))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double t_1 = (1.0 + (x / n)) - t_0;
double t_2 = -log(x) / n;
double tmp;
if (x <= 4.1e-305) {
tmp = 1.0 - t_0;
} else if (x <= 6.8e-236) {
tmp = t_2;
} else if (x <= 3.1e-173) {
tmp = t_1;
} else if (x <= 1.95e-45) {
tmp = t_2;
} else if (x <= 1.6e-24) {
tmp = t_1;
} else if (x <= 0.0112) {
tmp = t_2;
} else {
tmp = (t_0 / x) / n;
}
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 + (x / n)) - t_0
t_2 = -log(x) / n
if (x <= 4.1d-305) then
tmp = 1.0d0 - t_0
else if (x <= 6.8d-236) then
tmp = t_2
else if (x <= 3.1d-173) then
tmp = t_1
else if (x <= 1.95d-45) then
tmp = t_2
else if (x <= 1.6d-24) then
tmp = t_1
else if (x <= 0.0112d0) then
tmp = t_2
else
tmp = (t_0 / x) / n
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 + (x / n)) - t_0;
double t_2 = -Math.log(x) / n;
double tmp;
if (x <= 4.1e-305) {
tmp = 1.0 - t_0;
} else if (x <= 6.8e-236) {
tmp = t_2;
} else if (x <= 3.1e-173) {
tmp = t_1;
} else if (x <= 1.95e-45) {
tmp = t_2;
} else if (x <= 1.6e-24) {
tmp = t_1;
} else if (x <= 0.0112) {
tmp = t_2;
} else {
tmp = (t_0 / x) / n;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) t_1 = (1.0 + (x / n)) - t_0 t_2 = -math.log(x) / n tmp = 0 if x <= 4.1e-305: tmp = 1.0 - t_0 elif x <= 6.8e-236: tmp = t_2 elif x <= 3.1e-173: tmp = t_1 elif x <= 1.95e-45: tmp = t_2 elif x <= 1.6e-24: tmp = t_1 elif x <= 0.0112: tmp = t_2 else: tmp = (t_0 / x) / n return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) t_1 = Float64(Float64(1.0 + Float64(x / n)) - t_0) t_2 = Float64(Float64(-log(x)) / n) tmp = 0.0 if (x <= 4.1e-305) tmp = Float64(1.0 - t_0); elseif (x <= 6.8e-236) tmp = t_2; elseif (x <= 3.1e-173) tmp = t_1; elseif (x <= 1.95e-45) tmp = t_2; elseif (x <= 1.6e-24) tmp = t_1; elseif (x <= 0.0112) tmp = t_2; else tmp = Float64(Float64(t_0 / x) / n); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); t_1 = (1.0 + (x / n)) - t_0; t_2 = -log(x) / n; tmp = 0.0; if (x <= 4.1e-305) tmp = 1.0 - t_0; elseif (x <= 6.8e-236) tmp = t_2; elseif (x <= 3.1e-173) tmp = t_1; elseif (x <= 1.95e-45) tmp = t_2; elseif (x <= 1.6e-24) tmp = t_1; elseif (x <= 0.0112) tmp = t_2; else tmp = (t_0 / x) / n; 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[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision]}, If[LessEqual[x, 4.1e-305], N[(1.0 - t$95$0), $MachinePrecision], If[LessEqual[x, 6.8e-236], t$95$2, If[LessEqual[x, 3.1e-173], t$95$1, If[LessEqual[x, 1.95e-45], t$95$2, If[LessEqual[x, 1.6e-24], t$95$1, If[LessEqual[x, 0.0112], t$95$2, N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \left(1 + \frac{x}{n}\right) - t_0\\
t_2 := \frac{-\log x}{n}\\
\mathbf{if}\;x \leq 4.1 \cdot 10^{-305}:\\
\;\;\;\;1 - t_0\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-236}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-173}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{-45}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 0.0112:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t_0}{x}}{n}\\
\end{array}
\end{array}
if x < 4.1000000000000002e-305Initial program 100.0%
Taylor expanded in x around 0 100.0%
if 4.1000000000000002e-305 < x < 6.79999999999999961e-236 or 3.10000000000000005e-173 < x < 1.95e-45 or 1.60000000000000006e-24 < x < 0.0111999999999999999Initial program 33.7%
Taylor expanded in x around 0 32.8%
Taylor expanded in n around inf 57.4%
associate-*r/57.4%
mul-1-neg57.4%
Simplified57.4%
if 6.79999999999999961e-236 < x < 3.10000000000000005e-173 or 1.95e-45 < x < 1.60000000000000006e-24Initial program 66.6%
Taylor expanded in x around 0 66.7%
if 0.0111999999999999999 < x Initial program 70.0%
Taylor expanded in x around inf 96.8%
mul-1-neg96.8%
log-rec96.8%
mul-1-neg96.8%
distribute-neg-frac96.8%
mul-1-neg96.8%
remove-double-neg96.8%
*-commutative96.8%
Simplified96.8%
expm1-log1p-u96.8%
expm1-udef70.0%
associate-/r*70.0%
div-inv70.0%
pow-to-exp70.0%
pow170.0%
pow-div70.0%
Applied egg-rr70.0%
expm1-def98.2%
expm1-log1p98.2%
sub-neg98.2%
metadata-eval98.2%
Simplified98.2%
pow-prod-up98.5%
inv-pow98.5%
Applied egg-rr98.5%
*-commutative98.5%
associate-*l/98.4%
*-lft-identity98.4%
Simplified98.4%
Final simplification77.3%
(FPCore (x n)
:precision binary64
(let* ((t_0 (- 1.0 (pow x (/ 1.0 n)))) (t_1 (/ (- (log x)) n)))
(if (<= x 4.1e-305)
t_0
(if (<= x 6.5e-236)
t_1
(if (<= x 6.2e-173)
t_0
(if (<= x 2.4e-45)
t_1
(if (<= x 3e-24)
t_0
(if (<= x 0.55)
t_1
(if (<= x 3e+73)
(/ (/ 1.0 x) n)
(if (<= x 8e+137)
0.0
(if (<= x 5.2e+170) (/ (/ 1.0 n) x) 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.1e-305) {
tmp = t_0;
} else if (x <= 6.5e-236) {
tmp = t_1;
} else if (x <= 6.2e-173) {
tmp = t_0;
} else if (x <= 2.4e-45) {
tmp = t_1;
} else if (x <= 3e-24) {
tmp = t_0;
} else if (x <= 0.55) {
tmp = t_1;
} else if (x <= 3e+73) {
tmp = (1.0 / x) / n;
} else if (x <= 8e+137) {
tmp = 0.0;
} else if (x <= 5.2e+170) {
tmp = (1.0 / 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) :: 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.1d-305) then
tmp = t_0
else if (x <= 6.5d-236) then
tmp = t_1
else if (x <= 6.2d-173) then
tmp = t_0
else if (x <= 2.4d-45) then
tmp = t_1
else if (x <= 3d-24) then
tmp = t_0
else if (x <= 0.55d0) then
tmp = t_1
else if (x <= 3d+73) then
tmp = (1.0d0 / x) / n
else if (x <= 8d+137) then
tmp = 0.0d0
else if (x <= 5.2d+170) then
tmp = (1.0d0 / n) / x
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.1e-305) {
tmp = t_0;
} else if (x <= 6.5e-236) {
tmp = t_1;
} else if (x <= 6.2e-173) {
tmp = t_0;
} else if (x <= 2.4e-45) {
tmp = t_1;
} else if (x <= 3e-24) {
tmp = t_0;
} else if (x <= 0.55) {
tmp = t_1;
} else if (x <= 3e+73) {
tmp = (1.0 / x) / n;
} else if (x <= 8e+137) {
tmp = 0.0;
} else if (x <= 5.2e+170) {
tmp = (1.0 / n) / x;
} 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.1e-305: tmp = t_0 elif x <= 6.5e-236: tmp = t_1 elif x <= 6.2e-173: tmp = t_0 elif x <= 2.4e-45: tmp = t_1 elif x <= 3e-24: tmp = t_0 elif x <= 0.55: tmp = t_1 elif x <= 3e+73: tmp = (1.0 / x) / n elif x <= 8e+137: tmp = 0.0 elif x <= 5.2e+170: tmp = (1.0 / n) / x else: tmp = 0.0 return tmp
function code(x, n) t_0 = Float64(1.0 - (x ^ Float64(1.0 / n))) t_1 = Float64(Float64(-log(x)) / n) tmp = 0.0 if (x <= 4.1e-305) tmp = t_0; elseif (x <= 6.5e-236) tmp = t_1; elseif (x <= 6.2e-173) tmp = t_0; elseif (x <= 2.4e-45) tmp = t_1; elseif (x <= 3e-24) tmp = t_0; elseif (x <= 0.55) tmp = t_1; elseif (x <= 3e+73) tmp = Float64(Float64(1.0 / x) / n); elseif (x <= 8e+137) tmp = 0.0; elseif (x <= 5.2e+170) tmp = Float64(Float64(1.0 / n) / x); 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.1e-305) tmp = t_0; elseif (x <= 6.5e-236) tmp = t_1; elseif (x <= 6.2e-173) tmp = t_0; elseif (x <= 2.4e-45) tmp = t_1; elseif (x <= 3e-24) tmp = t_0; elseif (x <= 0.55) tmp = t_1; elseif (x <= 3e+73) tmp = (1.0 / x) / n; elseif (x <= 8e+137) tmp = 0.0; elseif (x <= 5.2e+170) tmp = (1.0 / n) / x; 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.1e-305], t$95$0, If[LessEqual[x, 6.5e-236], t$95$1, If[LessEqual[x, 6.2e-173], t$95$0, If[LessEqual[x, 2.4e-45], t$95$1, If[LessEqual[x, 3e-24], t$95$0, If[LessEqual[x, 0.55], t$95$1, If[LessEqual[x, 3e+73], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 8e+137], 0.0, If[LessEqual[x, 5.2e+170], N[(N[(1.0 / n), $MachinePrecision] / x), $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.1 \cdot 10^{-305}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-236}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-173}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-45}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-24}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 0.55:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+73}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+137}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+170}:\\
\;\;\;\;\frac{\frac{1}{n}}{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 4.1000000000000002e-305 or 6.5000000000000001e-236 < x < 6.20000000000000011e-173 or 2.3999999999999999e-45 < x < 2.99999999999999995e-24Initial program 70.1%
Taylor expanded in x around 0 70.1%
if 4.1000000000000002e-305 < x < 6.5000000000000001e-236 or 6.20000000000000011e-173 < x < 2.3999999999999999e-45 or 2.99999999999999995e-24 < x < 0.55000000000000004Initial program 33.7%
Taylor expanded in x around 0 32.8%
Taylor expanded in n around inf 57.4%
associate-*r/57.4%
mul-1-neg57.4%
Simplified57.4%
if 0.55000000000000004 < x < 3.00000000000000011e73Initial program 42.9%
Taylor expanded in x around inf 91.1%
mul-1-neg91.1%
log-rec91.1%
mul-1-neg91.1%
distribute-neg-frac91.1%
mul-1-neg91.1%
remove-double-neg91.1%
*-commutative91.1%
Simplified91.1%
expm1-log1p-u91.1%
expm1-udef42.9%
associate-/r*42.9%
div-inv42.9%
pow-to-exp42.9%
pow142.9%
pow-div42.9%
Applied egg-rr42.9%
expm1-def94.5%
expm1-log1p94.5%
sub-neg94.5%
metadata-eval94.5%
Simplified94.5%
Taylor expanded in n around inf 63.2%
if 3.00000000000000011e73 < x < 8.0000000000000003e137 or 5.1999999999999996e170 < x Initial program 88.3%
sub-neg88.3%
+-commutative88.3%
add-log-exp88.3%
add-log-exp88.3%
sum-log88.2%
add-exp-log88.2%
log-pow88.2%
+-commutative88.2%
log1p-udef88.2%
*-commutative88.2%
un-div-inv88.2%
Applied egg-rr88.2%
Taylor expanded in x around inf 88.2%
exp-neg88.3%
rgt-mult-inverse88.3%
metadata-eval88.3%
Simplified88.3%
if 8.0000000000000003e137 < x < 5.1999999999999996e170Initial program 39.7%
Taylor expanded in x around inf 97.4%
mul-1-neg97.4%
log-rec97.4%
mul-1-neg97.4%
distribute-neg-frac97.4%
mul-1-neg97.4%
remove-double-neg97.4%
*-commutative97.4%
Simplified97.4%
expm1-log1p-u97.4%
expm1-udef39.7%
associate-/r*39.7%
div-inv39.7%
pow-to-exp39.7%
pow139.7%
pow-div39.7%
Applied egg-rr39.7%
expm1-def99.6%
expm1-log1p99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in n around inf 90.0%
associate-/r*92.2%
Simplified92.2%
Final simplification70.2%
(FPCore (x n)
:precision binary64
(let* ((t_0 (/ (- (log x)) n)))
(if (<= x 6.2e-221)
t_0
(if (<= x 3.1e-173)
(/ 1.0 (* n x))
(if (<= x 0.55)
t_0
(if (<= x 2.3e+74)
(/ (/ 1.0 x) n)
(if (<= x 1.02e+138)
0.0
(if (<= x 1.05e+171) (/ (/ 1.0 n) x) 0.0))))))))
double code(double x, double n) {
double t_0 = -log(x) / n;
double tmp;
if (x <= 6.2e-221) {
tmp = t_0;
} else if (x <= 3.1e-173) {
tmp = 1.0 / (n * x);
} else if (x <= 0.55) {
tmp = t_0;
} else if (x <= 2.3e+74) {
tmp = (1.0 / x) / n;
} else if (x <= 1.02e+138) {
tmp = 0.0;
} else if (x <= 1.05e+171) {
tmp = (1.0 / 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) :: t_0
real(8) :: tmp
t_0 = -log(x) / n
if (x <= 6.2d-221) then
tmp = t_0
else if (x <= 3.1d-173) then
tmp = 1.0d0 / (n * x)
else if (x <= 0.55d0) then
tmp = t_0
else if (x <= 2.3d+74) then
tmp = (1.0d0 / x) / n
else if (x <= 1.02d+138) then
tmp = 0.0d0
else if (x <= 1.05d+171) then
tmp = (1.0d0 / n) / 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 <= 6.2e-221) {
tmp = t_0;
} else if (x <= 3.1e-173) {
tmp = 1.0 / (n * x);
} else if (x <= 0.55) {
tmp = t_0;
} else if (x <= 2.3e+74) {
tmp = (1.0 / x) / n;
} else if (x <= 1.02e+138) {
tmp = 0.0;
} else if (x <= 1.05e+171) {
tmp = (1.0 / n) / x;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): t_0 = -math.log(x) / n tmp = 0 if x <= 6.2e-221: tmp = t_0 elif x <= 3.1e-173: tmp = 1.0 / (n * x) elif x <= 0.55: tmp = t_0 elif x <= 2.3e+74: tmp = (1.0 / x) / n elif x <= 1.02e+138: tmp = 0.0 elif x <= 1.05e+171: tmp = (1.0 / n) / x else: tmp = 0.0 return tmp
function code(x, n) t_0 = Float64(Float64(-log(x)) / n) tmp = 0.0 if (x <= 6.2e-221) tmp = t_0; elseif (x <= 3.1e-173) tmp = Float64(1.0 / Float64(n * x)); elseif (x <= 0.55) tmp = t_0; elseif (x <= 2.3e+74) tmp = Float64(Float64(1.0 / x) / n); elseif (x <= 1.02e+138) tmp = 0.0; elseif (x <= 1.05e+171) tmp = Float64(Float64(1.0 / n) / 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 <= 6.2e-221) tmp = t_0; elseif (x <= 3.1e-173) tmp = 1.0 / (n * x); elseif (x <= 0.55) tmp = t_0; elseif (x <= 2.3e+74) tmp = (1.0 / x) / n; elseif (x <= 1.02e+138) tmp = 0.0; elseif (x <= 1.05e+171) tmp = (1.0 / n) / 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, 6.2e-221], t$95$0, If[LessEqual[x, 3.1e-173], N[(1.0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.55], t$95$0, If[LessEqual[x, 2.3e+74], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 1.02e+138], 0.0, If[LessEqual[x, 1.05e+171], N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision], 0.0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-\log x}{n}\\
\mathbf{if}\;x \leq 6.2 \cdot 10^{-221}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-173}:\\
\;\;\;\;\frac{1}{n \cdot x}\\
\mathbf{elif}\;x \leq 0.55:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+74}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\mathbf{elif}\;x \leq 1.02 \cdot 10^{+138}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+171}:\\
\;\;\;\;\frac{\frac{1}{n}}{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 6.1999999999999998e-221 or 3.10000000000000005e-173 < x < 0.55000000000000004Initial program 40.9%
Taylor expanded in x around 0 40.1%
Taylor expanded in n around inf 51.3%
associate-*r/51.3%
mul-1-neg51.3%
Simplified51.3%
if 6.1999999999999998e-221 < x < 3.10000000000000005e-173Initial program 67.6%
Taylor expanded in x around inf 43.7%
mul-1-neg43.7%
log-rec43.7%
mul-1-neg43.7%
distribute-neg-frac43.7%
mul-1-neg43.7%
remove-double-neg43.7%
*-commutative43.7%
Simplified43.7%
Taylor expanded in n around inf 55.8%
*-commutative55.8%
Simplified55.8%
if 0.55000000000000004 < x < 2.2999999999999999e74Initial program 42.9%
Taylor expanded in x around inf 91.1%
mul-1-neg91.1%
log-rec91.1%
mul-1-neg91.1%
distribute-neg-frac91.1%
mul-1-neg91.1%
remove-double-neg91.1%
*-commutative91.1%
Simplified91.1%
expm1-log1p-u91.1%
expm1-udef42.9%
associate-/r*42.9%
div-inv42.9%
pow-to-exp42.9%
pow142.9%
pow-div42.9%
Applied egg-rr42.9%
expm1-def94.5%
expm1-log1p94.5%
sub-neg94.5%
metadata-eval94.5%
Simplified94.5%
Taylor expanded in n around inf 63.2%
if 2.2999999999999999e74 < x < 1.02e138 or 1.0500000000000001e171 < x Initial program 88.3%
sub-neg88.3%
+-commutative88.3%
add-log-exp88.3%
add-log-exp88.3%
sum-log88.2%
add-exp-log88.2%
log-pow88.2%
+-commutative88.2%
log1p-udef88.2%
*-commutative88.2%
un-div-inv88.2%
Applied egg-rr88.2%
Taylor expanded in x around inf 88.2%
exp-neg88.3%
rgt-mult-inverse88.3%
metadata-eval88.3%
Simplified88.3%
if 1.02e138 < x < 1.0500000000000001e171Initial program 39.7%
Taylor expanded in x around inf 97.4%
mul-1-neg97.4%
log-rec97.4%
mul-1-neg97.4%
distribute-neg-frac97.4%
mul-1-neg97.4%
remove-double-neg97.4%
*-commutative97.4%
Simplified97.4%
expm1-log1p-u97.4%
expm1-udef39.7%
associate-/r*39.7%
div-inv39.7%
pow-to-exp39.7%
pow139.7%
pow-div39.7%
Applied egg-rr39.7%
expm1-def99.6%
expm1-log1p99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in n around inf 90.0%
associate-/r*92.2%
Simplified92.2%
Final simplification64.8%
(FPCore (x n) :precision binary64 (if (or (<= n -3.4) (not (<= n -2.4e-201))) (/ 1.0 (* n x)) 0.0))
double code(double x, double n) {
double tmp;
if ((n <= -3.4) || !(n <= -2.4e-201)) {
tmp = 1.0 / (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 ((n <= (-3.4d0)) .or. (.not. (n <= (-2.4d-201)))) then
tmp = 1.0d0 / (n * x)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((n <= -3.4) || !(n <= -2.4e-201)) {
tmp = 1.0 / (n * x);
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): tmp = 0 if (n <= -3.4) or not (n <= -2.4e-201): tmp = 1.0 / (n * x) else: tmp = 0.0 return tmp
function code(x, n) tmp = 0.0 if ((n <= -3.4) || !(n <= -2.4e-201)) tmp = Float64(1.0 / Float64(n * x)); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((n <= -3.4) || ~((n <= -2.4e-201))) tmp = 1.0 / (n * x); else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := If[Or[LessEqual[n, -3.4], N[Not[LessEqual[n, -2.4e-201]], $MachinePrecision]], N[(1.0 / N[(n * x), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -3.4 \lor \neg \left(n \leq -2.4 \cdot 10^{-201}\right):\\
\;\;\;\;\frac{1}{n \cdot x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if n < -3.39999999999999991 or -2.40000000000000009e-201 < n Initial program 44.2%
Taylor expanded in x around inf 49.3%
mul-1-neg49.3%
log-rec49.3%
mul-1-neg49.3%
distribute-neg-frac49.3%
mul-1-neg49.3%
remove-double-neg49.3%
*-commutative49.3%
Simplified49.3%
Taylor expanded in n around inf 49.7%
*-commutative49.7%
Simplified49.7%
if -3.39999999999999991 < n < -2.40000000000000009e-201Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
add-log-exp100.0%
add-log-exp100.0%
sum-log100.0%
add-exp-log100.0%
log-pow100.0%
+-commutative100.0%
log1p-udef100.0%
*-commutative100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 55.6%
exp-neg55.6%
rgt-mult-inverse56.3%
metadata-eval56.3%
Simplified56.3%
Final simplification51.1%
(FPCore (x n) :precision binary64 (if (or (<= n -13.0) (not (<= n -1.05e-201))) (/ (/ 1.0 n) x) 0.0))
double code(double x, double n) {
double tmp;
if ((n <= -13.0) || !(n <= -1.05e-201)) {
tmp = (1.0 / 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 ((n <= (-13.0d0)) .or. (.not. (n <= (-1.05d-201)))) then
tmp = (1.0d0 / n) / x
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((n <= -13.0) || !(n <= -1.05e-201)) {
tmp = (1.0 / n) / x;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): tmp = 0 if (n <= -13.0) or not (n <= -1.05e-201): tmp = (1.0 / n) / x else: tmp = 0.0 return tmp
function code(x, n) tmp = 0.0 if ((n <= -13.0) || !(n <= -1.05e-201)) tmp = Float64(Float64(1.0 / n) / x); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((n <= -13.0) || ~((n <= -1.05e-201))) tmp = (1.0 / n) / x; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := If[Or[LessEqual[n, -13.0], N[Not[LessEqual[n, -1.05e-201]], $MachinePrecision]], N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -13 \lor \neg \left(n \leq -1.05 \cdot 10^{-201}\right):\\
\;\;\;\;\frac{\frac{1}{n}}{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if n < -13 or -1.05000000000000006e-201 < n Initial program 44.2%
Taylor expanded in x around inf 49.3%
mul-1-neg49.3%
log-rec49.3%
mul-1-neg49.3%
distribute-neg-frac49.3%
mul-1-neg49.3%
remove-double-neg49.3%
*-commutative49.3%
Simplified49.3%
expm1-log1p-u39.1%
expm1-udef24.5%
associate-/r*24.7%
div-inv24.7%
pow-to-exp24.7%
pow124.7%
pow-div24.7%
Applied egg-rr24.7%
expm1-def40.1%
expm1-log1p50.3%
sub-neg50.3%
metadata-eval50.3%
Simplified50.3%
Taylor expanded in n around inf 49.7%
associate-/r*50.5%
Simplified50.5%
if -13 < n < -1.05000000000000006e-201Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
add-log-exp100.0%
add-log-exp100.0%
sum-log100.0%
add-exp-log100.0%
log-pow100.0%
+-commutative100.0%
log1p-udef100.0%
*-commutative100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 55.6%
exp-neg55.6%
rgt-mult-inverse56.3%
metadata-eval56.3%
Simplified56.3%
Final simplification51.7%
(FPCore (x n) :precision binary64 (if (<= n -11.0) (/ (/ 1.0 n) x) (if (<= n -7.8e-202) 0.0 (/ (/ 1.0 x) n))))
double code(double x, double n) {
double tmp;
if (n <= -11.0) {
tmp = (1.0 / n) / x;
} else if (n <= -7.8e-202) {
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 (n <= (-11.0d0)) then
tmp = (1.0d0 / n) / x
else if (n <= (-7.8d-202)) 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 (n <= -11.0) {
tmp = (1.0 / n) / x;
} else if (n <= -7.8e-202) {
tmp = 0.0;
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
def code(x, n): tmp = 0 if n <= -11.0: tmp = (1.0 / n) / x elif n <= -7.8e-202: tmp = 0.0 else: tmp = (1.0 / x) / n return tmp
function code(x, n) tmp = 0.0 if (n <= -11.0) tmp = Float64(Float64(1.0 / n) / x); elseif (n <= -7.8e-202) 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 (n <= -11.0) tmp = (1.0 / n) / x; elseif (n <= -7.8e-202) tmp = 0.0; else tmp = (1.0 / x) / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[n, -11.0], N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[n, -7.8e-202], 0.0, N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -11:\\
\;\;\;\;\frac{\frac{1}{n}}{x}\\
\mathbf{elif}\;n \leq -7.8 \cdot 10^{-202}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\end{array}
\end{array}
if n < -11Initial program 38.1%
Taylor expanded in x around inf 57.6%
mul-1-neg57.6%
log-rec57.6%
mul-1-neg57.6%
distribute-neg-frac57.6%
mul-1-neg57.6%
remove-double-neg57.6%
*-commutative57.6%
Simplified57.6%
expm1-log1p-u56.6%
expm1-udef36.0%
associate-/r*36.0%
div-inv36.0%
pow-to-exp36.0%
pow136.0%
pow-div36.0%
Applied egg-rr36.0%
expm1-def57.2%
expm1-log1p58.1%
sub-neg58.1%
metadata-eval58.1%
Simplified58.1%
Taylor expanded in n around inf 57.6%
associate-/r*58.2%
Simplified58.2%
if -11 < n < -7.7999999999999998e-202Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
add-log-exp100.0%
add-log-exp100.0%
sum-log100.0%
add-exp-log100.0%
log-pow100.0%
+-commutative100.0%
log1p-udef100.0%
*-commutative100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 55.6%
exp-neg55.6%
rgt-mult-inverse56.3%
metadata-eval56.3%
Simplified56.3%
if -7.7999999999999998e-202 < n Initial program 47.6%
Taylor expanded in x around inf 44.9%
mul-1-neg44.9%
log-rec44.9%
mul-1-neg44.9%
distribute-neg-frac44.9%
mul-1-neg44.9%
remove-double-neg44.9%
*-commutative44.9%
Simplified44.9%
expm1-log1p-u29.6%
expm1-udef18.3%
associate-/r*18.6%
div-inv18.6%
pow-to-exp18.6%
pow118.6%
pow-div18.6%
Applied egg-rr18.6%
expm1-def30.8%
expm1-log1p46.1%
sub-neg46.1%
metadata-eval46.1%
Simplified46.1%
Taylor expanded in n around inf 46.4%
Final simplification51.8%
(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 56.0%
sub-neg56.0%
+-commutative56.0%
add-log-exp55.9%
add-log-exp55.9%
sum-log55.9%
add-exp-log55.9%
log-pow55.9%
+-commutative55.9%
log1p-udef63.2%
*-commutative63.2%
un-div-inv63.2%
Applied egg-rr63.2%
Taylor expanded in x around inf 31.6%
exp-neg31.6%
rgt-mult-inverse31.9%
metadata-eval31.9%
Simplified31.9%
Final simplification31.9%
herbie shell --seed 2024019
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))