
(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 15 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 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -4e-48)
(/ (exp (/ (log x) n)) (* n x))
(if (<= (/ 1.0 n) 1e-10)
(/
(+
(log1p x)
(- (* 0.5 (/ (- (pow (log1p x) 2.0) (pow (log x) 2.0)) n)) (log x)))
n)
(if (<= (/ 1.0 n) 5000.0) (/ (/ t_0 n) x) (- (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) <= -4e-48) {
tmp = exp((log(x) / n)) / (n * x);
} else if ((1.0 / n) <= 1e-10) {
tmp = (log1p(x) + ((0.5 * ((pow(log1p(x), 2.0) - pow(log(x), 2.0)) / n)) - log(x))) / n;
} else if ((1.0 / n) <= 5000.0) {
tmp = (t_0 / n) / x;
} 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) <= -4e-48) {
tmp = Math.exp((Math.log(x) / n)) / (n * x);
} else if ((1.0 / n) <= 1e-10) {
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 if ((1.0 / n) <= 5000.0) {
tmp = (t_0 / n) / x;
} 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) <= -4e-48: tmp = math.exp((math.log(x) / n)) / (n * x) elif (1.0 / n) <= 1e-10: 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 elif (1.0 / n) <= 5000.0: tmp = (t_0 / n) / x 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) <= -4e-48) tmp = Float64(exp(Float64(log(x) / n)) / Float64(n * x)); elseif (Float64(1.0 / n) <= 1e-10) tmp = Float64(Float64(log1p(x) + Float64(Float64(0.5 * Float64(Float64((log1p(x) ^ 2.0) - (log(x) ^ 2.0)) / n)) - log(x))) / n); elseif (Float64(1.0 / n) <= 5000.0) tmp = Float64(Float64(t_0 / n) / x); 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], -4e-48], N[(N[Exp[N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-10], 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], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5000.0], N[(N[(t$95$0 / n), $MachinePrecision] / x), $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 -4 \cdot 10^{-48}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{n \cdot x}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{-10}:\\
\;\;\;\;\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{elif}\;\frac{1}{n} \leq 5000:\\
\;\;\;\;\frac{\frac{t\_0}{n}}{x}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{x}{n}} - t\_0\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -3.9999999999999999e-48Initial program 86.8%
Taylor expanded in x around inf 93.7%
mul-1-neg93.7%
log-rec93.7%
mul-1-neg93.7%
distribute-neg-frac93.7%
mul-1-neg93.7%
remove-double-neg93.7%
*-commutative93.7%
Simplified93.7%
if -3.9999999999999999e-48 < (/.f64 #s(literal 1 binary64) n) < 1.00000000000000004e-10Initial program 35.6%
Taylor expanded in n around inf 80.5%
associate--l+80.5%
log1p-define80.5%
+-commutative80.5%
associate--r+80.5%
distribute-lft-out--80.5%
div-sub80.5%
log1p-define80.5%
Simplified80.5%
if 1.00000000000000004e-10 < (/.f64 #s(literal 1 binary64) n) < 5e3Initial program 6.0%
Taylor expanded in x around inf 99.4%
associate-/r*99.4%
mul-1-neg99.4%
log-rec99.4%
mul-1-neg99.4%
distribute-neg-frac99.4%
mul-1-neg99.4%
remove-double-neg99.4%
*-rgt-identity99.4%
associate-/l*99.4%
exp-to-pow99.4%
Simplified99.4%
if 5e3 < (/.f64 #s(literal 1 binary64) n) Initial program 43.5%
Taylor expanded in n around 0 43.5%
log1p-define100.0%
*-rgt-identity100.0%
associate-*l/100.0%
associate-/l*100.0%
exp-to-pow100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification87.9%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -4e-48)
(/ (exp (/ (log x) n)) (* n x))
(if (<= (/ 1.0 n) 2e-57)
(/ (log (/ (+ x 1.0) x)) n)
(if (<= (/ 1.0 n) 5000.0) (/ (/ t_0 n) x) (- (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) <= -4e-48) {
tmp = exp((log(x) / n)) / (n * x);
} else if ((1.0 / n) <= 2e-57) {
tmp = log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5000.0) {
tmp = (t_0 / n) / x;
} else {
tmp = exp((x / n)) - t_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 = x ** (1.0d0 / n)
if ((1.0d0 / n) <= (-4d-48)) then
tmp = exp((log(x) / n)) / (n * x)
else if ((1.0d0 / n) <= 2d-57) then
tmp = log(((x + 1.0d0) / x)) / n
else if ((1.0d0 / n) <= 5000.0d0) then
tmp = (t_0 / n) / x
else
tmp = exp((x / n)) - t_0
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -4e-48) {
tmp = Math.exp((Math.log(x) / n)) / (n * x);
} else if ((1.0 / n) <= 2e-57) {
tmp = Math.log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5000.0) {
tmp = (t_0 / n) / x;
} 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) <= -4e-48: tmp = math.exp((math.log(x) / n)) / (n * x) elif (1.0 / n) <= 2e-57: tmp = math.log(((x + 1.0) / x)) / n elif (1.0 / n) <= 5000.0: tmp = (t_0 / n) / x 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) <= -4e-48) tmp = Float64(exp(Float64(log(x) / n)) / Float64(n * x)); elseif (Float64(1.0 / n) <= 2e-57) tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n); elseif (Float64(1.0 / n) <= 5000.0) tmp = Float64(Float64(t_0 / n) / x); else tmp = Float64(exp(Float64(x / n)) - t_0); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if ((1.0 / n) <= -4e-48) tmp = exp((log(x) / n)) / (n * x); elseif ((1.0 / n) <= 2e-57) tmp = log(((x + 1.0) / x)) / n; elseif ((1.0 / n) <= 5000.0) tmp = (t_0 / n) / x; else tmp = exp((x / n)) - t_0; end tmp_2 = 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], -4e-48], N[(N[Exp[N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-57], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5000.0], N[(N[(t$95$0 / n), $MachinePrecision] / x), $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 -4 \cdot 10^{-48}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{n \cdot x}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-57}:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5000:\\
\;\;\;\;\frac{\frac{t\_0}{n}}{x}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{x}{n}} - t\_0\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -3.9999999999999999e-48Initial program 86.8%
Taylor expanded in x around inf 93.7%
mul-1-neg93.7%
log-rec93.7%
mul-1-neg93.7%
distribute-neg-frac93.7%
mul-1-neg93.7%
remove-double-neg93.7%
*-commutative93.7%
Simplified93.7%
if -3.9999999999999999e-48 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999991e-57Initial program 37.8%
Taylor expanded in n around inf 83.7%
log1p-define83.7%
Simplified83.7%
log1p-undefine83.7%
diff-log83.8%
+-commutative83.8%
Applied egg-rr83.8%
if 1.99999999999999991e-57 < (/.f64 #s(literal 1 binary64) n) < 5e3Initial program 14.1%
Taylor expanded in x around inf 64.4%
associate-/r*64.5%
mul-1-neg64.5%
log-rec64.5%
mul-1-neg64.5%
distribute-neg-frac64.5%
mul-1-neg64.5%
remove-double-neg64.5%
*-rgt-identity64.5%
associate-/l*64.5%
exp-to-pow64.5%
Simplified64.5%
if 5e3 < (/.f64 #s(literal 1 binary64) n) Initial program 43.5%
Taylor expanded in n around 0 43.5%
log1p-define100.0%
*-rgt-identity100.0%
associate-*l/100.0%
associate-/l*100.0%
exp-to-pow100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification87.8%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -4e-48)
(/ (exp (/ (log x) n)) (* n x))
(if (<= (/ 1.0 n) 2e-57)
(/ (log (/ (+ x 1.0) x)) n)
(if (<= (/ 1.0 n) 5000.0)
(/ (/ t_0 n) x)
(if (<= (/ 1.0 n) 1e+141)
(- (+ (/ x n) 1.0) t_0)
(/
(+
(/ 1.0 n)
(/ (/ (+ (* n -0.5) (* n (/ 0.3333333333333333 x))) (* n n)) x))
x)))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -4e-48) {
tmp = exp((log(x) / n)) / (n * x);
} else if ((1.0 / n) <= 2e-57) {
tmp = log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5000.0) {
tmp = (t_0 / n) / x;
} else if ((1.0 / n) <= 1e+141) {
tmp = ((x / n) + 1.0) - t_0;
} else {
tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * 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) :: tmp
t_0 = x ** (1.0d0 / n)
if ((1.0d0 / n) <= (-4d-48)) then
tmp = exp((log(x) / n)) / (n * x)
else if ((1.0d0 / n) <= 2d-57) then
tmp = log(((x + 1.0d0) / x)) / n
else if ((1.0d0 / n) <= 5000.0d0) then
tmp = (t_0 / n) / x
else if ((1.0d0 / n) <= 1d+141) then
tmp = ((x / n) + 1.0d0) - t_0
else
tmp = ((1.0d0 / n) + ((((n * (-0.5d0)) + (n * (0.3333333333333333d0 / x))) / (n * 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 tmp;
if ((1.0 / n) <= -4e-48) {
tmp = Math.exp((Math.log(x) / n)) / (n * x);
} else if ((1.0 / n) <= 2e-57) {
tmp = Math.log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5000.0) {
tmp = (t_0 / n) / x;
} else if ((1.0 / n) <= 1e+141) {
tmp = ((x / n) + 1.0) - t_0;
} else {
tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -4e-48: tmp = math.exp((math.log(x) / n)) / (n * x) elif (1.0 / n) <= 2e-57: tmp = math.log(((x + 1.0) / x)) / n elif (1.0 / n) <= 5000.0: tmp = (t_0 / n) / x elif (1.0 / n) <= 1e+141: tmp = ((x / n) + 1.0) - t_0 else: tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -4e-48) tmp = Float64(exp(Float64(log(x) / n)) / Float64(n * x)); elseif (Float64(1.0 / n) <= 2e-57) tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n); elseif (Float64(1.0 / n) <= 5000.0) tmp = Float64(Float64(t_0 / n) / x); elseif (Float64(1.0 / n) <= 1e+141) tmp = Float64(Float64(Float64(x / n) + 1.0) - t_0); else tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(n * -0.5) + Float64(n * Float64(0.3333333333333333 / x))) / Float64(n * n)) / x)) / x); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if ((1.0 / n) <= -4e-48) tmp = exp((log(x) / n)) / (n * x); elseif ((1.0 / n) <= 2e-57) tmp = log(((x + 1.0) / x)) / n; elseif ((1.0 / n) <= 5000.0) tmp = (t_0 / n) / x; elseif ((1.0 / n) <= 1e+141) tmp = ((x / n) + 1.0) - t_0; else tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x; end tmp_2 = 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], -4e-48], N[(N[Exp[N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-57], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5000.0], N[(N[(t$95$0 / n), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+141], N[(N[(N[(x / n), $MachinePrecision] + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(n * -0.5), $MachinePrecision] + N[(n * N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-48}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{n \cdot x}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-57}:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5000:\\
\;\;\;\;\frac{\frac{t\_0}{n}}{x}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+141}:\\
\;\;\;\;\left(\frac{x}{n} + 1\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{n} + \frac{\frac{n \cdot -0.5 + n \cdot \frac{0.3333333333333333}{x}}{n \cdot n}}{x}}{x}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -3.9999999999999999e-48Initial program 86.8%
Taylor expanded in x around inf 93.7%
mul-1-neg93.7%
log-rec93.7%
mul-1-neg93.7%
distribute-neg-frac93.7%
mul-1-neg93.7%
remove-double-neg93.7%
*-commutative93.7%
Simplified93.7%
if -3.9999999999999999e-48 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999991e-57Initial program 37.8%
Taylor expanded in n around inf 83.7%
log1p-define83.7%
Simplified83.7%
log1p-undefine83.7%
diff-log83.8%
+-commutative83.8%
Applied egg-rr83.8%
if 1.99999999999999991e-57 < (/.f64 #s(literal 1 binary64) n) < 5e3Initial program 14.1%
Taylor expanded in x around inf 64.4%
associate-/r*64.5%
mul-1-neg64.5%
log-rec64.5%
mul-1-neg64.5%
distribute-neg-frac64.5%
mul-1-neg64.5%
remove-double-neg64.5%
*-rgt-identity64.5%
associate-/l*64.5%
exp-to-pow64.5%
Simplified64.5%
if 5e3 < (/.f64 #s(literal 1 binary64) n) < 1.00000000000000002e141Initial program 76.6%
Taylor expanded in x around 0 73.2%
if 1.00000000000000002e141 < (/.f64 #s(literal 1 binary64) n) Initial program 16.3%
Taylor expanded in n around inf 6.5%
log1p-define6.5%
Simplified6.5%
Taylor expanded in x around -inf 82.5%
mul-1-neg82.5%
mul-1-neg82.5%
associate-*r/82.5%
metadata-eval82.5%
*-commutative82.5%
associate-*r/82.5%
metadata-eval82.5%
Simplified82.5%
associate-/r*82.5%
frac-2neg82.5%
frac-sub86.8%
metadata-eval86.8%
Applied egg-rr86.8%
Final simplification84.8%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -1e+14)
(/ (- -0.3333333333333333) (* n (pow x 3.0)))
(if (<= (/ 1.0 n) 2e-237)
(/ (/ 1.0 n) x)
(if (<= (/ 1.0 n) 2e-76)
(/ (- x (log x)) n)
(if (<= (/ 1.0 n) 1e-18)
(/ (/ 1.0 x) n)
(if (<= (/ 1.0 n) 1e+141)
(- 1.0 (pow x (/ 1.0 n)))
(/
(+
(/ 1.0 n)
(/ (/ (+ (* n -0.5) (* n (/ 0.3333333333333333 x))) (* n n)) x))
x)))))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e+14) {
tmp = -(-0.3333333333333333) / (n * pow(x, 3.0));
} else if ((1.0 / n) <= 2e-237) {
tmp = (1.0 / n) / x;
} else if ((1.0 / n) <= 2e-76) {
tmp = (x - log(x)) / n;
} else if ((1.0 / n) <= 1e-18) {
tmp = (1.0 / x) / n;
} else if ((1.0 / n) <= 1e+141) {
tmp = 1.0 - pow(x, (1.0 / n));
} else {
tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * 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+14)) then
tmp = -(-0.3333333333333333d0) / (n * (x ** 3.0d0))
else if ((1.0d0 / n) <= 2d-237) then
tmp = (1.0d0 / n) / x
else if ((1.0d0 / n) <= 2d-76) then
tmp = (x - log(x)) / n
else if ((1.0d0 / n) <= 1d-18) then
tmp = (1.0d0 / x) / n
else if ((1.0d0 / n) <= 1d+141) then
tmp = 1.0d0 - (x ** (1.0d0 / n))
else
tmp = ((1.0d0 / n) + ((((n * (-0.5d0)) + (n * (0.3333333333333333d0 / x))) / (n * n)) / x)) / x
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e+14) {
tmp = -(-0.3333333333333333) / (n * Math.pow(x, 3.0));
} else if ((1.0 / n) <= 2e-237) {
tmp = (1.0 / n) / x;
} else if ((1.0 / n) <= 2e-76) {
tmp = (x - Math.log(x)) / n;
} else if ((1.0 / n) <= 1e-18) {
tmp = (1.0 / x) / n;
} else if ((1.0 / n) <= 1e+141) {
tmp = 1.0 - Math.pow(x, (1.0 / n));
} else {
tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x;
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -1e+14: tmp = -(-0.3333333333333333) / (n * math.pow(x, 3.0)) elif (1.0 / n) <= 2e-237: tmp = (1.0 / n) / x elif (1.0 / n) <= 2e-76: tmp = (x - math.log(x)) / n elif (1.0 / n) <= 1e-18: tmp = (1.0 / x) / n elif (1.0 / n) <= 1e+141: tmp = 1.0 - math.pow(x, (1.0 / n)) else: tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -1e+14) tmp = Float64(Float64(-(-0.3333333333333333)) / Float64(n * (x ^ 3.0))); elseif (Float64(1.0 / n) <= 2e-237) tmp = Float64(Float64(1.0 / n) / x); elseif (Float64(1.0 / n) <= 2e-76) tmp = Float64(Float64(x - log(x)) / n); elseif (Float64(1.0 / n) <= 1e-18) tmp = Float64(Float64(1.0 / x) / n); elseif (Float64(1.0 / n) <= 1e+141) tmp = Float64(1.0 - (x ^ Float64(1.0 / n))); else tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(n * -0.5) + Float64(n * Float64(0.3333333333333333 / x))) / Float64(n * n)) / x)) / x); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -1e+14) tmp = -(-0.3333333333333333) / (n * (x ^ 3.0)); elseif ((1.0 / n) <= 2e-237) tmp = (1.0 / n) / x; elseif ((1.0 / n) <= 2e-76) tmp = (x - log(x)) / n; elseif ((1.0 / n) <= 1e-18) tmp = (1.0 / x) / n; elseif ((1.0 / n) <= 1e+141) tmp = 1.0 - (x ^ (1.0 / n)); else tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+14], N[((--0.3333333333333333) / N[(n * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-237], N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-76], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-18], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+141], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(n * -0.5), $MachinePrecision] + N[(n * N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+14}:\\
\;\;\;\;\frac{--0.3333333333333333}{n \cdot {x}^{3}}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-237}:\\
\;\;\;\;\frac{\frac{1}{n}}{x}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-76}:\\
\;\;\;\;\frac{x - \log x}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{-18}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+141}:\\
\;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{n} + \frac{\frac{n \cdot -0.5 + n \cdot \frac{0.3333333333333333}{x}}{n \cdot n}}{x}}{x}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -1e14Initial program 100.0%
Taylor expanded in n around inf 48.6%
log1p-define48.6%
Simplified48.6%
Taylor expanded in x around -inf 51.2%
mul-1-neg51.2%
mul-1-neg51.2%
associate-*r/51.2%
metadata-eval51.2%
*-commutative51.2%
associate-*r/51.2%
metadata-eval51.2%
Simplified51.2%
Taylor expanded in x around 0 83.4%
if -1e14 < (/.f64 #s(literal 1 binary64) n) < 2e-237Initial program 39.9%
Taylor expanded in n around inf 77.7%
log1p-define77.7%
Simplified77.7%
Taylor expanded in x around inf 57.7%
*-commutative57.7%
Simplified57.7%
Taylor expanded in x around 0 57.7%
associate-/r*58.0%
Simplified58.0%
if 2e-237 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999985e-76Initial program 23.0%
Taylor expanded in n around inf 83.2%
log1p-define83.2%
Simplified83.2%
Taylor expanded in x around 0 64.0%
if 1.99999999999999985e-76 < (/.f64 #s(literal 1 binary64) n) < 1.0000000000000001e-18Initial program 22.3%
Taylor expanded in n around inf 53.2%
log1p-define53.2%
Simplified53.2%
Taylor expanded in x around inf 70.0%
if 1.0000000000000001e-18 < (/.f64 #s(literal 1 binary64) n) < 1.00000000000000002e141Initial program 59.4%
Taylor expanded in x around 0 55.0%
*-rgt-identity55.0%
associate-*l/55.0%
associate-/l*55.0%
exp-to-pow55.0%
Simplified55.0%
if 1.00000000000000002e141 < (/.f64 #s(literal 1 binary64) n) Initial program 16.3%
Taylor expanded in n around inf 6.5%
log1p-define6.5%
Simplified6.5%
Taylor expanded in x around -inf 82.5%
mul-1-neg82.5%
mul-1-neg82.5%
associate-*r/82.5%
metadata-eval82.5%
*-commutative82.5%
associate-*r/82.5%
metadata-eval82.5%
Simplified82.5%
associate-/r*82.5%
frac-2neg82.5%
frac-sub86.8%
metadata-eval86.8%
Applied egg-rr86.8%
Final simplification67.9%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))) (t_1 (/ (/ t_0 n) x)))
(if (<= (/ 1.0 n) -4e-48)
t_1
(if (<= (/ 1.0 n) 2e-57)
(/ (log (/ (+ x 1.0) x)) n)
(if (<= (/ 1.0 n) 5000.0)
t_1
(if (<= (/ 1.0 n) 1e+141)
(- (+ (/ x n) 1.0) t_0)
(/
(+
(/ 1.0 n)
(/ (/ (+ (* n -0.5) (* n (/ 0.3333333333333333 x))) (* n n)) x))
x)))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double t_1 = (t_0 / n) / x;
double tmp;
if ((1.0 / n) <= -4e-48) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-57) {
tmp = log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5000.0) {
tmp = t_1;
} else if ((1.0 / n) <= 1e+141) {
tmp = ((x / n) + 1.0) - t_0;
} else {
tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * 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 = x ** (1.0d0 / n)
t_1 = (t_0 / n) / x
if ((1.0d0 / n) <= (-4d-48)) then
tmp = t_1
else if ((1.0d0 / n) <= 2d-57) then
tmp = log(((x + 1.0d0) / x)) / n
else if ((1.0d0 / n) <= 5000.0d0) then
tmp = t_1
else if ((1.0d0 / n) <= 1d+141) then
tmp = ((x / n) + 1.0d0) - t_0
else
tmp = ((1.0d0 / n) + ((((n * (-0.5d0)) + (n * (0.3333333333333333d0 / x))) / (n * 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 = (t_0 / n) / x;
double tmp;
if ((1.0 / n) <= -4e-48) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-57) {
tmp = Math.log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5000.0) {
tmp = t_1;
} else if ((1.0 / n) <= 1e+141) {
tmp = ((x / n) + 1.0) - t_0;
} else {
tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) t_1 = (t_0 / n) / x tmp = 0 if (1.0 / n) <= -4e-48: tmp = t_1 elif (1.0 / n) <= 2e-57: tmp = math.log(((x + 1.0) / x)) / n elif (1.0 / n) <= 5000.0: tmp = t_1 elif (1.0 / n) <= 1e+141: tmp = ((x / n) + 1.0) - t_0 else: tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) t_1 = Float64(Float64(t_0 / n) / x) tmp = 0.0 if (Float64(1.0 / n) <= -4e-48) tmp = t_1; elseif (Float64(1.0 / n) <= 2e-57) tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n); elseif (Float64(1.0 / n) <= 5000.0) tmp = t_1; elseif (Float64(1.0 / n) <= 1e+141) tmp = Float64(Float64(Float64(x / n) + 1.0) - t_0); else tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(n * -0.5) + Float64(n * Float64(0.3333333333333333 / x))) / Float64(n * n)) / x)) / x); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); t_1 = (t_0 / n) / x; tmp = 0.0; if ((1.0 / n) <= -4e-48) tmp = t_1; elseif ((1.0 / n) <= 2e-57) tmp = log(((x + 1.0) / x)) / n; elseif ((1.0 / n) <= 5000.0) tmp = t_1; elseif ((1.0 / n) <= 1e+141) tmp = ((x / n) + 1.0) - t_0; else tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * 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[(N[(t$95$0 / n), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -4e-48], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-57], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5000.0], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+141], N[(N[(N[(x / n), $MachinePrecision] + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(n * -0.5), $MachinePrecision] + N[(n * N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{\frac{t\_0}{n}}{x}\\
\mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-57}:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+141}:\\
\;\;\;\;\left(\frac{x}{n} + 1\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{n} + \frac{\frac{n \cdot -0.5 + n \cdot \frac{0.3333333333333333}{x}}{n \cdot n}}{x}}{x}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -3.9999999999999999e-48 or 1.99999999999999991e-57 < (/.f64 #s(literal 1 binary64) n) < 5e3Initial program 72.2%
Taylor expanded in x around inf 87.8%
associate-/r*87.8%
mul-1-neg87.8%
log-rec87.8%
mul-1-neg87.8%
distribute-neg-frac87.8%
mul-1-neg87.8%
remove-double-neg87.8%
*-rgt-identity87.8%
associate-/l*87.8%
exp-to-pow87.8%
Simplified87.8%
if -3.9999999999999999e-48 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999991e-57Initial program 37.8%
Taylor expanded in n around inf 83.7%
log1p-define83.7%
Simplified83.7%
log1p-undefine83.7%
diff-log83.8%
+-commutative83.8%
Applied egg-rr83.8%
if 5e3 < (/.f64 #s(literal 1 binary64) n) < 1.00000000000000002e141Initial program 76.6%
Taylor expanded in x around 0 73.2%
if 1.00000000000000002e141 < (/.f64 #s(literal 1 binary64) n) Initial program 16.3%
Taylor expanded in n around inf 6.5%
log1p-define6.5%
Simplified6.5%
Taylor expanded in x around -inf 82.5%
mul-1-neg82.5%
mul-1-neg82.5%
associate-*r/82.5%
metadata-eval82.5%
*-commutative82.5%
associate-*r/82.5%
metadata-eval82.5%
Simplified82.5%
associate-/r*82.5%
frac-2neg82.5%
frac-sub86.8%
metadata-eval86.8%
Applied egg-rr86.8%
Final simplification84.8%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))) (t_1 (/ (/ t_0 n) x)))
(if (<= (/ 1.0 n) -4e-48)
t_1
(if (<= (/ 1.0 n) 2e-57)
(/ (log (/ (+ x 1.0) x)) n)
(if (<= (/ 1.0 n) 5000.0)
t_1
(if (<= (/ 1.0 n) 1e+141)
(- 1.0 t_0)
(/
(+
(/ 1.0 n)
(/ (/ (+ (* n -0.5) (* n (/ 0.3333333333333333 x))) (* n n)) x))
x)))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double t_1 = (t_0 / n) / x;
double tmp;
if ((1.0 / n) <= -4e-48) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-57) {
tmp = log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5000.0) {
tmp = t_1;
} else if ((1.0 / n) <= 1e+141) {
tmp = 1.0 - t_0;
} else {
tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * 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 = x ** (1.0d0 / n)
t_1 = (t_0 / n) / x
if ((1.0d0 / n) <= (-4d-48)) then
tmp = t_1
else if ((1.0d0 / n) <= 2d-57) then
tmp = log(((x + 1.0d0) / x)) / n
else if ((1.0d0 / n) <= 5000.0d0) then
tmp = t_1
else if ((1.0d0 / n) <= 1d+141) then
tmp = 1.0d0 - t_0
else
tmp = ((1.0d0 / n) + ((((n * (-0.5d0)) + (n * (0.3333333333333333d0 / x))) / (n * 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 = (t_0 / n) / x;
double tmp;
if ((1.0 / n) <= -4e-48) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-57) {
tmp = Math.log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5000.0) {
tmp = t_1;
} else if ((1.0 / n) <= 1e+141) {
tmp = 1.0 - t_0;
} else {
tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) t_1 = (t_0 / n) / x tmp = 0 if (1.0 / n) <= -4e-48: tmp = t_1 elif (1.0 / n) <= 2e-57: tmp = math.log(((x + 1.0) / x)) / n elif (1.0 / n) <= 5000.0: tmp = t_1 elif (1.0 / n) <= 1e+141: tmp = 1.0 - t_0 else: tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) t_1 = Float64(Float64(t_0 / n) / x) tmp = 0.0 if (Float64(1.0 / n) <= -4e-48) tmp = t_1; elseif (Float64(1.0 / n) <= 2e-57) tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n); elseif (Float64(1.0 / n) <= 5000.0) tmp = t_1; elseif (Float64(1.0 / n) <= 1e+141) tmp = Float64(1.0 - t_0); else tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(n * -0.5) + Float64(n * Float64(0.3333333333333333 / x))) / Float64(n * n)) / x)) / x); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); t_1 = (t_0 / n) / x; tmp = 0.0; if ((1.0 / n) <= -4e-48) tmp = t_1; elseif ((1.0 / n) <= 2e-57) tmp = log(((x + 1.0) / x)) / n; elseif ((1.0 / n) <= 5000.0) tmp = t_1; elseif ((1.0 / n) <= 1e+141) tmp = 1.0 - t_0; else tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * 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[(N[(t$95$0 / n), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -4e-48], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-57], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5000.0], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+141], N[(1.0 - t$95$0), $MachinePrecision], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(n * -0.5), $MachinePrecision] + N[(n * N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{\frac{t\_0}{n}}{x}\\
\mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-57}:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+141}:\\
\;\;\;\;1 - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{n} + \frac{\frac{n \cdot -0.5 + n \cdot \frac{0.3333333333333333}{x}}{n \cdot n}}{x}}{x}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -3.9999999999999999e-48 or 1.99999999999999991e-57 < (/.f64 #s(literal 1 binary64) n) < 5e3Initial program 72.2%
Taylor expanded in x around inf 87.8%
associate-/r*87.8%
mul-1-neg87.8%
log-rec87.8%
mul-1-neg87.8%
distribute-neg-frac87.8%
mul-1-neg87.8%
remove-double-neg87.8%
*-rgt-identity87.8%
associate-/l*87.8%
exp-to-pow87.8%
Simplified87.8%
if -3.9999999999999999e-48 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999991e-57Initial program 37.8%
Taylor expanded in n around inf 83.7%
log1p-define83.7%
Simplified83.7%
log1p-undefine83.7%
diff-log83.8%
+-commutative83.8%
Applied egg-rr83.8%
if 5e3 < (/.f64 #s(literal 1 binary64) n) < 1.00000000000000002e141Initial program 76.6%
Taylor expanded in x around 0 71.2%
*-rgt-identity71.2%
associate-*l/71.2%
associate-/l*71.2%
exp-to-pow71.2%
Simplified71.2%
if 1.00000000000000002e141 < (/.f64 #s(literal 1 binary64) n) Initial program 16.3%
Taylor expanded in n around inf 6.5%
log1p-define6.5%
Simplified6.5%
Taylor expanded in x around -inf 82.5%
mul-1-neg82.5%
mul-1-neg82.5%
associate-*r/82.5%
metadata-eval82.5%
*-commutative82.5%
associate-*r/82.5%
metadata-eval82.5%
Simplified82.5%
associate-/r*82.5%
frac-2neg82.5%
frac-sub86.8%
metadata-eval86.8%
Applied egg-rr86.8%
Final simplification84.7%
(FPCore (x n)
:precision binary64
(let* ((t_0 (/ (log x) (- n))) (t_1 (- 1.0 (pow x (/ 1.0 n)))))
(if (<= x 3.5e-273)
t_0
(if (<= x 2.8e-217)
t_1
(if (<= x 3.1e-189)
t_0
(if (<= x 2.5e-169)
t_1
(if (<= x 9.2e-32)
t_0
(if (<= x 1.02e+195)
(/
(+
(/ 1.0 n)
(/
(/ (+ (* n -0.5) (* n (/ 0.3333333333333333 x))) (* n n))
x))
x)
0.0))))))))
double code(double x, double n) {
double t_0 = log(x) / -n;
double t_1 = 1.0 - pow(x, (1.0 / n));
double tmp;
if (x <= 3.5e-273) {
tmp = t_0;
} else if (x <= 2.8e-217) {
tmp = t_1;
} else if (x <= 3.1e-189) {
tmp = t_0;
} else if (x <= 2.5e-169) {
tmp = t_1;
} else if (x <= 9.2e-32) {
tmp = t_0;
} else if (x <= 1.02e+195) {
tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * 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) :: t_1
real(8) :: tmp
t_0 = log(x) / -n
t_1 = 1.0d0 - (x ** (1.0d0 / n))
if (x <= 3.5d-273) then
tmp = t_0
else if (x <= 2.8d-217) then
tmp = t_1
else if (x <= 3.1d-189) then
tmp = t_0
else if (x <= 2.5d-169) then
tmp = t_1
else if (x <= 9.2d-32) then
tmp = t_0
else if (x <= 1.02d+195) then
tmp = ((1.0d0 / n) + ((((n * (-0.5d0)) + (n * (0.3333333333333333d0 / x))) / (n * 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 t_1 = 1.0 - Math.pow(x, (1.0 / n));
double tmp;
if (x <= 3.5e-273) {
tmp = t_0;
} else if (x <= 2.8e-217) {
tmp = t_1;
} else if (x <= 3.1e-189) {
tmp = t_0;
} else if (x <= 2.5e-169) {
tmp = t_1;
} else if (x <= 9.2e-32) {
tmp = t_0;
} else if (x <= 1.02e+195) {
tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): t_0 = math.log(x) / -n t_1 = 1.0 - math.pow(x, (1.0 / n)) tmp = 0 if x <= 3.5e-273: tmp = t_0 elif x <= 2.8e-217: tmp = t_1 elif x <= 3.1e-189: tmp = t_0 elif x <= 2.5e-169: tmp = t_1 elif x <= 9.2e-32: tmp = t_0 elif x <= 1.02e+195: tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x else: tmp = 0.0 return tmp
function code(x, n) t_0 = Float64(log(x) / Float64(-n)) t_1 = Float64(1.0 - (x ^ Float64(1.0 / n))) tmp = 0.0 if (x <= 3.5e-273) tmp = t_0; elseif (x <= 2.8e-217) tmp = t_1; elseif (x <= 3.1e-189) tmp = t_0; elseif (x <= 2.5e-169) tmp = t_1; elseif (x <= 9.2e-32) tmp = t_0; elseif (x <= 1.02e+195) tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(n * -0.5) + Float64(n * Float64(0.3333333333333333 / x))) / Float64(n * n)) / x)) / x); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) t_0 = log(x) / -n; t_1 = 1.0 - (x ^ (1.0 / n)); tmp = 0.0; if (x <= 3.5e-273) tmp = t_0; elseif (x <= 2.8e-217) tmp = t_1; elseif (x <= 3.1e-189) tmp = t_0; elseif (x <= 2.5e-169) tmp = t_1; elseif (x <= 9.2e-32) tmp = t_0; elseif (x <= 1.02e+195) tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * 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]}, Block[{t$95$1 = N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 3.5e-273], t$95$0, If[LessEqual[x, 2.8e-217], t$95$1, If[LessEqual[x, 3.1e-189], t$95$0, If[LessEqual[x, 2.5e-169], t$95$1, If[LessEqual[x, 9.2e-32], t$95$0, If[LessEqual[x, 1.02e+195], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(n * -0.5), $MachinePrecision] + N[(n * N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\log x}{-n}\\
t_1 := 1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;x \leq 3.5 \cdot 10^{-273}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-217}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-189}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{-32}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.02 \cdot 10^{+195}:\\
\;\;\;\;\frac{\frac{1}{n} + \frac{\frac{n \cdot -0.5 + n \cdot \frac{0.3333333333333333}{x}}{n \cdot n}}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 3.49999999999999992e-273 or 2.8e-217 < x < 3.1e-189 or 2.5000000000000001e-169 < x < 9.2000000000000002e-32Initial program 31.4%
Taylor expanded in n around inf 62.3%
log1p-define62.3%
Simplified62.3%
Taylor expanded in x around 0 62.3%
neg-mul-162.3%
Simplified62.3%
if 3.49999999999999992e-273 < x < 2.8e-217 or 3.1e-189 < x < 2.5000000000000001e-169Initial program 65.5%
Taylor expanded in x around 0 65.5%
*-rgt-identity65.5%
associate-*l/65.5%
associate-/l*65.5%
exp-to-pow65.5%
Simplified65.5%
if 9.2000000000000002e-32 < x < 1.02e195Initial program 50.5%
Taylor expanded in n around inf 50.7%
log1p-define50.7%
Simplified50.7%
Taylor expanded in x around -inf 68.2%
mul-1-neg68.2%
mul-1-neg68.2%
associate-*r/68.2%
metadata-eval68.2%
*-commutative68.2%
associate-*r/68.2%
metadata-eval68.2%
Simplified68.2%
associate-/r*68.2%
frac-2neg68.2%
frac-sub70.5%
metadata-eval70.5%
Applied egg-rr70.5%
if 1.02e195 < x Initial program 88.4%
Taylor expanded in x around 0 59.0%
*-rgt-identity59.0%
associate-*l/59.0%
associate-/l*59.0%
exp-to-pow59.0%
Simplified59.0%
add-sqr-sqrt59.0%
unpow-prod-down59.0%
Applied egg-rr59.0%
pow-sqr59.0%
associate-*r/59.0%
metadata-eval59.0%
Simplified59.0%
Taylor expanded in n around inf 88.5%
Final simplification69.4%
(FPCore (x n)
:precision binary64
(let* ((t_0 (/ (log x) (- n)))
(t_1 (/ (- 1.0 (/ (+ 0.5 (/ -0.3333333333333333 x)) x)) (* n x))))
(if (<= x 2.4e-228)
t_0
(if (<= x 2.8e-217)
t_1
(if (<= x 4.2e-189)
t_0
(if (<= x 1.3e-169)
t_1
(if (<= x 9.2e-32)
t_0
(if (<= x 1.5e+195)
(/
(+
(/ 1.0 n)
(/
(/ (+ (* n -0.5) (* n (/ 0.3333333333333333 x))) (* n n))
x))
x)
0.0))))))))
double code(double x, double n) {
double t_0 = log(x) / -n;
double t_1 = (1.0 - ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * x);
double tmp;
if (x <= 2.4e-228) {
tmp = t_0;
} else if (x <= 2.8e-217) {
tmp = t_1;
} else if (x <= 4.2e-189) {
tmp = t_0;
} else if (x <= 1.3e-169) {
tmp = t_1;
} else if (x <= 9.2e-32) {
tmp = t_0;
} else if (x <= 1.5e+195) {
tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * 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) :: t_1
real(8) :: tmp
t_0 = log(x) / -n
t_1 = (1.0d0 - ((0.5d0 + ((-0.3333333333333333d0) / x)) / x)) / (n * x)
if (x <= 2.4d-228) then
tmp = t_0
else if (x <= 2.8d-217) then
tmp = t_1
else if (x <= 4.2d-189) then
tmp = t_0
else if (x <= 1.3d-169) then
tmp = t_1
else if (x <= 9.2d-32) then
tmp = t_0
else if (x <= 1.5d+195) then
tmp = ((1.0d0 / n) + ((((n * (-0.5d0)) + (n * (0.3333333333333333d0 / x))) / (n * 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 t_1 = (1.0 - ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * x);
double tmp;
if (x <= 2.4e-228) {
tmp = t_0;
} else if (x <= 2.8e-217) {
tmp = t_1;
} else if (x <= 4.2e-189) {
tmp = t_0;
} else if (x <= 1.3e-169) {
tmp = t_1;
} else if (x <= 9.2e-32) {
tmp = t_0;
} else if (x <= 1.5e+195) {
tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): t_0 = math.log(x) / -n t_1 = (1.0 - ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * x) tmp = 0 if x <= 2.4e-228: tmp = t_0 elif x <= 2.8e-217: tmp = t_1 elif x <= 4.2e-189: tmp = t_0 elif x <= 1.3e-169: tmp = t_1 elif x <= 9.2e-32: tmp = t_0 elif x <= 1.5e+195: tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x else: tmp = 0.0 return tmp
function code(x, n) t_0 = Float64(log(x) / Float64(-n)) t_1 = Float64(Float64(1.0 - Float64(Float64(0.5 + Float64(-0.3333333333333333 / x)) / x)) / Float64(n * x)) tmp = 0.0 if (x <= 2.4e-228) tmp = t_0; elseif (x <= 2.8e-217) tmp = t_1; elseif (x <= 4.2e-189) tmp = t_0; elseif (x <= 1.3e-169) tmp = t_1; elseif (x <= 9.2e-32) tmp = t_0; elseif (x <= 1.5e+195) tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(n * -0.5) + Float64(n * Float64(0.3333333333333333 / x))) / Float64(n * n)) / x)) / x); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) t_0 = log(x) / -n; t_1 = (1.0 - ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * x); tmp = 0.0; if (x <= 2.4e-228) tmp = t_0; elseif (x <= 2.8e-217) tmp = t_1; elseif (x <= 4.2e-189) tmp = t_0; elseif (x <= 1.3e-169) tmp = t_1; elseif (x <= 9.2e-32) tmp = t_0; elseif (x <= 1.5e+195) tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * 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]}, Block[{t$95$1 = N[(N[(1.0 - N[(N[(0.5 + N[(-0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / N[(n * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 2.4e-228], t$95$0, If[LessEqual[x, 2.8e-217], t$95$1, If[LessEqual[x, 4.2e-189], t$95$0, If[LessEqual[x, 1.3e-169], t$95$1, If[LessEqual[x, 9.2e-32], t$95$0, If[LessEqual[x, 1.5e+195], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(n * -0.5), $MachinePrecision] + N[(n * N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\log x}{-n}\\
t_1 := \frac{1 - \frac{0.5 + \frac{-0.3333333333333333}{x}}{x}}{n \cdot x}\\
\mathbf{if}\;x \leq 2.4 \cdot 10^{-228}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-217}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-189}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{-32}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+195}:\\
\;\;\;\;\frac{\frac{1}{n} + \frac{\frac{n \cdot -0.5 + n \cdot \frac{0.3333333333333333}{x}}{n \cdot n}}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 2.40000000000000002e-228 or 2.8e-217 < x < 4.20000000000000033e-189 or 1.30000000000000007e-169 < x < 9.2000000000000002e-32Initial program 34.1%
Taylor expanded in n around inf 58.4%
log1p-define58.4%
Simplified58.4%
Taylor expanded in x around 0 58.4%
neg-mul-158.4%
Simplified58.4%
if 2.40000000000000002e-228 < x < 2.8e-217 or 4.20000000000000033e-189 < x < 1.30000000000000007e-169Initial program 84.7%
Taylor expanded in n around inf 10.3%
log1p-define10.3%
Simplified10.3%
Taylor expanded in x around -inf 74.5%
Taylor expanded in n around 0 74.5%
sub-neg74.5%
associate-*r/74.5%
sub-neg74.5%
metadata-eval74.5%
distribute-lft-in74.5%
neg-mul-174.5%
associate-*r/74.5%
metadata-eval74.5%
distribute-neg-frac74.5%
metadata-eval74.5%
metadata-eval74.5%
metadata-eval74.5%
*-commutative74.5%
Simplified74.5%
if 9.2000000000000002e-32 < x < 1.5e195Initial program 50.5%
Taylor expanded in n around inf 50.7%
log1p-define50.7%
Simplified50.7%
Taylor expanded in x around -inf 68.2%
mul-1-neg68.2%
mul-1-neg68.2%
associate-*r/68.2%
metadata-eval68.2%
*-commutative68.2%
associate-*r/68.2%
metadata-eval68.2%
Simplified68.2%
associate-/r*68.2%
frac-2neg68.2%
frac-sub70.5%
metadata-eval70.5%
Applied egg-rr70.5%
if 1.5e195 < x Initial program 88.4%
Taylor expanded in x around 0 59.0%
*-rgt-identity59.0%
associate-*l/59.0%
associate-/l*59.0%
exp-to-pow59.0%
Simplified59.0%
add-sqr-sqrt59.0%
unpow-prod-down59.0%
Applied egg-rr59.0%
pow-sqr59.0%
associate-*r/59.0%
metadata-eval59.0%
Simplified59.0%
Taylor expanded in n around inf 88.5%
Final simplification68.1%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -1.0)
(/ (- -0.3333333333333333) (* n (pow x 3.0)))
(if (<= (/ 1.0 n) 5000.0)
(/ (log (/ (+ x 1.0) x)) n)
(if (<= (/ 1.0 n) 1e+141)
(- 1.0 (pow x (/ 1.0 n)))
(/
(+
(/ 1.0 n)
(/ (/ (+ (* n -0.5) (* n (/ 0.3333333333333333 x))) (* n n)) x))
x)))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1.0) {
tmp = -(-0.3333333333333333) / (n * pow(x, 3.0));
} else if ((1.0 / n) <= 5000.0) {
tmp = log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 1e+141) {
tmp = 1.0 - pow(x, (1.0 / n));
} else {
tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * 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) <= (-1.0d0)) then
tmp = -(-0.3333333333333333d0) / (n * (x ** 3.0d0))
else if ((1.0d0 / n) <= 5000.0d0) then
tmp = log(((x + 1.0d0) / x)) / n
else if ((1.0d0 / n) <= 1d+141) then
tmp = 1.0d0 - (x ** (1.0d0 / n))
else
tmp = ((1.0d0 / n) + ((((n * (-0.5d0)) + (n * (0.3333333333333333d0 / x))) / (n * n)) / x)) / x
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1.0) {
tmp = -(-0.3333333333333333) / (n * Math.pow(x, 3.0));
} else if ((1.0 / n) <= 5000.0) {
tmp = Math.log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 1e+141) {
tmp = 1.0 - Math.pow(x, (1.0 / n));
} else {
tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x;
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -1.0: tmp = -(-0.3333333333333333) / (n * math.pow(x, 3.0)) elif (1.0 / n) <= 5000.0: tmp = math.log(((x + 1.0) / x)) / n elif (1.0 / n) <= 1e+141: tmp = 1.0 - math.pow(x, (1.0 / n)) else: tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -1.0) tmp = Float64(Float64(-(-0.3333333333333333)) / Float64(n * (x ^ 3.0))); elseif (Float64(1.0 / n) <= 5000.0) tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n); elseif (Float64(1.0 / n) <= 1e+141) tmp = Float64(1.0 - (x ^ Float64(1.0 / n))); else tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(n * -0.5) + Float64(n * Float64(0.3333333333333333 / x))) / Float64(n * n)) / x)) / x); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -1.0) tmp = -(-0.3333333333333333) / (n * (x ^ 3.0)); elseif ((1.0 / n) <= 5000.0) tmp = log(((x + 1.0) / x)) / n; elseif ((1.0 / n) <= 1e+141) tmp = 1.0 - (x ^ (1.0 / n)); else tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -1.0], N[((--0.3333333333333333) / N[(n * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5000.0], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+141], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(n * -0.5), $MachinePrecision] + N[(n * N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -1:\\
\;\;\;\;\frac{--0.3333333333333333}{n \cdot {x}^{3}}\\
\mathbf{elif}\;\frac{1}{n} \leq 5000:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+141}:\\
\;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{n} + \frac{\frac{n \cdot -0.5 + n \cdot \frac{0.3333333333333333}{x}}{n \cdot n}}{x}}{x}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -1Initial program 99.8%
Taylor expanded in n around inf 47.9%
log1p-define47.9%
Simplified47.9%
Taylor expanded in x around -inf 50.5%
mul-1-neg50.5%
mul-1-neg50.5%
associate-*r/50.5%
metadata-eval50.5%
*-commutative50.5%
associate-*r/50.5%
metadata-eval50.5%
Simplified50.5%
Taylor expanded in x around 0 82.2%
if -1 < (/.f64 #s(literal 1 binary64) n) < 5e3Initial program 33.2%
Taylor expanded in n around inf 74.4%
log1p-define74.4%
Simplified74.4%
log1p-undefine74.4%
diff-log74.5%
+-commutative74.5%
Applied egg-rr74.5%
if 5e3 < (/.f64 #s(literal 1 binary64) n) < 1.00000000000000002e141Initial program 76.6%
Taylor expanded in x around 0 71.2%
*-rgt-identity71.2%
associate-*l/71.2%
associate-/l*71.2%
exp-to-pow71.2%
Simplified71.2%
if 1.00000000000000002e141 < (/.f64 #s(literal 1 binary64) n) Initial program 16.3%
Taylor expanded in n around inf 6.5%
log1p-define6.5%
Simplified6.5%
Taylor expanded in x around -inf 82.5%
mul-1-neg82.5%
mul-1-neg82.5%
associate-*r/82.5%
metadata-eval82.5%
*-commutative82.5%
associate-*r/82.5%
metadata-eval82.5%
Simplified82.5%
associate-/r*82.5%
frac-2neg82.5%
frac-sub86.8%
metadata-eval86.8%
Applied egg-rr86.8%
Final simplification77.3%
(FPCore (x n)
:precision binary64
(if (<= x 5.5e+123)
(/ (- 1.0 (/ (+ 0.5 (/ -0.3333333333333333 x)) x)) (* n x))
(if (<= x 4.1e+150)
0.0
(if (<= x 5.6e+194) (/ (- (/ 1.0 n) (/ 0.5 (* n x))) x) 0.0))))
double code(double x, double n) {
double tmp;
if (x <= 5.5e+123) {
tmp = (1.0 - ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * x);
} else if (x <= 4.1e+150) {
tmp = 0.0;
} else if (x <= 5.6e+194) {
tmp = ((1.0 / n) - (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 <= 5.5d+123) then
tmp = (1.0d0 - ((0.5d0 + ((-0.3333333333333333d0) / x)) / x)) / (n * x)
else if (x <= 4.1d+150) then
tmp = 0.0d0
else if (x <= 5.6d+194) then
tmp = ((1.0d0 / n) - (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 <= 5.5e+123) {
tmp = (1.0 - ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * x);
} else if (x <= 4.1e+150) {
tmp = 0.0;
} else if (x <= 5.6e+194) {
tmp = ((1.0 / n) - (0.5 / (n * x))) / x;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 5.5e+123: tmp = (1.0 - ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * x) elif x <= 4.1e+150: tmp = 0.0 elif x <= 5.6e+194: tmp = ((1.0 / n) - (0.5 / (n * x))) / x else: tmp = 0.0 return tmp
function code(x, n) tmp = 0.0 if (x <= 5.5e+123) tmp = Float64(Float64(1.0 - Float64(Float64(0.5 + Float64(-0.3333333333333333 / x)) / x)) / Float64(n * x)); elseif (x <= 4.1e+150) tmp = 0.0; elseif (x <= 5.6e+194) tmp = Float64(Float64(Float64(1.0 / n) - Float64(0.5 / Float64(n * x))) / x); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 5.5e+123) tmp = (1.0 - ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * x); elseif (x <= 4.1e+150) tmp = 0.0; elseif (x <= 5.6e+194) tmp = ((1.0 / n) - (0.5 / (n * x))) / x; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 5.5e+123], N[(N[(1.0 - N[(N[(0.5 + N[(-0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.1e+150], 0.0, If[LessEqual[x, 5.6e+194], N[(N[(N[(1.0 / n), $MachinePrecision] - N[(0.5 / N[(n * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.5 \cdot 10^{+123}:\\
\;\;\;\;\frac{1 - \frac{0.5 + \frac{-0.3333333333333333}{x}}{x}}{n \cdot x}\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{+150}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{+194}:\\
\;\;\;\;\frac{\frac{1}{n} - \frac{0.5}{n \cdot x}}{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 5.5000000000000002e123Initial program 41.0%
Taylor expanded in n around inf 48.9%
log1p-define48.9%
Simplified48.9%
Taylor expanded in x around -inf 44.9%
Taylor expanded in n around 0 44.8%
sub-neg44.8%
associate-*r/44.8%
sub-neg44.8%
metadata-eval44.8%
distribute-lft-in44.8%
neg-mul-144.8%
associate-*r/44.8%
metadata-eval44.8%
distribute-neg-frac44.8%
metadata-eval44.8%
metadata-eval44.8%
metadata-eval44.8%
*-commutative44.8%
Simplified44.8%
if 5.5000000000000002e123 < x < 4.09999999999999994e150 or 5.60000000000000021e194 < x Initial program 83.9%
Taylor expanded in x around 0 49.4%
*-rgt-identity49.4%
associate-*l/49.4%
associate-/l*49.4%
exp-to-pow49.4%
Simplified49.4%
add-sqr-sqrt49.4%
unpow-prod-down49.4%
Applied egg-rr49.4%
pow-sqr49.4%
associate-*r/49.4%
metadata-eval49.4%
Simplified49.4%
Taylor expanded in n around inf 83.9%
if 4.09999999999999994e150 < x < 5.60000000000000021e194Initial program 59.4%
Taylor expanded in n around inf 59.4%
log1p-define59.4%
Simplified59.4%
Taylor expanded in x around inf 92.9%
associate-*r/92.9%
metadata-eval92.9%
*-commutative92.9%
Simplified92.9%
Final simplification56.8%
(FPCore (x n)
:precision binary64
(if (<= x 1.5e+195)
(/
(+
(/ 1.0 n)
(/ (/ (+ (* n -0.5) (* n (/ 0.3333333333333333 x))) (* n n)) x))
x)
0.0))
double code(double x, double n) {
double tmp;
if (x <= 1.5e+195) {
tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * 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 <= 1.5d+195) then
tmp = ((1.0d0 / n) + ((((n * (-0.5d0)) + (n * (0.3333333333333333d0 / x))) / (n * 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 <= 1.5e+195) {
tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 1.5e+195: tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x else: tmp = 0.0 return tmp
function code(x, n) tmp = 0.0 if (x <= 1.5e+195) tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(n * -0.5) + Float64(n * Float64(0.3333333333333333 / x))) / Float64(n * n)) / x)) / x); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 1.5e+195) tmp = ((1.0 / n) + ((((n * -0.5) + (n * (0.3333333333333333 / x))) / (n * n)) / x)) / x; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 1.5e+195], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(n * -0.5), $MachinePrecision] + N[(n * N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.5 \cdot 10^{+195}:\\
\;\;\;\;\frac{\frac{1}{n} + \frac{\frac{n \cdot -0.5 + n \cdot \frac{0.3333333333333333}{x}}{n \cdot n}}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 1.5e195Initial program 44.6%
Taylor expanded in n around inf 51.3%
log1p-define51.3%
Simplified51.3%
Taylor expanded in x around -inf 49.2%
mul-1-neg49.2%
mul-1-neg49.2%
associate-*r/49.2%
metadata-eval49.2%
*-commutative49.2%
associate-*r/49.2%
metadata-eval49.2%
Simplified49.2%
associate-/r*49.2%
frac-2neg49.2%
frac-sub49.8%
metadata-eval49.8%
Applied egg-rr49.8%
if 1.5e195 < x Initial program 88.4%
Taylor expanded in x around 0 59.0%
*-rgt-identity59.0%
associate-*l/59.0%
associate-/l*59.0%
exp-to-pow59.0%
Simplified59.0%
add-sqr-sqrt59.0%
unpow-prod-down59.0%
Applied egg-rr59.0%
pow-sqr59.0%
associate-*r/59.0%
metadata-eval59.0%
Simplified59.0%
Taylor expanded in n around inf 88.5%
Final simplification55.9%
(FPCore (x n)
:precision binary64
(if (or (<= n -1.06e-32)
(not
(or (<= n -2.2e-153)
(and (not (<= n -1.08e-219)) (<= n -1.1e-263)))))
(/ 1.0 (* n x))
0.0))
double code(double x, double n) {
double tmp;
if ((n <= -1.06e-32) || !((n <= -2.2e-153) || (!(n <= -1.08e-219) && (n <= -1.1e-263)))) {
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 <= (-1.06d-32)) .or. (.not. (n <= (-2.2d-153)) .or. (.not. (n <= (-1.08d-219))) .and. (n <= (-1.1d-263)))) 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 <= -1.06e-32) || !((n <= -2.2e-153) || (!(n <= -1.08e-219) && (n <= -1.1e-263)))) {
tmp = 1.0 / (n * x);
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): tmp = 0 if (n <= -1.06e-32) or not ((n <= -2.2e-153) or (not (n <= -1.08e-219) and (n <= -1.1e-263))): tmp = 1.0 / (n * x) else: tmp = 0.0 return tmp
function code(x, n) tmp = 0.0 if ((n <= -1.06e-32) || !((n <= -2.2e-153) || (!(n <= -1.08e-219) && (n <= -1.1e-263)))) 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 <= -1.06e-32) || ~(((n <= -2.2e-153) || (~((n <= -1.08e-219)) && (n <= -1.1e-263))))) tmp = 1.0 / (n * x); else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := If[Or[LessEqual[n, -1.06e-32], N[Not[Or[LessEqual[n, -2.2e-153], And[N[Not[LessEqual[n, -1.08e-219]], $MachinePrecision], LessEqual[n, -1.1e-263]]]], $MachinePrecision]], N[(1.0 / N[(n * x), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.06 \cdot 10^{-32} \lor \neg \left(n \leq -2.2 \cdot 10^{-153} \lor \neg \left(n \leq -1.08 \cdot 10^{-219}\right) \land n \leq -1.1 \cdot 10^{-263}\right):\\
\;\;\;\;\frac{1}{n \cdot x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if n < -1.05999999999999994e-32 or -2.20000000000000001e-153 < n < -1.08e-219 or -1.1e-263 < n Initial program 42.5%
Taylor expanded in n around inf 56.3%
log1p-define56.3%
Simplified56.3%
Taylor expanded in x around inf 48.5%
*-commutative48.5%
Simplified48.5%
if -1.05999999999999994e-32 < n < -2.20000000000000001e-153 or -1.08e-219 < n < -1.1e-263Initial program 100.0%
Taylor expanded in x around 0 39.5%
*-rgt-identity39.5%
associate-*l/39.5%
associate-/l*39.5%
exp-to-pow39.5%
Simplified39.5%
add-sqr-sqrt39.5%
unpow-prod-down39.5%
Applied egg-rr39.5%
pow-sqr39.5%
associate-*r/39.5%
metadata-eval39.5%
Simplified39.5%
Taylor expanded in n around inf 63.1%
Final simplification50.8%
(FPCore (x n) :precision binary64 (if (<= x 5.3e+194) (/ (- (/ 1.0 n) (/ (+ 0.5 (/ -0.3333333333333333 x)) (* n x))) x) 0.0))
double code(double x, double n) {
double tmp;
if (x <= 5.3e+194) {
tmp = ((1.0 / n) - ((0.5 + (-0.3333333333333333 / 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 <= 5.3d+194) then
tmp = ((1.0d0 / n) - ((0.5d0 + ((-0.3333333333333333d0) / 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 <= 5.3e+194) {
tmp = ((1.0 / n) - ((0.5 + (-0.3333333333333333 / x)) / (n * x))) / x;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 5.3e+194: tmp = ((1.0 / n) - ((0.5 + (-0.3333333333333333 / x)) / (n * x))) / x else: tmp = 0.0 return tmp
function code(x, n) tmp = 0.0 if (x <= 5.3e+194) tmp = Float64(Float64(Float64(1.0 / n) - Float64(Float64(0.5 + Float64(-0.3333333333333333 / x)) / Float64(n * x))) / x); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 5.3e+194) tmp = ((1.0 / n) - ((0.5 + (-0.3333333333333333 / x)) / (n * x))) / x; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 5.3e+194], N[(N[(N[(1.0 / n), $MachinePrecision] - N[(N[(0.5 + N[(-0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision] / N[(n * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.3 \cdot 10^{+194}:\\
\;\;\;\;\frac{\frac{1}{n} - \frac{0.5 + \frac{-0.3333333333333333}{x}}{n \cdot x}}{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 5.30000000000000005e194Initial program 44.6%
Taylor expanded in n around inf 51.3%
log1p-define51.3%
Simplified51.3%
Taylor expanded in x around -inf 49.2%
mul-1-neg49.2%
mul-1-neg49.2%
associate-*r/49.2%
metadata-eval49.2%
*-commutative49.2%
associate-*r/49.2%
metadata-eval49.2%
Simplified49.2%
Taylor expanded in x around inf 37.1%
Simplified49.2%
if 5.30000000000000005e194 < x Initial program 88.4%
Taylor expanded in x around 0 59.0%
*-rgt-identity59.0%
associate-*l/59.0%
associate-/l*59.0%
exp-to-pow59.0%
Simplified59.0%
add-sqr-sqrt59.0%
unpow-prod-down59.0%
Applied egg-rr59.0%
pow-sqr59.0%
associate-*r/59.0%
metadata-eval59.0%
Simplified59.0%
Taylor expanded in n around inf 88.5%
Final simplification55.4%
(FPCore (x n) :precision binary64 (if (<= (/ 1.0 n) -1e+44) 0.0 (/ (/ 1.0 n) x)))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e+44) {
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+44)) 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+44) {
tmp = 0.0;
} else {
tmp = (1.0 / n) / x;
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -1e+44: tmp = 0.0 else: tmp = (1.0 / n) / x return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -1e+44) 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+44) 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+44], 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^{+44}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{n}}{x}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -1.0000000000000001e44Initial program 100.0%
Taylor expanded in x around 0 51.6%
*-rgt-identity51.6%
associate-*l/51.6%
associate-/l*51.6%
exp-to-pow51.6%
Simplified51.6%
add-sqr-sqrt51.6%
unpow-prod-down51.6%
Applied egg-rr51.6%
pow-sqr51.6%
associate-*r/51.6%
metadata-eval51.6%
Simplified51.6%
Taylor expanded in n around inf 50.8%
if -1.0000000000000001e44 < (/.f64 #s(literal 1 binary64) n) Initial program 37.2%
Taylor expanded in n around inf 58.5%
log1p-define58.5%
Simplified58.5%
Taylor expanded in x around inf 46.7%
*-commutative46.7%
Simplified46.7%
Taylor expanded in x around 0 46.7%
associate-/r*47.3%
Simplified47.3%
Final simplification48.1%
(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 51.5%
Taylor expanded in x around 0 40.0%
*-rgt-identity40.0%
associate-*l/40.0%
associate-/l*40.0%
exp-to-pow40.0%
Simplified40.0%
add-sqr-sqrt40.0%
unpow-prod-down40.0%
Applied egg-rr40.0%
pow-sqr40.0%
associate-*r/40.0%
metadata-eval40.0%
Simplified40.0%
Taylor expanded in n around inf 30.7%
Final simplification30.7%
herbie shell --seed 2024091
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))