
(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 19 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
(if (<= (/ 1.0 n) -5e-47)
(* (/ 1.0 x) (/ (pow x (pow n -1.0)) n))
(if (<= (/ 1.0 n) 1e-10)
(+
(fma 0.5 (/ (pow (log1p x) 2.0) (* n n)) (/ (- (log1p x) (log x)) n))
(* (/ (pow (log x) 2.0) (* n n)) -0.5))
(- (exp (/ (log1p x) n)) (pow x (/ 1.0 n))))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -5e-47) {
tmp = (1.0 / x) * (pow(x, pow(n, -1.0)) / n);
} else if ((1.0 / n) <= 1e-10) {
tmp = fma(0.5, (pow(log1p(x), 2.0) / (n * n)), ((log1p(x) - log(x)) / n)) + ((pow(log(x), 2.0) / (n * n)) * -0.5);
} else {
tmp = exp((log1p(x) / n)) - pow(x, (1.0 / n));
}
return tmp;
}
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -5e-47) tmp = Float64(Float64(1.0 / x) * Float64((x ^ (n ^ -1.0)) / n)); elseif (Float64(1.0 / n) <= 1e-10) tmp = Float64(fma(0.5, Float64((log1p(x) ^ 2.0) / Float64(n * n)), Float64(Float64(log1p(x) - log(x)) / n)) + Float64(Float64((log(x) ^ 2.0) / Float64(n * n)) * -0.5)); else tmp = Float64(exp(Float64(log1p(x) / n)) - (x ^ Float64(1.0 / n))); end return tmp end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e-47], N[(N[(1.0 / x), $MachinePrecision] * N[(N[Power[x, N[Power[n, -1.0], $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-10], N[(N[(0.5 * N[(N[Power[N[Log[1 + x], $MachinePrecision], 2.0], $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-47}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{{x}^{\left({n}^{-1}\right)}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{-10}:\\
\;\;\;\;\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2}}{n \cdot n}, \frac{\mathsf{log1p}\left(x\right) - \log x}{n}\right) + \frac{{\log x}^{2}}{n \cdot n} \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)}\\
\end{array}
\end{array}
if (/.f64 1 n) < -5.00000000000000011e-47Initial program 90.0%
Taylor expanded in x around inf 97.4%
log-rec97.4%
mul-1-neg97.4%
mul-1-neg97.4%
distribute-frac-neg97.4%
neg-mul-197.4%
remove-double-neg97.4%
*-rgt-identity97.4%
associate-*r/97.4%
unpow-197.4%
exp-to-pow97.4%
unpow-197.4%
*-commutative97.4%
Simplified97.4%
*-un-lft-identity97.4%
times-frac97.9%
inv-pow97.9%
Applied egg-rr97.9%
if -5.00000000000000011e-47 < (/.f64 1 n) < 1.00000000000000004e-10Initial program 29.3%
Taylor expanded in n around inf 86.3%
associate--r+81.5%
sub-neg81.5%
Simplified86.2%
if 1.00000000000000004e-10 < (/.f64 1 n) Initial program 58.1%
Taylor expanded in n around 0 58.1%
log1p-def96.7%
*-rgt-identity96.7%
associate-*r/96.7%
unpow-196.7%
exp-to-pow96.7%
/-rgt-identity96.7%
metadata-eval96.7%
associate-/l*96.7%
*-commutative96.7%
*-commutative96.7%
associate-/l*96.7%
metadata-eval96.7%
/-rgt-identity96.7%
unpow-196.7%
Simplified96.7%
Final simplification91.5%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -5e-47)
(* (/ 1.0 x) (/ (pow x (pow n -1.0)) n))
(if (<= (/ 1.0 n) 1e-22)
(- (/ (log (/ x (+ 1.0 x))) n))
(- (exp (/ (log1p x) n)) (pow x (/ 1.0 n))))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -5e-47) {
tmp = (1.0 / x) * (pow(x, pow(n, -1.0)) / n);
} else if ((1.0 / n) <= 1e-22) {
tmp = -(log((x / (1.0 + x))) / n);
} else {
tmp = exp((log1p(x) / n)) - pow(x, (1.0 / n));
}
return tmp;
}
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -5e-47) {
tmp = (1.0 / x) * (Math.pow(x, Math.pow(n, -1.0)) / n);
} else if ((1.0 / n) <= 1e-22) {
tmp = -(Math.log((x / (1.0 + x))) / n);
} else {
tmp = Math.exp((Math.log1p(x) / n)) - Math.pow(x, (1.0 / n));
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -5e-47: tmp = (1.0 / x) * (math.pow(x, math.pow(n, -1.0)) / n) elif (1.0 / n) <= 1e-22: tmp = -(math.log((x / (1.0 + x))) / n) else: tmp = math.exp((math.log1p(x) / n)) - math.pow(x, (1.0 / n)) return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -5e-47) tmp = Float64(Float64(1.0 / x) * Float64((x ^ (n ^ -1.0)) / n)); elseif (Float64(1.0 / n) <= 1e-22) tmp = Float64(-Float64(log(Float64(x / Float64(1.0 + x))) / n)); else tmp = Float64(exp(Float64(log1p(x) / n)) - (x ^ Float64(1.0 / n))); end return tmp end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e-47], N[(N[(1.0 / x), $MachinePrecision] * N[(N[Power[x, N[Power[n, -1.0], $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-22], (-N[(N[Log[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]), N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-47}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{{x}^{\left({n}^{-1}\right)}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{-22}:\\
\;\;\;\;-\frac{\log \left(\frac{x}{1 + x}\right)}{n}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)}\\
\end{array}
\end{array}
if (/.f64 1 n) < -5.00000000000000011e-47Initial program 90.0%
Taylor expanded in x around inf 97.4%
log-rec97.4%
mul-1-neg97.4%
mul-1-neg97.4%
distribute-frac-neg97.4%
neg-mul-197.4%
remove-double-neg97.4%
*-rgt-identity97.4%
associate-*r/97.4%
unpow-197.4%
exp-to-pow97.4%
unpow-197.4%
*-commutative97.4%
Simplified97.4%
*-un-lft-identity97.4%
times-frac97.9%
inv-pow97.9%
Applied egg-rr97.9%
if -5.00000000000000011e-47 < (/.f64 1 n) < 1e-22Initial program 29.0%
Taylor expanded in n around inf 86.1%
log1p-def86.1%
Simplified86.1%
log1p-udef86.1%
diff-log86.3%
+-commutative86.3%
Applied egg-rr86.3%
clear-num86.3%
log-div86.4%
metadata-eval86.4%
Applied egg-rr86.4%
neg-sub086.4%
Simplified86.4%
if 1e-22 < (/.f64 1 n) Initial program 58.3%
Taylor expanded in n around 0 58.3%
log1p-def95.6%
*-rgt-identity95.6%
associate-*r/95.6%
unpow-195.6%
exp-to-pow95.6%
/-rgt-identity95.6%
metadata-eval95.6%
associate-/l*95.6%
*-commutative95.6%
*-commutative95.6%
associate-/l*95.6%
metadata-eval95.6%
/-rgt-identity95.6%
unpow-195.6%
Simplified95.6%
Final simplification91.5%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -5e-47)
(* (/ 1.0 x) (/ (pow x (pow n -1.0)) n))
(if (<= (/ 1.0 n) 1e-22)
(- (/ (log (/ x (+ 1.0 x))) n))
(if (<= (/ 1.0 n) 1e+195)
(- (pow (+ 1.0 x) (/ 1.0 n)) (pow x (/ 1.0 n)))
(/ (/ n x) (* n n))))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -5e-47) {
tmp = (1.0 / x) * (pow(x, pow(n, -1.0)) / n);
} else if ((1.0 / n) <= 1e-22) {
tmp = -(log((x / (1.0 + x))) / n);
} else if ((1.0 / n) <= 1e+195) {
tmp = pow((1.0 + x), (1.0 / n)) - pow(x, (1.0 / n));
} else {
tmp = (n / x) / (n * n);
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if ((1.0d0 / n) <= (-5d-47)) then
tmp = (1.0d0 / x) * ((x ** (n ** (-1.0d0))) / n)
else if ((1.0d0 / n) <= 1d-22) then
tmp = -(log((x / (1.0d0 + x))) / n)
else if ((1.0d0 / n) <= 1d+195) then
tmp = ((1.0d0 + x) ** (1.0d0 / n)) - (x ** (1.0d0 / n))
else
tmp = (n / x) / (n * n)
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -5e-47) {
tmp = (1.0 / x) * (Math.pow(x, Math.pow(n, -1.0)) / n);
} else if ((1.0 / n) <= 1e-22) {
tmp = -(Math.log((x / (1.0 + x))) / n);
} else if ((1.0 / n) <= 1e+195) {
tmp = Math.pow((1.0 + x), (1.0 / n)) - Math.pow(x, (1.0 / n));
} else {
tmp = (n / x) / (n * n);
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -5e-47: tmp = (1.0 / x) * (math.pow(x, math.pow(n, -1.0)) / n) elif (1.0 / n) <= 1e-22: tmp = -(math.log((x / (1.0 + x))) / n) elif (1.0 / n) <= 1e+195: tmp = math.pow((1.0 + x), (1.0 / n)) - math.pow(x, (1.0 / n)) else: tmp = (n / x) / (n * n) return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -5e-47) tmp = Float64(Float64(1.0 / x) * Float64((x ^ (n ^ -1.0)) / n)); elseif (Float64(1.0 / n) <= 1e-22) tmp = Float64(-Float64(log(Float64(x / Float64(1.0 + x))) / n)); elseif (Float64(1.0 / n) <= 1e+195) tmp = Float64((Float64(1.0 + x) ^ Float64(1.0 / n)) - (x ^ Float64(1.0 / n))); else tmp = Float64(Float64(n / x) / Float64(n * n)); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -5e-47) tmp = (1.0 / x) * ((x ^ (n ^ -1.0)) / n); elseif ((1.0 / n) <= 1e-22) tmp = -(log((x / (1.0 + x))) / n); elseif ((1.0 / n) <= 1e+195) tmp = ((1.0 + x) ^ (1.0 / n)) - (x ^ (1.0 / n)); else tmp = (n / x) / (n * n); end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e-47], N[(N[(1.0 / x), $MachinePrecision] * N[(N[Power[x, N[Power[n, -1.0], $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-22], (-N[(N[Log[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]), If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+195], N[(N[Power[N[(1.0 + x), $MachinePrecision], N[(1.0 / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(n / x), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-47}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{{x}^{\left({n}^{-1}\right)}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{-22}:\\
\;\;\;\;-\frac{\log \left(\frac{x}{1 + x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+195}:\\
\;\;\;\;{\left(1 + x\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{n}{x}}{n \cdot n}\\
\end{array}
\end{array}
if (/.f64 1 n) < -5.00000000000000011e-47Initial program 90.0%
Taylor expanded in x around inf 97.4%
log-rec97.4%
mul-1-neg97.4%
mul-1-neg97.4%
distribute-frac-neg97.4%
neg-mul-197.4%
remove-double-neg97.4%
*-rgt-identity97.4%
associate-*r/97.4%
unpow-197.4%
exp-to-pow97.4%
unpow-197.4%
*-commutative97.4%
Simplified97.4%
*-un-lft-identity97.4%
times-frac97.9%
inv-pow97.9%
Applied egg-rr97.9%
if -5.00000000000000011e-47 < (/.f64 1 n) < 1e-22Initial program 29.0%
Taylor expanded in n around inf 86.1%
log1p-def86.1%
Simplified86.1%
log1p-udef86.1%
diff-log86.3%
+-commutative86.3%
Applied egg-rr86.3%
clear-num86.3%
log-div86.4%
metadata-eval86.4%
Applied egg-rr86.4%
neg-sub086.4%
Simplified86.4%
if 1e-22 < (/.f64 1 n) < 9.99999999999999977e194Initial program 81.0%
if 9.99999999999999977e194 < (/.f64 1 n) Initial program 26.2%
Taylor expanded in n around inf 7.3%
log1p-def7.3%
Simplified7.3%
add-log-exp83.9%
div-inv83.9%
exp-prod83.9%
exp-diff83.9%
log1p-udef83.9%
add-exp-log83.9%
add-exp-log83.9%
+-commutative83.9%
Applied egg-rr83.9%
log-pow7.3%
associate-*l/7.3%
*-un-lft-identity7.3%
log-div7.3%
+-commutative7.3%
log1p-udef7.3%
div-sub7.3%
frac-sub83.9%
Applied egg-rr83.9%
*-commutative83.9%
distribute-lft-out--83.9%
Simplified83.9%
Taylor expanded in x around inf 83.9%
Final simplification89.9%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -5e-47)
(* (/ 1.0 x) (/ (pow x (pow n -1.0)) n))
(if (<= (/ 1.0 n) 1e-22)
(- (/ (log (/ x (+ 1.0 x))) n))
(if (<= (/ 1.0 n) 1e+195)
(- (+ 1.0 (/ x n)) (pow x (/ 1.0 n)))
(/ (/ n x) (* n n))))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -5e-47) {
tmp = (1.0 / x) * (pow(x, pow(n, -1.0)) / n);
} else if ((1.0 / n) <= 1e-22) {
tmp = -(log((x / (1.0 + x))) / n);
} else if ((1.0 / n) <= 1e+195) {
tmp = (1.0 + (x / n)) - pow(x, (1.0 / n));
} else {
tmp = (n / x) / (n * n);
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if ((1.0d0 / n) <= (-5d-47)) then
tmp = (1.0d0 / x) * ((x ** (n ** (-1.0d0))) / n)
else if ((1.0d0 / n) <= 1d-22) then
tmp = -(log((x / (1.0d0 + x))) / n)
else if ((1.0d0 / n) <= 1d+195) then
tmp = (1.0d0 + (x / n)) - (x ** (1.0d0 / n))
else
tmp = (n / x) / (n * n)
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -5e-47) {
tmp = (1.0 / x) * (Math.pow(x, Math.pow(n, -1.0)) / n);
} else if ((1.0 / n) <= 1e-22) {
tmp = -(Math.log((x / (1.0 + x))) / n);
} else if ((1.0 / n) <= 1e+195) {
tmp = (1.0 + (x / n)) - Math.pow(x, (1.0 / n));
} else {
tmp = (n / x) / (n * n);
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -5e-47: tmp = (1.0 / x) * (math.pow(x, math.pow(n, -1.0)) / n) elif (1.0 / n) <= 1e-22: tmp = -(math.log((x / (1.0 + x))) / n) elif (1.0 / n) <= 1e+195: tmp = (1.0 + (x / n)) - math.pow(x, (1.0 / n)) else: tmp = (n / x) / (n * n) return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -5e-47) tmp = Float64(Float64(1.0 / x) * Float64((x ^ (n ^ -1.0)) / n)); elseif (Float64(1.0 / n) <= 1e-22) tmp = Float64(-Float64(log(Float64(x / Float64(1.0 + x))) / n)); elseif (Float64(1.0 / n) <= 1e+195) tmp = Float64(Float64(1.0 + Float64(x / n)) - (x ^ Float64(1.0 / n))); else tmp = Float64(Float64(n / x) / Float64(n * n)); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -5e-47) tmp = (1.0 / x) * ((x ^ (n ^ -1.0)) / n); elseif ((1.0 / n) <= 1e-22) tmp = -(log((x / (1.0 + x))) / n); elseif ((1.0 / n) <= 1e+195) tmp = (1.0 + (x / n)) - (x ^ (1.0 / n)); else tmp = (n / x) / (n * n); end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e-47], N[(N[(1.0 / x), $MachinePrecision] * N[(N[Power[x, N[Power[n, -1.0], $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-22], (-N[(N[Log[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]), If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+195], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(n / x), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-47}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{{x}^{\left({n}^{-1}\right)}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{-22}:\\
\;\;\;\;-\frac{\log \left(\frac{x}{1 + x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+195}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{n}{x}}{n \cdot n}\\
\end{array}
\end{array}
if (/.f64 1 n) < -5.00000000000000011e-47Initial program 90.0%
Taylor expanded in x around inf 97.4%
log-rec97.4%
mul-1-neg97.4%
mul-1-neg97.4%
distribute-frac-neg97.4%
neg-mul-197.4%
remove-double-neg97.4%
*-rgt-identity97.4%
associate-*r/97.4%
unpow-197.4%
exp-to-pow97.4%
unpow-197.4%
*-commutative97.4%
Simplified97.4%
*-un-lft-identity97.4%
times-frac97.9%
inv-pow97.9%
Applied egg-rr97.9%
if -5.00000000000000011e-47 < (/.f64 1 n) < 1e-22Initial program 29.0%
Taylor expanded in n around inf 86.1%
log1p-def86.1%
Simplified86.1%
log1p-udef86.1%
diff-log86.3%
+-commutative86.3%
Applied egg-rr86.3%
clear-num86.3%
log-div86.4%
metadata-eval86.4%
Applied egg-rr86.4%
neg-sub086.4%
Simplified86.4%
if 1e-22 < (/.f64 1 n) < 9.99999999999999977e194Initial program 81.0%
Taylor expanded in x around 0 75.1%
if 9.99999999999999977e194 < (/.f64 1 n) Initial program 26.2%
Taylor expanded in n around inf 7.3%
log1p-def7.3%
Simplified7.3%
add-log-exp83.9%
div-inv83.9%
exp-prod83.9%
exp-diff83.9%
log1p-udef83.9%
add-exp-log83.9%
add-exp-log83.9%
+-commutative83.9%
Applied egg-rr83.9%
log-pow7.3%
associate-*l/7.3%
*-un-lft-identity7.3%
log-div7.3%
+-commutative7.3%
log1p-udef7.3%
div-sub7.3%
frac-sub83.9%
Applied egg-rr83.9%
*-commutative83.9%
distribute-lft-out--83.9%
Simplified83.9%
Taylor expanded in x around inf 83.9%
Final simplification89.6%
(FPCore (x n)
:precision binary64
(let* ((t_0 (- 1.0 (pow x (/ 1.0 n)))) (t_1 (/ (log (/ (+ 1.0 x) x)) n)))
(if (<= (/ 1.0 n) -1e+224)
t_0
(if (<= (/ 1.0 n) -5e+206)
t_1
(if (<= (/ 1.0 n) -50000.0)
t_0
(if (<= (/ 1.0 n) 1e-22)
t_1
(if (<= (/ 1.0 n) 1e+195) t_0 (/ (/ n x) (* n n)))))))))
double code(double x, double n) {
double t_0 = 1.0 - pow(x, (1.0 / n));
double t_1 = log(((1.0 + x) / x)) / n;
double tmp;
if ((1.0 / n) <= -1e+224) {
tmp = t_0;
} else if ((1.0 / n) <= -5e+206) {
tmp = t_1;
} else if ((1.0 / n) <= -50000.0) {
tmp = t_0;
} else if ((1.0 / n) <= 1e-22) {
tmp = t_1;
} else if ((1.0 / n) <= 1e+195) {
tmp = t_0;
} else {
tmp = (n / x) / (n * 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) :: tmp
t_0 = 1.0d0 - (x ** (1.0d0 / n))
t_1 = log(((1.0d0 + x) / x)) / n
if ((1.0d0 / n) <= (-1d+224)) then
tmp = t_0
else if ((1.0d0 / n) <= (-5d+206)) then
tmp = t_1
else if ((1.0d0 / n) <= (-50000.0d0)) then
tmp = t_0
else if ((1.0d0 / n) <= 1d-22) then
tmp = t_1
else if ((1.0d0 / n) <= 1d+195) then
tmp = t_0
else
tmp = (n / x) / (n * n)
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(((1.0 + x) / x)) / n;
double tmp;
if ((1.0 / n) <= -1e+224) {
tmp = t_0;
} else if ((1.0 / n) <= -5e+206) {
tmp = t_1;
} else if ((1.0 / n) <= -50000.0) {
tmp = t_0;
} else if ((1.0 / n) <= 1e-22) {
tmp = t_1;
} else if ((1.0 / n) <= 1e+195) {
tmp = t_0;
} else {
tmp = (n / x) / (n * n);
}
return tmp;
}
def code(x, n): t_0 = 1.0 - math.pow(x, (1.0 / n)) t_1 = math.log(((1.0 + x) / x)) / n tmp = 0 if (1.0 / n) <= -1e+224: tmp = t_0 elif (1.0 / n) <= -5e+206: tmp = t_1 elif (1.0 / n) <= -50000.0: tmp = t_0 elif (1.0 / n) <= 1e-22: tmp = t_1 elif (1.0 / n) <= 1e+195: tmp = t_0 else: tmp = (n / x) / (n * n) return tmp
function code(x, n) t_0 = Float64(1.0 - (x ^ Float64(1.0 / n))) t_1 = Float64(log(Float64(Float64(1.0 + x) / x)) / n) tmp = 0.0 if (Float64(1.0 / n) <= -1e+224) tmp = t_0; elseif (Float64(1.0 / n) <= -5e+206) tmp = t_1; elseif (Float64(1.0 / n) <= -50000.0) tmp = t_0; elseif (Float64(1.0 / n) <= 1e-22) tmp = t_1; elseif (Float64(1.0 / n) <= 1e+195) tmp = t_0; else tmp = Float64(Float64(n / x) / Float64(n * n)); end return tmp end
function tmp_2 = code(x, n) t_0 = 1.0 - (x ^ (1.0 / n)); t_1 = log(((1.0 + x) / x)) / n; tmp = 0.0; if ((1.0 / n) <= -1e+224) tmp = t_0; elseif ((1.0 / n) <= -5e+206) tmp = t_1; elseif ((1.0 / n) <= -50000.0) tmp = t_0; elseif ((1.0 / n) <= 1e-22) tmp = t_1; elseif ((1.0 / n) <= 1e+195) tmp = t_0; else tmp = (n / x) / (n * n); end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Log[N[(N[(1.0 + x), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+224], t$95$0, If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e+206], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], -50000.0], t$95$0, If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-22], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+195], t$95$0, N[(N[(n / x), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{\log \left(\frac{1 + x}{x}\right)}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+224}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\frac{1}{n} \leq -5 \cdot 10^{+206}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\frac{1}{n} \leq -50000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{-22}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+195}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{n}{x}}{n \cdot n}\\
\end{array}
\end{array}
if (/.f64 1 n) < -9.9999999999999997e223 or -5.0000000000000002e206 < (/.f64 1 n) < -5e4 or 1e-22 < (/.f64 1 n) < 9.99999999999999977e194Initial program 96.4%
Taylor expanded in x around 0 64.8%
*-rgt-identity64.8%
associate-*r/64.8%
unpow-164.8%
exp-to-pow64.8%
unpow-164.8%
Simplified64.8%
if -9.9999999999999997e223 < (/.f64 1 n) < -5.0000000000000002e206 or -5e4 < (/.f64 1 n) < 1e-22Initial program 31.5%
Taylor expanded in n around inf 82.6%
log1p-def82.6%
Simplified82.6%
log1p-udef82.6%
diff-log82.7%
+-commutative82.7%
Applied egg-rr82.7%
if 9.99999999999999977e194 < (/.f64 1 n) Initial program 26.2%
Taylor expanded in n around inf 7.3%
log1p-def7.3%
Simplified7.3%
add-log-exp83.9%
div-inv83.9%
exp-prod83.9%
exp-diff83.9%
log1p-udef83.9%
add-exp-log83.9%
add-exp-log83.9%
+-commutative83.9%
Applied egg-rr83.9%
log-pow7.3%
associate-*l/7.3%
*-un-lft-identity7.3%
log-div7.3%
+-commutative7.3%
log1p-udef7.3%
div-sub7.3%
frac-sub83.9%
Applied egg-rr83.9%
*-commutative83.9%
distribute-lft-out--83.9%
Simplified83.9%
Taylor expanded in x around inf 83.9%
Final simplification76.5%
(FPCore (x n)
:precision binary64
(let* ((t_0 (- 1.0 (pow x (/ 1.0 n)))))
(if (<= (/ 1.0 n) -1e+224)
t_0
(if (<= (/ 1.0 n) -5e+206)
(/ (log (/ (+ 1.0 x) x)) n)
(if (<= (/ 1.0 n) -50000.0)
t_0
(if (<= (/ 1.0 n) 1e-22)
(- (/ (log (/ x (+ 1.0 x))) n))
(if (<= (/ 1.0 n) 1e+195) t_0 (/ (/ n x) (* n n)))))))))
double code(double x, double n) {
double t_0 = 1.0 - pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -1e+224) {
tmp = t_0;
} else if ((1.0 / n) <= -5e+206) {
tmp = log(((1.0 + x) / x)) / n;
} else if ((1.0 / n) <= -50000.0) {
tmp = t_0;
} else if ((1.0 / n) <= 1e-22) {
tmp = -(log((x / (1.0 + x))) / n);
} else if ((1.0 / n) <= 1e+195) {
tmp = t_0;
} else {
tmp = (n / x) / (n * 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) :: tmp
t_0 = 1.0d0 - (x ** (1.0d0 / n))
if ((1.0d0 / n) <= (-1d+224)) then
tmp = t_0
else if ((1.0d0 / n) <= (-5d+206)) then
tmp = log(((1.0d0 + x) / x)) / n
else if ((1.0d0 / n) <= (-50000.0d0)) then
tmp = t_0
else if ((1.0d0 / n) <= 1d-22) then
tmp = -(log((x / (1.0d0 + x))) / n)
else if ((1.0d0 / n) <= 1d+195) then
tmp = t_0
else
tmp = (n / x) / (n * n)
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 tmp;
if ((1.0 / n) <= -1e+224) {
tmp = t_0;
} else if ((1.0 / n) <= -5e+206) {
tmp = Math.log(((1.0 + x) / x)) / n;
} else if ((1.0 / n) <= -50000.0) {
tmp = t_0;
} else if ((1.0 / n) <= 1e-22) {
tmp = -(Math.log((x / (1.0 + x))) / n);
} else if ((1.0 / n) <= 1e+195) {
tmp = t_0;
} else {
tmp = (n / x) / (n * n);
}
return tmp;
}
def code(x, n): t_0 = 1.0 - math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -1e+224: tmp = t_0 elif (1.0 / n) <= -5e+206: tmp = math.log(((1.0 + x) / x)) / n elif (1.0 / n) <= -50000.0: tmp = t_0 elif (1.0 / n) <= 1e-22: tmp = -(math.log((x / (1.0 + x))) / n) elif (1.0 / n) <= 1e+195: tmp = t_0 else: tmp = (n / x) / (n * n) return tmp
function code(x, n) t_0 = Float64(1.0 - (x ^ Float64(1.0 / n))) tmp = 0.0 if (Float64(1.0 / n) <= -1e+224) tmp = t_0; elseif (Float64(1.0 / n) <= -5e+206) tmp = Float64(log(Float64(Float64(1.0 + x) / x)) / n); elseif (Float64(1.0 / n) <= -50000.0) tmp = t_0; elseif (Float64(1.0 / n) <= 1e-22) tmp = Float64(-Float64(log(Float64(x / Float64(1.0 + x))) / n)); elseif (Float64(1.0 / n) <= 1e+195) tmp = t_0; else tmp = Float64(Float64(n / x) / Float64(n * n)); end return tmp end
function tmp_2 = code(x, n) t_0 = 1.0 - (x ^ (1.0 / n)); tmp = 0.0; if ((1.0 / n) <= -1e+224) tmp = t_0; elseif ((1.0 / n) <= -5e+206) tmp = log(((1.0 + x) / x)) / n; elseif ((1.0 / n) <= -50000.0) tmp = t_0; elseif ((1.0 / n) <= 1e-22) tmp = -(log((x / (1.0 + x))) / n); elseif ((1.0 / n) <= 1e+195) tmp = t_0; else tmp = (n / x) / (n * n); 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]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+224], t$95$0, If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e+206], N[(N[Log[N[(N[(1.0 + x), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], -50000.0], t$95$0, If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-22], (-N[(N[Log[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]), If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+195], t$95$0, N[(N[(n / x), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+224}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\frac{1}{n} \leq -5 \cdot 10^{+206}:\\
\;\;\;\;\frac{\log \left(\frac{1 + x}{x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq -50000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{-22}:\\
\;\;\;\;-\frac{\log \left(\frac{x}{1 + x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+195}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{n}{x}}{n \cdot n}\\
\end{array}
\end{array}
if (/.f64 1 n) < -9.9999999999999997e223 or -5.0000000000000002e206 < (/.f64 1 n) < -5e4 or 1e-22 < (/.f64 1 n) < 9.99999999999999977e194Initial program 96.4%
Taylor expanded in x around 0 64.8%
*-rgt-identity64.8%
associate-*r/64.8%
unpow-164.8%
exp-to-pow64.8%
unpow-164.8%
Simplified64.8%
if -9.9999999999999997e223 < (/.f64 1 n) < -5.0000000000000002e206Initial program 100.0%
Taylor expanded in n around inf 88.2%
log1p-def88.2%
Simplified88.2%
log1p-udef88.2%
diff-log88.2%
+-commutative88.2%
Applied egg-rr88.2%
if -5e4 < (/.f64 1 n) < 1e-22Initial program 27.7%
Taylor expanded in n around inf 82.3%
log1p-def82.3%
Simplified82.3%
log1p-udef82.3%
diff-log82.4%
+-commutative82.4%
Applied egg-rr82.4%
clear-num82.4%
log-div82.5%
metadata-eval82.5%
Applied egg-rr82.5%
neg-sub082.5%
Simplified82.5%
if 9.99999999999999977e194 < (/.f64 1 n) Initial program 26.2%
Taylor expanded in n around inf 7.3%
log1p-def7.3%
Simplified7.3%
add-log-exp83.9%
div-inv83.9%
exp-prod83.9%
exp-diff83.9%
log1p-udef83.9%
add-exp-log83.9%
add-exp-log83.9%
+-commutative83.9%
Applied egg-rr83.9%
log-pow7.3%
associate-*l/7.3%
*-un-lft-identity7.3%
log-div7.3%
+-commutative7.3%
log1p-udef7.3%
div-sub7.3%
frac-sub83.9%
Applied egg-rr83.9%
*-commutative83.9%
distribute-lft-out--83.9%
Simplified83.9%
Taylor expanded in x around inf 83.9%
Final simplification76.6%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -5e-47)
(/ t_0 (* n x))
(if (<= (/ 1.0 n) 1e-22)
(- (/ (log (/ x (+ 1.0 x))) n))
(if (<= (/ 1.0 n) 1e+195)
(- (+ 1.0 (/ x n)) t_0)
(/ (/ n x) (* n n)))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -5e-47) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 1e-22) {
tmp = -(log((x / (1.0 + x))) / n);
} else if ((1.0 / n) <= 1e+195) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = (n / x) / (n * 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) :: tmp
t_0 = x ** (1.0d0 / n)
if ((1.0d0 / n) <= (-5d-47)) then
tmp = t_0 / (n * x)
else if ((1.0d0 / n) <= 1d-22) then
tmp = -(log((x / (1.0d0 + x))) / n)
else if ((1.0d0 / n) <= 1d+195) then
tmp = (1.0d0 + (x / n)) - t_0
else
tmp = (n / x) / (n * 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 tmp;
if ((1.0 / n) <= -5e-47) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 1e-22) {
tmp = -(Math.log((x / (1.0 + x))) / n);
} else if ((1.0 / n) <= 1e+195) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = (n / x) / (n * n);
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -5e-47: tmp = t_0 / (n * x) elif (1.0 / n) <= 1e-22: tmp = -(math.log((x / (1.0 + x))) / n) elif (1.0 / n) <= 1e+195: tmp = (1.0 + (x / n)) - t_0 else: tmp = (n / x) / (n * n) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -5e-47) tmp = Float64(t_0 / Float64(n * x)); elseif (Float64(1.0 / n) <= 1e-22) tmp = Float64(-Float64(log(Float64(x / Float64(1.0 + x))) / n)); elseif (Float64(1.0 / n) <= 1e+195) tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0); else tmp = Float64(Float64(n / x) / Float64(n * n)); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if ((1.0 / n) <= -5e-47) tmp = t_0 / (n * x); elseif ((1.0 / n) <= 1e-22) tmp = -(log((x / (1.0 + x))) / n); elseif ((1.0 / n) <= 1e+195) tmp = (1.0 + (x / n)) - t_0; else tmp = (n / x) / (n * n); 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], -5e-47], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-22], (-N[(N[Log[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]), If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+195], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(n / x), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-47}:\\
\;\;\;\;\frac{t_0}{n \cdot x}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{-22}:\\
\;\;\;\;-\frac{\log \left(\frac{x}{1 + x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+195}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{n}{x}}{n \cdot n}\\
\end{array}
\end{array}
if (/.f64 1 n) < -5.00000000000000011e-47Initial program 90.0%
Taylor expanded in x around inf 97.4%
log-rec97.4%
mul-1-neg97.4%
mul-1-neg97.4%
distribute-frac-neg97.4%
neg-mul-197.4%
remove-double-neg97.4%
*-rgt-identity97.4%
associate-*r/97.4%
unpow-197.4%
exp-to-pow97.4%
unpow-197.4%
*-commutative97.4%
Simplified97.4%
if -5.00000000000000011e-47 < (/.f64 1 n) < 1e-22Initial program 29.0%
Taylor expanded in n around inf 86.1%
log1p-def86.1%
Simplified86.1%
log1p-udef86.1%
diff-log86.3%
+-commutative86.3%
Applied egg-rr86.3%
clear-num86.3%
log-div86.4%
metadata-eval86.4%
Applied egg-rr86.4%
neg-sub086.4%
Simplified86.4%
if 1e-22 < (/.f64 1 n) < 9.99999999999999977e194Initial program 81.0%
Taylor expanded in x around 0 75.1%
if 9.99999999999999977e194 < (/.f64 1 n) Initial program 26.2%
Taylor expanded in n around inf 7.3%
log1p-def7.3%
Simplified7.3%
add-log-exp83.9%
div-inv83.9%
exp-prod83.9%
exp-diff83.9%
log1p-udef83.9%
add-exp-log83.9%
add-exp-log83.9%
+-commutative83.9%
Applied egg-rr83.9%
log-pow7.3%
associate-*l/7.3%
*-un-lft-identity7.3%
log-div7.3%
+-commutative7.3%
log1p-udef7.3%
div-sub7.3%
frac-sub83.9%
Applied egg-rr83.9%
*-commutative83.9%
distribute-lft-out--83.9%
Simplified83.9%
Taylor expanded in x around inf 83.9%
Final simplification89.4%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -5e-47)
(/ t_0 (* n x))
(if (<= (/ 1.0 n) 1e-22)
(- (/ (log (/ x (+ 1.0 x))) n))
(if (<= (/ 1.0 n) 1e+195) (- 1.0 t_0) (/ (/ n x) (* n n)))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -5e-47) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 1e-22) {
tmp = -(log((x / (1.0 + x))) / n);
} else if ((1.0 / n) <= 1e+195) {
tmp = 1.0 - t_0;
} else {
tmp = (n / x) / (n * 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) :: tmp
t_0 = x ** (1.0d0 / n)
if ((1.0d0 / n) <= (-5d-47)) then
tmp = t_0 / (n * x)
else if ((1.0d0 / n) <= 1d-22) then
tmp = -(log((x / (1.0d0 + x))) / n)
else if ((1.0d0 / n) <= 1d+195) then
tmp = 1.0d0 - t_0
else
tmp = (n / x) / (n * 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 tmp;
if ((1.0 / n) <= -5e-47) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 1e-22) {
tmp = -(Math.log((x / (1.0 + x))) / n);
} else if ((1.0 / n) <= 1e+195) {
tmp = 1.0 - t_0;
} else {
tmp = (n / x) / (n * n);
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -5e-47: tmp = t_0 / (n * x) elif (1.0 / n) <= 1e-22: tmp = -(math.log((x / (1.0 + x))) / n) elif (1.0 / n) <= 1e+195: tmp = 1.0 - t_0 else: tmp = (n / x) / (n * n) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -5e-47) tmp = Float64(t_0 / Float64(n * x)); elseif (Float64(1.0 / n) <= 1e-22) tmp = Float64(-Float64(log(Float64(x / Float64(1.0 + x))) / n)); elseif (Float64(1.0 / n) <= 1e+195) tmp = Float64(1.0 - t_0); else tmp = Float64(Float64(n / x) / Float64(n * n)); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if ((1.0 / n) <= -5e-47) tmp = t_0 / (n * x); elseif ((1.0 / n) <= 1e-22) tmp = -(log((x / (1.0 + x))) / n); elseif ((1.0 / n) <= 1e+195) tmp = 1.0 - t_0; else tmp = (n / x) / (n * n); 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], -5e-47], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-22], (-N[(N[Log[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]), If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+195], N[(1.0 - t$95$0), $MachinePrecision], N[(N[(n / x), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-47}:\\
\;\;\;\;\frac{t_0}{n \cdot x}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{-22}:\\
\;\;\;\;-\frac{\log \left(\frac{x}{1 + x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+195}:\\
\;\;\;\;1 - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{n}{x}}{n \cdot n}\\
\end{array}
\end{array}
if (/.f64 1 n) < -5.00000000000000011e-47Initial program 90.0%
Taylor expanded in x around inf 97.4%
log-rec97.4%
mul-1-neg97.4%
mul-1-neg97.4%
distribute-frac-neg97.4%
neg-mul-197.4%
remove-double-neg97.4%
*-rgt-identity97.4%
associate-*r/97.4%
unpow-197.4%
exp-to-pow97.4%
unpow-197.4%
*-commutative97.4%
Simplified97.4%
if -5.00000000000000011e-47 < (/.f64 1 n) < 1e-22Initial program 29.0%
Taylor expanded in n around inf 86.1%
log1p-def86.1%
Simplified86.1%
log1p-udef86.1%
diff-log86.3%
+-commutative86.3%
Applied egg-rr86.3%
clear-num86.3%
log-div86.4%
metadata-eval86.4%
Applied egg-rr86.4%
neg-sub086.4%
Simplified86.4%
if 1e-22 < (/.f64 1 n) < 9.99999999999999977e194Initial program 81.0%
Taylor expanded in x around 0 75.1%
*-rgt-identity75.1%
associate-*r/75.1%
unpow-175.1%
exp-to-pow75.1%
unpow-175.1%
Simplified75.1%
if 9.99999999999999977e194 < (/.f64 1 n) Initial program 26.2%
Taylor expanded in n around inf 7.3%
log1p-def7.3%
Simplified7.3%
add-log-exp83.9%
div-inv83.9%
exp-prod83.9%
exp-diff83.9%
log1p-udef83.9%
add-exp-log83.9%
add-exp-log83.9%
+-commutative83.9%
Applied egg-rr83.9%
log-pow7.3%
associate-*l/7.3%
*-un-lft-identity7.3%
log-div7.3%
+-commutative7.3%
log1p-udef7.3%
div-sub7.3%
frac-sub83.9%
Applied egg-rr83.9%
*-commutative83.9%
distribute-lft-out--83.9%
Simplified83.9%
Taylor expanded in x around inf 83.9%
Final simplification89.4%
(FPCore (x n)
:precision binary64
(if (<= x 5.4e-284)
(/ (- (log x)) n)
(if (<= x 2.3e-233)
(/ 1.0 (* n x))
(if (<= x 0.98)
(/ (- x (log x)) n)
(if (<= x 1e+89) (/ (- (/ 1.0 x) (/ 0.5 (* x x))) n) (/ 0.0 n))))))
double code(double x, double n) {
double tmp;
if (x <= 5.4e-284) {
tmp = -log(x) / n;
} else if (x <= 2.3e-233) {
tmp = 1.0 / (n * x);
} else if (x <= 0.98) {
tmp = (x - log(x)) / n;
} else if (x <= 1e+89) {
tmp = ((1.0 / x) - (0.5 / (x * x))) / n;
} else {
tmp = 0.0 / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 5.4d-284) then
tmp = -log(x) / n
else if (x <= 2.3d-233) then
tmp = 1.0d0 / (n * x)
else if (x <= 0.98d0) then
tmp = (x - log(x)) / n
else if (x <= 1d+89) then
tmp = ((1.0d0 / x) - (0.5d0 / (x * x))) / n
else
tmp = 0.0d0 / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 5.4e-284) {
tmp = -Math.log(x) / n;
} else if (x <= 2.3e-233) {
tmp = 1.0 / (n * x);
} else if (x <= 0.98) {
tmp = (x - Math.log(x)) / n;
} else if (x <= 1e+89) {
tmp = ((1.0 / x) - (0.5 / (x * x))) / n;
} else {
tmp = 0.0 / n;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 5.4e-284: tmp = -math.log(x) / n elif x <= 2.3e-233: tmp = 1.0 / (n * x) elif x <= 0.98: tmp = (x - math.log(x)) / n elif x <= 1e+89: tmp = ((1.0 / x) - (0.5 / (x * x))) / n else: tmp = 0.0 / n return tmp
function code(x, n) tmp = 0.0 if (x <= 5.4e-284) tmp = Float64(Float64(-log(x)) / n); elseif (x <= 2.3e-233) tmp = Float64(1.0 / Float64(n * x)); elseif (x <= 0.98) tmp = Float64(Float64(x - log(x)) / n); elseif (x <= 1e+89) tmp = Float64(Float64(Float64(1.0 / x) - Float64(0.5 / Float64(x * x))) / n); else tmp = Float64(0.0 / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 5.4e-284) tmp = -log(x) / n; elseif (x <= 2.3e-233) tmp = 1.0 / (n * x); elseif (x <= 0.98) tmp = (x - log(x)) / n; elseif (x <= 1e+89) tmp = ((1.0 / x) - (0.5 / (x * x))) / n; else tmp = 0.0 / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 5.4e-284], N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision], If[LessEqual[x, 2.3e-233], N[(1.0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.98], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 1e+89], N[(N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(0.0 / n), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.4 \cdot 10^{-284}:\\
\;\;\;\;\frac{-\log x}{n}\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{-233}:\\
\;\;\;\;\frac{1}{n \cdot x}\\
\mathbf{elif}\;x \leq 0.98:\\
\;\;\;\;\frac{x - \log x}{n}\\
\mathbf{elif}\;x \leq 10^{+89}:\\
\;\;\;\;\frac{\frac{1}{x} - \frac{0.5}{x \cdot x}}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{n}\\
\end{array}
\end{array}
if x < 5.39999999999999969e-284Initial program 42.5%
Taylor expanded in n around inf 61.6%
log1p-def61.6%
Simplified61.6%
Taylor expanded in x around 0 61.6%
neg-mul-161.6%
Simplified61.6%
if 5.39999999999999969e-284 < x < 2.3000000000000002e-233Initial program 68.1%
Taylor expanded in n around inf 26.8%
log1p-def26.8%
Simplified26.8%
Taylor expanded in x around inf 52.2%
*-commutative52.2%
Simplified52.2%
if 2.3000000000000002e-233 < x < 0.97999999999999998Initial program 37.4%
Taylor expanded in n around inf 61.2%
log1p-def61.2%
Simplified61.2%
Taylor expanded in x around 0 61.1%
neg-mul-161.1%
sub-neg61.1%
Simplified61.1%
if 0.97999999999999998 < x < 9.99999999999999995e88Initial program 45.4%
Taylor expanded in n around inf 50.9%
log1p-def50.9%
Simplified50.9%
Taylor expanded in x around inf 68.4%
associate-*r/68.4%
metadata-eval68.4%
unpow268.4%
Simplified68.4%
if 9.99999999999999995e88 < x Initial program 83.2%
Taylor expanded in n around inf 83.2%
log1p-def83.2%
Simplified83.2%
log1p-udef83.2%
diff-log83.2%
+-commutative83.2%
Applied egg-rr83.2%
Taylor expanded in x around inf 83.2%
Final simplification67.1%
(FPCore (x n)
:precision binary64
(if (<= x 3.5e-284)
(* (log x) (/ 1.0 (- n)))
(if (<= x 2.3e-233)
(/ 1.0 (* n x))
(if (<= x 0.96)
(/ (- x (log x)) n)
(if (<= x 3.5e+90) (/ (- (/ 1.0 x) (/ 0.5 (* x x))) n) (/ 0.0 n))))))
double code(double x, double n) {
double tmp;
if (x <= 3.5e-284) {
tmp = log(x) * (1.0 / -n);
} else if (x <= 2.3e-233) {
tmp = 1.0 / (n * x);
} else if (x <= 0.96) {
tmp = (x - log(x)) / n;
} else if (x <= 3.5e+90) {
tmp = ((1.0 / x) - (0.5 / (x * x))) / n;
} else {
tmp = 0.0 / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 3.5d-284) then
tmp = log(x) * (1.0d0 / -n)
else if (x <= 2.3d-233) then
tmp = 1.0d0 / (n * x)
else if (x <= 0.96d0) then
tmp = (x - log(x)) / n
else if (x <= 3.5d+90) then
tmp = ((1.0d0 / x) - (0.5d0 / (x * x))) / n
else
tmp = 0.0d0 / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 3.5e-284) {
tmp = Math.log(x) * (1.0 / -n);
} else if (x <= 2.3e-233) {
tmp = 1.0 / (n * x);
} else if (x <= 0.96) {
tmp = (x - Math.log(x)) / n;
} else if (x <= 3.5e+90) {
tmp = ((1.0 / x) - (0.5 / (x * x))) / n;
} else {
tmp = 0.0 / n;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 3.5e-284: tmp = math.log(x) * (1.0 / -n) elif x <= 2.3e-233: tmp = 1.0 / (n * x) elif x <= 0.96: tmp = (x - math.log(x)) / n elif x <= 3.5e+90: tmp = ((1.0 / x) - (0.5 / (x * x))) / n else: tmp = 0.0 / n return tmp
function code(x, n) tmp = 0.0 if (x <= 3.5e-284) tmp = Float64(log(x) * Float64(1.0 / Float64(-n))); elseif (x <= 2.3e-233) tmp = Float64(1.0 / Float64(n * x)); elseif (x <= 0.96) tmp = Float64(Float64(x - log(x)) / n); elseif (x <= 3.5e+90) tmp = Float64(Float64(Float64(1.0 / x) - Float64(0.5 / Float64(x * x))) / n); else tmp = Float64(0.0 / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 3.5e-284) tmp = log(x) * (1.0 / -n); elseif (x <= 2.3e-233) tmp = 1.0 / (n * x); elseif (x <= 0.96) tmp = (x - log(x)) / n; elseif (x <= 3.5e+90) tmp = ((1.0 / x) - (0.5 / (x * x))) / n; else tmp = 0.0 / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 3.5e-284], N[(N[Log[x], $MachinePrecision] * N[(1.0 / (-n)), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.3e-233], N[(1.0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.96], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 3.5e+90], N[(N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(0.0 / n), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.5 \cdot 10^{-284}:\\
\;\;\;\;\log x \cdot \frac{1}{-n}\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{-233}:\\
\;\;\;\;\frac{1}{n \cdot x}\\
\mathbf{elif}\;x \leq 0.96:\\
\;\;\;\;\frac{x - \log x}{n}\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+90}:\\
\;\;\;\;\frac{\frac{1}{x} - \frac{0.5}{x \cdot x}}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{n}\\
\end{array}
\end{array}
if x < 3.49999999999999975e-284Initial program 42.5%
Taylor expanded in n around inf 61.6%
log1p-def61.6%
Simplified61.6%
log1p-udef61.6%
diff-log61.6%
+-commutative61.6%
Applied egg-rr61.6%
frac-2neg61.6%
div-inv61.9%
neg-log61.9%
clear-num61.9%
Applied egg-rr61.9%
Taylor expanded in x around 0 61.9%
if 3.49999999999999975e-284 < x < 2.3000000000000002e-233Initial program 68.1%
Taylor expanded in n around inf 26.8%
log1p-def26.8%
Simplified26.8%
Taylor expanded in x around inf 52.2%
*-commutative52.2%
Simplified52.2%
if 2.3000000000000002e-233 < x < 0.95999999999999996Initial program 37.4%
Taylor expanded in n around inf 61.2%
log1p-def61.2%
Simplified61.2%
Taylor expanded in x around 0 61.1%
neg-mul-161.1%
sub-neg61.1%
Simplified61.1%
if 0.95999999999999996 < x < 3.4999999999999998e90Initial program 45.4%
Taylor expanded in n around inf 50.9%
log1p-def50.9%
Simplified50.9%
Taylor expanded in x around inf 68.4%
associate-*r/68.4%
metadata-eval68.4%
unpow268.4%
Simplified68.4%
if 3.4999999999999998e90 < x Initial program 83.2%
Taylor expanded in n around inf 83.2%
log1p-def83.2%
Simplified83.2%
log1p-udef83.2%
diff-log83.2%
+-commutative83.2%
Applied egg-rr83.2%
Taylor expanded in x around inf 83.2%
Final simplification67.1%
(FPCore (x n)
:precision binary64
(let* ((t_0 (/ (- (log x)) n)))
(if (<= x 5.4e-284)
t_0
(if (<= x 2.1e-233)
(/ 1.0 (* n x))
(if (<= x 0.68)
t_0
(if (<= x 1.15e+89)
(/ (- (/ 1.0 x) (/ 0.5 (* x x))) n)
(/ 0.0 n)))))))
double code(double x, double n) {
double t_0 = -log(x) / n;
double tmp;
if (x <= 5.4e-284) {
tmp = t_0;
} else if (x <= 2.1e-233) {
tmp = 1.0 / (n * x);
} else if (x <= 0.68) {
tmp = t_0;
} else if (x <= 1.15e+89) {
tmp = ((1.0 / x) - (0.5 / (x * x))) / n;
} else {
tmp = 0.0 / 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) :: tmp
t_0 = -log(x) / n
if (x <= 5.4d-284) then
tmp = t_0
else if (x <= 2.1d-233) then
tmp = 1.0d0 / (n * x)
else if (x <= 0.68d0) then
tmp = t_0
else if (x <= 1.15d+89) then
tmp = ((1.0d0 / x) - (0.5d0 / (x * x))) / n
else
tmp = 0.0d0 / n
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 <= 5.4e-284) {
tmp = t_0;
} else if (x <= 2.1e-233) {
tmp = 1.0 / (n * x);
} else if (x <= 0.68) {
tmp = t_0;
} else if (x <= 1.15e+89) {
tmp = ((1.0 / x) - (0.5 / (x * x))) / n;
} else {
tmp = 0.0 / n;
}
return tmp;
}
def code(x, n): t_0 = -math.log(x) / n tmp = 0 if x <= 5.4e-284: tmp = t_0 elif x <= 2.1e-233: tmp = 1.0 / (n * x) elif x <= 0.68: tmp = t_0 elif x <= 1.15e+89: tmp = ((1.0 / x) - (0.5 / (x * x))) / n else: tmp = 0.0 / n return tmp
function code(x, n) t_0 = Float64(Float64(-log(x)) / n) tmp = 0.0 if (x <= 5.4e-284) tmp = t_0; elseif (x <= 2.1e-233) tmp = Float64(1.0 / Float64(n * x)); elseif (x <= 0.68) tmp = t_0; elseif (x <= 1.15e+89) tmp = Float64(Float64(Float64(1.0 / x) - Float64(0.5 / Float64(x * x))) / n); else tmp = Float64(0.0 / n); end return tmp end
function tmp_2 = code(x, n) t_0 = -log(x) / n; tmp = 0.0; if (x <= 5.4e-284) tmp = t_0; elseif (x <= 2.1e-233) tmp = 1.0 / (n * x); elseif (x <= 0.68) tmp = t_0; elseif (x <= 1.15e+89) tmp = ((1.0 / x) - (0.5 / (x * x))) / n; else tmp = 0.0 / n; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision]}, If[LessEqual[x, 5.4e-284], t$95$0, If[LessEqual[x, 2.1e-233], N[(1.0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.68], t$95$0, If[LessEqual[x, 1.15e+89], N[(N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(0.0 / n), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-\log x}{n}\\
\mathbf{if}\;x \leq 5.4 \cdot 10^{-284}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-233}:\\
\;\;\;\;\frac{1}{n \cdot x}\\
\mathbf{elif}\;x \leq 0.68:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{+89}:\\
\;\;\;\;\frac{\frac{1}{x} - \frac{0.5}{x \cdot x}}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{n}\\
\end{array}
\end{array}
if x < 5.39999999999999969e-284 or 2.0999999999999999e-233 < x < 0.680000000000000049Initial program 38.0%
Taylor expanded in n around inf 61.2%
log1p-def61.2%
Simplified61.2%
Taylor expanded in x around 0 60.4%
neg-mul-160.4%
Simplified60.4%
if 5.39999999999999969e-284 < x < 2.0999999999999999e-233Initial program 68.1%
Taylor expanded in n around inf 26.8%
log1p-def26.8%
Simplified26.8%
Taylor expanded in x around inf 52.2%
*-commutative52.2%
Simplified52.2%
if 0.680000000000000049 < x < 1.1499999999999999e89Initial program 45.4%
Taylor expanded in n around inf 50.9%
log1p-def50.9%
Simplified50.9%
Taylor expanded in x around inf 68.4%
associate-*r/68.4%
metadata-eval68.4%
unpow268.4%
Simplified68.4%
if 1.1499999999999999e89 < x Initial program 83.2%
Taylor expanded in n around inf 83.2%
log1p-def83.2%
Simplified83.2%
log1p-udef83.2%
diff-log83.2%
+-commutative83.2%
Applied egg-rr83.2%
Taylor expanded in x around inf 83.2%
Final simplification66.7%
(FPCore (x n)
:precision binary64
(if (<= x 4e-233)
(- 1.0 (pow x (/ 1.0 n)))
(if (<= x 0.98)
(/ (- x (log x)) n)
(if (<= x 1.3e+90) (/ (- (/ 1.0 x) (/ 0.5 (* x x))) n) (/ 0.0 n)))))
double code(double x, double n) {
double tmp;
if (x <= 4e-233) {
tmp = 1.0 - pow(x, (1.0 / n));
} else if (x <= 0.98) {
tmp = (x - log(x)) / n;
} else if (x <= 1.3e+90) {
tmp = ((1.0 / x) - (0.5 / (x * x))) / n;
} else {
tmp = 0.0 / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 4d-233) then
tmp = 1.0d0 - (x ** (1.0d0 / n))
else if (x <= 0.98d0) then
tmp = (x - log(x)) / n
else if (x <= 1.3d+90) then
tmp = ((1.0d0 / x) - (0.5d0 / (x * x))) / n
else
tmp = 0.0d0 / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 4e-233) {
tmp = 1.0 - Math.pow(x, (1.0 / n));
} else if (x <= 0.98) {
tmp = (x - Math.log(x)) / n;
} else if (x <= 1.3e+90) {
tmp = ((1.0 / x) - (0.5 / (x * x))) / n;
} else {
tmp = 0.0 / n;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 4e-233: tmp = 1.0 - math.pow(x, (1.0 / n)) elif x <= 0.98: tmp = (x - math.log(x)) / n elif x <= 1.3e+90: tmp = ((1.0 / x) - (0.5 / (x * x))) / n else: tmp = 0.0 / n return tmp
function code(x, n) tmp = 0.0 if (x <= 4e-233) tmp = Float64(1.0 - (x ^ Float64(1.0 / n))); elseif (x <= 0.98) tmp = Float64(Float64(x - log(x)) / n); elseif (x <= 1.3e+90) tmp = Float64(Float64(Float64(1.0 / x) - Float64(0.5 / Float64(x * x))) / n); else tmp = Float64(0.0 / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 4e-233) tmp = 1.0 - (x ^ (1.0 / n)); elseif (x <= 0.98) tmp = (x - log(x)) / n; elseif (x <= 1.3e+90) tmp = ((1.0 / x) - (0.5 / (x * x))) / n; else tmp = 0.0 / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 4e-233], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.98], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 1.3e+90], N[(N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(0.0 / n), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4 \cdot 10^{-233}:\\
\;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{elif}\;x \leq 0.98:\\
\;\;\;\;\frac{x - \log x}{n}\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+90}:\\
\;\;\;\;\frac{\frac{1}{x} - \frac{0.5}{x \cdot x}}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{n}\\
\end{array}
\end{array}
if x < 3.99999999999999983e-233Initial program 58.4%
Taylor expanded in x around 0 58.4%
*-rgt-identity58.4%
associate-*r/58.4%
unpow-158.4%
exp-to-pow58.4%
unpow-158.4%
Simplified58.4%
if 3.99999999999999983e-233 < x < 0.97999999999999998Initial program 37.2%
Taylor expanded in n around inf 61.2%
log1p-def61.2%
Simplified61.2%
Taylor expanded in x around 0 61.1%
neg-mul-161.1%
sub-neg61.1%
Simplified61.1%
if 0.97999999999999998 < x < 1.2999999999999999e90Initial program 45.4%
Taylor expanded in n around inf 50.9%
log1p-def50.9%
Simplified50.9%
Taylor expanded in x around inf 68.4%
associate-*r/68.4%
metadata-eval68.4%
unpow268.4%
Simplified68.4%
if 1.2999999999999999e90 < x Initial program 83.2%
Taylor expanded in n around inf 83.2%
log1p-def83.2%
Simplified83.2%
log1p-udef83.2%
diff-log83.2%
+-commutative83.2%
Applied egg-rr83.2%
Taylor expanded in x around inf 83.2%
Final simplification67.5%
(FPCore (x n) :precision binary64 (if (or (<= (/ 1.0 n) -1e+24) (not (<= (/ 1.0 n) 1e-88))) (/ (/ n x) (* n n)) (/ (/ 1.0 x) n)))
double code(double x, double n) {
double tmp;
if (((1.0 / n) <= -1e+24) || !((1.0 / n) <= 1e-88)) {
tmp = (n / x) / (n * n);
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (((1.0d0 / n) <= (-1d+24)) .or. (.not. ((1.0d0 / n) <= 1d-88))) then
tmp = (n / x) / (n * n)
else
tmp = (1.0d0 / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (((1.0 / n) <= -1e+24) || !((1.0 / n) <= 1e-88)) {
tmp = (n / x) / (n * n);
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
def code(x, n): tmp = 0 if ((1.0 / n) <= -1e+24) or not ((1.0 / n) <= 1e-88): tmp = (n / x) / (n * n) else: tmp = (1.0 / x) / n return tmp
function code(x, n) tmp = 0.0 if ((Float64(1.0 / n) <= -1e+24) || !(Float64(1.0 / n) <= 1e-88)) tmp = Float64(Float64(n / x) / Float64(n * n)); else tmp = Float64(Float64(1.0 / x) / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (((1.0 / n) <= -1e+24) || ~(((1.0 / n) <= 1e-88))) tmp = (n / x) / (n * n); else tmp = (1.0 / x) / n; end tmp_2 = tmp; end
code[x_, n_] := If[Or[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+24], N[Not[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-88]], $MachinePrecision]], N[(N[(n / x), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+24} \lor \neg \left(\frac{1}{n} \leq 10^{-88}\right):\\
\;\;\;\;\frac{\frac{n}{x}}{n \cdot n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\end{array}
\end{array}
if (/.f64 1 n) < -9.9999999999999998e23 or 9.99999999999999934e-89 < (/.f64 1 n) Initial program 81.5%
Taylor expanded in n around inf 41.1%
log1p-def41.1%
Simplified41.1%
add-log-exp78.3%
div-inv78.3%
exp-prod78.3%
exp-diff78.3%
log1p-udef78.3%
add-exp-log51.4%
add-exp-log78.3%
+-commutative78.3%
Applied egg-rr78.3%
log-pow41.1%
associate-*l/41.1%
*-un-lft-identity41.1%
log-div41.1%
+-commutative41.1%
log1p-udef41.1%
div-sub41.1%
frac-sub51.7%
Applied egg-rr51.7%
*-commutative51.7%
distribute-lft-out--51.7%
Simplified51.7%
Taylor expanded in x around inf 42.4%
if -9.9999999999999998e23 < (/.f64 1 n) < 9.99999999999999934e-89Initial program 30.5%
Taylor expanded in n around inf 80.5%
log1p-def80.5%
Simplified80.5%
Taylor expanded in x around inf 44.4%
Final simplification43.5%
(FPCore (x n) :precision binary64 (if (<= (/ 1.0 n) -2e-35) (/ (* n (/ 1.0 x)) (* n n)) (if (<= (/ 1.0 n) 1e-88) (/ (/ 1.0 x) n) (/ (/ n x) (* n n)))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -2e-35) {
tmp = (n * (1.0 / x)) / (n * n);
} else if ((1.0 / n) <= 1e-88) {
tmp = (1.0 / x) / n;
} else {
tmp = (n / x) / (n * n);
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if ((1.0d0 / n) <= (-2d-35)) then
tmp = (n * (1.0d0 / x)) / (n * n)
else if ((1.0d0 / n) <= 1d-88) then
tmp = (1.0d0 / x) / n
else
tmp = (n / x) / (n * n)
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -2e-35) {
tmp = (n * (1.0 / x)) / (n * n);
} else if ((1.0 / n) <= 1e-88) {
tmp = (1.0 / x) / n;
} else {
tmp = (n / x) / (n * n);
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -2e-35: tmp = (n * (1.0 / x)) / (n * n) elif (1.0 / n) <= 1e-88: tmp = (1.0 / x) / n else: tmp = (n / x) / (n * n) return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-35) tmp = Float64(Float64(n * Float64(1.0 / x)) / Float64(n * n)); elseif (Float64(1.0 / n) <= 1e-88) tmp = Float64(Float64(1.0 / x) / n); else tmp = Float64(Float64(n / x) / Float64(n * n)); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -2e-35) tmp = (n * (1.0 / x)) / (n * n); elseif ((1.0 / n) <= 1e-88) tmp = (1.0 / x) / n; else tmp = (n / x) / (n * n); end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-35], N[(N[(n * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-88], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision], N[(N[(n / x), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-35}:\\
\;\;\;\;\frac{n \cdot \frac{1}{x}}{n \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{-88}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{n}{x}}{n \cdot n}\\
\end{array}
\end{array}
if (/.f64 1 n) < -2.00000000000000002e-35Initial program 91.0%
Taylor expanded in n around inf 44.4%
log1p-def44.4%
Simplified44.4%
add-log-exp90.0%
div-inv90.0%
exp-prod90.0%
exp-diff90.0%
log1p-udef90.0%
add-exp-log53.5%
add-exp-log90.0%
+-commutative90.0%
Applied egg-rr90.0%
log-pow44.4%
associate-*l/44.4%
*-un-lft-identity44.4%
log-div44.4%
+-commutative44.4%
log1p-udef44.4%
div-sub44.4%
frac-sub48.0%
Applied egg-rr48.0%
*-commutative48.0%
distribute-lft-out--48.0%
Simplified48.0%
Taylor expanded in x around inf 45.0%
if -2.00000000000000002e-35 < (/.f64 1 n) < 9.99999999999999934e-89Initial program 29.7%
Taylor expanded in n around inf 85.7%
log1p-def85.7%
Simplified85.7%
Taylor expanded in x around inf 44.3%
if 9.99999999999999934e-89 < (/.f64 1 n) Initial program 47.1%
Taylor expanded in n around inf 30.7%
log1p-def30.7%
Simplified30.7%
add-log-exp40.5%
div-inv40.5%
exp-prod40.5%
exp-diff40.5%
log1p-udef40.5%
add-exp-log40.5%
add-exp-log40.5%
+-commutative40.5%
Applied egg-rr40.5%
log-pow30.7%
associate-*l/30.7%
*-un-lft-identity30.7%
log-div30.7%
+-commutative30.7%
log1p-udef30.7%
div-sub30.7%
frac-sub53.1%
Applied egg-rr53.1%
*-commutative53.1%
distribute-lft-out--53.1%
Simplified53.1%
Taylor expanded in x around inf 37.8%
Final simplification43.5%
(FPCore (x n) :precision binary64 (if (<= x 1.0) (/ (/ n x) (* n n)) (if (<= x 9.6e+89) (/ (- (/ 1.0 x) (/ 0.5 (* x x))) n) (/ 0.0 n))))
double code(double x, double n) {
double tmp;
if (x <= 1.0) {
tmp = (n / x) / (n * n);
} else if (x <= 9.6e+89) {
tmp = ((1.0 / x) - (0.5 / (x * x))) / n;
} else {
tmp = 0.0 / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 1.0d0) then
tmp = (n / x) / (n * n)
else if (x <= 9.6d+89) then
tmp = ((1.0d0 / x) - (0.5d0 / (x * x))) / n
else
tmp = 0.0d0 / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 1.0) {
tmp = (n / x) / (n * n);
} else if (x <= 9.6e+89) {
tmp = ((1.0 / x) - (0.5 / (x * x))) / n;
} else {
tmp = 0.0 / n;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 1.0: tmp = (n / x) / (n * n) elif x <= 9.6e+89: tmp = ((1.0 / x) - (0.5 / (x * x))) / n else: tmp = 0.0 / n return tmp
function code(x, n) tmp = 0.0 if (x <= 1.0) tmp = Float64(Float64(n / x) / Float64(n * n)); elseif (x <= 9.6e+89) tmp = Float64(Float64(Float64(1.0 / x) - Float64(0.5 / Float64(x * x))) / n); else tmp = Float64(0.0 / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 1.0) tmp = (n / x) / (n * n); elseif (x <= 9.6e+89) tmp = ((1.0 / x) - (0.5 / (x * x))) / n; else tmp = 0.0 / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 1.0], N[(N[(n / x), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.6e+89], N[(N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(0.0 / n), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\frac{\frac{n}{x}}{n \cdot n}\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{+89}:\\
\;\;\;\;\frac{\frac{1}{x} - \frac{0.5}{x \cdot x}}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{n}\\
\end{array}
\end{array}
if x < 1Initial program 42.7%
Taylor expanded in n around inf 55.9%
log1p-def55.9%
Simplified55.9%
add-log-exp41.0%
div-inv41.0%
exp-prod41.0%
exp-diff41.0%
log1p-udef41.0%
add-exp-log41.0%
add-exp-log41.0%
+-commutative41.0%
Applied egg-rr41.0%
log-pow55.9%
associate-*l/55.9%
*-un-lft-identity55.9%
log-div55.9%
+-commutative55.9%
log1p-udef55.9%
div-sub55.9%
frac-sub48.4%
Applied egg-rr48.4%
*-commutative48.4%
distribute-lft-out--48.4%
Simplified48.4%
Taylor expanded in x around inf 28.4%
if 1 < x < 9.60000000000000018e89Initial program 45.4%
Taylor expanded in n around inf 50.9%
log1p-def50.9%
Simplified50.9%
Taylor expanded in x around inf 68.4%
associate-*r/68.4%
metadata-eval68.4%
unpow268.4%
Simplified68.4%
if 9.60000000000000018e89 < x Initial program 83.2%
Taylor expanded in n around inf 83.2%
log1p-def83.2%
Simplified83.2%
log1p-udef83.2%
diff-log83.2%
+-commutative83.2%
Applied egg-rr83.2%
Taylor expanded in x around inf 83.2%
Final simplification48.1%
(FPCore (x n) :precision binary64 (if (<= x 1.0) (/ (/ n x) (* n n)) (/ (- (/ 1.0 x) (/ 0.5 (* x x))) n)))
double code(double x, double n) {
double tmp;
if (x <= 1.0) {
tmp = (n / x) / (n * n);
} else {
tmp = ((1.0 / x) - (0.5 / (x * x))) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 1.0d0) then
tmp = (n / x) / (n * n)
else
tmp = ((1.0d0 / x) - (0.5d0 / (x * x))) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 1.0) {
tmp = (n / x) / (n * n);
} else {
tmp = ((1.0 / x) - (0.5 / (x * x))) / n;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 1.0: tmp = (n / x) / (n * n) else: tmp = ((1.0 / x) - (0.5 / (x * x))) / n return tmp
function code(x, n) tmp = 0.0 if (x <= 1.0) tmp = Float64(Float64(n / x) / Float64(n * n)); else tmp = Float64(Float64(Float64(1.0 / x) - Float64(0.5 / Float64(x * x))) / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 1.0) tmp = (n / x) / (n * n); else tmp = ((1.0 / x) - (0.5 / (x * x))) / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 1.0], N[(N[(n / x), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\frac{\frac{n}{x}}{n \cdot n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x} - \frac{0.5}{x \cdot x}}{n}\\
\end{array}
\end{array}
if x < 1Initial program 42.7%
Taylor expanded in n around inf 55.9%
log1p-def55.9%
Simplified55.9%
add-log-exp41.0%
div-inv41.0%
exp-prod41.0%
exp-diff41.0%
log1p-udef41.0%
add-exp-log41.0%
add-exp-log41.0%
+-commutative41.0%
Applied egg-rr41.0%
log-pow55.9%
associate-*l/55.9%
*-un-lft-identity55.9%
log-div55.9%
+-commutative55.9%
log1p-udef55.9%
div-sub55.9%
frac-sub48.4%
Applied egg-rr48.4%
*-commutative48.4%
distribute-lft-out--48.4%
Simplified48.4%
Taylor expanded in x around inf 28.4%
if 1 < x Initial program 70.8%
Taylor expanded in n around inf 72.6%
log1p-def72.6%
Simplified72.6%
Taylor expanded in x around inf 63.9%
associate-*r/63.9%
metadata-eval63.9%
unpow263.9%
Simplified63.9%
Final simplification42.4%
(FPCore (x n) :precision binary64 (/ 1.0 (* n x)))
double code(double x, double n) {
return 1.0 / (n * x);
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
code = 1.0d0 / (n * x)
end function
public static double code(double x, double n) {
return 1.0 / (n * x);
}
def code(x, n): return 1.0 / (n * x)
function code(x, n) return Float64(1.0 / Float64(n * x)) end
function tmp = code(x, n) tmp = 1.0 / (n * x); end
code[x_, n_] := N[(1.0 / N[(n * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{n \cdot x}
\end{array}
Initial program 53.8%
Taylor expanded in n around inf 62.5%
log1p-def62.5%
Simplified62.5%
Taylor expanded in x around inf 37.1%
*-commutative37.1%
Simplified37.1%
Final simplification37.1%
(FPCore (x n) :precision binary64 (/ (/ 1.0 x) n))
double code(double x, double n) {
return (1.0 / x) / n;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
code = (1.0d0 / x) / n
end function
public static double code(double x, double n) {
return (1.0 / x) / n;
}
def code(x, n): return (1.0 / x) / n
function code(x, n) return Float64(Float64(1.0 / x) / n) end
function tmp = code(x, n) tmp = (1.0 / x) / n; end
code[x_, n_] := N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1}{x}}{n}
\end{array}
Initial program 53.8%
Taylor expanded in n around inf 62.5%
log1p-def62.5%
Simplified62.5%
Taylor expanded in x around inf 37.6%
Final simplification37.6%
(FPCore (x n) :precision binary64 (/ x n))
double code(double x, double n) {
return x / n;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
code = x / n
end function
public static double code(double x, double n) {
return x / n;
}
def code(x, n): return x / n
function code(x, n) return Float64(x / n) end
function tmp = code(x, n) tmp = x / n; end
code[x_, n_] := N[(x / n), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{n}
\end{array}
Initial program 53.8%
Taylor expanded in x around 0 33.3%
Taylor expanded in x around inf 4.6%
Final simplification4.6%
herbie shell --seed 2023227
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))