
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x n) :precision binary64 (- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))
double code(double x, double n) {
return pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n));
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
code = ((x + 1.0d0) ** (1.0d0 / n)) - (x ** (1.0d0 / n))
end function
public static double code(double x, double n) {
return Math.pow((x + 1.0), (1.0 / n)) - Math.pow(x, (1.0 / n));
}
def code(x, n): return math.pow((x + 1.0), (1.0 / n)) - math.pow(x, (1.0 / n))
function code(x, n) return Float64((Float64(x + 1.0) ^ Float64(1.0 / n)) - (x ^ Float64(1.0 / n))) end
function tmp = code(x, n) tmp = ((x + 1.0) ^ (1.0 / n)) - (x ^ (1.0 / n)); end
code[x_, n_] := N[(N[Power[N[(x + 1.0), $MachinePrecision], N[(1.0 / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -2.5e-20)
(/ (/ t_0 x) n)
(if (<= (/ 1.0 n) 2e-51)
(/ (log (/ (+ x 1.0) x)) n)
(if (<= (/ 1.0 n) 5.0)
(/ (/ (pow (pow (exp (log x)) (pow n -0.5)) (pow n -0.5)) x) n)
(- (exp (/ (log1p x) n)) t_0))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2.5e-20) {
tmp = (t_0 / x) / n;
} else if ((1.0 / n) <= 2e-51) {
tmp = log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5.0) {
tmp = (pow(pow(exp(log(x)), pow(n, -0.5)), pow(n, -0.5)) / x) / n;
} else {
tmp = exp((log1p(x) / n)) - t_0;
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2.5e-20) {
tmp = (t_0 / x) / n;
} else if ((1.0 / n) <= 2e-51) {
tmp = Math.log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5.0) {
tmp = (Math.pow(Math.pow(Math.exp(Math.log(x)), Math.pow(n, -0.5)), Math.pow(n, -0.5)) / x) / n;
} else {
tmp = Math.exp((Math.log1p(x) / n)) - t_0;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -2.5e-20: tmp = (t_0 / x) / n elif (1.0 / n) <= 2e-51: tmp = math.log(((x + 1.0) / x)) / n elif (1.0 / n) <= 5.0: tmp = (math.pow(math.pow(math.exp(math.log(x)), math.pow(n, -0.5)), math.pow(n, -0.5)) / x) / n else: tmp = math.exp((math.log1p(x) / n)) - t_0 return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -2.5e-20) tmp = Float64(Float64(t_0 / x) / n); elseif (Float64(1.0 / n) <= 2e-51) tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n); elseif (Float64(1.0 / n) <= 5.0) tmp = Float64(Float64(((exp(log(x)) ^ (n ^ -0.5)) ^ (n ^ -0.5)) / x) / n); else tmp = Float64(exp(Float64(log1p(x) / n)) - t_0); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2.5e-20], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-51], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5.0], N[(N[(N[Power[N[Power[N[Exp[N[Log[x], $MachinePrecision]], $MachinePrecision], N[Power[n, -0.5], $MachinePrecision]], $MachinePrecision], N[Power[n, -0.5], $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision], N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -2.5 \cdot 10^{-20}:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-51}:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5:\\
\;\;\;\;\frac{\frac{{\left({\left(e^{\log x}\right)}^{\left({n}^{-0.5}\right)}\right)}^{\left({n}^{-0.5}\right)}}{x}}{n}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t\_0\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -2.4999999999999999e-20Initial program 92.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6496.4%
Simplified96.4%
associate-/r*N/A
/-lowering-/.f64N/A
pow-flipN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
/-lowering-/.f6496.5%
Applied egg-rr96.5%
if -2.4999999999999999e-20 < (/.f64 #s(literal 1 binary64) n) < 2e-51Initial program 27.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f6482.4%
Simplified82.4%
/-lowering-/.f64N/A
diff-logN/A
+-commutativeN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6482.6%
Applied egg-rr82.6%
if 2e-51 < (/.f64 #s(literal 1 binary64) n) < 5Initial program 4.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6477.1%
Simplified77.1%
associate-/r*N/A
/-lowering-/.f64N/A
pow-flipN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
/-lowering-/.f6477.3%
Applied egg-rr77.3%
pow-to-expN/A
exp-prodN/A
inv-powN/A
sqr-powN/A
pow-unpowN/A
pow-lowering-pow.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
log-lowering-log.f64N/A
pow-lowering-pow.f64N/A
metadata-evalN/A
pow-lowering-pow.f64N/A
metadata-eval77.5%
Applied egg-rr77.5%
if 5 < (/.f64 #s(literal 1 binary64) n) Initial program 62.0%
pow-to-expN/A
exp-lowering-exp.f64N/A
un-div-invN/A
/-lowering-/.f64N/A
+-commutativeN/A
log1p-defineN/A
log1p-lowering-log1p.f64100.0%
Applied egg-rr100.0%
(FPCore (x n)
:precision binary64
(if (<= x 8e-269)
(- 1.0 (pow x (/ 1.0 n)))
(if (<= x 18.0)
(/
(-
(/
(+
(* 0.5 (* (log (* x (+ x 1.0))) (log (/ (+ x 1.0) x))))
(*
(- (pow (log1p x) 3.0) (pow (log x) 3.0))
(/ 0.16666666666666666 n)))
n)
(log (/ x (+ x 1.0))))
n)
(/ (/ (pow (/ 1.0 x) (/ -1.0 n)) x) n))))
double code(double x, double n) {
double tmp;
if (x <= 8e-269) {
tmp = 1.0 - pow(x, (1.0 / n));
} else if (x <= 18.0) {
tmp = ((((0.5 * (log((x * (x + 1.0))) * log(((x + 1.0) / x)))) + ((pow(log1p(x), 3.0) - pow(log(x), 3.0)) * (0.16666666666666666 / n))) / n) - log((x / (x + 1.0)))) / n;
} else {
tmp = (pow((1.0 / x), (-1.0 / n)) / x) / n;
}
return tmp;
}
public static double code(double x, double n) {
double tmp;
if (x <= 8e-269) {
tmp = 1.0 - Math.pow(x, (1.0 / n));
} else if (x <= 18.0) {
tmp = ((((0.5 * (Math.log((x * (x + 1.0))) * Math.log(((x + 1.0) / x)))) + ((Math.pow(Math.log1p(x), 3.0) - Math.pow(Math.log(x), 3.0)) * (0.16666666666666666 / n))) / n) - Math.log((x / (x + 1.0)))) / n;
} else {
tmp = (Math.pow((1.0 / x), (-1.0 / n)) / x) / n;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 8e-269: tmp = 1.0 - math.pow(x, (1.0 / n)) elif x <= 18.0: tmp = ((((0.5 * (math.log((x * (x + 1.0))) * math.log(((x + 1.0) / x)))) + ((math.pow(math.log1p(x), 3.0) - math.pow(math.log(x), 3.0)) * (0.16666666666666666 / n))) / n) - math.log((x / (x + 1.0)))) / n else: tmp = (math.pow((1.0 / x), (-1.0 / n)) / x) / n return tmp
function code(x, n) tmp = 0.0 if (x <= 8e-269) tmp = Float64(1.0 - (x ^ Float64(1.0 / n))); elseif (x <= 18.0) tmp = Float64(Float64(Float64(Float64(Float64(0.5 * Float64(log(Float64(x * Float64(x + 1.0))) * log(Float64(Float64(x + 1.0) / x)))) + Float64(Float64((log1p(x) ^ 3.0) - (log(x) ^ 3.0)) * Float64(0.16666666666666666 / n))) / n) - log(Float64(x / Float64(x + 1.0)))) / n); else tmp = Float64(Float64((Float64(1.0 / x) ^ Float64(-1.0 / n)) / x) / n); end return tmp end
code[x_, n_] := If[LessEqual[x, 8e-269], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 18.0], N[(N[(N[(N[(N[(0.5 * N[(N[Log[N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[N[Log[1 + x], $MachinePrecision], 3.0], $MachinePrecision] - N[Power[N[Log[x], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] * N[(0.16666666666666666 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] - N[Log[N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[(N[Power[N[(1.0 / x), $MachinePrecision], N[(-1.0 / n), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8 \cdot 10^{-269}:\\
\;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{elif}\;x \leq 18:\\
\;\;\;\;\frac{\frac{0.5 \cdot \left(\log \left(x \cdot \left(x + 1\right)\right) \cdot \log \left(\frac{x + 1}{x}\right)\right) + \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right) \cdot \frac{0.16666666666666666}{n}}{n} - \log \left(\frac{x}{x + 1}\right)}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{{\left(\frac{1}{x}\right)}^{\left(\frac{-1}{n}\right)}}{x}}{n}\\
\end{array}
\end{array}
if x < 7.9999999999999997e-269Initial program 67.1%
Taylor expanded in x around 0
Simplified67.1%
if 7.9999999999999997e-269 < x < 18Initial program 35.2%
Taylor expanded in n around -inf
Simplified84.4%
Applied egg-rr84.4%
if 18 < x Initial program 66.2%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6497.9%
Simplified97.9%
associate-/r*N/A
/-lowering-/.f64N/A
pow-flipN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
/-lowering-/.f6499.1%
Applied egg-rr99.1%
frac-2negN/A
metadata-evalN/A
div-invN/A
sub0-negN/A
pow-unpowN/A
inv-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
sub0-negN/A
frac-2negN/A
metadata-evalN/A
remove-double-negN/A
/-lowering-/.f6499.1%
Applied egg-rr99.1%
Final simplification88.7%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -2.5e-20)
(/ (/ t_0 x) n)
(if (<= (/ 1.0 n) 2e-51)
(/ (log (/ (+ x 1.0) x)) n)
(if (<= (/ 1.0 n) 5.0)
(/ (/ (pow (pow x (pow n -0.5)) (pow n -0.5)) x) n)
(- (exp (/ (log1p x) n)) t_0))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2.5e-20) {
tmp = (t_0 / x) / n;
} else if ((1.0 / n) <= 2e-51) {
tmp = log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5.0) {
tmp = (pow(pow(x, pow(n, -0.5)), pow(n, -0.5)) / x) / n;
} else {
tmp = exp((log1p(x) / n)) - t_0;
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2.5e-20) {
tmp = (t_0 / x) / n;
} else if ((1.0 / n) <= 2e-51) {
tmp = Math.log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5.0) {
tmp = (Math.pow(Math.pow(x, Math.pow(n, -0.5)), Math.pow(n, -0.5)) / x) / n;
} else {
tmp = Math.exp((Math.log1p(x) / n)) - t_0;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -2.5e-20: tmp = (t_0 / x) / n elif (1.0 / n) <= 2e-51: tmp = math.log(((x + 1.0) / x)) / n elif (1.0 / n) <= 5.0: tmp = (math.pow(math.pow(x, math.pow(n, -0.5)), math.pow(n, -0.5)) / x) / n else: tmp = math.exp((math.log1p(x) / n)) - t_0 return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -2.5e-20) tmp = Float64(Float64(t_0 / x) / n); elseif (Float64(1.0 / n) <= 2e-51) tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n); elseif (Float64(1.0 / n) <= 5.0) tmp = Float64(Float64(((x ^ (n ^ -0.5)) ^ (n ^ -0.5)) / x) / n); else tmp = Float64(exp(Float64(log1p(x) / n)) - t_0); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2.5e-20], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-51], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5.0], N[(N[(N[Power[N[Power[x, N[Power[n, -0.5], $MachinePrecision]], $MachinePrecision], N[Power[n, -0.5], $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision], N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -2.5 \cdot 10^{-20}:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-51}:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5:\\
\;\;\;\;\frac{\frac{{\left({x}^{\left({n}^{-0.5}\right)}\right)}^{\left({n}^{-0.5}\right)}}{x}}{n}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t\_0\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -2.4999999999999999e-20Initial program 92.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6496.4%
Simplified96.4%
associate-/r*N/A
/-lowering-/.f64N/A
pow-flipN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
/-lowering-/.f6496.5%
Applied egg-rr96.5%
if -2.4999999999999999e-20 < (/.f64 #s(literal 1 binary64) n) < 2e-51Initial program 27.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f6482.4%
Simplified82.4%
/-lowering-/.f64N/A
diff-logN/A
+-commutativeN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6482.6%
Applied egg-rr82.6%
if 2e-51 < (/.f64 #s(literal 1 binary64) n) < 5Initial program 4.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6477.1%
Simplified77.1%
associate-/r*N/A
/-lowering-/.f64N/A
pow-flipN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
/-lowering-/.f6477.3%
Applied egg-rr77.3%
inv-powN/A
sqr-powN/A
pow-unpowN/A
pow-lowering-pow.f64N/A
pow-lowering-pow.f64N/A
pow-lowering-pow.f64N/A
metadata-evalN/A
pow-lowering-pow.f64N/A
metadata-eval77.5%
Applied egg-rr77.5%
if 5 < (/.f64 #s(literal 1 binary64) n) Initial program 62.0%
pow-to-expN/A
exp-lowering-exp.f64N/A
un-div-invN/A
/-lowering-/.f64N/A
+-commutativeN/A
log1p-defineN/A
log1p-lowering-log1p.f64100.0%
Applied egg-rr100.0%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -2.5e-20)
(/ (/ t_0 x) n)
(if (<= (/ 1.0 n) 2e-51)
(/ (log (/ (+ x 1.0) x)) n)
(if (<= (/ 1.0 n) 5.0)
(/ (/ 1.0 (* x n)) (pow x (/ -1.0 n)))
(- (exp (/ (log1p x) n)) t_0))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2.5e-20) {
tmp = (t_0 / x) / n;
} else if ((1.0 / n) <= 2e-51) {
tmp = log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5.0) {
tmp = (1.0 / (x * n)) / pow(x, (-1.0 / n));
} else {
tmp = exp((log1p(x) / n)) - t_0;
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2.5e-20) {
tmp = (t_0 / x) / n;
} else if ((1.0 / n) <= 2e-51) {
tmp = Math.log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5.0) {
tmp = (1.0 / (x * n)) / Math.pow(x, (-1.0 / n));
} else {
tmp = Math.exp((Math.log1p(x) / n)) - t_0;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -2.5e-20: tmp = (t_0 / x) / n elif (1.0 / n) <= 2e-51: tmp = math.log(((x + 1.0) / x)) / n elif (1.0 / n) <= 5.0: tmp = (1.0 / (x * n)) / math.pow(x, (-1.0 / n)) else: tmp = math.exp((math.log1p(x) / n)) - t_0 return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -2.5e-20) tmp = Float64(Float64(t_0 / x) / n); elseif (Float64(1.0 / n) <= 2e-51) tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n); elseif (Float64(1.0 / n) <= 5.0) tmp = Float64(Float64(1.0 / Float64(x * n)) / (x ^ Float64(-1.0 / n))); else tmp = Float64(exp(Float64(log1p(x) / n)) - t_0); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2.5e-20], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-51], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5.0], N[(N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision] / N[Power[x, N[(-1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -2.5 \cdot 10^{-20}:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-51}:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5:\\
\;\;\;\;\frac{\frac{1}{x \cdot n}}{{x}^{\left(\frac{-1}{n}\right)}}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t\_0\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -2.4999999999999999e-20Initial program 92.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6496.4%
Simplified96.4%
associate-/r*N/A
/-lowering-/.f64N/A
pow-flipN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
/-lowering-/.f6496.5%
Applied egg-rr96.5%
if -2.4999999999999999e-20 < (/.f64 #s(literal 1 binary64) n) < 2e-51Initial program 27.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f6482.4%
Simplified82.4%
/-lowering-/.f64N/A
diff-logN/A
+-commutativeN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6482.6%
Applied egg-rr82.6%
if 2e-51 < (/.f64 #s(literal 1 binary64) n) < 5Initial program 4.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6477.1%
Simplified77.1%
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
/-lowering-/.f6477.3%
Applied egg-rr77.3%
if 5 < (/.f64 #s(literal 1 binary64) n) Initial program 62.0%
pow-to-expN/A
exp-lowering-exp.f64N/A
un-div-invN/A
/-lowering-/.f64N/A
+-commutativeN/A
log1p-defineN/A
log1p-lowering-log1p.f64100.0%
Applied egg-rr100.0%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -2.5e-20)
(/ (/ t_0 x) n)
(if (<= (/ 1.0 n) 2e-51)
(/ (log (/ (+ x 1.0) x)) n)
(if (<= (/ 1.0 n) 5.0)
(/ (/ 1.0 (* x n)) (pow x (/ -1.0 n)))
(if (<= (/ 1.0 n) 2e+187)
(- (+ (/ x n) 1.0) t_0)
(-
(+ (* x (+ (/ 1.0 n) (* x (+ (/ 0.5 (* n n)) (/ -0.5 n))))) 1.0)
t_0)))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2.5e-20) {
tmp = (t_0 / x) / n;
} else if ((1.0 / n) <= 2e-51) {
tmp = log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5.0) {
tmp = (1.0 / (x * n)) / pow(x, (-1.0 / n));
} else if ((1.0 / n) <= 2e+187) {
tmp = ((x / n) + 1.0) - t_0;
} else {
tmp = ((x * ((1.0 / n) + (x * ((0.5 / (n * n)) + (-0.5 / n))))) + 1.0) - t_0;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = x ** (1.0d0 / n)
if ((1.0d0 / n) <= (-2.5d-20)) then
tmp = (t_0 / x) / n
else if ((1.0d0 / n) <= 2d-51) then
tmp = log(((x + 1.0d0) / x)) / n
else if ((1.0d0 / n) <= 5.0d0) then
tmp = (1.0d0 / (x * n)) / (x ** ((-1.0d0) / n))
else if ((1.0d0 / n) <= 2d+187) then
tmp = ((x / n) + 1.0d0) - t_0
else
tmp = ((x * ((1.0d0 / n) + (x * ((0.5d0 / (n * n)) + ((-0.5d0) / n))))) + 1.0d0) - t_0
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2.5e-20) {
tmp = (t_0 / x) / n;
} else if ((1.0 / n) <= 2e-51) {
tmp = Math.log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5.0) {
tmp = (1.0 / (x * n)) / Math.pow(x, (-1.0 / n));
} else if ((1.0 / n) <= 2e+187) {
tmp = ((x / n) + 1.0) - t_0;
} else {
tmp = ((x * ((1.0 / n) + (x * ((0.5 / (n * n)) + (-0.5 / n))))) + 1.0) - t_0;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -2.5e-20: tmp = (t_0 / x) / n elif (1.0 / n) <= 2e-51: tmp = math.log(((x + 1.0) / x)) / n elif (1.0 / n) <= 5.0: tmp = (1.0 / (x * n)) / math.pow(x, (-1.0 / n)) elif (1.0 / n) <= 2e+187: tmp = ((x / n) + 1.0) - t_0 else: tmp = ((x * ((1.0 / n) + (x * ((0.5 / (n * n)) + (-0.5 / n))))) + 1.0) - t_0 return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -2.5e-20) tmp = Float64(Float64(t_0 / x) / n); elseif (Float64(1.0 / n) <= 2e-51) tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n); elseif (Float64(1.0 / n) <= 5.0) tmp = Float64(Float64(1.0 / Float64(x * n)) / (x ^ Float64(-1.0 / n))); elseif (Float64(1.0 / n) <= 2e+187) tmp = Float64(Float64(Float64(x / n) + 1.0) - t_0); else tmp = Float64(Float64(Float64(x * Float64(Float64(1.0 / n) + Float64(x * Float64(Float64(0.5 / Float64(n * n)) + Float64(-0.5 / n))))) + 1.0) - t_0); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if ((1.0 / n) <= -2.5e-20) tmp = (t_0 / x) / n; elseif ((1.0 / n) <= 2e-51) tmp = log(((x + 1.0) / x)) / n; elseif ((1.0 / n) <= 5.0) tmp = (1.0 / (x * n)) / (x ^ (-1.0 / n)); elseif ((1.0 / n) <= 2e+187) tmp = ((x / n) + 1.0) - t_0; else tmp = ((x * ((1.0 / n) + (x * ((0.5 / (n * n)) + (-0.5 / n))))) + 1.0) - t_0; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2.5e-20], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-51], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5.0], N[(N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision] / N[Power[x, N[(-1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e+187], N[(N[(N[(x / n), $MachinePrecision] + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(x * N[(N[(1.0 / n), $MachinePrecision] + N[(x * N[(N[(0.5 / N[(n * n), $MachinePrecision]), $MachinePrecision] + N[(-0.5 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -2.5 \cdot 10^{-20}:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-51}:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5:\\
\;\;\;\;\frac{\frac{1}{x \cdot n}}{{x}^{\left(\frac{-1}{n}\right)}}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+187}:\\
\;\;\;\;\left(\frac{x}{n} + 1\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(\frac{1}{n} + x \cdot \left(\frac{0.5}{n \cdot n} + \frac{-0.5}{n}\right)\right) + 1\right) - t\_0\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -2.4999999999999999e-20Initial program 92.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6496.4%
Simplified96.4%
associate-/r*N/A
/-lowering-/.f64N/A
pow-flipN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
/-lowering-/.f6496.5%
Applied egg-rr96.5%
if -2.4999999999999999e-20 < (/.f64 #s(literal 1 binary64) n) < 2e-51Initial program 27.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f6482.4%
Simplified82.4%
/-lowering-/.f64N/A
diff-logN/A
+-commutativeN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6482.6%
Applied egg-rr82.6%
if 2e-51 < (/.f64 #s(literal 1 binary64) n) < 5Initial program 4.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6477.1%
Simplified77.1%
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
/-lowering-/.f6477.3%
Applied egg-rr77.3%
if 5 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999981e187Initial program 84.0%
Taylor expanded in x around 0
*-rgt-identityN/A
associate-*r/N/A
+-lowering-+.f64N/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f6484.9%
Simplified84.9%
if 1.99999999999999981e187 < (/.f64 #s(literal 1 binary64) n) Initial program 41.0%
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
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f6474.7%
Simplified74.7%
Final simplification86.1%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -2.5e-20)
(/ (/ t_0 x) n)
(if (<= (/ 1.0 n) 2e-51)
(/ (log (/ (+ x 1.0) x)) n)
(if (<= (/ 1.0 n) 5.0)
(/ (/ 1.0 (* x n)) (pow x (/ -1.0 n)))
(if (<= (/ 1.0 n) 2e+187)
(- (+ (/ x n) 1.0) t_0)
(/
(/ (+ (- (/ 0.3333333333333333 (* x x)) (/ 0.5 x)) 1.0) x)
n)))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2.5e-20) {
tmp = (t_0 / x) / n;
} else if ((1.0 / n) <= 2e-51) {
tmp = log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5.0) {
tmp = (1.0 / (x * n)) / pow(x, (-1.0 / n));
} else if ((1.0 / n) <= 2e+187) {
tmp = ((x / n) + 1.0) - t_0;
} else {
tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = x ** (1.0d0 / n)
if ((1.0d0 / n) <= (-2.5d-20)) then
tmp = (t_0 / x) / n
else if ((1.0d0 / n) <= 2d-51) then
tmp = log(((x + 1.0d0) / x)) / n
else if ((1.0d0 / n) <= 5.0d0) then
tmp = (1.0d0 / (x * n)) / (x ** ((-1.0d0) / n))
else if ((1.0d0 / n) <= 2d+187) then
tmp = ((x / n) + 1.0d0) - t_0
else
tmp = ((((0.3333333333333333d0 / (x * x)) - (0.5d0 / x)) + 1.0d0) / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2.5e-20) {
tmp = (t_0 / x) / n;
} else if ((1.0 / n) <= 2e-51) {
tmp = Math.log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5.0) {
tmp = (1.0 / (x * n)) / Math.pow(x, (-1.0 / n));
} else if ((1.0 / n) <= 2e+187) {
tmp = ((x / n) + 1.0) - t_0;
} else {
tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -2.5e-20: tmp = (t_0 / x) / n elif (1.0 / n) <= 2e-51: tmp = math.log(((x + 1.0) / x)) / n elif (1.0 / n) <= 5.0: tmp = (1.0 / (x * n)) / math.pow(x, (-1.0 / n)) elif (1.0 / n) <= 2e+187: tmp = ((x / n) + 1.0) - t_0 else: tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -2.5e-20) tmp = Float64(Float64(t_0 / x) / n); elseif (Float64(1.0 / n) <= 2e-51) tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n); elseif (Float64(1.0 / n) <= 5.0) tmp = Float64(Float64(1.0 / Float64(x * n)) / (x ^ Float64(-1.0 / n))); elseif (Float64(1.0 / n) <= 2e+187) tmp = Float64(Float64(Float64(x / n) + 1.0) - t_0); else tmp = Float64(Float64(Float64(Float64(Float64(0.3333333333333333 / Float64(x * x)) - Float64(0.5 / x)) + 1.0) / x) / n); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if ((1.0 / n) <= -2.5e-20) tmp = (t_0 / x) / n; elseif ((1.0 / n) <= 2e-51) tmp = log(((x + 1.0) / x)) / n; elseif ((1.0 / n) <= 5.0) tmp = (1.0 / (x * n)) / (x ^ (-1.0 / n)); elseif ((1.0 / n) <= 2e+187) tmp = ((x / n) + 1.0) - t_0; else tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / 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], -2.5e-20], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-51], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5.0], N[(N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision] / N[Power[x, N[(-1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e+187], N[(N[(N[(x / n), $MachinePrecision] + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(N[(N[(0.3333333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision] - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -2.5 \cdot 10^{-20}:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-51}:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5:\\
\;\;\;\;\frac{\frac{1}{x \cdot n}}{{x}^{\left(\frac{-1}{n}\right)}}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+187}:\\
\;\;\;\;\left(\frac{x}{n} + 1\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(\frac{0.3333333333333333}{x \cdot x} - \frac{0.5}{x}\right) + 1}{x}}{n}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -2.4999999999999999e-20Initial program 92.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6496.4%
Simplified96.4%
associate-/r*N/A
/-lowering-/.f64N/A
pow-flipN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
/-lowering-/.f6496.5%
Applied egg-rr96.5%
if -2.4999999999999999e-20 < (/.f64 #s(literal 1 binary64) n) < 2e-51Initial program 27.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f6482.4%
Simplified82.4%
/-lowering-/.f64N/A
diff-logN/A
+-commutativeN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6482.6%
Applied egg-rr82.6%
if 2e-51 < (/.f64 #s(literal 1 binary64) n) < 5Initial program 4.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6477.1%
Simplified77.1%
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
/-lowering-/.f6477.3%
Applied egg-rr77.3%
if 5 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999981e187Initial program 84.0%
Taylor expanded in x around 0
*-rgt-identityN/A
associate-*r/N/A
+-lowering-+.f64N/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f6484.9%
Simplified84.9%
if 1.99999999999999981e187 < (/.f64 #s(literal 1 binary64) n) Initial program 41.0%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f646.4%
Simplified6.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6458.8%
Simplified58.8%
Final simplification84.7%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))) (t_1 (/ (/ t_0 x) n)))
(if (<= (/ 1.0 n) -2.5e-20)
t_1
(if (<= (/ 1.0 n) 2e-51)
(/ (log (/ (+ x 1.0) x)) n)
(if (<= (/ 1.0 n) 5.0)
t_1
(if (<= (/ 1.0 n) 2e+187)
(- (+ (/ x n) 1.0) t_0)
(/
(/ (+ (- (/ 0.3333333333333333 (* x x)) (/ 0.5 x)) 1.0) x)
n)))))))
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) <= -2.5e-20) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-51) {
tmp = log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5.0) {
tmp = t_1;
} else if ((1.0 / n) <= 2e+187) {
tmp = ((x / n) + 1.0) - t_0;
} else {
tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x ** (1.0d0 / n)
t_1 = (t_0 / x) / n
if ((1.0d0 / n) <= (-2.5d-20)) then
tmp = t_1
else if ((1.0d0 / n) <= 2d-51) then
tmp = log(((x + 1.0d0) / x)) / n
else if ((1.0d0 / n) <= 5.0d0) then
tmp = t_1
else if ((1.0d0 / n) <= 2d+187) then
tmp = ((x / n) + 1.0d0) - t_0
else
tmp = ((((0.3333333333333333d0 / (x * x)) - (0.5d0 / x)) + 1.0d0) / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double t_1 = (t_0 / x) / n;
double tmp;
if ((1.0 / n) <= -2.5e-20) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-51) {
tmp = Math.log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5.0) {
tmp = t_1;
} else if ((1.0 / n) <= 2e+187) {
tmp = ((x / n) + 1.0) - t_0;
} else {
tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n;
}
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) <= -2.5e-20: tmp = t_1 elif (1.0 / n) <= 2e-51: tmp = math.log(((x + 1.0) / x)) / n elif (1.0 / n) <= 5.0: tmp = t_1 elif (1.0 / n) <= 2e+187: tmp = ((x / n) + 1.0) - t_0 else: tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n 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) <= -2.5e-20) tmp = t_1; elseif (Float64(1.0 / n) <= 2e-51) tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n); elseif (Float64(1.0 / n) <= 5.0) tmp = t_1; elseif (Float64(1.0 / n) <= 2e+187) tmp = Float64(Float64(Float64(x / n) + 1.0) - t_0); else tmp = Float64(Float64(Float64(Float64(Float64(0.3333333333333333 / Float64(x * x)) - Float64(0.5 / x)) + 1.0) / x) / n); 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) <= -2.5e-20) tmp = t_1; elseif ((1.0 / n) <= 2e-51) tmp = log(((x + 1.0) / x)) / n; elseif ((1.0 / n) <= 5.0) tmp = t_1; elseif ((1.0 / n) <= 2e+187) tmp = ((x / n) + 1.0) - t_0; else tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2.5e-20], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-51], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5.0], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e+187], N[(N[(N[(x / n), $MachinePrecision] + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(N[(N[(0.3333333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision] - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision] / n), $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 -2.5 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-51}:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+187}:\\
\;\;\;\;\left(\frac{x}{n} + 1\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(\frac{0.3333333333333333}{x \cdot x} - \frac{0.5}{x}\right) + 1}{x}}{n}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -2.4999999999999999e-20 or 2e-51 < (/.f64 #s(literal 1 binary64) n) < 5Initial program 78.8%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6493.5%
Simplified93.5%
associate-/r*N/A
/-lowering-/.f64N/A
pow-flipN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
/-lowering-/.f6493.6%
Applied egg-rr93.6%
if -2.4999999999999999e-20 < (/.f64 #s(literal 1 binary64) n) < 2e-51Initial program 27.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f6482.4%
Simplified82.4%
/-lowering-/.f64N/A
diff-logN/A
+-commutativeN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6482.6%
Applied egg-rr82.6%
if 5 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999981e187Initial program 84.0%
Taylor expanded in x around 0
*-rgt-identityN/A
associate-*r/N/A
+-lowering-+.f64N/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f6484.9%
Simplified84.9%
if 1.99999999999999981e187 < (/.f64 #s(literal 1 binary64) n) Initial program 41.0%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f646.4%
Simplified6.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6458.8%
Simplified58.8%
Final simplification84.7%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))) (t_1 (/ (/ t_0 x) n)))
(if (<= (/ 1.0 n) -2.5e-20)
t_1
(if (<= (/ 1.0 n) 2e-51)
(/ (log (/ (+ x 1.0) x)) n)
(if (<= (/ 1.0 n) 5.0)
t_1
(if (<= (/ 1.0 n) 2e+187)
(- 1.0 t_0)
(/
(/ (+ (- (/ 0.3333333333333333 (* x x)) (/ 0.5 x)) 1.0) x)
n)))))))
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) <= -2.5e-20) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-51) {
tmp = log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5.0) {
tmp = t_1;
} else if ((1.0 / n) <= 2e+187) {
tmp = 1.0 - t_0;
} else {
tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x ** (1.0d0 / n)
t_1 = (t_0 / x) / n
if ((1.0d0 / n) <= (-2.5d-20)) then
tmp = t_1
else if ((1.0d0 / n) <= 2d-51) then
tmp = log(((x + 1.0d0) / x)) / n
else if ((1.0d0 / n) <= 5.0d0) then
tmp = t_1
else if ((1.0d0 / n) <= 2d+187) then
tmp = 1.0d0 - t_0
else
tmp = ((((0.3333333333333333d0 / (x * x)) - (0.5d0 / x)) + 1.0d0) / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double t_1 = (t_0 / x) / n;
double tmp;
if ((1.0 / n) <= -2.5e-20) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-51) {
tmp = Math.log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5.0) {
tmp = t_1;
} else if ((1.0 / n) <= 2e+187) {
tmp = 1.0 - t_0;
} else {
tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n;
}
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) <= -2.5e-20: tmp = t_1 elif (1.0 / n) <= 2e-51: tmp = math.log(((x + 1.0) / x)) / n elif (1.0 / n) <= 5.0: tmp = t_1 elif (1.0 / n) <= 2e+187: tmp = 1.0 - t_0 else: tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n 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) <= -2.5e-20) tmp = t_1; elseif (Float64(1.0 / n) <= 2e-51) tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n); elseif (Float64(1.0 / n) <= 5.0) tmp = t_1; elseif (Float64(1.0 / n) <= 2e+187) tmp = Float64(1.0 - t_0); else tmp = Float64(Float64(Float64(Float64(Float64(0.3333333333333333 / Float64(x * x)) - Float64(0.5 / x)) + 1.0) / x) / n); 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) <= -2.5e-20) tmp = t_1; elseif ((1.0 / n) <= 2e-51) tmp = log(((x + 1.0) / x)) / n; elseif ((1.0 / n) <= 5.0) tmp = t_1; elseif ((1.0 / n) <= 2e+187) tmp = 1.0 - t_0; else tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2.5e-20], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-51], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5.0], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e+187], N[(1.0 - t$95$0), $MachinePrecision], N[(N[(N[(N[(N[(0.3333333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision] - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision] / n), $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 -2.5 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-51}:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+187}:\\
\;\;\;\;1 - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(\frac{0.3333333333333333}{x \cdot x} - \frac{0.5}{x}\right) + 1}{x}}{n}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -2.4999999999999999e-20 or 2e-51 < (/.f64 #s(literal 1 binary64) n) < 5Initial program 78.8%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6493.5%
Simplified93.5%
associate-/r*N/A
/-lowering-/.f64N/A
pow-flipN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
/-lowering-/.f6493.6%
Applied egg-rr93.6%
if -2.4999999999999999e-20 < (/.f64 #s(literal 1 binary64) n) < 2e-51Initial program 27.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f6482.4%
Simplified82.4%
/-lowering-/.f64N/A
diff-logN/A
+-commutativeN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6482.6%
Applied egg-rr82.6%
if 5 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999981e187Initial program 84.0%
Taylor expanded in x around 0
Simplified84.0%
if 1.99999999999999981e187 < (/.f64 #s(literal 1 binary64) n) Initial program 41.0%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f646.4%
Simplified6.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6458.8%
Simplified58.8%
Final simplification84.6%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))) (t_1 (/ (/ t_0 n) x)))
(if (<= (/ 1.0 n) -2.5e-20)
t_1
(if (<= (/ 1.0 n) 2e-51)
(/ (log (/ (+ x 1.0) x)) n)
(if (<= (/ 1.0 n) 5.0)
t_1
(if (<= (/ 1.0 n) 2e+187)
(- 1.0 t_0)
(/
(/ (+ (- (/ 0.3333333333333333 (* x x)) (/ 0.5 x)) 1.0) x)
n)))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double t_1 = (t_0 / n) / x;
double tmp;
if ((1.0 / n) <= -2.5e-20) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-51) {
tmp = log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5.0) {
tmp = t_1;
} else if ((1.0 / n) <= 2e+187) {
tmp = 1.0 - t_0;
} else {
tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x ** (1.0d0 / n)
t_1 = (t_0 / n) / x
if ((1.0d0 / n) <= (-2.5d-20)) then
tmp = t_1
else if ((1.0d0 / n) <= 2d-51) then
tmp = log(((x + 1.0d0) / x)) / n
else if ((1.0d0 / n) <= 5.0d0) then
tmp = t_1
else if ((1.0d0 / n) <= 2d+187) then
tmp = 1.0d0 - t_0
else
tmp = ((((0.3333333333333333d0 / (x * x)) - (0.5d0 / x)) + 1.0d0) / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double t_1 = (t_0 / n) / x;
double tmp;
if ((1.0 / n) <= -2.5e-20) {
tmp = t_1;
} else if ((1.0 / n) <= 2e-51) {
tmp = Math.log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5.0) {
tmp = t_1;
} else if ((1.0 / n) <= 2e+187) {
tmp = 1.0 - t_0;
} else {
tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) t_1 = (t_0 / n) / x tmp = 0 if (1.0 / n) <= -2.5e-20: tmp = t_1 elif (1.0 / n) <= 2e-51: tmp = math.log(((x + 1.0) / x)) / n elif (1.0 / n) <= 5.0: tmp = t_1 elif (1.0 / n) <= 2e+187: tmp = 1.0 - t_0 else: tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) t_1 = Float64(Float64(t_0 / n) / x) tmp = 0.0 if (Float64(1.0 / n) <= -2.5e-20) tmp = t_1; elseif (Float64(1.0 / n) <= 2e-51) tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n); elseif (Float64(1.0 / n) <= 5.0) tmp = t_1; elseif (Float64(1.0 / n) <= 2e+187) tmp = Float64(1.0 - t_0); else tmp = Float64(Float64(Float64(Float64(Float64(0.3333333333333333 / Float64(x * x)) - Float64(0.5 / x)) + 1.0) / x) / n); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); t_1 = (t_0 / n) / x; tmp = 0.0; if ((1.0 / n) <= -2.5e-20) tmp = t_1; elseif ((1.0 / n) <= 2e-51) tmp = log(((x + 1.0) / x)) / n; elseif ((1.0 / n) <= 5.0) tmp = t_1; elseif ((1.0 / n) <= 2e+187) tmp = 1.0 - t_0; else tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 / n), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2.5e-20], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-51], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5.0], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e+187], N[(1.0 - t$95$0), $MachinePrecision], N[(N[(N[(N[(N[(0.3333333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision] - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{\frac{t\_0}{n}}{x}\\
\mathbf{if}\;\frac{1}{n} \leq -2.5 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-51}:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+187}:\\
\;\;\;\;1 - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(\frac{0.3333333333333333}{x \cdot x} - \frac{0.5}{x}\right) + 1}{x}}{n}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -2.4999999999999999e-20 or 2e-51 < (/.f64 #s(literal 1 binary64) n) < 5Initial program 78.8%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6493.5%
Simplified93.5%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
pow-flipN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
/-lowering-/.f6493.5%
Applied egg-rr93.5%
if -2.4999999999999999e-20 < (/.f64 #s(literal 1 binary64) n) < 2e-51Initial program 27.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f6482.4%
Simplified82.4%
/-lowering-/.f64N/A
diff-logN/A
+-commutativeN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6482.6%
Applied egg-rr82.6%
if 5 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999981e187Initial program 84.0%
Taylor expanded in x around 0
Simplified84.0%
if 1.99999999999999981e187 < (/.f64 #s(literal 1 binary64) n) Initial program 41.0%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f646.4%
Simplified6.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6458.8%
Simplified58.8%
Final simplification84.6%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) 2e-51)
(/ (log (/ (+ x 1.0) x)) n)
(if (<= (/ 1.0 n) 5.0)
(/ (/ 1.0 x) n)
(if (<= (/ 1.0 n) 2e+187)
(- 1.0 (pow x (/ 1.0 n)))
(/ (/ (+ (- (/ 0.3333333333333333 (* x x)) (/ 0.5 x)) 1.0) x) n)))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= 2e-51) {
tmp = log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5.0) {
tmp = (1.0 / x) / n;
} else if ((1.0 / n) <= 2e+187) {
tmp = 1.0 - pow(x, (1.0 / n));
} else {
tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 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) <= 2d-51) then
tmp = log(((x + 1.0d0) / x)) / n
else if ((1.0d0 / n) <= 5.0d0) then
tmp = (1.0d0 / x) / n
else if ((1.0d0 / n) <= 2d+187) then
tmp = 1.0d0 - (x ** (1.0d0 / n))
else
tmp = ((((0.3333333333333333d0 / (x * x)) - (0.5d0 / x)) + 1.0d0) / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= 2e-51) {
tmp = Math.log(((x + 1.0) / x)) / n;
} else if ((1.0 / n) <= 5.0) {
tmp = (1.0 / x) / n;
} else if ((1.0 / n) <= 2e+187) {
tmp = 1.0 - Math.pow(x, (1.0 / n));
} else {
tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n;
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= 2e-51: tmp = math.log(((x + 1.0) / x)) / n elif (1.0 / n) <= 5.0: tmp = (1.0 / x) / n elif (1.0 / n) <= 2e+187: tmp = 1.0 - math.pow(x, (1.0 / n)) else: tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= 2e-51) tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n); elseif (Float64(1.0 / n) <= 5.0) tmp = Float64(Float64(1.0 / x) / n); elseif (Float64(1.0 / n) <= 2e+187) tmp = Float64(1.0 - (x ^ Float64(1.0 / n))); else tmp = Float64(Float64(Float64(Float64(Float64(0.3333333333333333 / Float64(x * x)) - Float64(0.5 / x)) + 1.0) / x) / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= 2e-51) tmp = log(((x + 1.0) / x)) / n; elseif ((1.0 / n) <= 5.0) tmp = (1.0 / x) / n; elseif ((1.0 / n) <= 2e+187) tmp = 1.0 - (x ^ (1.0 / n)); else tmp = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-51], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5.0], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e+187], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(0.3333333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision] - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq 2 \cdot 10^{-51}:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+187}:\\
\;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(\frac{0.3333333333333333}{x \cdot x} - \frac{0.5}{x}\right) + 1}{x}}{n}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < 2e-51Initial program 53.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f6471.7%
Simplified71.7%
/-lowering-/.f64N/A
diff-logN/A
+-commutativeN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6471.9%
Applied egg-rr71.9%
if 2e-51 < (/.f64 #s(literal 1 binary64) n) < 5Initial program 4.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6477.1%
Simplified77.1%
associate-/r*N/A
/-lowering-/.f64N/A
pow-flipN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
/-lowering-/.f6477.3%
Applied egg-rr77.3%
Taylor expanded in n around inf
/-lowering-/.f6457.6%
Simplified57.6%
if 5 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999981e187Initial program 84.0%
Taylor expanded in x around 0
Simplified84.0%
if 1.99999999999999981e187 < (/.f64 #s(literal 1 binary64) n) Initial program 41.0%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f646.4%
Simplified6.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6458.8%
Simplified58.8%
Final simplification71.0%
(FPCore (x n)
:precision binary64
(if (<= x 1e-267)
(- 1.0 (pow x (/ 1.0 n)))
(if (<= x 2.55e-40)
(/ (log x) (- 0.0 n))
(if (<= x 1.0)
(/
(+
(* 0.16666666666666666 (* x (* x x)))
(*
n
(+
(* (* x x) (+ 0.5 (* x -0.5)))
(* (* x n) (+ (* x (+ -0.5 (* x 0.3333333333333333))) 1.0)))))
(* n (* n n)))
(if (<= x 2.8e+53)
(/
(/ (+ 1.0 (/ (- -0.5 (/ (+ (/ 0.25 x) -0.3333333333333333) x)) x)) x)
n)
(if (<= x 4e+147)
0.0
(if (<= x 5.2e+196) (/ (/ (- 1.0 (/ 0.5 x)) x) n) 0.0)))))))
double code(double x, double n) {
double tmp;
if (x <= 1e-267) {
tmp = 1.0 - pow(x, (1.0 / n));
} else if (x <= 2.55e-40) {
tmp = log(x) / (0.0 - n);
} else if (x <= 1.0) {
tmp = ((0.16666666666666666 * (x * (x * x))) + (n * (((x * x) * (0.5 + (x * -0.5))) + ((x * n) * ((x * (-0.5 + (x * 0.3333333333333333))) + 1.0))))) / (n * (n * n));
} else if (x <= 2.8e+53) {
tmp = ((1.0 + ((-0.5 - (((0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n;
} else if (x <= 4e+147) {
tmp = 0.0;
} else if (x <= 5.2e+196) {
tmp = ((1.0 - (0.5 / x)) / x) / n;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 1d-267) then
tmp = 1.0d0 - (x ** (1.0d0 / n))
else if (x <= 2.55d-40) then
tmp = log(x) / (0.0d0 - n)
else if (x <= 1.0d0) then
tmp = ((0.16666666666666666d0 * (x * (x * x))) + (n * (((x * x) * (0.5d0 + (x * (-0.5d0)))) + ((x * n) * ((x * ((-0.5d0) + (x * 0.3333333333333333d0))) + 1.0d0))))) / (n * (n * n))
else if (x <= 2.8d+53) then
tmp = ((1.0d0 + (((-0.5d0) - (((0.25d0 / x) + (-0.3333333333333333d0)) / x)) / x)) / x) / n
else if (x <= 4d+147) then
tmp = 0.0d0
else if (x <= 5.2d+196) then
tmp = ((1.0d0 - (0.5d0 / x)) / x) / n
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 1e-267) {
tmp = 1.0 - Math.pow(x, (1.0 / n));
} else if (x <= 2.55e-40) {
tmp = Math.log(x) / (0.0 - n);
} else if (x <= 1.0) {
tmp = ((0.16666666666666666 * (x * (x * x))) + (n * (((x * x) * (0.5 + (x * -0.5))) + ((x * n) * ((x * (-0.5 + (x * 0.3333333333333333))) + 1.0))))) / (n * (n * n));
} else if (x <= 2.8e+53) {
tmp = ((1.0 + ((-0.5 - (((0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n;
} else if (x <= 4e+147) {
tmp = 0.0;
} else if (x <= 5.2e+196) {
tmp = ((1.0 - (0.5 / x)) / x) / n;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 1e-267: tmp = 1.0 - math.pow(x, (1.0 / n)) elif x <= 2.55e-40: tmp = math.log(x) / (0.0 - n) elif x <= 1.0: tmp = ((0.16666666666666666 * (x * (x * x))) + (n * (((x * x) * (0.5 + (x * -0.5))) + ((x * n) * ((x * (-0.5 + (x * 0.3333333333333333))) + 1.0))))) / (n * (n * n)) elif x <= 2.8e+53: tmp = ((1.0 + ((-0.5 - (((0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n elif x <= 4e+147: tmp = 0.0 elif x <= 5.2e+196: tmp = ((1.0 - (0.5 / x)) / x) / n else: tmp = 0.0 return tmp
function code(x, n) tmp = 0.0 if (x <= 1e-267) tmp = Float64(1.0 - (x ^ Float64(1.0 / n))); elseif (x <= 2.55e-40) tmp = Float64(log(x) / Float64(0.0 - n)); elseif (x <= 1.0) tmp = Float64(Float64(Float64(0.16666666666666666 * Float64(x * Float64(x * x))) + Float64(n * Float64(Float64(Float64(x * x) * Float64(0.5 + Float64(x * -0.5))) + Float64(Float64(x * n) * Float64(Float64(x * Float64(-0.5 + Float64(x * 0.3333333333333333))) + 1.0))))) / Float64(n * Float64(n * n))); elseif (x <= 2.8e+53) tmp = Float64(Float64(Float64(1.0 + Float64(Float64(-0.5 - Float64(Float64(Float64(0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n); elseif (x <= 4e+147) tmp = 0.0; elseif (x <= 5.2e+196) tmp = Float64(Float64(Float64(1.0 - Float64(0.5 / x)) / x) / n); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 1e-267) tmp = 1.0 - (x ^ (1.0 / n)); elseif (x <= 2.55e-40) tmp = log(x) / (0.0 - n); elseif (x <= 1.0) tmp = ((0.16666666666666666 * (x * (x * x))) + (n * (((x * x) * (0.5 + (x * -0.5))) + ((x * n) * ((x * (-0.5 + (x * 0.3333333333333333))) + 1.0))))) / (n * (n * n)); elseif (x <= 2.8e+53) tmp = ((1.0 + ((-0.5 - (((0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n; elseif (x <= 4e+147) tmp = 0.0; elseif (x <= 5.2e+196) tmp = ((1.0 - (0.5 / x)) / x) / n; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 1e-267], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.55e-40], N[(N[Log[x], $MachinePrecision] / N[(0.0 - n), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.0], N[(N[(N[(0.16666666666666666 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x * n), $MachinePrecision] * N[(N[(x * N[(-0.5 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.8e+53], N[(N[(N[(1.0 + N[(N[(-0.5 - N[(N[(N[(0.25 / x), $MachinePrecision] + -0.3333333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 4e+147], 0.0, If[LessEqual[x, 5.2e+196], N[(N[(N[(1.0 - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision], 0.0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{-267}:\\
\;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{elif}\;x \leq 2.55 \cdot 10^{-40}:\\
\;\;\;\;\frac{\log x}{0 - n}\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;\frac{0.16666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right) + n \cdot \left(\left(x \cdot x\right) \cdot \left(0.5 + x \cdot -0.5\right) + \left(x \cdot n\right) \cdot \left(x \cdot \left(-0.5 + x \cdot 0.3333333333333333\right) + 1\right)\right)}{n \cdot \left(n \cdot n\right)}\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+53}:\\
\;\;\;\;\frac{\frac{1 + \frac{-0.5 - \frac{\frac{0.25}{x} + -0.3333333333333333}{x}}{x}}{x}}{n}\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+147}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+196}:\\
\;\;\;\;\frac{\frac{1 - \frac{0.5}{x}}{x}}{n}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 9.9999999999999998e-268Initial program 67.1%
Taylor expanded in x around 0
Simplified67.1%
if 9.9999999999999998e-268 < x < 2.55000000000000019e-40Initial program 31.8%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f6459.3%
Simplified59.3%
Taylor expanded in x around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f6459.3%
Simplified59.3%
if 2.55000000000000019e-40 < x < 1Initial program 64.7%
Taylor expanded in x around 0
Simplified18.0%
Taylor expanded in n around 0
/-lowering-/.f64N/A
Simplified71.3%
if 1 < x < 2.8e53Initial program 32.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f6426.4%
Simplified26.4%
Taylor expanded in x around -inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
Simplified64.0%
if 2.8e53 < x < 3.9999999999999999e147 or 5.20000000000000024e196 < x Initial program 81.7%
Taylor expanded in x around 0
Simplified33.8%
Taylor expanded in n around inf
Simplified81.7%
metadata-eval81.7%
Applied egg-rr81.7%
if 3.9999999999999999e147 < x < 5.20000000000000024e196Initial program 44.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f6444.1%
Simplified44.1%
Taylor expanded in x around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6478.9%
Simplified78.9%
Final simplification68.9%
(FPCore (x n)
:precision binary64
(if (<= x 4.3e-41)
(/ (log x) (- 0.0 n))
(if (<= x 1.0)
(/
(+
(* 0.16666666666666666 (* x (* x x)))
(*
n
(+
(* (* x x) (+ 0.5 (* x -0.5)))
(* (* x n) (+ (* x (+ -0.5 (* x 0.3333333333333333))) 1.0)))))
(* n (* n n)))
(if (<= x 2.6e+56)
(/
(/ (+ 1.0 (/ (- -0.5 (/ (+ (/ 0.25 x) -0.3333333333333333) x)) x)) x)
n)
(if (<= x 5.2e+151)
0.0
(if (<= x 4.4e+197) (/ (/ (- 1.0 (/ 0.5 x)) x) n) 0.0))))))
double code(double x, double n) {
double tmp;
if (x <= 4.3e-41) {
tmp = log(x) / (0.0 - n);
} else if (x <= 1.0) {
tmp = ((0.16666666666666666 * (x * (x * x))) + (n * (((x * x) * (0.5 + (x * -0.5))) + ((x * n) * ((x * (-0.5 + (x * 0.3333333333333333))) + 1.0))))) / (n * (n * n));
} else if (x <= 2.6e+56) {
tmp = ((1.0 + ((-0.5 - (((0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n;
} else if (x <= 5.2e+151) {
tmp = 0.0;
} else if (x <= 4.4e+197) {
tmp = ((1.0 - (0.5 / x)) / x) / n;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 4.3d-41) then
tmp = log(x) / (0.0d0 - n)
else if (x <= 1.0d0) then
tmp = ((0.16666666666666666d0 * (x * (x * x))) + (n * (((x * x) * (0.5d0 + (x * (-0.5d0)))) + ((x * n) * ((x * ((-0.5d0) + (x * 0.3333333333333333d0))) + 1.0d0))))) / (n * (n * n))
else if (x <= 2.6d+56) then
tmp = ((1.0d0 + (((-0.5d0) - (((0.25d0 / x) + (-0.3333333333333333d0)) / x)) / x)) / x) / n
else if (x <= 5.2d+151) then
tmp = 0.0d0
else if (x <= 4.4d+197) then
tmp = ((1.0d0 - (0.5d0 / x)) / x) / n
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 4.3e-41) {
tmp = Math.log(x) / (0.0 - n);
} else if (x <= 1.0) {
tmp = ((0.16666666666666666 * (x * (x * x))) + (n * (((x * x) * (0.5 + (x * -0.5))) + ((x * n) * ((x * (-0.5 + (x * 0.3333333333333333))) + 1.0))))) / (n * (n * n));
} else if (x <= 2.6e+56) {
tmp = ((1.0 + ((-0.5 - (((0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n;
} else if (x <= 5.2e+151) {
tmp = 0.0;
} else if (x <= 4.4e+197) {
tmp = ((1.0 - (0.5 / x)) / x) / n;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 4.3e-41: tmp = math.log(x) / (0.0 - n) elif x <= 1.0: tmp = ((0.16666666666666666 * (x * (x * x))) + (n * (((x * x) * (0.5 + (x * -0.5))) + ((x * n) * ((x * (-0.5 + (x * 0.3333333333333333))) + 1.0))))) / (n * (n * n)) elif x <= 2.6e+56: tmp = ((1.0 + ((-0.5 - (((0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n elif x <= 5.2e+151: tmp = 0.0 elif x <= 4.4e+197: tmp = ((1.0 - (0.5 / x)) / x) / n else: tmp = 0.0 return tmp
function code(x, n) tmp = 0.0 if (x <= 4.3e-41) tmp = Float64(log(x) / Float64(0.0 - n)); elseif (x <= 1.0) tmp = Float64(Float64(Float64(0.16666666666666666 * Float64(x * Float64(x * x))) + Float64(n * Float64(Float64(Float64(x * x) * Float64(0.5 + Float64(x * -0.5))) + Float64(Float64(x * n) * Float64(Float64(x * Float64(-0.5 + Float64(x * 0.3333333333333333))) + 1.0))))) / Float64(n * Float64(n * n))); elseif (x <= 2.6e+56) tmp = Float64(Float64(Float64(1.0 + Float64(Float64(-0.5 - Float64(Float64(Float64(0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n); elseif (x <= 5.2e+151) tmp = 0.0; elseif (x <= 4.4e+197) tmp = Float64(Float64(Float64(1.0 - Float64(0.5 / x)) / x) / n); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 4.3e-41) tmp = log(x) / (0.0 - n); elseif (x <= 1.0) tmp = ((0.16666666666666666 * (x * (x * x))) + (n * (((x * x) * (0.5 + (x * -0.5))) + ((x * n) * ((x * (-0.5 + (x * 0.3333333333333333))) + 1.0))))) / (n * (n * n)); elseif (x <= 2.6e+56) tmp = ((1.0 + ((-0.5 - (((0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n; elseif (x <= 5.2e+151) tmp = 0.0; elseif (x <= 4.4e+197) tmp = ((1.0 - (0.5 / x)) / x) / n; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 4.3e-41], N[(N[Log[x], $MachinePrecision] / N[(0.0 - n), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.0], N[(N[(N[(0.16666666666666666 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x * n), $MachinePrecision] * N[(N[(x * N[(-0.5 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.6e+56], N[(N[(N[(1.0 + N[(N[(-0.5 - N[(N[(N[(0.25 / x), $MachinePrecision] + -0.3333333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 5.2e+151], 0.0, If[LessEqual[x, 4.4e+197], N[(N[(N[(1.0 - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision], 0.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.3 \cdot 10^{-41}:\\
\;\;\;\;\frac{\log x}{0 - n}\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;\frac{0.16666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right) + n \cdot \left(\left(x \cdot x\right) \cdot \left(0.5 + x \cdot -0.5\right) + \left(x \cdot n\right) \cdot \left(x \cdot \left(-0.5 + x \cdot 0.3333333333333333\right) + 1\right)\right)}{n \cdot \left(n \cdot n\right)}\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{+56}:\\
\;\;\;\;\frac{\frac{1 + \frac{-0.5 - \frac{\frac{0.25}{x} + -0.3333333333333333}{x}}{x}}{x}}{n}\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+151}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{+197}:\\
\;\;\;\;\frac{\frac{1 - \frac{0.5}{x}}{x}}{n}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 4.2999999999999999e-41Initial program 39.5%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f6454.6%
Simplified54.6%
Taylor expanded in x around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f6454.6%
Simplified54.6%
if 4.2999999999999999e-41 < x < 1Initial program 64.7%
Taylor expanded in x around 0
Simplified18.0%
Taylor expanded in n around 0
/-lowering-/.f64N/A
Simplified71.3%
if 1 < x < 2.60000000000000011e56Initial program 32.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f6426.4%
Simplified26.4%
Taylor expanded in x around -inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
Simplified64.0%
if 2.60000000000000011e56 < x < 5.20000000000000026e151 or 4.39999999999999979e197 < x Initial program 81.7%
Taylor expanded in x around 0
Simplified33.8%
Taylor expanded in n around inf
Simplified81.7%
metadata-eval81.7%
Applied egg-rr81.7%
if 5.20000000000000026e151 < x < 4.39999999999999979e197Initial program 44.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f6444.1%
Simplified44.1%
Taylor expanded in x around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6478.9%
Simplified78.9%
Final simplification65.6%
(FPCore (x n) :precision binary64 (let* ((t_0 (/ (/ (+ (- (/ 0.3333333333333333 (* x x)) (/ 0.5 x)) 1.0) x) n))) (if (<= n -1.75e-32) t_0 (if (<= n -7.2e-306) 0.0 t_0))))
double code(double x, double n) {
double t_0 = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n;
double tmp;
if (n <= -1.75e-32) {
tmp = t_0;
} else if (n <= -7.2e-306) {
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 = ((((0.3333333333333333d0 / (x * x)) - (0.5d0 / x)) + 1.0d0) / x) / n
if (n <= (-1.75d-32)) then
tmp = t_0
else if (n <= (-7.2d-306)) 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 = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n;
double tmp;
if (n <= -1.75e-32) {
tmp = t_0;
} else if (n <= -7.2e-306) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, n): t_0 = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n tmp = 0 if n <= -1.75e-32: tmp = t_0 elif n <= -7.2e-306: tmp = 0.0 else: tmp = t_0 return tmp
function code(x, n) t_0 = Float64(Float64(Float64(Float64(Float64(0.3333333333333333 / Float64(x * x)) - Float64(0.5 / x)) + 1.0) / x) / n) tmp = 0.0 if (n <= -1.75e-32) tmp = t_0; elseif (n <= -7.2e-306) tmp = 0.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, n) t_0 = ((((0.3333333333333333 / (x * x)) - (0.5 / x)) + 1.0) / x) / n; tmp = 0.0; if (n <= -1.75e-32) tmp = t_0; elseif (n <= -7.2e-306) tmp = 0.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(N[(N[(N[(N[(0.3333333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision] - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[n, -1.75e-32], t$95$0, If[LessEqual[n, -7.2e-306], 0.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{\left(\frac{0.3333333333333333}{x \cdot x} - \frac{0.5}{x}\right) + 1}{x}}{n}\\
\mathbf{if}\;n \leq -1.75 \cdot 10^{-32}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq -7.2 \cdot 10^{-306}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -1.7499999999999999e-32 or -7.19999999999999982e-306 < n Initial program 35.4%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f6456.9%
Simplified56.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6444.2%
Simplified44.2%
if -1.7499999999999999e-32 < n < -7.19999999999999982e-306Initial program 100.0%
Taylor expanded in x around 0
Simplified39.8%
Taylor expanded in n around inf
Simplified62.7%
metadata-eval62.7%
Applied egg-rr62.7%
Final simplification49.0%
(FPCore (x n) :precision binary64 (if (<= n -9.5) (/ (/ 1.0 n) x) (if (<= n -7.2e-306) 0.0 (/ (/ 1.0 x) n))))
double code(double x, double n) {
double tmp;
if (n <= -9.5) {
tmp = (1.0 / n) / x;
} else if (n <= -7.2e-306) {
tmp = 0.0;
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-9.5d0)) then
tmp = (1.0d0 / n) / x
else if (n <= (-7.2d-306)) then
tmp = 0.0d0
else
tmp = (1.0d0 / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (n <= -9.5) {
tmp = (1.0 / n) / x;
} else if (n <= -7.2e-306) {
tmp = 0.0;
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
def code(x, n): tmp = 0 if n <= -9.5: tmp = (1.0 / n) / x elif n <= -7.2e-306: tmp = 0.0 else: tmp = (1.0 / x) / n return tmp
function code(x, n) tmp = 0.0 if (n <= -9.5) tmp = Float64(Float64(1.0 / n) / x); elseif (n <= -7.2e-306) tmp = 0.0; else tmp = Float64(Float64(1.0 / x) / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (n <= -9.5) tmp = (1.0 / n) / x; elseif (n <= -7.2e-306) tmp = 0.0; else tmp = (1.0 / x) / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[n, -9.5], N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[n, -7.2e-306], 0.0, N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -9.5:\\
\;\;\;\;\frac{\frac{1}{n}}{x}\\
\mathbf{elif}\;n \leq -7.2 \cdot 10^{-306}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\end{array}
\end{array}
if n < -9.5Initial program 26.9%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
log-lowering-log.f6474.6%
Simplified74.6%
Taylor expanded in x around -inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
Simplified46.2%
Taylor expanded in x around inf
/-lowering-/.f6447.4%
Simplified47.4%
if -9.5 < n < -7.19999999999999982e-306Initial program 100.0%
Taylor expanded in x around 0
Simplified41.3%
Taylor expanded in n around inf
Simplified61.2%
metadata-eval61.2%
Applied egg-rr61.2%
if -7.19999999999999982e-306 < n Initial program 37.7%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6429.5%
Simplified29.5%
associate-/r*N/A
/-lowering-/.f64N/A
pow-flipN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
/-lowering-/.f6430.7%
Applied egg-rr30.7%
Taylor expanded in n around inf
/-lowering-/.f6439.0%
Simplified39.0%
Final simplification47.4%
(FPCore (x n) :precision binary64 (let* ((t_0 (/ (/ 1.0 x) n))) (if (<= n -9.5) t_0 (if (<= n -4e-306) 0.0 t_0))))
double code(double x, double n) {
double t_0 = (1.0 / x) / n;
double tmp;
if (n <= -9.5) {
tmp = t_0;
} else if (n <= -4e-306) {
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 <= (-9.5d0)) then
tmp = t_0
else if (n <= (-4d-306)) 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 <= -9.5) {
tmp = t_0;
} else if (n <= -4e-306) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, n): t_0 = (1.0 / x) / n tmp = 0 if n <= -9.5: tmp = t_0 elif n <= -4e-306: 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 <= -9.5) tmp = t_0; elseif (n <= -4e-306) 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 <= -9.5) tmp = t_0; elseif (n <= -4e-306) 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, -9.5], t$95$0, If[LessEqual[n, -4e-306], 0.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{1}{x}}{n}\\
\mathbf{if}\;n \leq -9.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq -4 \cdot 10^{-306}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -9.5 or -4.00000000000000011e-306 < n Initial program 33.6%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6436.7%
Simplified36.7%
associate-/r*N/A
/-lowering-/.f64N/A
pow-flipN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
/-lowering-/.f6437.8%
Applied egg-rr37.8%
Taylor expanded in n around inf
/-lowering-/.f6442.1%
Simplified42.1%
if -9.5 < n < -4.00000000000000011e-306Initial program 100.0%
Taylor expanded in x around 0
Simplified41.3%
Taylor expanded in n around inf
Simplified61.2%
metadata-eval61.2%
Applied egg-rr61.2%
(FPCore (x n) :precision binary64 (let* ((t_0 (/ 1.0 (* x n)))) (if (<= n -1.55) t_0 (if (<= n -3.3e-308) 0.0 t_0))))
double code(double x, double n) {
double t_0 = 1.0 / (x * n);
double tmp;
if (n <= -1.55) {
tmp = t_0;
} else if (n <= -3.3e-308) {
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 <= (-1.55d0)) then
tmp = t_0
else if (n <= (-3.3d-308)) 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 <= -1.55) {
tmp = t_0;
} else if (n <= -3.3e-308) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, n): t_0 = 1.0 / (x * n) tmp = 0 if n <= -1.55: tmp = t_0 elif n <= -3.3e-308: tmp = 0.0 else: tmp = t_0 return tmp
function code(x, n) t_0 = Float64(1.0 / Float64(x * n)) tmp = 0.0 if (n <= -1.55) tmp = t_0; elseif (n <= -3.3e-308) 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 <= -1.55) tmp = t_0; elseif (n <= -3.3e-308) tmp = 0.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.55], t$95$0, If[LessEqual[n, -3.3e-308], 0.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{x \cdot n}\\
\mathbf{if}\;n \leq -1.55:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq -3.3 \cdot 10^{-308}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -1.55000000000000004 or -3.2999999999999998e-308 < n Initial program 33.6%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6436.7%
Simplified36.7%
Taylor expanded in n around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6441.5%
Simplified41.5%
if -1.55000000000000004 < n < -3.2999999999999998e-308Initial program 100.0%
Taylor expanded in x around 0
Simplified41.3%
Taylor expanded in n around inf
Simplified61.2%
metadata-eval61.2%
Applied egg-rr61.2%
(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 52.0%
Taylor expanded in x around 0
Simplified34.6%
Taylor expanded in n around inf
Simplified30.3%
metadata-eval30.3%
Applied egg-rr30.3%
herbie shell --seed 2024139
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))