
(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 20 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))) (t_1 (/ (/ t_0 x) n)))
(if (<= (/ 1.0 n) -1e-5)
t_1
(if (<= (/ 1.0 n) 2e-133)
(/
(+
(* 0.5 (/ (- (pow (log1p x) 2.0) (pow (log x) 2.0)) n))
(- (log1p x) (log x)))
n)
(if (<= (/ 1.0 n) 2e-7) t_1 (- (pow E (/ (log1p x) n)) t_0))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double t_1 = (t_0 / x) / n;
double tmp;
if ((1.0 / n) <= -1e-5) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-133) {
tmp = ((0.5 * ((pow(log1p(x), 2.0) - pow(log(x), 2.0)) / n)) + (log1p(x) - log(x))) / n;
} else if ((1.0 / n) <= 2e-7) {
tmp = t_1;
} else {
tmp = pow(((double) M_E), (log1p(x) / n)) - t_0;
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double t_1 = (t_0 / x) / n;
double tmp;
if ((1.0 / n) <= -1e-5) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-133) {
tmp = ((0.5 * ((Math.pow(Math.log1p(x), 2.0) - Math.pow(Math.log(x), 2.0)) / n)) + (Math.log1p(x) - Math.log(x))) / n;
} else if ((1.0 / n) <= 2e-7) {
tmp = t_1;
} else {
tmp = Math.pow(Math.E, (Math.log1p(x) / n)) - t_0;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) t_1 = (t_0 / x) / n tmp = 0 if (1.0 / n) <= -1e-5: tmp = t_1 elif (1.0 / n) <= 2e-133: tmp = ((0.5 * ((math.pow(math.log1p(x), 2.0) - math.pow(math.log(x), 2.0)) / n)) + (math.log1p(x) - math.log(x))) / n elif (1.0 / n) <= 2e-7: tmp = t_1 else: tmp = math.pow(math.e, (math.log1p(x) / n)) - t_0 return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) t_1 = Float64(Float64(t_0 / x) / n) tmp = 0.0 if (Float64(1.0 / n) <= -1e-5) tmp = t_1; elseif (Float64(1.0 / n) <= 2e-133) tmp = Float64(Float64(Float64(0.5 * Float64(Float64((log1p(x) ^ 2.0) - (log(x) ^ 2.0)) / n)) + Float64(log1p(x) - log(x))) / n); elseif (Float64(1.0 / n) <= 2e-7) tmp = t_1; else tmp = Float64((exp(1) ^ Float64(log1p(x) / n)) - t_0); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-5], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-133], N[(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[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-7], t$95$1, N[(N[Power[E, N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{\frac{t\_0}{x}}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-133}:\\
\;\;\;\;\frac{0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} + \left(\mathsf{log1p}\left(x\right) - \log x\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;{e}^{\left(\frac{\mathsf{log1p}\left(x\right)}{n}\right)} - t\_0\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -1.00000000000000008e-5 or 2.0000000000000001e-133 < (/.f64 #s(literal 1 binary64) n) < 1.9999999999999999e-7Initial program 75.5%
Taylor expanded in x around inf
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6492.2
Simplified92.2%
if -1.00000000000000008e-5 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e-133Initial program 38.7%
Taylor expanded in n around inf
/-lowering-/.f64N/A
Simplified83.7%
if 1.9999999999999999e-7 < (/.f64 #s(literal 1 binary64) n) Initial program 47.1%
pow-to-expN/A
exp-lowering-exp.f64N/A
un-div-invN/A
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-log1p.f6499.8
Applied egg-rr99.8%
*-lft-identityN/A
exp-prodN/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-log1p.f64100.0
Applied egg-rr100.0%
Final simplification89.6%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))) (t_1 (/ (/ t_0 x) n)))
(if (<= (/ 1.0 n) -5e-145)
t_1
(if (<= (/ 1.0 n) 2e-133)
(* (/ -1.0 n) (log (/ x (+ 1.0 x))))
(if (<= (/ 1.0 n) 2e-7) t_1 (- (pow E (/ (log1p x) n)) t_0))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double t_1 = (t_0 / x) / n;
double tmp;
if ((1.0 / n) <= -5e-145) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-133) {
tmp = (-1.0 / n) * log((x / (1.0 + x)));
} else if ((1.0 / n) <= 2e-7) {
tmp = t_1;
} else {
tmp = pow(((double) M_E), (log1p(x) / n)) - t_0;
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double t_1 = (t_0 / x) / n;
double tmp;
if ((1.0 / n) <= -5e-145) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-133) {
tmp = (-1.0 / n) * Math.log((x / (1.0 + x)));
} else if ((1.0 / n) <= 2e-7) {
tmp = t_1;
} else {
tmp = Math.pow(Math.E, (Math.log1p(x) / n)) - t_0;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) t_1 = (t_0 / x) / n tmp = 0 if (1.0 / n) <= -5e-145: tmp = t_1 elif (1.0 / n) <= 2e-133: tmp = (-1.0 / n) * math.log((x / (1.0 + x))) elif (1.0 / n) <= 2e-7: tmp = t_1 else: tmp = math.pow(math.e, (math.log1p(x) / n)) - t_0 return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) t_1 = Float64(Float64(t_0 / x) / n) tmp = 0.0 if (Float64(1.0 / n) <= -5e-145) tmp = t_1; elseif (Float64(1.0 / n) <= 2e-133) tmp = Float64(Float64(-1.0 / n) * log(Float64(x / Float64(1.0 + x)))); elseif (Float64(1.0 / n) <= 2e-7) tmp = t_1; else tmp = Float64((exp(1) ^ Float64(log1p(x) / n)) - t_0); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e-145], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-133], N[(N[(-1.0 / n), $MachinePrecision] * N[Log[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-7], t$95$1, N[(N[Power[E, N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{\frac{t\_0}{x}}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-133}:\\
\;\;\;\;\frac{-1}{n} \cdot \log \left(\frac{x}{1 + x}\right)\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;{e}^{\left(\frac{\mathsf{log1p}\left(x\right)}{n}\right)} - t\_0\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -4.9999999999999998e-145 or 2.0000000000000001e-133 < (/.f64 #s(literal 1 binary64) n) < 1.9999999999999999e-7Initial program 63.3%
Taylor expanded in x around inf
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6484.6
Simplified84.6%
if -4.9999999999999998e-145 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e-133Initial program 44.7%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6491.1
Simplified91.1%
/-lowering-/.f64N/A
diff-logN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6491.1
Applied egg-rr91.1%
frac-2negN/A
log-recN/A
*-lft-identityN/A
associate-*l/N/A
distribute-frac-neg2N/A
*-lowering-*.f64N/A
neg-mul-1N/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6491.2
Applied egg-rr91.2%
if 1.9999999999999999e-7 < (/.f64 #s(literal 1 binary64) n) Initial program 47.1%
pow-to-expN/A
exp-lowering-exp.f64N/A
un-div-invN/A
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-log1p.f6499.8
Applied egg-rr99.8%
*-lft-identityN/A
exp-prodN/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-log1p.f64100.0
Applied egg-rr100.0%
Final simplification89.5%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))) (t_1 (/ (/ t_0 x) n)))
(if (<= (/ 1.0 n) -5e-145)
t_1
(if (<= (/ 1.0 n) 2e-133)
(* (/ -1.0 n) (log (/ x (+ 1.0 x))))
(if (<= (/ 1.0 n) 2e-7) t_1 (- (exp (/ x n)) t_0))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double t_1 = (t_0 / x) / n;
double tmp;
if ((1.0 / n) <= -5e-145) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-133) {
tmp = (-1.0 / n) * log((x / (1.0 + x)));
} else if ((1.0 / n) <= 2e-7) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = x ** (1.0d0 / n)
t_1 = (t_0 / x) / n
if ((1.0d0 / n) <= (-5d-145)) then
tmp = t_1
else if ((1.0d0 / n) <= 2d-133) then
tmp = ((-1.0d0) / n) * log((x / (1.0d0 + x)))
else if ((1.0d0 / n) <= 2d-7) then
tmp = t_1
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 t_1 = (t_0 / x) / n;
double tmp;
if ((1.0 / n) <= -5e-145) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-133) {
tmp = (-1.0 / n) * Math.log((x / (1.0 + x)));
} else if ((1.0 / n) <= 2e-7) {
tmp = t_1;
} else {
tmp = Math.exp((x / n)) - t_0;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) t_1 = (t_0 / x) / n tmp = 0 if (1.0 / n) <= -5e-145: tmp = t_1 elif (1.0 / n) <= 2e-133: tmp = (-1.0 / n) * math.log((x / (1.0 + x))) elif (1.0 / n) <= 2e-7: tmp = t_1 else: tmp = math.exp((x / n)) - t_0 return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) t_1 = Float64(Float64(t_0 / x) / n) tmp = 0.0 if (Float64(1.0 / n) <= -5e-145) tmp = t_1; elseif (Float64(1.0 / n) <= 2e-133) tmp = Float64(Float64(-1.0 / n) * log(Float64(x / Float64(1.0 + x)))); elseif (Float64(1.0 / n) <= 2e-7) tmp = t_1; 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); t_1 = (t_0 / x) / n; tmp = 0.0; if ((1.0 / n) <= -5e-145) tmp = t_1; elseif ((1.0 / n) <= 2e-133) tmp = (-1.0 / n) * log((x / (1.0 + x))); elseif ((1.0 / n) <= 2e-7) tmp = t_1; 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]}, Block[{t$95$1 = N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e-145], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-133], N[(N[(-1.0 / n), $MachinePrecision] * N[Log[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-7], t$95$1, 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)}\\
t_1 := \frac{\frac{t\_0}{x}}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-133}:\\
\;\;\;\;\frac{-1}{n} \cdot \log \left(\frac{x}{1 + x}\right)\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{x}{n}} - t\_0\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -4.9999999999999998e-145 or 2.0000000000000001e-133 < (/.f64 #s(literal 1 binary64) n) < 1.9999999999999999e-7Initial program 63.3%
Taylor expanded in x around inf
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6484.6
Simplified84.6%
if -4.9999999999999998e-145 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e-133Initial program 44.7%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6491.1
Simplified91.1%
/-lowering-/.f64N/A
diff-logN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6491.1
Applied egg-rr91.1%
frac-2negN/A
log-recN/A
*-lft-identityN/A
associate-*l/N/A
distribute-frac-neg2N/A
*-lowering-*.f64N/A
neg-mul-1N/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6491.2
Applied egg-rr91.2%
if 1.9999999999999999e-7 < (/.f64 #s(literal 1 binary64) n) Initial program 47.1%
pow-to-expN/A
exp-lowering-exp.f64N/A
un-div-invN/A
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-log1p.f6499.8
Applied egg-rr99.8%
Taylor expanded in x around 0
/-lowering-/.f6499.8
Simplified99.8%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))) (t_1 (/ (/ t_0 x) n)))
(if (<= (/ 1.0 n) -5e-145)
t_1
(if (<= (/ 1.0 n) 2e-133)
(* (/ -1.0 n) (log (/ x (+ 1.0 x))))
(if (<= (/ 1.0 n) 2e-7)
t_1
(- (+ 1.0 (* x (+ (/ 1.0 n) (/ (/ (* x 0.5) n) n)))) t_0))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double t_1 = (t_0 / x) / n;
double tmp;
if ((1.0 / n) <= -5e-145) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-133) {
tmp = (-1.0 / n) * log((x / (1.0 + x)));
} else if ((1.0 / n) <= 2e-7) {
tmp = t_1;
} else {
tmp = (1.0 + (x * ((1.0 / n) + (((x * 0.5) / n) / 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) :: t_1
real(8) :: tmp
t_0 = x ** (1.0d0 / n)
t_1 = (t_0 / x) / n
if ((1.0d0 / n) <= (-5d-145)) then
tmp = t_1
else if ((1.0d0 / n) <= 2d-133) then
tmp = ((-1.0d0) / n) * log((x / (1.0d0 + x)))
else if ((1.0d0 / n) <= 2d-7) then
tmp = t_1
else
tmp = (1.0d0 + (x * ((1.0d0 / n) + (((x * 0.5d0) / n) / 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 t_1 = (t_0 / x) / n;
double tmp;
if ((1.0 / n) <= -5e-145) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-133) {
tmp = (-1.0 / n) * Math.log((x / (1.0 + x)));
} else if ((1.0 / n) <= 2e-7) {
tmp = t_1;
} else {
tmp = (1.0 + (x * ((1.0 / n) + (((x * 0.5) / n) / n)))) - t_0;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) t_1 = (t_0 / x) / n tmp = 0 if (1.0 / n) <= -5e-145: tmp = t_1 elif (1.0 / n) <= 2e-133: tmp = (-1.0 / n) * math.log((x / (1.0 + x))) elif (1.0 / n) <= 2e-7: tmp = t_1 else: tmp = (1.0 + (x * ((1.0 / n) + (((x * 0.5) / n) / n)))) - t_0 return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) t_1 = Float64(Float64(t_0 / x) / n) tmp = 0.0 if (Float64(1.0 / n) <= -5e-145) tmp = t_1; elseif (Float64(1.0 / n) <= 2e-133) tmp = Float64(Float64(-1.0 / n) * log(Float64(x / Float64(1.0 + x)))); elseif (Float64(1.0 / n) <= 2e-7) tmp = t_1; else tmp = Float64(Float64(1.0 + Float64(x * Float64(Float64(1.0 / n) + Float64(Float64(Float64(x * 0.5) / n) / n)))) - t_0); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); t_1 = (t_0 / x) / n; tmp = 0.0; if ((1.0 / n) <= -5e-145) tmp = t_1; elseif ((1.0 / n) <= 2e-133) tmp = (-1.0 / n) * log((x / (1.0 + x))); elseif ((1.0 / n) <= 2e-7) tmp = t_1; else tmp = (1.0 + (x * ((1.0 / n) + (((x * 0.5) / n) / n)))) - t_0; 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 / x), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e-145], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-133], N[(N[(-1.0 / n), $MachinePrecision] * N[Log[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-7], t$95$1, N[(N[(1.0 + N[(x * N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(x * 0.5), $MachinePrecision] / n), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{\frac{t\_0}{x}}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-133}:\\
\;\;\;\;\frac{-1}{n} \cdot \log \left(\frac{x}{1 + x}\right)\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x \cdot \left(\frac{1}{n} + \frac{\frac{x \cdot 0.5}{n}}{n}\right)\right) - t\_0\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -4.9999999999999998e-145 or 2.0000000000000001e-133 < (/.f64 #s(literal 1 binary64) n) < 1.9999999999999999e-7Initial program 63.3%
Taylor expanded in x around inf
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6484.6
Simplified84.6%
if -4.9999999999999998e-145 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e-133Initial program 44.7%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6491.1
Simplified91.1%
/-lowering-/.f64N/A
diff-logN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6491.1
Applied egg-rr91.1%
frac-2negN/A
log-recN/A
*-lft-identityN/A
associate-*l/N/A
distribute-frac-neg2N/A
*-lowering-*.f64N/A
neg-mul-1N/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6491.2
Applied egg-rr91.2%
if 1.9999999999999999e-7 < (/.f64 #s(literal 1 binary64) n) Initial program 47.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f6468.6
Simplified68.6%
Taylor expanded in n around 0
associate-*r/N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6473.3
Simplified73.3%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))) (t_1 (/ (/ t_0 x) n)))
(if (<= (/ 1.0 n) -5e-145)
t_1
(if (<= (/ 1.0 n) 2e-133)
(* (/ -1.0 n) (log (/ x (+ 1.0 x))))
(if (<= (/ 1.0 n) 2e-7)
t_1
(if (<= (/ 1.0 n) 8e+142)
(- (+ 1.0 (/ x n)) t_0)
(/ 0.3333333333333333 (* x (* x (* n x))))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double t_1 = (t_0 / x) / n;
double tmp;
if ((1.0 / n) <= -5e-145) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-133) {
tmp = (-1.0 / n) * log((x / (1.0 + x)));
} else if ((1.0 / n) <= 2e-7) {
tmp = t_1;
} else if ((1.0 / n) <= 8e+142) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = 0.3333333333333333 / (x * (x * (n * 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 / x) / n
if ((1.0d0 / n) <= (-5d-145)) then
tmp = t_1
else if ((1.0d0 / n) <= 2d-133) then
tmp = ((-1.0d0) / n) * log((x / (1.0d0 + x)))
else if ((1.0d0 / n) <= 2d-7) then
tmp = t_1
else if ((1.0d0 / n) <= 8d+142) then
tmp = (1.0d0 + (x / n)) - t_0
else
tmp = 0.3333333333333333d0 / (x * (x * (n * 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 / x) / n;
double tmp;
if ((1.0 / n) <= -5e-145) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-133) {
tmp = (-1.0 / n) * Math.log((x / (1.0 + x)));
} else if ((1.0 / n) <= 2e-7) {
tmp = t_1;
} else if ((1.0 / n) <= 8e+142) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = 0.3333333333333333 / (x * (x * (n * x)));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) t_1 = (t_0 / x) / n tmp = 0 if (1.0 / n) <= -5e-145: tmp = t_1 elif (1.0 / n) <= 2e-133: tmp = (-1.0 / n) * math.log((x / (1.0 + x))) elif (1.0 / n) <= 2e-7: tmp = t_1 elif (1.0 / n) <= 8e+142: tmp = (1.0 + (x / n)) - t_0 else: tmp = 0.3333333333333333 / (x * (x * (n * x))) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) t_1 = Float64(Float64(t_0 / x) / n) tmp = 0.0 if (Float64(1.0 / n) <= -5e-145) tmp = t_1; elseif (Float64(1.0 / n) <= 2e-133) tmp = Float64(Float64(-1.0 / n) * log(Float64(x / Float64(1.0 + x)))); elseif (Float64(1.0 / n) <= 2e-7) tmp = t_1; elseif (Float64(1.0 / n) <= 8e+142) tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0); else tmp = Float64(0.3333333333333333 / Float64(x * Float64(x * Float64(n * x)))); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); t_1 = (t_0 / x) / n; tmp = 0.0; if ((1.0 / n) <= -5e-145) tmp = t_1; elseif ((1.0 / n) <= 2e-133) tmp = (-1.0 / n) * log((x / (1.0 + x))); elseif ((1.0 / n) <= 2e-7) tmp = t_1; elseif ((1.0 / n) <= 8e+142) tmp = (1.0 + (x / n)) - t_0; else tmp = 0.3333333333333333 / (x * (x * (n * 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 / x), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e-145], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-133], N[(N[(-1.0 / n), $MachinePrecision] * N[Log[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-7], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 8e+142], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(0.3333333333333333 / N[(x * N[(x * N[(n * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{\frac{t\_0}{x}}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-133}:\\
\;\;\;\;\frac{-1}{n} \cdot \log \left(\frac{x}{1 + x}\right)\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 8 \cdot 10^{+142}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333}{x \cdot \left(x \cdot \left(n \cdot x\right)\right)}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -4.9999999999999998e-145 or 2.0000000000000001e-133 < (/.f64 #s(literal 1 binary64) n) < 1.9999999999999999e-7Initial program 63.3%
Taylor expanded in x around inf
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6484.6
Simplified84.6%
if -4.9999999999999998e-145 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e-133Initial program 44.7%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6491.1
Simplified91.1%
/-lowering-/.f64N/A
diff-logN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6491.1
Applied egg-rr91.1%
frac-2negN/A
log-recN/A
*-lft-identityN/A
associate-*l/N/A
distribute-frac-neg2N/A
*-lowering-*.f64N/A
neg-mul-1N/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6491.2
Applied egg-rr91.2%
if 1.9999999999999999e-7 < (/.f64 #s(literal 1 binary64) n) < 8.00000000000000041e142Initial program 80.6%
Taylor expanded in x around 0
*-rgt-identityN/A
associate-*r/N/A
+-lowering-+.f64N/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f6474.3
Simplified74.3%
if 8.00000000000000041e142 < (/.f64 #s(literal 1 binary64) n) Initial program 29.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f645.9
Simplified5.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
Simplified66.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6466.0
Simplified66.0%
Final simplification84.3%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))) (t_1 (/ (/ t_0 x) n)))
(if (<= (/ 1.0 n) -5e-145)
t_1
(if (<= (/ 1.0 n) 2e-133)
(* (/ -1.0 n) (log (/ x (+ 1.0 x))))
(if (<= (/ 1.0 n) 2e-7)
t_1
(if (<= (/ 1.0 n) 8e+142)
(- 1.0 t_0)
(/ 0.3333333333333333 (* x (* x (* n x))))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double t_1 = (t_0 / x) / n;
double tmp;
if ((1.0 / n) <= -5e-145) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-133) {
tmp = (-1.0 / n) * log((x / (1.0 + x)));
} else if ((1.0 / n) <= 2e-7) {
tmp = t_1;
} else if ((1.0 / n) <= 8e+142) {
tmp = 1.0 - t_0;
} else {
tmp = 0.3333333333333333 / (x * (x * (n * 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 / x) / n
if ((1.0d0 / n) <= (-5d-145)) then
tmp = t_1
else if ((1.0d0 / n) <= 2d-133) then
tmp = ((-1.0d0) / n) * log((x / (1.0d0 + x)))
else if ((1.0d0 / n) <= 2d-7) then
tmp = t_1
else if ((1.0d0 / n) <= 8d+142) then
tmp = 1.0d0 - t_0
else
tmp = 0.3333333333333333d0 / (x * (x * (n * 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 / x) / n;
double tmp;
if ((1.0 / n) <= -5e-145) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-133) {
tmp = (-1.0 / n) * Math.log((x / (1.0 + x)));
} else if ((1.0 / n) <= 2e-7) {
tmp = t_1;
} else if ((1.0 / n) <= 8e+142) {
tmp = 1.0 - t_0;
} else {
tmp = 0.3333333333333333 / (x * (x * (n * x)));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) t_1 = (t_0 / x) / n tmp = 0 if (1.0 / n) <= -5e-145: tmp = t_1 elif (1.0 / n) <= 2e-133: tmp = (-1.0 / n) * math.log((x / (1.0 + x))) elif (1.0 / n) <= 2e-7: tmp = t_1 elif (1.0 / n) <= 8e+142: tmp = 1.0 - t_0 else: tmp = 0.3333333333333333 / (x * (x * (n * x))) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) t_1 = Float64(Float64(t_0 / x) / n) tmp = 0.0 if (Float64(1.0 / n) <= -5e-145) tmp = t_1; elseif (Float64(1.0 / n) <= 2e-133) tmp = Float64(Float64(-1.0 / n) * log(Float64(x / Float64(1.0 + x)))); elseif (Float64(1.0 / n) <= 2e-7) tmp = t_1; elseif (Float64(1.0 / n) <= 8e+142) tmp = Float64(1.0 - t_0); else tmp = Float64(0.3333333333333333 / Float64(x * Float64(x * Float64(n * x)))); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); t_1 = (t_0 / x) / n; tmp = 0.0; if ((1.0 / n) <= -5e-145) tmp = t_1; elseif ((1.0 / n) <= 2e-133) tmp = (-1.0 / n) * log((x / (1.0 + x))); elseif ((1.0 / n) <= 2e-7) tmp = t_1; elseif ((1.0 / n) <= 8e+142) tmp = 1.0 - t_0; else tmp = 0.3333333333333333 / (x * (x * (n * 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 / x), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e-145], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-133], N[(N[(-1.0 / n), $MachinePrecision] * N[Log[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-7], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 8e+142], N[(1.0 - t$95$0), $MachinePrecision], N[(0.3333333333333333 / N[(x * N[(x * N[(n * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{\frac{t\_0}{x}}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-133}:\\
\;\;\;\;\frac{-1}{n} \cdot \log \left(\frac{x}{1 + x}\right)\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 8 \cdot 10^{+142}:\\
\;\;\;\;1 - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333}{x \cdot \left(x \cdot \left(n \cdot x\right)\right)}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -4.9999999999999998e-145 or 2.0000000000000001e-133 < (/.f64 #s(literal 1 binary64) n) < 1.9999999999999999e-7Initial program 63.3%
Taylor expanded in x around inf
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6484.6
Simplified84.6%
if -4.9999999999999998e-145 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e-133Initial program 44.7%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6491.1
Simplified91.1%
/-lowering-/.f64N/A
diff-logN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6491.1
Applied egg-rr91.1%
frac-2negN/A
log-recN/A
*-lft-identityN/A
associate-*l/N/A
distribute-frac-neg2N/A
*-lowering-*.f64N/A
neg-mul-1N/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6491.2
Applied egg-rr91.2%
if 1.9999999999999999e-7 < (/.f64 #s(literal 1 binary64) n) < 8.00000000000000041e142Initial program 80.6%
Taylor expanded in x around 0
remove-double-negN/A
mul-1-negN/A
distribute-neg-fracN/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
--lowering--.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6474.2
Simplified74.2%
if 8.00000000000000041e142 < (/.f64 #s(literal 1 binary64) n) Initial program 29.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f645.9
Simplified5.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
Simplified66.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6466.0
Simplified66.0%
Final simplification84.2%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))) (t_1 (/ (/ t_0 x) n)))
(if (<= (/ 1.0 n) -5e-145)
t_1
(if (<= (/ 1.0 n) 2e-133)
(/ (log (/ x (+ 1.0 x))) (- 0.0 n))
(if (<= (/ 1.0 n) 2e-7)
t_1
(if (<= (/ 1.0 n) 8e+142)
(- 1.0 t_0)
(/ 0.3333333333333333 (* x (* x (* n x))))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double t_1 = (t_0 / x) / n;
double tmp;
if ((1.0 / n) <= -5e-145) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-133) {
tmp = log((x / (1.0 + x))) / (0.0 - n);
} else if ((1.0 / n) <= 2e-7) {
tmp = t_1;
} else if ((1.0 / n) <= 8e+142) {
tmp = 1.0 - t_0;
} else {
tmp = 0.3333333333333333 / (x * (x * (n * 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 / x) / n
if ((1.0d0 / n) <= (-5d-145)) then
tmp = t_1
else if ((1.0d0 / n) <= 2d-133) then
tmp = log((x / (1.0d0 + x))) / (0.0d0 - n)
else if ((1.0d0 / n) <= 2d-7) then
tmp = t_1
else if ((1.0d0 / n) <= 8d+142) then
tmp = 1.0d0 - t_0
else
tmp = 0.3333333333333333d0 / (x * (x * (n * 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 / x) / n;
double tmp;
if ((1.0 / n) <= -5e-145) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-133) {
tmp = Math.log((x / (1.0 + x))) / (0.0 - n);
} else if ((1.0 / n) <= 2e-7) {
tmp = t_1;
} else if ((1.0 / n) <= 8e+142) {
tmp = 1.0 - t_0;
} else {
tmp = 0.3333333333333333 / (x * (x * (n * x)));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) t_1 = (t_0 / x) / n tmp = 0 if (1.0 / n) <= -5e-145: tmp = t_1 elif (1.0 / n) <= 2e-133: tmp = math.log((x / (1.0 + x))) / (0.0 - n) elif (1.0 / n) <= 2e-7: tmp = t_1 elif (1.0 / n) <= 8e+142: tmp = 1.0 - t_0 else: tmp = 0.3333333333333333 / (x * (x * (n * x))) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) t_1 = Float64(Float64(t_0 / x) / n) tmp = 0.0 if (Float64(1.0 / n) <= -5e-145) tmp = t_1; elseif (Float64(1.0 / n) <= 2e-133) tmp = Float64(log(Float64(x / Float64(1.0 + x))) / Float64(0.0 - n)); elseif (Float64(1.0 / n) <= 2e-7) tmp = t_1; elseif (Float64(1.0 / n) <= 8e+142) tmp = Float64(1.0 - t_0); else tmp = Float64(0.3333333333333333 / Float64(x * Float64(x * Float64(n * x)))); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); t_1 = (t_0 / x) / n; tmp = 0.0; if ((1.0 / n) <= -5e-145) tmp = t_1; elseif ((1.0 / n) <= 2e-133) tmp = log((x / (1.0 + x))) / (0.0 - n); elseif ((1.0 / n) <= 2e-7) tmp = t_1; elseif ((1.0 / n) <= 8e+142) tmp = 1.0 - t_0; else tmp = 0.3333333333333333 / (x * (x * (n * 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 / x), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e-145], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-133], N[(N[Log[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-7], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 8e+142], N[(1.0 - t$95$0), $MachinePrecision], N[(0.3333333333333333 / N[(x * N[(x * N[(n * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{\frac{t\_0}{x}}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-133}:\\
\;\;\;\;\frac{\log \left(\frac{x}{1 + x}\right)}{0 - n}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 8 \cdot 10^{+142}:\\
\;\;\;\;1 - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333}{x \cdot \left(x \cdot \left(n \cdot x\right)\right)}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -4.9999999999999998e-145 or 2.0000000000000001e-133 < (/.f64 #s(literal 1 binary64) n) < 1.9999999999999999e-7Initial program 63.3%
Taylor expanded in x around inf
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6484.6
Simplified84.6%
if -4.9999999999999998e-145 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e-133Initial program 44.7%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6491.1
Simplified91.1%
diff-logN/A
clear-numN/A
log-recN/A
neg-lowering-neg.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6491.2
Applied egg-rr91.2%
if 1.9999999999999999e-7 < (/.f64 #s(literal 1 binary64) n) < 8.00000000000000041e142Initial program 80.6%
Taylor expanded in x around 0
remove-double-negN/A
mul-1-negN/A
distribute-neg-fracN/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
--lowering--.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6474.2
Simplified74.2%
if 8.00000000000000041e142 < (/.f64 #s(literal 1 binary64) n) Initial program 29.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f645.9
Simplified5.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
Simplified66.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6466.0
Simplified66.0%
Final simplification84.2%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -1e+66)
(/ (/ 0.3333333333333333 (* x (* x x))) n)
(if (<= (/ 1.0 n) 2e-133)
(/ (log (/ x (+ 1.0 x))) (- 0.0 n))
(if (<= (/ 1.0 n) 2e-17)
(/ 1.0 (* x (+ n (/ (* n 0.5) x))))
(if (<= (/ 1.0 n) 8e+142)
(- 1.0 (pow x (/ 1.0 n)))
(/ 0.3333333333333333 (* x (* x (* n x)))))))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e+66) {
tmp = (0.3333333333333333 / (x * (x * x))) / n;
} else if ((1.0 / n) <= 2e-133) {
tmp = log((x / (1.0 + x))) / (0.0 - n);
} else if ((1.0 / n) <= 2e-17) {
tmp = 1.0 / (x * (n + ((n * 0.5) / x)));
} else if ((1.0 / n) <= 8e+142) {
tmp = 1.0 - pow(x, (1.0 / n));
} else {
tmp = 0.3333333333333333 / (x * (x * (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+66)) then
tmp = (0.3333333333333333d0 / (x * (x * x))) / n
else if ((1.0d0 / n) <= 2d-133) then
tmp = log((x / (1.0d0 + x))) / (0.0d0 - n)
else if ((1.0d0 / n) <= 2d-17) then
tmp = 1.0d0 / (x * (n + ((n * 0.5d0) / x)))
else if ((1.0d0 / n) <= 8d+142) then
tmp = 1.0d0 - (x ** (1.0d0 / n))
else
tmp = 0.3333333333333333d0 / (x * (x * (n * x)))
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e+66) {
tmp = (0.3333333333333333 / (x * (x * x))) / n;
} else if ((1.0 / n) <= 2e-133) {
tmp = Math.log((x / (1.0 + x))) / (0.0 - n);
} else if ((1.0 / n) <= 2e-17) {
tmp = 1.0 / (x * (n + ((n * 0.5) / x)));
} else if ((1.0 / n) <= 8e+142) {
tmp = 1.0 - Math.pow(x, (1.0 / n));
} else {
tmp = 0.3333333333333333 / (x * (x * (n * x)));
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -1e+66: tmp = (0.3333333333333333 / (x * (x * x))) / n elif (1.0 / n) <= 2e-133: tmp = math.log((x / (1.0 + x))) / (0.0 - n) elif (1.0 / n) <= 2e-17: tmp = 1.0 / (x * (n + ((n * 0.5) / x))) elif (1.0 / n) <= 8e+142: tmp = 1.0 - math.pow(x, (1.0 / n)) else: tmp = 0.3333333333333333 / (x * (x * (n * x))) return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -1e+66) tmp = Float64(Float64(0.3333333333333333 / Float64(x * Float64(x * x))) / n); elseif (Float64(1.0 / n) <= 2e-133) tmp = Float64(log(Float64(x / Float64(1.0 + x))) / Float64(0.0 - n)); elseif (Float64(1.0 / n) <= 2e-17) tmp = Float64(1.0 / Float64(x * Float64(n + Float64(Float64(n * 0.5) / x)))); elseif (Float64(1.0 / n) <= 8e+142) tmp = Float64(1.0 - (x ^ Float64(1.0 / n))); else tmp = Float64(0.3333333333333333 / Float64(x * Float64(x * Float64(n * x)))); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -1e+66) tmp = (0.3333333333333333 / (x * (x * x))) / n; elseif ((1.0 / n) <= 2e-133) tmp = log((x / (1.0 + x))) / (0.0 - n); elseif ((1.0 / n) <= 2e-17) tmp = 1.0 / (x * (n + ((n * 0.5) / x))); elseif ((1.0 / n) <= 8e+142) tmp = 1.0 - (x ^ (1.0 / n)); else tmp = 0.3333333333333333 / (x * (x * (n * x))); end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+66], N[(N[(0.3333333333333333 / N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-133], N[(N[Log[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-17], N[(1.0 / N[(x * N[(n + N[(N[(n * 0.5), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 8e+142], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 / N[(x * N[(x * N[(n * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+66}:\\
\;\;\;\;\frac{\frac{0.3333333333333333}{x \cdot \left(x \cdot x\right)}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-133}:\\
\;\;\;\;\frac{\log \left(\frac{x}{1 + x}\right)}{0 - n}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-17}:\\
\;\;\;\;\frac{1}{x \cdot \left(n + \frac{n \cdot 0.5}{x}\right)}\\
\mathbf{elif}\;\frac{1}{n} \leq 8 \cdot 10^{+142}:\\
\;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333}{x \cdot \left(x \cdot \left(n \cdot x\right)\right)}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -9.99999999999999945e65Initial program 100.0%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6450.1
Simplified50.1%
Taylor expanded in x around inf
/-lowering-/.f64N/A
Simplified48.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6487.9
Simplified87.9%
if -9.99999999999999945e65 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e-133Initial program 47.5%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6478.0
Simplified78.0%
diff-logN/A
clear-numN/A
log-recN/A
neg-lowering-neg.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6478.0
Applied egg-rr78.0%
if 2.0000000000000001e-133 < (/.f64 #s(literal 1 binary64) n) < 2.00000000000000014e-17Initial program 14.7%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6443.9
Simplified43.9%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
diff-logN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6443.9
Applied egg-rr43.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-lft-neg-inN/A
/-lowering-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-lowering-*.f6471.1
Simplified71.1%
if 2.00000000000000014e-17 < (/.f64 #s(literal 1 binary64) n) < 8.00000000000000041e142Initial program 75.2%
Taylor expanded in x around 0
remove-double-negN/A
mul-1-negN/A
distribute-neg-fracN/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
--lowering--.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6468.9
Simplified68.9%
if 8.00000000000000041e142 < (/.f64 #s(literal 1 binary64) n) Initial program 29.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f645.9
Simplified5.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
Simplified66.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6466.0
Simplified66.0%
Final simplification77.3%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -1e+66)
(/ (/ 0.3333333333333333 (* x (* x x))) n)
(if (<= (/ 1.0 n) 2e-133)
(/ (log (/ (+ 1.0 x) x)) n)
(if (<= (/ 1.0 n) 2e-17)
(/ 1.0 (* x (+ n (/ (* n 0.5) x))))
(if (<= (/ 1.0 n) 8e+142)
(- 1.0 (pow x (/ 1.0 n)))
(/ 0.3333333333333333 (* x (* x (* n x)))))))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e+66) {
tmp = (0.3333333333333333 / (x * (x * x))) / n;
} else if ((1.0 / n) <= 2e-133) {
tmp = log(((1.0 + x) / x)) / n;
} else if ((1.0 / n) <= 2e-17) {
tmp = 1.0 / (x * (n + ((n * 0.5) / x)));
} else if ((1.0 / n) <= 8e+142) {
tmp = 1.0 - pow(x, (1.0 / n));
} else {
tmp = 0.3333333333333333 / (x * (x * (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+66)) then
tmp = (0.3333333333333333d0 / (x * (x * x))) / n
else if ((1.0d0 / n) <= 2d-133) then
tmp = log(((1.0d0 + x) / x)) / n
else if ((1.0d0 / n) <= 2d-17) then
tmp = 1.0d0 / (x * (n + ((n * 0.5d0) / x)))
else if ((1.0d0 / n) <= 8d+142) then
tmp = 1.0d0 - (x ** (1.0d0 / n))
else
tmp = 0.3333333333333333d0 / (x * (x * (n * x)))
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e+66) {
tmp = (0.3333333333333333 / (x * (x * x))) / n;
} else if ((1.0 / n) <= 2e-133) {
tmp = Math.log(((1.0 + x) / x)) / n;
} else if ((1.0 / n) <= 2e-17) {
tmp = 1.0 / (x * (n + ((n * 0.5) / x)));
} else if ((1.0 / n) <= 8e+142) {
tmp = 1.0 - Math.pow(x, (1.0 / n));
} else {
tmp = 0.3333333333333333 / (x * (x * (n * x)));
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -1e+66: tmp = (0.3333333333333333 / (x * (x * x))) / n elif (1.0 / n) <= 2e-133: tmp = math.log(((1.0 + x) / x)) / n elif (1.0 / n) <= 2e-17: tmp = 1.0 / (x * (n + ((n * 0.5) / x))) elif (1.0 / n) <= 8e+142: tmp = 1.0 - math.pow(x, (1.0 / n)) else: tmp = 0.3333333333333333 / (x * (x * (n * x))) return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -1e+66) tmp = Float64(Float64(0.3333333333333333 / Float64(x * Float64(x * x))) / n); elseif (Float64(1.0 / n) <= 2e-133) tmp = Float64(log(Float64(Float64(1.0 + x) / x)) / n); elseif (Float64(1.0 / n) <= 2e-17) tmp = Float64(1.0 / Float64(x * Float64(n + Float64(Float64(n * 0.5) / x)))); elseif (Float64(1.0 / n) <= 8e+142) tmp = Float64(1.0 - (x ^ Float64(1.0 / n))); else tmp = Float64(0.3333333333333333 / Float64(x * Float64(x * Float64(n * x)))); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -1e+66) tmp = (0.3333333333333333 / (x * (x * x))) / n; elseif ((1.0 / n) <= 2e-133) tmp = log(((1.0 + x) / x)) / n; elseif ((1.0 / n) <= 2e-17) tmp = 1.0 / (x * (n + ((n * 0.5) / x))); elseif ((1.0 / n) <= 8e+142) tmp = 1.0 - (x ^ (1.0 / n)); else tmp = 0.3333333333333333 / (x * (x * (n * x))); end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+66], N[(N[(0.3333333333333333 / N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-133], N[(N[Log[N[(N[(1.0 + x), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-17], N[(1.0 / N[(x * N[(n + N[(N[(n * 0.5), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 8e+142], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 / N[(x * N[(x * N[(n * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+66}:\\
\;\;\;\;\frac{\frac{0.3333333333333333}{x \cdot \left(x \cdot x\right)}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-133}:\\
\;\;\;\;\frac{\log \left(\frac{1 + x}{x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-17}:\\
\;\;\;\;\frac{1}{x \cdot \left(n + \frac{n \cdot 0.5}{x}\right)}\\
\mathbf{elif}\;\frac{1}{n} \leq 8 \cdot 10^{+142}:\\
\;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333}{x \cdot \left(x \cdot \left(n \cdot x\right)\right)}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -9.99999999999999945e65Initial program 100.0%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6450.1
Simplified50.1%
Taylor expanded in x around inf
/-lowering-/.f64N/A
Simplified48.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6487.9
Simplified87.9%
if -9.99999999999999945e65 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e-133Initial program 47.5%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6478.0
Simplified78.0%
/-lowering-/.f64N/A
diff-logN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6478.0
Applied egg-rr78.0%
if 2.0000000000000001e-133 < (/.f64 #s(literal 1 binary64) n) < 2.00000000000000014e-17Initial program 14.7%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6443.9
Simplified43.9%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
diff-logN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6443.9
Applied egg-rr43.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-lft-neg-inN/A
/-lowering-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-lowering-*.f6471.1
Simplified71.1%
if 2.00000000000000014e-17 < (/.f64 #s(literal 1 binary64) n) < 8.00000000000000041e142Initial program 75.2%
Taylor expanded in x around 0
remove-double-negN/A
mul-1-negN/A
distribute-neg-fracN/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
--lowering--.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6468.9
Simplified68.9%
if 8.00000000000000041e142 < (/.f64 #s(literal 1 binary64) n) Initial program 29.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f645.9
Simplified5.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
Simplified66.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6466.0
Simplified66.0%
Final simplification77.3%
(FPCore (x n)
:precision binary64
(let* ((t_0 (+ -0.5 (/ 0.3333333333333333 x))) (t_1 (/ t_0 x)))
(if (<= x 3.5e-88)
(/ 1.0 (/ n (- x (log x))))
(if (<= x 7.8e+119)
(* (/ (/ 1.0 n) (/ x (- 1.0 (/ t_1 (/ x t_0))))) (/ 1.0 (- 1.0 t_1)))
0.0))))
double code(double x, double n) {
double t_0 = -0.5 + (0.3333333333333333 / x);
double t_1 = t_0 / x;
double tmp;
if (x <= 3.5e-88) {
tmp = 1.0 / (n / (x - log(x)));
} else if (x <= 7.8e+119) {
tmp = ((1.0 / n) / (x / (1.0 - (t_1 / (x / t_0))))) * (1.0 / (1.0 - t_1));
} 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 = (-0.5d0) + (0.3333333333333333d0 / x)
t_1 = t_0 / x
if (x <= 3.5d-88) then
tmp = 1.0d0 / (n / (x - log(x)))
else if (x <= 7.8d+119) then
tmp = ((1.0d0 / n) / (x / (1.0d0 - (t_1 / (x / t_0))))) * (1.0d0 / (1.0d0 - t_1))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = -0.5 + (0.3333333333333333 / x);
double t_1 = t_0 / x;
double tmp;
if (x <= 3.5e-88) {
tmp = 1.0 / (n / (x - Math.log(x)));
} else if (x <= 7.8e+119) {
tmp = ((1.0 / n) / (x / (1.0 - (t_1 / (x / t_0))))) * (1.0 / (1.0 - t_1));
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): t_0 = -0.5 + (0.3333333333333333 / x) t_1 = t_0 / x tmp = 0 if x <= 3.5e-88: tmp = 1.0 / (n / (x - math.log(x))) elif x <= 7.8e+119: tmp = ((1.0 / n) / (x / (1.0 - (t_1 / (x / t_0))))) * (1.0 / (1.0 - t_1)) else: tmp = 0.0 return tmp
function code(x, n) t_0 = Float64(-0.5 + Float64(0.3333333333333333 / x)) t_1 = Float64(t_0 / x) tmp = 0.0 if (x <= 3.5e-88) tmp = Float64(1.0 / Float64(n / Float64(x - log(x)))); elseif (x <= 7.8e+119) tmp = Float64(Float64(Float64(1.0 / n) / Float64(x / Float64(1.0 - Float64(t_1 / Float64(x / t_0))))) * Float64(1.0 / Float64(1.0 - t_1))); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) t_0 = -0.5 + (0.3333333333333333 / x); t_1 = t_0 / x; tmp = 0.0; if (x <= 3.5e-88) tmp = 1.0 / (n / (x - log(x))); elseif (x <= 7.8e+119) tmp = ((1.0 / n) / (x / (1.0 - (t_1 / (x / t_0))))) * (1.0 / (1.0 - t_1)); else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(-0.5 + N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / x), $MachinePrecision]}, If[LessEqual[x, 3.5e-88], N[(1.0 / N[(n / N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.8e+119], N[(N[(N[(1.0 / n), $MachinePrecision] / N[(x / N[(1.0 - N[(t$95$1 / N[(x / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.5 + \frac{0.3333333333333333}{x}\\
t_1 := \frac{t\_0}{x}\\
\mathbf{if}\;x \leq 3.5 \cdot 10^{-88}:\\
\;\;\;\;\frac{1}{\frac{n}{x - \log x}}\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{+119}:\\
\;\;\;\;\frac{\frac{1}{n}}{\frac{x}{1 - \frac{t\_1}{\frac{x}{t\_0}}}} \cdot \frac{1}{1 - t\_1}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 3.5000000000000001e-88Initial program 42.2%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6451.5
Simplified51.5%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
diff-logN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6451.5
Applied egg-rr51.5%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6451.5
Simplified51.5%
if 3.5000000000000001e-88 < x < 7.7999999999999997e119Initial program 43.8%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6442.8
Simplified42.8%
Taylor expanded in x around inf
/-lowering-/.f64N/A
Simplified54.6%
div-invN/A
clear-numN/A
associate-*l/N/A
*-commutativeN/A
flip-+N/A
associate-/r/N/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr60.2%
if 7.7999999999999997e119 < x Initial program 81.0%
Taylor expanded in x around 0
remove-double-negN/A
mul-1-negN/A
distribute-neg-fracN/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
--lowering--.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6451.0
Simplified51.0%
Taylor expanded in n around inf
Simplified81.0%
metadata-eval81.0
Applied egg-rr81.0%
(FPCore (x n)
:precision binary64
(let* ((t_0 (+ -0.5 (/ 0.3333333333333333 x))) (t_1 (/ t_0 x)))
(if (<= x 3.95e-88)
(/ (log x) (- 0.0 n))
(if (<= x 1.85e+119)
(* (/ (/ 1.0 n) (/ x (- 1.0 (/ t_1 (/ x t_0))))) (/ 1.0 (- 1.0 t_1)))
0.0))))
double code(double x, double n) {
double t_0 = -0.5 + (0.3333333333333333 / x);
double t_1 = t_0 / x;
double tmp;
if (x <= 3.95e-88) {
tmp = log(x) / (0.0 - n);
} else if (x <= 1.85e+119) {
tmp = ((1.0 / n) / (x / (1.0 - (t_1 / (x / t_0))))) * (1.0 / (1.0 - t_1));
} 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 = (-0.5d0) + (0.3333333333333333d0 / x)
t_1 = t_0 / x
if (x <= 3.95d-88) then
tmp = log(x) / (0.0d0 - n)
else if (x <= 1.85d+119) then
tmp = ((1.0d0 / n) / (x / (1.0d0 - (t_1 / (x / t_0))))) * (1.0d0 / (1.0d0 - t_1))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = -0.5 + (0.3333333333333333 / x);
double t_1 = t_0 / x;
double tmp;
if (x <= 3.95e-88) {
tmp = Math.log(x) / (0.0 - n);
} else if (x <= 1.85e+119) {
tmp = ((1.0 / n) / (x / (1.0 - (t_1 / (x / t_0))))) * (1.0 / (1.0 - t_1));
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): t_0 = -0.5 + (0.3333333333333333 / x) t_1 = t_0 / x tmp = 0 if x <= 3.95e-88: tmp = math.log(x) / (0.0 - n) elif x <= 1.85e+119: tmp = ((1.0 / n) / (x / (1.0 - (t_1 / (x / t_0))))) * (1.0 / (1.0 - t_1)) else: tmp = 0.0 return tmp
function code(x, n) t_0 = Float64(-0.5 + Float64(0.3333333333333333 / x)) t_1 = Float64(t_0 / x) tmp = 0.0 if (x <= 3.95e-88) tmp = Float64(log(x) / Float64(0.0 - n)); elseif (x <= 1.85e+119) tmp = Float64(Float64(Float64(1.0 / n) / Float64(x / Float64(1.0 - Float64(t_1 / Float64(x / t_0))))) * Float64(1.0 / Float64(1.0 - t_1))); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) t_0 = -0.5 + (0.3333333333333333 / x); t_1 = t_0 / x; tmp = 0.0; if (x <= 3.95e-88) tmp = log(x) / (0.0 - n); elseif (x <= 1.85e+119) tmp = ((1.0 / n) / (x / (1.0 - (t_1 / (x / t_0))))) * (1.0 / (1.0 - t_1)); else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(-0.5 + N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / x), $MachinePrecision]}, If[LessEqual[x, 3.95e-88], N[(N[Log[x], $MachinePrecision] / N[(0.0 - n), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.85e+119], N[(N[(N[(1.0 / n), $MachinePrecision] / N[(x / N[(1.0 - N[(t$95$1 / N[(x / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.5 + \frac{0.3333333333333333}{x}\\
t_1 := \frac{t\_0}{x}\\
\mathbf{if}\;x \leq 3.95 \cdot 10^{-88}:\\
\;\;\;\;\frac{\log x}{0 - n}\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{+119}:\\
\;\;\;\;\frac{\frac{1}{n}}{\frac{x}{1 - \frac{t\_1}{\frac{x}{t\_0}}}} \cdot \frac{1}{1 - t\_1}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 3.94999999999999983e-88Initial program 42.2%
Taylor expanded in x around 0
remove-double-negN/A
mul-1-negN/A
distribute-neg-fracN/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
--lowering--.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6442.2
Simplified42.2%
Taylor expanded in n around inf
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
log-lowering-log.f64N/A
neg-lowering-neg.f6451.5
Simplified51.5%
if 3.94999999999999983e-88 < x < 1.85e119Initial program 43.8%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6442.8
Simplified42.8%
Taylor expanded in x around inf
/-lowering-/.f64N/A
Simplified54.6%
div-invN/A
clear-numN/A
associate-*l/N/A
*-commutativeN/A
flip-+N/A
associate-/r/N/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr60.2%
if 1.85e119 < x Initial program 81.0%
Taylor expanded in x around 0
remove-double-negN/A
mul-1-negN/A
distribute-neg-fracN/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
--lowering--.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6451.0
Simplified51.0%
Taylor expanded in n around inf
Simplified81.0%
metadata-eval81.0
Applied egg-rr81.0%
Final simplification62.9%
(FPCore (x n)
:precision binary64
(if (<= n -7.6)
(/ (/ 1.0 x) n)
(if (<= n 2e-88)
(/ (/ 0.3333333333333333 (* x (* x x))) n)
(/ 1.0 (* x (+ n (/ (* n 0.5) x)))))))
double code(double x, double n) {
double tmp;
if (n <= -7.6) {
tmp = (1.0 / x) / n;
} else if (n <= 2e-88) {
tmp = (0.3333333333333333 / (x * (x * x))) / n;
} else {
tmp = 1.0 / (x * (n + ((n * 0.5) / x)));
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-7.6d0)) then
tmp = (1.0d0 / x) / n
else if (n <= 2d-88) then
tmp = (0.3333333333333333d0 / (x * (x * x))) / n
else
tmp = 1.0d0 / (x * (n + ((n * 0.5d0) / x)))
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (n <= -7.6) {
tmp = (1.0 / x) / n;
} else if (n <= 2e-88) {
tmp = (0.3333333333333333 / (x * (x * x))) / n;
} else {
tmp = 1.0 / (x * (n + ((n * 0.5) / x)));
}
return tmp;
}
def code(x, n): tmp = 0 if n <= -7.6: tmp = (1.0 / x) / n elif n <= 2e-88: tmp = (0.3333333333333333 / (x * (x * x))) / n else: tmp = 1.0 / (x * (n + ((n * 0.5) / x))) return tmp
function code(x, n) tmp = 0.0 if (n <= -7.6) tmp = Float64(Float64(1.0 / x) / n); elseif (n <= 2e-88) tmp = Float64(Float64(0.3333333333333333 / Float64(x * Float64(x * x))) / n); else tmp = Float64(1.0 / Float64(x * Float64(n + Float64(Float64(n * 0.5) / x)))); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (n <= -7.6) tmp = (1.0 / x) / n; elseif (n <= 2e-88) tmp = (0.3333333333333333 / (x * (x * x))) / n; else tmp = 1.0 / (x * (n + ((n * 0.5) / x))); end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[n, -7.6], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[n, 2e-88], N[(N[(0.3333333333333333 / N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(1.0 / N[(x * N[(n + N[(N[(n * 0.5), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -7.6:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\mathbf{elif}\;n \leq 2 \cdot 10^{-88}:\\
\;\;\;\;\frac{\frac{0.3333333333333333}{x \cdot \left(x \cdot x\right)}}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \left(n + \frac{n \cdot 0.5}{x}\right)}\\
\end{array}
\end{array}
if n < -7.5999999999999996Initial program 33.5%
Taylor expanded in x around inf
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6460.7
Simplified60.7%
Taylor expanded in n around inf
Simplified57.2%
if -7.5999999999999996 < n < 1.99999999999999987e-88Initial program 78.3%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6437.0
Simplified37.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
Simplified47.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6469.2
Simplified69.2%
if 1.99999999999999987e-88 < n Initial program 40.3%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6472.6
Simplified72.6%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
diff-logN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6472.7
Applied egg-rr72.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-lft-neg-inN/A
/-lowering-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-lowering-*.f6451.2
Simplified51.2%
(FPCore (x n) :precision binary64 (if (<= (/ 1.0 n) -100000000000.0) (/ (/ 0.3333333333333333 (* x (* x x))) n) (/ (/ (+ 1.0 (/ (+ -0.5 (/ 0.3333333333333333 x)) x)) x) n)))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -100000000000.0) {
tmp = (0.3333333333333333 / (x * (x * x))) / n;
} else {
tmp = ((1.0 + ((-0.5 + (0.3333333333333333 / x)) / 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 ((1.0d0 / n) <= (-100000000000.0d0)) then
tmp = (0.3333333333333333d0 / (x * (x * x))) / n
else
tmp = ((1.0d0 + (((-0.5d0) + (0.3333333333333333d0 / x)) / x)) / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -100000000000.0) {
tmp = (0.3333333333333333 / (x * (x * x))) / n;
} else {
tmp = ((1.0 + ((-0.5 + (0.3333333333333333 / x)) / x)) / x) / n;
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -100000000000.0: tmp = (0.3333333333333333 / (x * (x * x))) / n else: tmp = ((1.0 + ((-0.5 + (0.3333333333333333 / x)) / x)) / x) / n return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -100000000000.0) tmp = Float64(Float64(0.3333333333333333 / Float64(x * Float64(x * x))) / n); else tmp = Float64(Float64(Float64(1.0 + Float64(Float64(-0.5 + Float64(0.3333333333333333 / x)) / x)) / x) / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -100000000000.0) tmp = (0.3333333333333333 / (x * (x * x))) / n; else tmp = ((1.0 + ((-0.5 + (0.3333333333333333 / x)) / x)) / x) / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -100000000000.0], N[(N[(0.3333333333333333 / N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[(N[(1.0 + N[(N[(-0.5 + N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -100000000000:\\
\;\;\;\;\frac{\frac{0.3333333333333333}{x \cdot \left(x \cdot x\right)}}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \frac{-0.5 + \frac{0.3333333333333333}{x}}{x}}{x}}{n}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -1e11Initial program 100.0%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6454.2
Simplified54.2%
Taylor expanded in x around inf
/-lowering-/.f64N/A
Simplified42.1%
Taylor expanded in x around 0
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.3
Simplified76.3%
if -1e11 < (/.f64 #s(literal 1 binary64) n) Initial program 37.4%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6458.6
Simplified58.6%
Taylor expanded in x around inf
/-lowering-/.f64N/A
Simplified53.3%
(FPCore (x n)
:precision binary64
(let* ((t_0 (/ (/ 1.0 x) n)))
(if (<= n -4.6)
t_0
(if (<= n 1.08e-85) (/ (/ 0.3333333333333333 (* x (* x x))) n) t_0))))
double code(double x, double n) {
double t_0 = (1.0 / x) / n;
double tmp;
if (n <= -4.6) {
tmp = t_0;
} else if (n <= 1.08e-85) {
tmp = (0.3333333333333333 / (x * (x * x))) / n;
} else {
tmp = 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 = (1.0d0 / x) / n
if (n <= (-4.6d0)) then
tmp = t_0
else if (n <= 1.08d-85) then
tmp = (0.3333333333333333d0 / (x * (x * x))) / n
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = (1.0 / x) / n;
double tmp;
if (n <= -4.6) {
tmp = t_0;
} else if (n <= 1.08e-85) {
tmp = (0.3333333333333333 / (x * (x * x))) / n;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, n): t_0 = (1.0 / x) / n tmp = 0 if n <= -4.6: tmp = t_0 elif n <= 1.08e-85: tmp = (0.3333333333333333 / (x * (x * x))) / n else: tmp = t_0 return tmp
function code(x, n) t_0 = Float64(Float64(1.0 / x) / n) tmp = 0.0 if (n <= -4.6) tmp = t_0; elseif (n <= 1.08e-85) tmp = Float64(Float64(0.3333333333333333 / Float64(x * Float64(x * x))) / n); else tmp = t_0; end return tmp end
function tmp_2 = code(x, n) t_0 = (1.0 / x) / n; tmp = 0.0; if (n <= -4.6) tmp = t_0; elseif (n <= 1.08e-85) tmp = (0.3333333333333333 / (x * (x * x))) / n; else tmp = t_0; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[n, -4.6], t$95$0, If[LessEqual[n, 1.08e-85], N[(N[(0.3333333333333333 / N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{1}{x}}{n}\\
\mathbf{if}\;n \leq -4.6:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 1.08 \cdot 10^{-85}:\\
\;\;\;\;\frac{\frac{0.3333333333333333}{x \cdot \left(x \cdot x\right)}}{n}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -4.5999999999999996 or 1.07999999999999997e-85 < n Initial program 37.1%
Taylor expanded in x around inf
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6455.0
Simplified55.0%
Taylor expanded in n around inf
Simplified53.0%
if -4.5999999999999996 < n < 1.07999999999999997e-85Initial program 78.3%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6437.0
Simplified37.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
Simplified47.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6469.2
Simplified69.2%
(FPCore (x n)
:precision binary64
(let* ((t_0 (/ (/ 1.0 x) n)))
(if (<= n -5.0)
t_0
(if (<= n 1.7e-86) (/ 0.3333333333333333 (* x (* x (* n x)))) t_0))))
double code(double x, double n) {
double t_0 = (1.0 / x) / n;
double tmp;
if (n <= -5.0) {
tmp = t_0;
} else if (n <= 1.7e-86) {
tmp = 0.3333333333333333 / (x * (x * (n * x)));
} else {
tmp = 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 = (1.0d0 / x) / n
if (n <= (-5.0d0)) then
tmp = t_0
else if (n <= 1.7d-86) then
tmp = 0.3333333333333333d0 / (x * (x * (n * x)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = (1.0 / x) / n;
double tmp;
if (n <= -5.0) {
tmp = t_0;
} else if (n <= 1.7e-86) {
tmp = 0.3333333333333333 / (x * (x * (n * x)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, n): t_0 = (1.0 / x) / n tmp = 0 if n <= -5.0: tmp = t_0 elif n <= 1.7e-86: tmp = 0.3333333333333333 / (x * (x * (n * x))) else: tmp = t_0 return tmp
function code(x, n) t_0 = Float64(Float64(1.0 / x) / n) tmp = 0.0 if (n <= -5.0) tmp = t_0; elseif (n <= 1.7e-86) tmp = Float64(0.3333333333333333 / Float64(x * Float64(x * Float64(n * x)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, n) t_0 = (1.0 / x) / n; tmp = 0.0; if (n <= -5.0) tmp = t_0; elseif (n <= 1.7e-86) tmp = 0.3333333333333333 / (x * (x * (n * x))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[n, -5.0], t$95$0, If[LessEqual[n, 1.7e-86], N[(0.3333333333333333 / N[(x * N[(x * N[(n * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{1}{x}}{n}\\
\mathbf{if}\;n \leq -5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 1.7 \cdot 10^{-86}:\\
\;\;\;\;\frac{0.3333333333333333}{x \cdot \left(x \cdot \left(n \cdot x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -5 or 1.7e-86 < n Initial program 37.1%
Taylor expanded in x around inf
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6455.0
Simplified55.0%
Taylor expanded in n around inf
Simplified53.0%
if -5 < n < 1.7e-86Initial program 78.3%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6437.0
Simplified37.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
Simplified47.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6463.2
Simplified63.2%
Final simplification57.2%
(FPCore (x n) :precision binary64 (if (<= (/ 1.0 n) -100000000000.0) (/ (/ 0.3333333333333333 (* x (* x x))) n) (/ (/ (+ 1.0 (/ 0.3333333333333333 (* x x))) x) n)))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -100000000000.0) {
tmp = (0.3333333333333333 / (x * (x * x))) / n;
} else {
tmp = ((1.0 + (0.3333333333333333 / (x * 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 ((1.0d0 / n) <= (-100000000000.0d0)) then
tmp = (0.3333333333333333d0 / (x * (x * x))) / n
else
tmp = ((1.0d0 + (0.3333333333333333d0 / (x * x))) / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -100000000000.0) {
tmp = (0.3333333333333333 / (x * (x * x))) / n;
} else {
tmp = ((1.0 + (0.3333333333333333 / (x * x))) / x) / n;
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -100000000000.0: tmp = (0.3333333333333333 / (x * (x * x))) / n else: tmp = ((1.0 + (0.3333333333333333 / (x * x))) / x) / n return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -100000000000.0) tmp = Float64(Float64(0.3333333333333333 / Float64(x * Float64(x * x))) / n); else tmp = Float64(Float64(Float64(1.0 + Float64(0.3333333333333333 / Float64(x * x))) / x) / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -100000000000.0) tmp = (0.3333333333333333 / (x * (x * x))) / n; else tmp = ((1.0 + (0.3333333333333333 / (x * x))) / x) / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -100000000000.0], N[(N[(0.3333333333333333 / N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[(N[(1.0 + N[(0.3333333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -100000000000:\\
\;\;\;\;\frac{\frac{0.3333333333333333}{x \cdot \left(x \cdot x\right)}}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \frac{0.3333333333333333}{x \cdot x}}{x}}{n}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -1e11Initial program 100.0%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6454.2
Simplified54.2%
Taylor expanded in x around inf
/-lowering-/.f64N/A
Simplified42.1%
Taylor expanded in x around 0
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.3
Simplified76.3%
if -1e11 < (/.f64 #s(literal 1 binary64) n) Initial program 37.4%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6458.6
Simplified58.6%
Taylor expanded in x around inf
/-lowering-/.f64N/A
Simplified53.3%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6452.9
Simplified52.9%
(FPCore (x n) :precision binary64 (let* ((t_0 (/ (/ 1.0 x) n))) (if (<= n -2.8e-9) t_0 (if (<= n -7.2e-216) 0.0 t_0))))
double code(double x, double n) {
double t_0 = (1.0 / x) / n;
double tmp;
if (n <= -2.8e-9) {
tmp = t_0;
} else if (n <= -7.2e-216) {
tmp = 0.0;
} else {
tmp = 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 = (1.0d0 / x) / n
if (n <= (-2.8d-9)) then
tmp = t_0
else if (n <= (-7.2d-216)) then
tmp = 0.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = (1.0 / x) / n;
double tmp;
if (n <= -2.8e-9) {
tmp = t_0;
} else if (n <= -7.2e-216) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, n): t_0 = (1.0 / x) / n tmp = 0 if n <= -2.8e-9: tmp = t_0 elif n <= -7.2e-216: tmp = 0.0 else: tmp = t_0 return tmp
function code(x, n) t_0 = Float64(Float64(1.0 / x) / n) tmp = 0.0 if (n <= -2.8e-9) tmp = t_0; elseif (n <= -7.2e-216) tmp = 0.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, n) t_0 = (1.0 / x) / n; tmp = 0.0; if (n <= -2.8e-9) tmp = t_0; elseif (n <= -7.2e-216) tmp = 0.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[n, -2.8e-9], t$95$0, If[LessEqual[n, -7.2e-216], 0.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{1}{x}}{n}\\
\mathbf{if}\;n \leq -2.8 \cdot 10^{-9}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq -7.2 \cdot 10^{-216}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -2.79999999999999984e-9 or -7.1999999999999998e-216 < n Initial program 42.9%
Taylor expanded in x around inf
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6449.9
Simplified49.9%
Taylor expanded in n around inf
Simplified50.8%
if -2.79999999999999984e-9 < n < -7.1999999999999998e-216Initial program 100.0%
Taylor expanded in x around 0
remove-double-negN/A
mul-1-negN/A
distribute-neg-fracN/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
--lowering--.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6441.9
Simplified41.9%
Taylor expanded in n around inf
Simplified60.6%
metadata-eval60.6
Applied egg-rr60.6%
(FPCore (x n) :precision binary64 (let* ((t_0 (/ (/ 1.0 n) x))) (if (<= n -2.8e-9) t_0 (if (<= n -3.2e-215) 0.0 t_0))))
double code(double x, double n) {
double t_0 = (1.0 / n) / x;
double tmp;
if (n <= -2.8e-9) {
tmp = t_0;
} else if (n <= -3.2e-215) {
tmp = 0.0;
} else {
tmp = 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 = (1.0d0 / n) / x
if (n <= (-2.8d-9)) then
tmp = t_0
else if (n <= (-3.2d-215)) then
tmp = 0.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = (1.0 / n) / x;
double tmp;
if (n <= -2.8e-9) {
tmp = t_0;
} else if (n <= -3.2e-215) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, n): t_0 = (1.0 / n) / x tmp = 0 if n <= -2.8e-9: tmp = t_0 elif n <= -3.2e-215: tmp = 0.0 else: tmp = t_0 return tmp
function code(x, n) t_0 = Float64(Float64(1.0 / n) / x) tmp = 0.0 if (n <= -2.8e-9) tmp = t_0; elseif (n <= -3.2e-215) tmp = 0.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, n) t_0 = (1.0 / n) / x; tmp = 0.0; if (n <= -2.8e-9) tmp = t_0; elseif (n <= -3.2e-215) tmp = 0.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[n, -2.8e-9], t$95$0, If[LessEqual[n, -3.2e-215], 0.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{1}{n}}{x}\\
\mathbf{if}\;n \leq -2.8 \cdot 10^{-9}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq -3.2 \cdot 10^{-215}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -2.79999999999999984e-9 or -3.2000000000000001e-215 < n Initial program 42.9%
Taylor expanded in x around inf
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6449.9
Simplified49.9%
Taylor expanded in n around inf
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6450.7
Simplified50.7%
if -2.79999999999999984e-9 < n < -3.2000000000000001e-215Initial program 100.0%
Taylor expanded in x around 0
remove-double-negN/A
mul-1-negN/A
distribute-neg-fracN/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
--lowering--.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6441.9
Simplified41.9%
Taylor expanded in n around inf
Simplified60.6%
metadata-eval60.6
Applied egg-rr60.6%
(FPCore (x n) :precision binary64 (let* ((t_0 (/ 1.0 (* n x)))) (if (<= n -2.8e-9) t_0 (if (<= n -3.8e-215) 0.0 t_0))))
double code(double x, double n) {
double t_0 = 1.0 / (n * x);
double tmp;
if (n <= -2.8e-9) {
tmp = t_0;
} else if (n <= -3.8e-215) {
tmp = 0.0;
} else {
tmp = 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 = 1.0d0 / (n * x)
if (n <= (-2.8d-9)) then
tmp = t_0
else if (n <= (-3.8d-215)) then
tmp = 0.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = 1.0 / (n * x);
double tmp;
if (n <= -2.8e-9) {
tmp = t_0;
} else if (n <= -3.8e-215) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, n): t_0 = 1.0 / (n * x) tmp = 0 if n <= -2.8e-9: tmp = t_0 elif n <= -3.8e-215: tmp = 0.0 else: tmp = t_0 return tmp
function code(x, n) t_0 = Float64(1.0 / Float64(n * x)) tmp = 0.0 if (n <= -2.8e-9) tmp = t_0; elseif (n <= -3.8e-215) tmp = 0.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, n) t_0 = 1.0 / (n * x); tmp = 0.0; if (n <= -2.8e-9) tmp = t_0; elseif (n <= -3.8e-215) tmp = 0.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(1.0 / N[(n * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -2.8e-9], t$95$0, If[LessEqual[n, -3.8e-215], 0.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{n \cdot x}\\
\mathbf{if}\;n \leq -2.8 \cdot 10^{-9}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq -3.8 \cdot 10^{-215}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -2.79999999999999984e-9 or -3.79999999999999977e-215 < n Initial program 42.9%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
accelerator-lowering-log1p.f64N/A
log-lowering-log.f6456.4
Simplified56.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
Simplified54.5%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6449.3
Simplified49.3%
if -2.79999999999999984e-9 < n < -3.79999999999999977e-215Initial program 100.0%
Taylor expanded in x around 0
remove-double-negN/A
mul-1-negN/A
distribute-neg-fracN/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
--lowering--.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6441.9
Simplified41.9%
Taylor expanded in n around inf
Simplified60.6%
metadata-eval60.6
Applied egg-rr60.6%
Final simplification51.5%
(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 54.0%
Taylor expanded in x around 0
remove-double-negN/A
mul-1-negN/A
distribute-neg-fracN/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
--lowering--.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6439.9
Simplified39.9%
Taylor expanded in n around inf
Simplified32.8%
metadata-eval32.8
Applied egg-rr32.8%
herbie shell --seed 2024191
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))