
(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 18 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 (<= x -4e-14)
(/ (pow (pow x 2.0) (* (+ (/ 1.0 n) -1.0) 0.5)) n)
(if (<= x -5e-310)
(- (exp (/ (log1p x) n)) t_0)
(if (<= x 2350.0)
(/
(-
(+
(log1p x)
(/
(+
(* 0.5 (- (pow (log1p x) 2.0) (pow (log x) 2.0)))
(*
0.16666666666666666
(/ (- (pow (log1p x) 3.0) (pow (log x) 3.0)) n)))
n))
(log x))
n)
(/ (/ t_0 x) n))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if (x <= -4e-14) {
tmp = pow(pow(x, 2.0), (((1.0 / n) + -1.0) * 0.5)) / n;
} else if (x <= -5e-310) {
tmp = exp((log1p(x) / n)) - t_0;
} else if (x <= 2350.0) {
tmp = ((log1p(x) + (((0.5 * (pow(log1p(x), 2.0) - pow(log(x), 2.0))) + (0.16666666666666666 * ((pow(log1p(x), 3.0) - pow(log(x), 3.0)) / n))) / n)) - log(x)) / n;
} else {
tmp = (t_0 / x) / n;
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if (x <= -4e-14) {
tmp = Math.pow(Math.pow(x, 2.0), (((1.0 / n) + -1.0) * 0.5)) / n;
} else if (x <= -5e-310) {
tmp = Math.exp((Math.log1p(x) / n)) - t_0;
} else if (x <= 2350.0) {
tmp = ((Math.log1p(x) + (((0.5 * (Math.pow(Math.log1p(x), 2.0) - Math.pow(Math.log(x), 2.0))) + (0.16666666666666666 * ((Math.pow(Math.log1p(x), 3.0) - Math.pow(Math.log(x), 3.0)) / n))) / n)) - Math.log(x)) / n;
} else {
tmp = (t_0 / x) / n;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if x <= -4e-14: tmp = math.pow(math.pow(x, 2.0), (((1.0 / n) + -1.0) * 0.5)) / n elif x <= -5e-310: tmp = math.exp((math.log1p(x) / n)) - t_0 elif x <= 2350.0: tmp = ((math.log1p(x) + (((0.5 * (math.pow(math.log1p(x), 2.0) - math.pow(math.log(x), 2.0))) + (0.16666666666666666 * ((math.pow(math.log1p(x), 3.0) - math.pow(math.log(x), 3.0)) / n))) / n)) - math.log(x)) / n else: tmp = (t_0 / x) / n return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (x <= -4e-14) tmp = Float64(((x ^ 2.0) ^ Float64(Float64(Float64(1.0 / n) + -1.0) * 0.5)) / n); elseif (x <= -5e-310) tmp = Float64(exp(Float64(log1p(x) / n)) - t_0); elseif (x <= 2350.0) tmp = Float64(Float64(Float64(log1p(x) + Float64(Float64(Float64(0.5 * Float64((log1p(x) ^ 2.0) - (log(x) ^ 2.0))) + Float64(0.16666666666666666 * Float64(Float64((log1p(x) ^ 3.0) - (log(x) ^ 3.0)) / n))) / n)) - log(x)) / n); else tmp = Float64(Float64(t_0 / x) / n); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -4e-14], N[(N[Power[N[Power[x, 2.0], $MachinePrecision], N[(N[(N[(1.0 / n), $MachinePrecision] + -1.0), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, -5e-310], N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x, 2350.0], N[(N[(N[(N[Log[1 + x], $MachinePrecision] + N[(N[(N[(0.5 * N[(N[Power[N[Log[1 + x], $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.16666666666666666 * N[(N[(N[Power[N[Log[1 + x], $MachinePrecision], 3.0], $MachinePrecision] - N[Power[N[Log[x], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;x \leq -4 \cdot 10^{-14}:\\
\;\;\;\;\frac{{\left({x}^{2}\right)}^{\left(\left(\frac{1}{n} + -1\right) \cdot 0.5\right)}}{n}\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-310}:\\
\;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t\_0\\
\mathbf{elif}\;x \leq 2350:\\
\;\;\;\;\frac{\left(\mathsf{log1p}\left(x\right) + \frac{0.5 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}\right) + 0.16666666666666666 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}}{n}}{n}\right) - \log x}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\end{array}
\end{array}
if x < -4e-14Initial program 88.5%
Taylor expanded in x around inf 0.0%
associate-/r*0.0%
mul-1-neg0.0%
log-rec0.0%
mul-1-neg0.0%
distribute-neg-frac0.0%
mul-1-neg0.0%
remove-double-neg0.0%
*-rgt-identity0.0%
associate-/l*0.0%
exp-to-pow88.5%
Simplified88.5%
associate-/l/88.5%
pow-to-exp0.0%
div-inv0.0%
*-un-lft-identity0.0%
associate-/r*0.0%
div-inv0.0%
pow-to-exp88.5%
pow188.5%
pow-div88.5%
Applied egg-rr88.5%
*-lft-identity88.5%
sub-neg88.5%
metadata-eval88.5%
Simplified88.5%
unpow-prod-up88.5%
inv-pow88.5%
Applied egg-rr88.5%
associate-*r/88.5%
*-rgt-identity88.5%
Simplified88.5%
div-inv88.5%
inv-pow88.5%
unpow-prod-up88.5%
sqr-pow88.5%
unpow-prod-down96.3%
unpow296.3%
div-inv96.3%
metadata-eval96.3%
Applied egg-rr96.3%
if -4e-14 < x < -4.999999999999985e-310Initial program 50.6%
Taylor expanded in n around 0 0.0%
log1p-define0.0%
*-rgt-identity0.0%
associate-*l/0.0%
associate-/l*0.0%
exp-to-pow100.0%
Simplified100.0%
if -4.999999999999985e-310 < x < 2350Initial program 36.8%
Taylor expanded in n around -inf 80.9%
Simplified80.9%
if 2350 < x Initial program 57.4%
Taylor expanded in x around inf 96.8%
associate-/r*99.1%
mul-1-neg99.1%
log-rec99.1%
mul-1-neg99.1%
distribute-neg-frac99.1%
mul-1-neg99.1%
remove-double-neg99.1%
*-rgt-identity99.1%
associate-/l*99.1%
exp-to-pow99.1%
Simplified99.1%
associate-/l/96.8%
pow-to-exp96.8%
div-inv96.8%
*-un-lft-identity96.8%
associate-/r*99.1%
div-inv99.1%
pow-to-exp99.1%
pow199.1%
pow-div98.6%
Applied egg-rr98.6%
*-lft-identity98.6%
sub-neg98.6%
metadata-eval98.6%
Simplified98.6%
unpow-prod-up99.1%
inv-pow99.1%
Applied egg-rr99.1%
associate-*r/99.1%
*-rgt-identity99.1%
Simplified99.1%
Final simplification91.0%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))) (t_1 (/ (- (log1p x) (log x)) n)))
(if (<= (/ 1.0 n) -5e-29)
(/ (/ t_0 x) n)
(if (<= (/ 1.0 n) -1.2e-109)
t_1
(if (<= (/ 1.0 n) -1e-117)
(/ (/ 1.0 x) n)
(if (<= (/ 1.0 n) 2e-54)
t_1
(if (<= (/ 1.0 n) 1e-11)
(/ (/ (/ t_0 (sqrt x)) (sqrt x)) n)
(exp (log (- (exp (/ (log1p x) n)) t_0))))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double t_1 = (log1p(x) - log(x)) / n;
double tmp;
if ((1.0 / n) <= -5e-29) {
tmp = (t_0 / x) / n;
} else if ((1.0 / n) <= -1.2e-109) {
tmp = t_1;
} else if ((1.0 / n) <= -1e-117) {
tmp = (1.0 / x) / n;
} else if ((1.0 / n) <= 2e-54) {
tmp = t_1;
} else if ((1.0 / n) <= 1e-11) {
tmp = ((t_0 / sqrt(x)) / sqrt(x)) / n;
} else {
tmp = exp(log((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 t_1 = (Math.log1p(x) - Math.log(x)) / n;
double tmp;
if ((1.0 / n) <= -5e-29) {
tmp = (t_0 / x) / n;
} else if ((1.0 / n) <= -1.2e-109) {
tmp = t_1;
} else if ((1.0 / n) <= -1e-117) {
tmp = (1.0 / x) / n;
} else if ((1.0 / n) <= 2e-54) {
tmp = t_1;
} else if ((1.0 / n) <= 1e-11) {
tmp = ((t_0 / Math.sqrt(x)) / Math.sqrt(x)) / n;
} else {
tmp = Math.exp(Math.log((Math.exp((Math.log1p(x) / n)) - t_0)));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) t_1 = (math.log1p(x) - math.log(x)) / n tmp = 0 if (1.0 / n) <= -5e-29: tmp = (t_0 / x) / n elif (1.0 / n) <= -1.2e-109: tmp = t_1 elif (1.0 / n) <= -1e-117: tmp = (1.0 / x) / n elif (1.0 / n) <= 2e-54: tmp = t_1 elif (1.0 / n) <= 1e-11: tmp = ((t_0 / math.sqrt(x)) / math.sqrt(x)) / n else: tmp = math.exp(math.log((math.exp((math.log1p(x) / n)) - t_0))) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) t_1 = Float64(Float64(log1p(x) - log(x)) / n) tmp = 0.0 if (Float64(1.0 / n) <= -5e-29) tmp = Float64(Float64(t_0 / x) / n); elseif (Float64(1.0 / n) <= -1.2e-109) tmp = t_1; elseif (Float64(1.0 / n) <= -1e-117) tmp = Float64(Float64(1.0 / x) / n); elseif (Float64(1.0 / n) <= 2e-54) tmp = t_1; elseif (Float64(1.0 / n) <= 1e-11) tmp = Float64(Float64(Float64(t_0 / sqrt(x)) / sqrt(x)) / n); else tmp = exp(log(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]}, Block[{t$95$1 = N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e-29], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], -1.2e-109], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-117], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-54], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-11], N[(N[(N[(t$95$0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[Exp[N[Log[N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{\mathsf{log1p}\left(x\right) - \log x}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-29}:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq -1.2 \cdot 10^{-109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{-117}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{-11}:\\
\;\;\;\;\frac{\frac{\frac{t\_0}{\sqrt{x}}}{\sqrt{x}}}{n}\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left(e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t\_0\right)}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -4.99999999999999986e-29Initial program 89.9%
Taylor expanded in x around inf 66.8%
associate-/r*66.8%
mul-1-neg66.8%
log-rec66.8%
mul-1-neg66.8%
distribute-neg-frac66.8%
mul-1-neg66.8%
remove-double-neg66.8%
*-rgt-identity66.8%
associate-/l*66.8%
exp-to-pow96.3%
Simplified96.3%
associate-/l/96.2%
pow-to-exp66.8%
div-inv66.8%
*-un-lft-identity66.8%
associate-/r*66.8%
div-inv66.8%
pow-to-exp96.3%
pow196.3%
pow-div95.8%
Applied egg-rr95.8%
*-lft-identity95.8%
sub-neg95.8%
metadata-eval95.8%
Simplified95.8%
unpow-prod-up96.3%
inv-pow96.3%
Applied egg-rr96.3%
associate-*r/96.3%
*-rgt-identity96.3%
Simplified96.3%
if -4.99999999999999986e-29 < (/.f64 #s(literal 1 binary64) n) < -1.19999999999999994e-109 or -1.00000000000000003e-117 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e-54Initial program 22.7%
Taylor expanded in n around inf 82.3%
log1p-define82.3%
Simplified82.3%
if -1.19999999999999994e-109 < (/.f64 #s(literal 1 binary64) n) < -1.00000000000000003e-117Initial program 15.4%
Taylor expanded in x around inf 94.1%
associate-/r*99.2%
mul-1-neg99.2%
log-rec99.2%
mul-1-neg99.2%
distribute-neg-frac99.2%
mul-1-neg99.2%
remove-double-neg99.2%
*-rgt-identity99.2%
associate-/l*99.2%
exp-to-pow99.2%
Simplified99.2%
associate-/l/94.1%
pow-to-exp94.1%
div-inv94.1%
*-un-lft-identity94.1%
associate-/r*99.5%
div-inv99.5%
pow-to-exp99.5%
pow199.5%
pow-div99.5%
Applied egg-rr99.5%
*-lft-identity99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in n around inf 99.5%
if 2.0000000000000001e-54 < (/.f64 #s(literal 1 binary64) n) < 9.99999999999999939e-12Initial program 16.1%
Taylor expanded in x around inf 75.6%
associate-/r*80.0%
mul-1-neg80.0%
log-rec80.0%
mul-1-neg80.0%
distribute-neg-frac80.0%
mul-1-neg80.0%
remove-double-neg80.0%
*-rgt-identity80.0%
associate-/l*80.0%
exp-to-pow80.0%
Simplified80.0%
associate-/l/75.6%
pow-to-exp75.6%
div-inv75.6%
*-un-lft-identity75.6%
associate-/r*80.3%
div-inv80.3%
pow-to-exp80.3%
pow180.3%
pow-div79.2%
Applied egg-rr79.2%
*-lft-identity79.2%
sub-neg79.2%
metadata-eval79.2%
Simplified79.2%
unpow-prod-up80.3%
inv-pow80.3%
div-inv80.3%
metadata-eval80.3%
metadata-eval80.3%
associate-*r/80.3%
associate-/r*80.3%
pow-pow51.0%
add-sqr-sqrt50.7%
associate-/r*50.8%
pow-pow80.3%
associate-/r*80.3%
associate-*r/80.3%
metadata-eval80.3%
metadata-eval80.3%
Applied egg-rr80.3%
if 9.99999999999999939e-12 < (/.f64 #s(literal 1 binary64) n) Initial program 58.2%
add-exp-log58.2%
pow-to-exp58.2%
un-div-inv58.2%
+-commutative58.2%
log1p-define94.6%
Applied egg-rr94.6%
Final simplification89.6%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= x -4e-14)
(/ (pow (pow x 2.0) (* (+ (/ 1.0 n) -1.0) 0.5)) n)
(if (<= x 1e-309)
(- (exp (/ (log1p x) n)) t_0)
(if (<= x 0.7)
(/
(-
(/
(-
(* -0.16666666666666666 (/ (pow (log x) 3.0) n))
(* 0.5 (pow (log x) 2.0)))
n)
(log x))
n)
(/ (/ t_0 x) n))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if (x <= -4e-14) {
tmp = pow(pow(x, 2.0), (((1.0 / n) + -1.0) * 0.5)) / n;
} else if (x <= 1e-309) {
tmp = exp((log1p(x) / n)) - t_0;
} else if (x <= 0.7) {
tmp = ((((-0.16666666666666666 * (pow(log(x), 3.0) / n)) - (0.5 * pow(log(x), 2.0))) / n) - log(x)) / n;
} else {
tmp = (t_0 / x) / n;
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if (x <= -4e-14) {
tmp = Math.pow(Math.pow(x, 2.0), (((1.0 / n) + -1.0) * 0.5)) / n;
} else if (x <= 1e-309) {
tmp = Math.exp((Math.log1p(x) / n)) - t_0;
} else if (x <= 0.7) {
tmp = ((((-0.16666666666666666 * (Math.pow(Math.log(x), 3.0) / n)) - (0.5 * Math.pow(Math.log(x), 2.0))) / n) - Math.log(x)) / n;
} else {
tmp = (t_0 / x) / n;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if x <= -4e-14: tmp = math.pow(math.pow(x, 2.0), (((1.0 / n) + -1.0) * 0.5)) / n elif x <= 1e-309: tmp = math.exp((math.log1p(x) / n)) - t_0 elif x <= 0.7: tmp = ((((-0.16666666666666666 * (math.pow(math.log(x), 3.0) / n)) - (0.5 * math.pow(math.log(x), 2.0))) / n) - math.log(x)) / n else: tmp = (t_0 / x) / n return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (x <= -4e-14) tmp = Float64(((x ^ 2.0) ^ Float64(Float64(Float64(1.0 / n) + -1.0) * 0.5)) / n); elseif (x <= 1e-309) tmp = Float64(exp(Float64(log1p(x) / n)) - t_0); elseif (x <= 0.7) tmp = Float64(Float64(Float64(Float64(Float64(-0.16666666666666666 * Float64((log(x) ^ 3.0) / n)) - Float64(0.5 * (log(x) ^ 2.0))) / n) - log(x)) / n); else tmp = Float64(Float64(t_0 / x) / n); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -4e-14], N[(N[Power[N[Power[x, 2.0], $MachinePrecision], N[(N[(N[(1.0 / n), $MachinePrecision] + -1.0), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 1e-309], N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x, 0.7], N[(N[(N[(N[(N[(-0.16666666666666666 * N[(N[Power[N[Log[x], $MachinePrecision], 3.0], $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision] - N[(0.5 * N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;x \leq -4 \cdot 10^{-14}:\\
\;\;\;\;\frac{{\left({x}^{2}\right)}^{\left(\left(\frac{1}{n} + -1\right) \cdot 0.5\right)}}{n}\\
\mathbf{elif}\;x \leq 10^{-309}:\\
\;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t\_0\\
\mathbf{elif}\;x \leq 0.7:\\
\;\;\;\;\frac{\frac{-0.16666666666666666 \cdot \frac{{\log x}^{3}}{n} - 0.5 \cdot {\log x}^{2}}{n} - \log x}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\end{array}
\end{array}
if x < -4e-14Initial program 88.5%
Taylor expanded in x around inf 0.0%
associate-/r*0.0%
mul-1-neg0.0%
log-rec0.0%
mul-1-neg0.0%
distribute-neg-frac0.0%
mul-1-neg0.0%
remove-double-neg0.0%
*-rgt-identity0.0%
associate-/l*0.0%
exp-to-pow88.5%
Simplified88.5%
associate-/l/88.5%
pow-to-exp0.0%
div-inv0.0%
*-un-lft-identity0.0%
associate-/r*0.0%
div-inv0.0%
pow-to-exp88.5%
pow188.5%
pow-div88.5%
Applied egg-rr88.5%
*-lft-identity88.5%
sub-neg88.5%
metadata-eval88.5%
Simplified88.5%
unpow-prod-up88.5%
inv-pow88.5%
Applied egg-rr88.5%
associate-*r/88.5%
*-rgt-identity88.5%
Simplified88.5%
div-inv88.5%
inv-pow88.5%
unpow-prod-up88.5%
sqr-pow88.5%
unpow-prod-down96.3%
unpow296.3%
div-inv96.3%
metadata-eval96.3%
Applied egg-rr96.3%
if -4e-14 < x < 1.000000000000002e-309Initial program 50.6%
Taylor expanded in n around 0 0.0%
log1p-define0.0%
*-rgt-identity0.0%
associate-*l/0.0%
associate-/l*0.0%
exp-to-pow100.0%
Simplified100.0%
if 1.000000000000002e-309 < x < 0.69999999999999996Initial program 37.0%
Taylor expanded in x around 0 36.2%
*-rgt-identity36.2%
associate-*l/36.2%
associate-/l*36.2%
exp-to-pow36.2%
Simplified36.2%
Taylor expanded in n around -inf 80.0%
if 0.69999999999999996 < x Initial program 56.9%
Taylor expanded in x around inf 96.0%
associate-/r*98.2%
mul-1-neg98.2%
log-rec98.2%
mul-1-neg98.2%
distribute-neg-frac98.2%
mul-1-neg98.2%
remove-double-neg98.2%
*-rgt-identity98.2%
associate-/l*98.2%
exp-to-pow98.2%
Simplified98.2%
associate-/l/96.0%
pow-to-exp96.0%
div-inv96.0%
*-un-lft-identity96.0%
associate-/r*98.3%
div-inv98.3%
pow-to-exp98.3%
pow198.3%
pow-div97.7%
Applied egg-rr97.7%
*-lft-identity97.7%
sub-neg97.7%
metadata-eval97.7%
Simplified97.7%
unpow-prod-up98.3%
inv-pow98.3%
Applied egg-rr98.3%
associate-*r/98.3%
*-rgt-identity98.3%
Simplified98.3%
Final simplification90.3%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))) (t_1 (/ (- (log1p x) (log x)) n)))
(if (<= (/ 1.0 n) -5e-29)
(/ (/ t_0 x) n)
(if (<= (/ 1.0 n) -1.2e-109)
t_1
(if (<= (/ 1.0 n) -1e-117)
(/ (/ 1.0 x) n)
(if (<= (/ 1.0 n) 2e-54)
t_1
(if (<= (/ 1.0 n) 1e-11)
(/ (/ (/ t_0 (sqrt x)) (sqrt x)) n)
(- (exp (/ (log1p x) n)) t_0))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double t_1 = (log1p(x) - log(x)) / n;
double tmp;
if ((1.0 / n) <= -5e-29) {
tmp = (t_0 / x) / n;
} else if ((1.0 / n) <= -1.2e-109) {
tmp = t_1;
} else if ((1.0 / n) <= -1e-117) {
tmp = (1.0 / x) / n;
} else if ((1.0 / n) <= 2e-54) {
tmp = t_1;
} else if ((1.0 / n) <= 1e-11) {
tmp = ((t_0 / sqrt(x)) / sqrt(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 t_1 = (Math.log1p(x) - Math.log(x)) / n;
double tmp;
if ((1.0 / n) <= -5e-29) {
tmp = (t_0 / x) / n;
} else if ((1.0 / n) <= -1.2e-109) {
tmp = t_1;
} else if ((1.0 / n) <= -1e-117) {
tmp = (1.0 / x) / n;
} else if ((1.0 / n) <= 2e-54) {
tmp = t_1;
} else if ((1.0 / n) <= 1e-11) {
tmp = ((t_0 / Math.sqrt(x)) / Math.sqrt(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)) t_1 = (math.log1p(x) - math.log(x)) / n tmp = 0 if (1.0 / n) <= -5e-29: tmp = (t_0 / x) / n elif (1.0 / n) <= -1.2e-109: tmp = t_1 elif (1.0 / n) <= -1e-117: tmp = (1.0 / x) / n elif (1.0 / n) <= 2e-54: tmp = t_1 elif (1.0 / n) <= 1e-11: tmp = ((t_0 / math.sqrt(x)) / math.sqrt(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) t_1 = Float64(Float64(log1p(x) - log(x)) / n) tmp = 0.0 if (Float64(1.0 / n) <= -5e-29) tmp = Float64(Float64(t_0 / x) / n); elseif (Float64(1.0 / n) <= -1.2e-109) tmp = t_1; elseif (Float64(1.0 / n) <= -1e-117) tmp = Float64(Float64(1.0 / x) / n); elseif (Float64(1.0 / n) <= 2e-54) tmp = t_1; elseif (Float64(1.0 / n) <= 1e-11) tmp = Float64(Float64(Float64(t_0 / sqrt(x)) / sqrt(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]}, Block[{t$95$1 = N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e-29], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], -1.2e-109], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-117], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-54], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-11], N[(N[(N[(t$95$0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{\mathsf{log1p}\left(x\right) - \log x}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-29}:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq -1.2 \cdot 10^{-109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{-117}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{-11}:\\
\;\;\;\;\frac{\frac{\frac{t\_0}{\sqrt{x}}}{\sqrt{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) < -4.99999999999999986e-29Initial program 89.9%
Taylor expanded in x around inf 66.8%
associate-/r*66.8%
mul-1-neg66.8%
log-rec66.8%
mul-1-neg66.8%
distribute-neg-frac66.8%
mul-1-neg66.8%
remove-double-neg66.8%
*-rgt-identity66.8%
associate-/l*66.8%
exp-to-pow96.3%
Simplified96.3%
associate-/l/96.2%
pow-to-exp66.8%
div-inv66.8%
*-un-lft-identity66.8%
associate-/r*66.8%
div-inv66.8%
pow-to-exp96.3%
pow196.3%
pow-div95.8%
Applied egg-rr95.8%
*-lft-identity95.8%
sub-neg95.8%
metadata-eval95.8%
Simplified95.8%
unpow-prod-up96.3%
inv-pow96.3%
Applied egg-rr96.3%
associate-*r/96.3%
*-rgt-identity96.3%
Simplified96.3%
if -4.99999999999999986e-29 < (/.f64 #s(literal 1 binary64) n) < -1.19999999999999994e-109 or -1.00000000000000003e-117 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e-54Initial program 22.7%
Taylor expanded in n around inf 82.3%
log1p-define82.3%
Simplified82.3%
if -1.19999999999999994e-109 < (/.f64 #s(literal 1 binary64) n) < -1.00000000000000003e-117Initial program 15.4%
Taylor expanded in x around inf 94.1%
associate-/r*99.2%
mul-1-neg99.2%
log-rec99.2%
mul-1-neg99.2%
distribute-neg-frac99.2%
mul-1-neg99.2%
remove-double-neg99.2%
*-rgt-identity99.2%
associate-/l*99.2%
exp-to-pow99.2%
Simplified99.2%
associate-/l/94.1%
pow-to-exp94.1%
div-inv94.1%
*-un-lft-identity94.1%
associate-/r*99.5%
div-inv99.5%
pow-to-exp99.5%
pow199.5%
pow-div99.5%
Applied egg-rr99.5%
*-lft-identity99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in n around inf 99.5%
if 2.0000000000000001e-54 < (/.f64 #s(literal 1 binary64) n) < 9.99999999999999939e-12Initial program 16.1%
Taylor expanded in x around inf 75.6%
associate-/r*80.0%
mul-1-neg80.0%
log-rec80.0%
mul-1-neg80.0%
distribute-neg-frac80.0%
mul-1-neg80.0%
remove-double-neg80.0%
*-rgt-identity80.0%
associate-/l*80.0%
exp-to-pow80.0%
Simplified80.0%
associate-/l/75.6%
pow-to-exp75.6%
div-inv75.6%
*-un-lft-identity75.6%
associate-/r*80.3%
div-inv80.3%
pow-to-exp80.3%
pow180.3%
pow-div79.2%
Applied egg-rr79.2%
*-lft-identity79.2%
sub-neg79.2%
metadata-eval79.2%
Simplified79.2%
unpow-prod-up80.3%
inv-pow80.3%
div-inv80.3%
metadata-eval80.3%
metadata-eval80.3%
associate-*r/80.3%
associate-/r*80.3%
pow-pow51.0%
add-sqr-sqrt50.7%
associate-/r*50.8%
pow-pow80.3%
associate-/r*80.3%
associate-*r/80.3%
metadata-eval80.3%
metadata-eval80.3%
Applied egg-rr80.3%
if 9.99999999999999939e-12 < (/.f64 #s(literal 1 binary64) n) Initial program 58.2%
Taylor expanded in n around 0 32.9%
log1p-define44.6%
*-rgt-identity44.6%
associate-*l/44.6%
associate-/l*44.6%
exp-to-pow94.6%
Simplified94.6%
Final simplification89.6%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n)))
(t_1 (/ (/ t_0 x) n))
(t_2 (/ (- (log1p x) (log x)) n)))
(if (<= (/ 1.0 n) -5e-29)
t_1
(if (<= (/ 1.0 n) -1.2e-109)
t_2
(if (<= (/ 1.0 n) -1e-117)
(/ (/ 1.0 x) n)
(if (<= (/ 1.0 n) 2e-54)
t_2
(if (<= (/ 1.0 n) 1e-11) t_1 (- (exp (/ (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 t_2 = (log1p(x) - log(x)) / n;
double tmp;
if ((1.0 / n) <= -5e-29) {
tmp = t_1;
} else if ((1.0 / n) <= -1.2e-109) {
tmp = t_2;
} else if ((1.0 / n) <= -1e-117) {
tmp = (1.0 / x) / n;
} else if ((1.0 / n) <= 2e-54) {
tmp = t_2;
} else if ((1.0 / n) <= 1e-11) {
tmp = t_1;
} 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 t_1 = (t_0 / x) / n;
double t_2 = (Math.log1p(x) - Math.log(x)) / n;
double tmp;
if ((1.0 / n) <= -5e-29) {
tmp = t_1;
} else if ((1.0 / n) <= -1.2e-109) {
tmp = t_2;
} else if ((1.0 / n) <= -1e-117) {
tmp = (1.0 / x) / n;
} else if ((1.0 / n) <= 2e-54) {
tmp = t_2;
} else if ((1.0 / n) <= 1e-11) {
tmp = t_1;
} else {
tmp = Math.exp((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 t_2 = (math.log1p(x) - math.log(x)) / n tmp = 0 if (1.0 / n) <= -5e-29: tmp = t_1 elif (1.0 / n) <= -1.2e-109: tmp = t_2 elif (1.0 / n) <= -1e-117: tmp = (1.0 / x) / n elif (1.0 / n) <= 2e-54: tmp = t_2 elif (1.0 / n) <= 1e-11: tmp = t_1 else: tmp = math.exp((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) t_2 = Float64(Float64(log1p(x) - log(x)) / n) tmp = 0.0 if (Float64(1.0 / n) <= -5e-29) tmp = t_1; elseif (Float64(1.0 / n) <= -1.2e-109) tmp = t_2; elseif (Float64(1.0 / n) <= -1e-117) tmp = Float64(Float64(1.0 / x) / n); elseif (Float64(1.0 / n) <= 2e-54) tmp = t_2; elseif (Float64(1.0 / n) <= 1e-11) tmp = t_1; 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]}, Block[{t$95$1 = N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e-29], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1.2e-109], t$95$2, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-117], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-54], t$95$2, If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-11], t$95$1, 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)}\\
t_1 := \frac{\frac{t\_0}{x}}{n}\\
t_2 := \frac{\mathsf{log1p}\left(x\right) - \log x}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{1}{n} \leq -1.2 \cdot 10^{-109}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{-117}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-54}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t\_0\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -4.99999999999999986e-29 or 2.0000000000000001e-54 < (/.f64 #s(literal 1 binary64) n) < 9.99999999999999939e-12Initial program 81.5%
Taylor expanded in x around inf 67.8%
associate-/r*68.3%
mul-1-neg68.3%
log-rec68.3%
mul-1-neg68.3%
distribute-neg-frac68.3%
mul-1-neg68.3%
remove-double-neg68.3%
*-rgt-identity68.3%
associate-/l*68.3%
exp-to-pow94.4%
Simplified94.4%
associate-/l/93.9%
pow-to-exp67.8%
div-inv67.8%
*-un-lft-identity67.8%
associate-/r*68.3%
div-inv68.3%
pow-to-exp94.5%
pow194.5%
pow-div93.9%
Applied egg-rr93.9%
*-lft-identity93.9%
sub-neg93.9%
metadata-eval93.9%
Simplified93.9%
unpow-prod-up94.4%
inv-pow94.4%
Applied egg-rr94.4%
associate-*r/94.5%
*-rgt-identity94.5%
Simplified94.5%
if -4.99999999999999986e-29 < (/.f64 #s(literal 1 binary64) n) < -1.19999999999999994e-109 or -1.00000000000000003e-117 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e-54Initial program 22.7%
Taylor expanded in n around inf 82.3%
log1p-define82.3%
Simplified82.3%
if -1.19999999999999994e-109 < (/.f64 #s(literal 1 binary64) n) < -1.00000000000000003e-117Initial program 15.4%
Taylor expanded in x around inf 94.1%
associate-/r*99.2%
mul-1-neg99.2%
log-rec99.2%
mul-1-neg99.2%
distribute-neg-frac99.2%
mul-1-neg99.2%
remove-double-neg99.2%
*-rgt-identity99.2%
associate-/l*99.2%
exp-to-pow99.2%
Simplified99.2%
associate-/l/94.1%
pow-to-exp94.1%
div-inv94.1%
*-un-lft-identity94.1%
associate-/r*99.5%
div-inv99.5%
pow-to-exp99.5%
pow199.5%
pow-div99.5%
Applied egg-rr99.5%
*-lft-identity99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in n around inf 99.5%
if 9.99999999999999939e-12 < (/.f64 #s(literal 1 binary64) n) Initial program 58.2%
Taylor expanded in n around 0 32.9%
log1p-define44.6%
*-rgt-identity44.6%
associate-*l/44.6%
associate-/l*44.6%
exp-to-pow94.6%
Simplified94.6%
Final simplification89.6%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= x -2.25e-153)
(/ (/ t_0 n) x)
(if (<= x 5e-309)
(- (+ 1.0 (/ x n)) t_0)
(if (<= x 970.0) (/ (- (log1p x) (log x)) n) (/ (/ t_0 x) n))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if (x <= -2.25e-153) {
tmp = (t_0 / n) / x;
} else if (x <= 5e-309) {
tmp = (1.0 + (x / n)) - t_0;
} else if (x <= 970.0) {
tmp = (log1p(x) - log(x)) / n;
} else {
tmp = (t_0 / x) / n;
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if (x <= -2.25e-153) {
tmp = (t_0 / n) / x;
} else if (x <= 5e-309) {
tmp = (1.0 + (x / n)) - t_0;
} else if (x <= 970.0) {
tmp = (Math.log1p(x) - Math.log(x)) / n;
} else {
tmp = (t_0 / x) / n;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if x <= -2.25e-153: tmp = (t_0 / n) / x elif x <= 5e-309: tmp = (1.0 + (x / n)) - t_0 elif x <= 970.0: tmp = (math.log1p(x) - math.log(x)) / n else: tmp = (t_0 / x) / n return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (x <= -2.25e-153) tmp = Float64(Float64(t_0 / n) / x); elseif (x <= 5e-309) tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0); elseif (x <= 970.0) tmp = Float64(Float64(log1p(x) - log(x)) / n); else tmp = Float64(Float64(t_0 / x) / n); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -2.25e-153], N[(N[(t$95$0 / n), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 5e-309], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x, 970.0], N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;x \leq -2.25 \cdot 10^{-153}:\\
\;\;\;\;\frac{\frac{t\_0}{n}}{x}\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-309}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - t\_0\\
\mathbf{elif}\;x \leq 970:\\
\;\;\;\;\frac{\mathsf{log1p}\left(x\right) - \log x}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\end{array}
\end{array}
if x < -2.25e-153Initial program 65.7%
Taylor expanded in x around inf 0.0%
associate-/r*0.0%
mul-1-neg0.0%
log-rec0.0%
mul-1-neg0.0%
distribute-neg-frac0.0%
mul-1-neg0.0%
remove-double-neg0.0%
*-rgt-identity0.0%
associate-/l*0.0%
exp-to-pow89.3%
Simplified89.3%
if -2.25e-153 < x < 4.9999999999999995e-309Initial program 74.3%
Taylor expanded in x around 0 80.6%
if 4.9999999999999995e-309 < x < 970Initial program 36.8%
Taylor expanded in n around inf 63.3%
log1p-define63.3%
Simplified63.3%
if 970 < x Initial program 57.4%
Taylor expanded in x around inf 96.8%
associate-/r*99.1%
mul-1-neg99.1%
log-rec99.1%
mul-1-neg99.1%
distribute-neg-frac99.1%
mul-1-neg99.1%
remove-double-neg99.1%
*-rgt-identity99.1%
associate-/l*99.1%
exp-to-pow99.1%
Simplified99.1%
associate-/l/96.8%
pow-to-exp96.8%
div-inv96.8%
*-un-lft-identity96.8%
associate-/r*99.1%
div-inv99.1%
pow-to-exp99.1%
pow199.1%
pow-div98.6%
Applied egg-rr98.6%
*-lft-identity98.6%
sub-neg98.6%
metadata-eval98.6%
Simplified98.6%
unpow-prod-up99.1%
inv-pow99.1%
Applied egg-rr99.1%
associate-*r/99.1%
*-rgt-identity99.1%
Simplified99.1%
Final simplification80.7%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= x -1.8e-152)
(/ (pow (pow x 2.0) (* (+ (/ 1.0 n) -1.0) 0.5)) n)
(if (<= x 1.4e-308)
(- (+ 1.0 (/ x n)) t_0)
(if (<= x 9.0) (/ (- (log1p x) (log x)) n) (/ (/ t_0 x) n))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if (x <= -1.8e-152) {
tmp = pow(pow(x, 2.0), (((1.0 / n) + -1.0) * 0.5)) / n;
} else if (x <= 1.4e-308) {
tmp = (1.0 + (x / n)) - t_0;
} else if (x <= 9.0) {
tmp = (log1p(x) - log(x)) / n;
} else {
tmp = (t_0 / x) / n;
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if (x <= -1.8e-152) {
tmp = Math.pow(Math.pow(x, 2.0), (((1.0 / n) + -1.0) * 0.5)) / n;
} else if (x <= 1.4e-308) {
tmp = (1.0 + (x / n)) - t_0;
} else if (x <= 9.0) {
tmp = (Math.log1p(x) - Math.log(x)) / n;
} else {
tmp = (t_0 / x) / n;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if x <= -1.8e-152: tmp = math.pow(math.pow(x, 2.0), (((1.0 / n) + -1.0) * 0.5)) / n elif x <= 1.4e-308: tmp = (1.0 + (x / n)) - t_0 elif x <= 9.0: tmp = (math.log1p(x) - math.log(x)) / n else: tmp = (t_0 / x) / n return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (x <= -1.8e-152) tmp = Float64(((x ^ 2.0) ^ Float64(Float64(Float64(1.0 / n) + -1.0) * 0.5)) / n); elseif (x <= 1.4e-308) tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0); elseif (x <= 9.0) tmp = Float64(Float64(log1p(x) - log(x)) / n); else tmp = Float64(Float64(t_0 / x) / n); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.8e-152], N[(N[Power[N[Power[x, 2.0], $MachinePrecision], N[(N[(N[(1.0 / n), $MachinePrecision] + -1.0), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 1.4e-308], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x, 9.0], N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;x \leq -1.8 \cdot 10^{-152}:\\
\;\;\;\;\frac{{\left({x}^{2}\right)}^{\left(\left(\frac{1}{n} + -1\right) \cdot 0.5\right)}}{n}\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-308}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - t\_0\\
\mathbf{elif}\;x \leq 9:\\
\;\;\;\;\frac{\mathsf{log1p}\left(x\right) - \log x}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\end{array}
\end{array}
if x < -1.8e-152Initial program 65.7%
Taylor expanded in x around inf 0.0%
associate-/r*0.0%
mul-1-neg0.0%
log-rec0.0%
mul-1-neg0.0%
distribute-neg-frac0.0%
mul-1-neg0.0%
remove-double-neg0.0%
*-rgt-identity0.0%
associate-/l*0.0%
exp-to-pow89.3%
Simplified89.3%
associate-/l/78.5%
pow-to-exp0.0%
div-inv0.0%
*-un-lft-identity0.0%
associate-/r*0.0%
div-inv0.0%
pow-to-exp89.3%
pow189.3%
pow-div89.3%
Applied egg-rr89.3%
*-lft-identity89.3%
sub-neg89.3%
metadata-eval89.3%
Simplified89.3%
unpow-prod-up89.3%
inv-pow89.3%
Applied egg-rr89.3%
associate-*r/89.3%
*-rgt-identity89.3%
Simplified89.3%
div-inv89.3%
inv-pow89.3%
unpow-prod-up89.3%
sqr-pow89.3%
unpow-prod-down94.8%
unpow294.8%
div-inv94.8%
metadata-eval94.8%
Applied egg-rr94.8%
if -1.8e-152 < x < 1.4000000000000002e-308Initial program 74.3%
Taylor expanded in x around 0 80.6%
if 1.4000000000000002e-308 < x < 9Initial program 36.8%
Taylor expanded in n around inf 63.3%
log1p-define63.3%
Simplified63.3%
if 9 < x Initial program 57.4%
Taylor expanded in x around inf 96.8%
associate-/r*99.1%
mul-1-neg99.1%
log-rec99.1%
mul-1-neg99.1%
distribute-neg-frac99.1%
mul-1-neg99.1%
remove-double-neg99.1%
*-rgt-identity99.1%
associate-/l*99.1%
exp-to-pow99.1%
Simplified99.1%
associate-/l/96.8%
pow-to-exp96.8%
div-inv96.8%
*-un-lft-identity96.8%
associate-/r*99.1%
div-inv99.1%
pow-to-exp99.1%
pow199.1%
pow-div98.6%
Applied egg-rr98.6%
*-lft-identity98.6%
sub-neg98.6%
metadata-eval98.6%
Simplified98.6%
unpow-prod-up99.1%
inv-pow99.1%
Applied egg-rr99.1%
associate-*r/99.1%
*-rgt-identity99.1%
Simplified99.1%
Final simplification81.5%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))) (t_1 (/ (/ t_0 n) x)))
(if (<= x -1.4e-152)
t_1
(if (<= x 5.5e-308)
(- 1.0 t_0)
(if (<= x 1.05e-15) (- (/ (log x) n)) t_1)))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double t_1 = (t_0 / n) / x;
double tmp;
if (x <= -1.4e-152) {
tmp = t_1;
} else if (x <= 5.5e-308) {
tmp = 1.0 - t_0;
} else if (x <= 1.05e-15) {
tmp = -(log(x) / n);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x ** (1.0d0 / n)
t_1 = (t_0 / n) / x
if (x <= (-1.4d-152)) then
tmp = t_1
else if (x <= 5.5d-308) then
tmp = 1.0d0 - t_0
else if (x <= 1.05d-15) then
tmp = -(log(x) / n)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double t_1 = (t_0 / n) / x;
double tmp;
if (x <= -1.4e-152) {
tmp = t_1;
} else if (x <= 5.5e-308) {
tmp = 1.0 - t_0;
} else if (x <= 1.05e-15) {
tmp = -(Math.log(x) / n);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) t_1 = (t_0 / n) / x tmp = 0 if x <= -1.4e-152: tmp = t_1 elif x <= 5.5e-308: tmp = 1.0 - t_0 elif x <= 1.05e-15: tmp = -(math.log(x) / n) else: tmp = t_1 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 (x <= -1.4e-152) tmp = t_1; elseif (x <= 5.5e-308) tmp = Float64(1.0 - t_0); elseif (x <= 1.05e-15) tmp = Float64(-Float64(log(x) / n)); else tmp = t_1; 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 (x <= -1.4e-152) tmp = t_1; elseif (x <= 5.5e-308) tmp = 1.0 - t_0; elseif (x <= 1.05e-15) tmp = -(log(x) / n); else tmp = t_1; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 / n), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[x, -1.4e-152], t$95$1, If[LessEqual[x, 5.5e-308], N[(1.0 - t$95$0), $MachinePrecision], If[LessEqual[x, 1.05e-15], (-N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]), t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{\frac{t\_0}{n}}{x}\\
\mathbf{if}\;x \leq -1.4 \cdot 10^{-152}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-308}:\\
\;\;\;\;1 - t\_0\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-15}:\\
\;\;\;\;-\frac{\log x}{n}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.39999999999999992e-152 or 1.0499999999999999e-15 < x Initial program 58.9%
Taylor expanded in x around inf 67.5%
associate-/r*69.0%
mul-1-neg69.0%
log-rec69.0%
mul-1-neg69.0%
distribute-neg-frac69.0%
mul-1-neg69.0%
remove-double-neg69.0%
*-rgt-identity69.0%
associate-/l*69.0%
exp-to-pow94.4%
Simplified94.4%
if -1.39999999999999992e-152 < x < 5.5e-308Initial program 74.3%
Taylor expanded in x around 0 0.0%
*-rgt-identity0.0%
associate-*l/0.0%
associate-/l*0.0%
exp-to-pow74.3%
Simplified74.3%
if 5.5e-308 < x < 1.0499999999999999e-15Initial program 37.0%
Taylor expanded in x around 0 36.1%
*-rgt-identity36.1%
associate-*l/36.1%
associate-/l*36.1%
exp-to-pow36.1%
Simplified36.1%
Taylor expanded in n around inf 62.8%
mul-1-neg62.8%
distribute-frac-neg262.8%
Simplified62.8%
Final simplification79.7%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= x -3.75e-149)
(/ (/ t_0 n) x)
(if (<= x 4.8e-308)
(- 1.0 t_0)
(if (<= x 1.9e-15) (- (/ (log x) n)) (/ (/ t_0 x) n))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if (x <= -3.75e-149) {
tmp = (t_0 / n) / x;
} else if (x <= 4.8e-308) {
tmp = 1.0 - t_0;
} else if (x <= 1.9e-15) {
tmp = -(log(x) / n);
} else {
tmp = (t_0 / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = x ** (1.0d0 / n)
if (x <= (-3.75d-149)) then
tmp = (t_0 / n) / x
else if (x <= 4.8d-308) then
tmp = 1.0d0 - t_0
else if (x <= 1.9d-15) then
tmp = -(log(x) / n)
else
tmp = (t_0 / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if (x <= -3.75e-149) {
tmp = (t_0 / n) / x;
} else if (x <= 4.8e-308) {
tmp = 1.0 - t_0;
} else if (x <= 1.9e-15) {
tmp = -(Math.log(x) / n);
} else {
tmp = (t_0 / x) / n;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if x <= -3.75e-149: tmp = (t_0 / n) / x elif x <= 4.8e-308: tmp = 1.0 - t_0 elif x <= 1.9e-15: tmp = -(math.log(x) / n) else: tmp = (t_0 / x) / n return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (x <= -3.75e-149) tmp = Float64(Float64(t_0 / n) / x); elseif (x <= 4.8e-308) tmp = Float64(1.0 - t_0); elseif (x <= 1.9e-15) tmp = Float64(-Float64(log(x) / n)); else tmp = Float64(Float64(t_0 / x) / n); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if (x <= -3.75e-149) tmp = (t_0 / n) / x; elseif (x <= 4.8e-308) tmp = 1.0 - t_0; elseif (x <= 1.9e-15) tmp = -(log(x) / n); else tmp = (t_0 / x) / n; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -3.75e-149], N[(N[(t$95$0 / n), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 4.8e-308], N[(1.0 - t$95$0), $MachinePrecision], If[LessEqual[x, 1.9e-15], (-N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]), N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;x \leq -3.75 \cdot 10^{-149}:\\
\;\;\;\;\frac{\frac{t\_0}{n}}{x}\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-308}:\\
\;\;\;\;1 - t\_0\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-15}:\\
\;\;\;\;-\frac{\log x}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\end{array}
\end{array}
if x < -3.74999999999999998e-149Initial program 65.7%
Taylor expanded in x around inf 0.0%
associate-/r*0.0%
mul-1-neg0.0%
log-rec0.0%
mul-1-neg0.0%
distribute-neg-frac0.0%
mul-1-neg0.0%
remove-double-neg0.0%
*-rgt-identity0.0%
associate-/l*0.0%
exp-to-pow89.3%
Simplified89.3%
if -3.74999999999999998e-149 < x < 4.80000000000000016e-308Initial program 74.3%
Taylor expanded in x around 0 0.0%
*-rgt-identity0.0%
associate-*l/0.0%
associate-/l*0.0%
exp-to-pow74.3%
Simplified74.3%
if 4.80000000000000016e-308 < x < 1.9000000000000001e-15Initial program 37.0%
Taylor expanded in x around 0 36.1%
*-rgt-identity36.1%
associate-*l/36.1%
associate-/l*36.1%
exp-to-pow36.1%
Simplified36.1%
Taylor expanded in n around inf 62.8%
mul-1-neg62.8%
distribute-frac-neg262.8%
Simplified62.8%
if 1.9000000000000001e-15 < x Initial program 56.2%
Taylor expanded in x around inf 94.3%
associate-/r*96.5%
mul-1-neg96.5%
log-rec96.5%
mul-1-neg96.5%
distribute-neg-frac96.5%
mul-1-neg96.5%
remove-double-neg96.5%
*-rgt-identity96.5%
associate-/l*96.5%
exp-to-pow96.5%
Simplified96.5%
associate-/l/94.3%
pow-to-exp94.3%
div-inv94.3%
*-un-lft-identity94.3%
associate-/r*96.5%
div-inv96.5%
pow-to-exp96.5%
pow196.5%
pow-div96.0%
Applied egg-rr96.0%
*-lft-identity96.0%
sub-neg96.0%
metadata-eval96.0%
Simplified96.0%
unpow-prod-up96.5%
inv-pow96.5%
Applied egg-rr96.5%
associate-*r/96.5%
*-rgt-identity96.5%
Simplified96.5%
Final simplification79.7%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= x -2.5e-153)
(/ (/ t_0 n) x)
(if (<= x 1.8e-308)
(- (+ 1.0 (/ x n)) t_0)
(if (<= x 3.2e-15) (- (/ (log x) n)) (/ (/ t_0 x) n))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if (x <= -2.5e-153) {
tmp = (t_0 / n) / x;
} else if (x <= 1.8e-308) {
tmp = (1.0 + (x / n)) - t_0;
} else if (x <= 3.2e-15) {
tmp = -(log(x) / n);
} else {
tmp = (t_0 / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = x ** (1.0d0 / n)
if (x <= (-2.5d-153)) then
tmp = (t_0 / n) / x
else if (x <= 1.8d-308) then
tmp = (1.0d0 + (x / n)) - t_0
else if (x <= 3.2d-15) then
tmp = -(log(x) / n)
else
tmp = (t_0 / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if (x <= -2.5e-153) {
tmp = (t_0 / n) / x;
} else if (x <= 1.8e-308) {
tmp = (1.0 + (x / n)) - t_0;
} else if (x <= 3.2e-15) {
tmp = -(Math.log(x) / n);
} else {
tmp = (t_0 / x) / n;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if x <= -2.5e-153: tmp = (t_0 / n) / x elif x <= 1.8e-308: tmp = (1.0 + (x / n)) - t_0 elif x <= 3.2e-15: tmp = -(math.log(x) / n) else: tmp = (t_0 / x) / n return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (x <= -2.5e-153) tmp = Float64(Float64(t_0 / n) / x); elseif (x <= 1.8e-308) tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0); elseif (x <= 3.2e-15) tmp = Float64(-Float64(log(x) / n)); else tmp = Float64(Float64(t_0 / x) / n); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if (x <= -2.5e-153) tmp = (t_0 / n) / x; elseif (x <= 1.8e-308) tmp = (1.0 + (x / n)) - t_0; elseif (x <= 3.2e-15) tmp = -(log(x) / n); else tmp = (t_0 / x) / n; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -2.5e-153], N[(N[(t$95$0 / n), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 1.8e-308], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x, 3.2e-15], (-N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]), N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{-153}:\\
\;\;\;\;\frac{\frac{t\_0}{n}}{x}\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-308}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - t\_0\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-15}:\\
\;\;\;\;-\frac{\log x}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\end{array}
\end{array}
if x < -2.50000000000000016e-153Initial program 65.7%
Taylor expanded in x around inf 0.0%
associate-/r*0.0%
mul-1-neg0.0%
log-rec0.0%
mul-1-neg0.0%
distribute-neg-frac0.0%
mul-1-neg0.0%
remove-double-neg0.0%
*-rgt-identity0.0%
associate-/l*0.0%
exp-to-pow89.3%
Simplified89.3%
if -2.50000000000000016e-153 < x < 1.7999999999999999e-308Initial program 74.3%
Taylor expanded in x around 0 80.6%
if 1.7999999999999999e-308 < x < 3.1999999999999999e-15Initial program 37.0%
Taylor expanded in x around 0 36.1%
*-rgt-identity36.1%
associate-*l/36.1%
associate-/l*36.1%
exp-to-pow36.1%
Simplified36.1%
Taylor expanded in n around inf 62.8%
mul-1-neg62.8%
distribute-frac-neg262.8%
Simplified62.8%
if 3.1999999999999999e-15 < x Initial program 56.2%
Taylor expanded in x around inf 94.3%
associate-/r*96.5%
mul-1-neg96.5%
log-rec96.5%
mul-1-neg96.5%
distribute-neg-frac96.5%
mul-1-neg96.5%
remove-double-neg96.5%
*-rgt-identity96.5%
associate-/l*96.5%
exp-to-pow96.5%
Simplified96.5%
associate-/l/94.3%
pow-to-exp94.3%
div-inv94.3%
*-un-lft-identity94.3%
associate-/r*96.5%
div-inv96.5%
pow-to-exp96.5%
pow196.5%
pow-div96.0%
Applied egg-rr96.0%
*-lft-identity96.0%
sub-neg96.0%
metadata-eval96.0%
Simplified96.0%
unpow-prod-up96.5%
inv-pow96.5%
Applied egg-rr96.5%
associate-*r/96.5%
*-rgt-identity96.5%
Simplified96.5%
Final simplification80.1%
(FPCore (x n)
:precision binary64
(if (<= x -1.46e-151)
(/ (log (+ x 1.0)) n)
(if (<= x 1.4e-308)
(- 1.0 (pow x (/ 1.0 n)))
(if (<= x 0.55) (- (/ (log x) n)) (/ (/ 1.0 x) n)))))
double code(double x, double n) {
double tmp;
if (x <= -1.46e-151) {
tmp = log((x + 1.0)) / n;
} else if (x <= 1.4e-308) {
tmp = 1.0 - pow(x, (1.0 / n));
} else if (x <= 0.55) {
tmp = -(log(x) / n);
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= (-1.46d-151)) then
tmp = log((x + 1.0d0)) / n
else if (x <= 1.4d-308) then
tmp = 1.0d0 - (x ** (1.0d0 / n))
else if (x <= 0.55d0) then
tmp = -(log(x) / n)
else
tmp = (1.0d0 / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= -1.46e-151) {
tmp = Math.log((x + 1.0)) / n;
} else if (x <= 1.4e-308) {
tmp = 1.0 - Math.pow(x, (1.0 / n));
} else if (x <= 0.55) {
tmp = -(Math.log(x) / n);
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= -1.46e-151: tmp = math.log((x + 1.0)) / n elif x <= 1.4e-308: tmp = 1.0 - math.pow(x, (1.0 / n)) elif x <= 0.55: tmp = -(math.log(x) / n) else: tmp = (1.0 / x) / n return tmp
function code(x, n) tmp = 0.0 if (x <= -1.46e-151) tmp = Float64(log(Float64(x + 1.0)) / n); elseif (x <= 1.4e-308) tmp = Float64(1.0 - (x ^ Float64(1.0 / n))); elseif (x <= 0.55) tmp = Float64(-Float64(log(x) / n)); else tmp = Float64(Float64(1.0 / x) / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= -1.46e-151) tmp = log((x + 1.0)) / n; elseif (x <= 1.4e-308) tmp = 1.0 - (x ^ (1.0 / n)); elseif (x <= 0.55) tmp = -(log(x) / n); else tmp = (1.0 / x) / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, -1.46e-151], N[(N[Log[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 1.4e-308], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.55], (-N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]), N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.46 \cdot 10^{-151}:\\
\;\;\;\;\frac{\log \left(x + 1\right)}{n}\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-308}:\\
\;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{elif}\;x \leq 0.55:\\
\;\;\;\;-\frac{\log x}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\end{array}
\end{array}
if x < -1.45999999999999996e-151Initial program 65.7%
add-sqr-sqrt65.7%
sqrt-unprod65.7%
pow-prod-down70.7%
pow270.7%
Applied egg-rr70.7%
Taylor expanded in n around inf 29.2%
Taylor expanded in n around inf 27.2%
if -1.45999999999999996e-151 < x < 1.4000000000000002e-308Initial program 74.3%
Taylor expanded in x around 0 0.0%
*-rgt-identity0.0%
associate-*l/0.0%
associate-/l*0.0%
exp-to-pow74.3%
Simplified74.3%
if 1.4000000000000002e-308 < x < 0.55000000000000004Initial program 37.0%
Taylor expanded in x around 0 36.2%
*-rgt-identity36.2%
associate-*l/36.2%
associate-/l*36.2%
exp-to-pow36.2%
Simplified36.2%
Taylor expanded in n around inf 62.2%
mul-1-neg62.2%
distribute-frac-neg262.2%
Simplified62.2%
if 0.55000000000000004 < x Initial program 56.9%
Taylor expanded in x around inf 96.0%
associate-/r*98.2%
mul-1-neg98.2%
log-rec98.2%
mul-1-neg98.2%
distribute-neg-frac98.2%
mul-1-neg98.2%
remove-double-neg98.2%
*-rgt-identity98.2%
associate-/l*98.2%
exp-to-pow98.2%
Simplified98.2%
associate-/l/96.0%
pow-to-exp96.0%
div-inv96.0%
*-un-lft-identity96.0%
associate-/r*98.3%
div-inv98.3%
pow-to-exp98.3%
pow198.3%
pow-div97.7%
Applied egg-rr97.7%
*-lft-identity97.7%
sub-neg97.7%
metadata-eval97.7%
Simplified97.7%
Taylor expanded in n around inf 63.5%
Final simplification58.5%
(FPCore (x n)
:precision binary64
(if (<= x -3.4e-153)
(+ -1.0 (pow (+ x 1.0) (/ 1.0 n)))
(if (<= x 3e-308)
(- 1.0 (pow x (/ 1.0 n)))
(if (<= x 0.55) (- (/ (log x) n)) (/ (/ 1.0 x) n)))))
double code(double x, double n) {
double tmp;
if (x <= -3.4e-153) {
tmp = -1.0 + pow((x + 1.0), (1.0 / n));
} else if (x <= 3e-308) {
tmp = 1.0 - pow(x, (1.0 / n));
} else if (x <= 0.55) {
tmp = -(log(x) / n);
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= (-3.4d-153)) then
tmp = (-1.0d0) + ((x + 1.0d0) ** (1.0d0 / n))
else if (x <= 3d-308) then
tmp = 1.0d0 - (x ** (1.0d0 / n))
else if (x <= 0.55d0) then
tmp = -(log(x) / n)
else
tmp = (1.0d0 / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= -3.4e-153) {
tmp = -1.0 + Math.pow((x + 1.0), (1.0 / n));
} else if (x <= 3e-308) {
tmp = 1.0 - Math.pow(x, (1.0 / n));
} else if (x <= 0.55) {
tmp = -(Math.log(x) / n);
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= -3.4e-153: tmp = -1.0 + math.pow((x + 1.0), (1.0 / n)) elif x <= 3e-308: tmp = 1.0 - math.pow(x, (1.0 / n)) elif x <= 0.55: tmp = -(math.log(x) / n) else: tmp = (1.0 / x) / n return tmp
function code(x, n) tmp = 0.0 if (x <= -3.4e-153) tmp = Float64(-1.0 + (Float64(x + 1.0) ^ Float64(1.0 / n))); elseif (x <= 3e-308) tmp = Float64(1.0 - (x ^ Float64(1.0 / n))); elseif (x <= 0.55) tmp = Float64(-Float64(log(x) / n)); else tmp = Float64(Float64(1.0 / x) / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= -3.4e-153) tmp = -1.0 + ((x + 1.0) ^ (1.0 / n)); elseif (x <= 3e-308) tmp = 1.0 - (x ^ (1.0 / n)); elseif (x <= 0.55) tmp = -(log(x) / n); else tmp = (1.0 / x) / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, -3.4e-153], N[(-1.0 + N[Power[N[(x + 1.0), $MachinePrecision], N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3e-308], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.55], (-N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]), N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-153}:\\
\;\;\;\;-1 + {\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-308}:\\
\;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{elif}\;x \leq 0.55:\\
\;\;\;\;-\frac{\log x}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\end{array}
\end{array}
if x < -3.3999999999999998e-153Initial program 65.7%
add-sqr-sqrt65.7%
sqrt-unprod65.7%
pow-prod-down70.7%
pow270.7%
Applied egg-rr70.7%
sqrt-pow170.7%
associate-/l/70.7%
Applied egg-rr70.7%
Taylor expanded in n around inf 29.2%
if -3.3999999999999998e-153 < x < 3.00000000000000022e-308Initial program 74.3%
Taylor expanded in x around 0 0.0%
*-rgt-identity0.0%
associate-*l/0.0%
associate-/l*0.0%
exp-to-pow74.3%
Simplified74.3%
if 3.00000000000000022e-308 < x < 0.55000000000000004Initial program 37.0%
Taylor expanded in x around 0 36.2%
*-rgt-identity36.2%
associate-*l/36.2%
associate-/l*36.2%
exp-to-pow36.2%
Simplified36.2%
Taylor expanded in n around inf 62.2%
mul-1-neg62.2%
distribute-frac-neg262.2%
Simplified62.2%
if 0.55000000000000004 < x Initial program 56.9%
Taylor expanded in x around inf 96.0%
associate-/r*98.2%
mul-1-neg98.2%
log-rec98.2%
mul-1-neg98.2%
distribute-neg-frac98.2%
mul-1-neg98.2%
remove-double-neg98.2%
*-rgt-identity98.2%
associate-/l*98.2%
exp-to-pow98.2%
Simplified98.2%
associate-/l/96.0%
pow-to-exp96.0%
div-inv96.0%
*-un-lft-identity96.0%
associate-/r*98.3%
div-inv98.3%
pow-to-exp98.3%
pow198.3%
pow-div97.7%
Applied egg-rr97.7%
*-lft-identity97.7%
sub-neg97.7%
metadata-eval97.7%
Simplified97.7%
Taylor expanded in n around inf 63.5%
Final simplification58.7%
(FPCore (x n) :precision binary64 (if (<= x -5e-310) (/ (log (+ x 1.0)) n) (if (<= x 0.55) (- (/ (log x) n)) (/ (/ 1.0 x) n))))
double code(double x, double n) {
double tmp;
if (x <= -5e-310) {
tmp = log((x + 1.0)) / n;
} else if (x <= 0.55) {
tmp = -(log(x) / n);
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= (-5d-310)) then
tmp = log((x + 1.0d0)) / n
else if (x <= 0.55d0) then
tmp = -(log(x) / n)
else
tmp = (1.0d0 / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= -5e-310) {
tmp = Math.log((x + 1.0)) / n;
} else if (x <= 0.55) {
tmp = -(Math.log(x) / n);
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= -5e-310: tmp = math.log((x + 1.0)) / n elif x <= 0.55: tmp = -(math.log(x) / n) else: tmp = (1.0 / x) / n return tmp
function code(x, n) tmp = 0.0 if (x <= -5e-310) tmp = Float64(log(Float64(x + 1.0)) / n); elseif (x <= 0.55) tmp = Float64(-Float64(log(x) / n)); else tmp = Float64(Float64(1.0 / x) / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= -5e-310) tmp = log((x + 1.0)) / n; elseif (x <= 0.55) tmp = -(log(x) / n); else tmp = (1.0 / x) / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, -5e-310], N[(N[Log[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 0.55], (-N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]), N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\log \left(x + 1\right)}{n}\\
\mathbf{elif}\;x \leq 0.55:\\
\;\;\;\;-\frac{\log x}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\end{array}
\end{array}
if x < -4.999999999999985e-310Initial program 68.5%
add-sqr-sqrt68.5%
sqrt-unprod68.5%
pow-prod-down71.9%
pow271.9%
Applied egg-rr71.9%
Taylor expanded in n around inf 25.9%
Taylor expanded in n around inf 24.6%
if -4.999999999999985e-310 < x < 0.55000000000000004Initial program 37.0%
Taylor expanded in x around 0 36.2%
*-rgt-identity36.2%
associate-*l/36.2%
associate-/l*36.2%
exp-to-pow36.2%
Simplified36.2%
Taylor expanded in n around inf 62.2%
mul-1-neg62.2%
distribute-frac-neg262.2%
Simplified62.2%
if 0.55000000000000004 < x Initial program 56.9%
Taylor expanded in x around inf 96.0%
associate-/r*98.2%
mul-1-neg98.2%
log-rec98.2%
mul-1-neg98.2%
distribute-neg-frac98.2%
mul-1-neg98.2%
remove-double-neg98.2%
*-rgt-identity98.2%
associate-/l*98.2%
exp-to-pow98.2%
Simplified98.2%
associate-/l/96.0%
pow-to-exp96.0%
div-inv96.0%
*-un-lft-identity96.0%
associate-/r*98.3%
div-inv98.3%
pow-to-exp98.3%
pow198.3%
pow-div97.7%
Applied egg-rr97.7%
*-lft-identity97.7%
sub-neg97.7%
metadata-eval97.7%
Simplified97.7%
Taylor expanded in n around inf 63.5%
Final simplification54.6%
(FPCore (x n) :precision binary64 (if (<= x 0.55) (- (/ (log x) n)) (/ (/ 1.0 x) n)))
double code(double x, double n) {
double tmp;
if (x <= 0.55) {
tmp = -(log(x) / n);
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 0.55d0) then
tmp = -(log(x) / n)
else
tmp = (1.0d0 / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 0.55) {
tmp = -(Math.log(x) / n);
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 0.55: tmp = -(math.log(x) / n) else: tmp = (1.0 / x) / n return tmp
function code(x, n) tmp = 0.0 if (x <= 0.55) tmp = Float64(-Float64(log(x) / n)); else tmp = Float64(Float64(1.0 / x) / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 0.55) tmp = -(log(x) / n); else tmp = (1.0 / x) / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 0.55], (-N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]), N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.55:\\
\;\;\;\;-\frac{\log x}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\end{array}
\end{array}
if x < 0.55000000000000004Initial program 47.5%
Taylor expanded in x around 0 24.2%
*-rgt-identity24.2%
associate-*l/24.2%
associate-/l*24.2%
exp-to-pow33.5%
Simplified33.5%
Taylor expanded in n around inf 41.6%
mul-1-neg41.6%
distribute-frac-neg241.6%
Simplified41.6%
if 0.55000000000000004 < x Initial program 56.9%
Taylor expanded in x around inf 96.0%
associate-/r*98.2%
mul-1-neg98.2%
log-rec98.2%
mul-1-neg98.2%
distribute-neg-frac98.2%
mul-1-neg98.2%
remove-double-neg98.2%
*-rgt-identity98.2%
associate-/l*98.2%
exp-to-pow98.2%
Simplified98.2%
associate-/l/96.0%
pow-to-exp96.0%
div-inv96.0%
*-un-lft-identity96.0%
associate-/r*98.3%
div-inv98.3%
pow-to-exp98.3%
pow198.3%
pow-div97.7%
Applied egg-rr97.7%
*-lft-identity97.7%
sub-neg97.7%
metadata-eval97.7%
Simplified97.7%
Taylor expanded in n around inf 63.5%
Final simplification49.3%
(FPCore (x n) :precision binary64 (/ 1.0 (* x n)))
double code(double x, double n) {
return 1.0 / (x * n);
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
code = 1.0d0 / (x * n)
end function
public static double code(double x, double n) {
return 1.0 / (x * n);
}
def code(x, n): return 1.0 / (x * n)
function code(x, n) return Float64(1.0 / Float64(x * n)) end
function tmp = code(x, n) tmp = 1.0 / (x * n); end
code[x_, n_] := N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{x \cdot n}
\end{array}
Initial program 50.8%
Taylor expanded in x around inf 42.0%
associate-/r*42.8%
mul-1-neg42.8%
log-rec42.8%
mul-1-neg42.8%
distribute-neg-frac42.8%
mul-1-neg42.8%
remove-double-neg42.8%
*-rgt-identity42.8%
associate-/l*42.8%
exp-to-pow57.1%
Simplified57.1%
Taylor expanded in n around inf 28.7%
*-commutative28.7%
Simplified28.7%
Final simplification28.7%
(FPCore (x n) :precision binary64 (/ (/ 1.0 n) x))
double code(double x, double n) {
return (1.0 / n) / x;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
code = (1.0d0 / n) / x
end function
public static double code(double x, double n) {
return (1.0 / n) / x;
}
def code(x, n): return (1.0 / n) / x
function code(x, n) return Float64(Float64(1.0 / n) / x) end
function tmp = code(x, n) tmp = (1.0 / n) / x; end
code[x_, n_] := N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1}{n}}{x}
\end{array}
Initial program 50.8%
Taylor expanded in x around inf 42.0%
associate-/r*42.8%
mul-1-neg42.8%
log-rec42.8%
mul-1-neg42.8%
distribute-neg-frac42.8%
mul-1-neg42.8%
remove-double-neg42.8%
*-rgt-identity42.8%
associate-/l*42.8%
exp-to-pow57.1%
Simplified57.1%
Taylor expanded in n around inf 29.5%
Final simplification29.5%
(FPCore (x n) :precision binary64 (/ (/ 1.0 x) n))
double code(double x, double n) {
return (1.0 / x) / n;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
code = (1.0d0 / x) / n
end function
public static double code(double x, double n) {
return (1.0 / x) / n;
}
def code(x, n): return (1.0 / x) / n
function code(x, n) return Float64(Float64(1.0 / x) / n) end
function tmp = code(x, n) tmp = (1.0 / x) / n; end
code[x_, n_] := N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1}{x}}{n}
\end{array}
Initial program 50.8%
Taylor expanded in x around inf 42.0%
associate-/r*42.8%
mul-1-neg42.8%
log-rec42.8%
mul-1-neg42.8%
distribute-neg-frac42.8%
mul-1-neg42.8%
remove-double-neg42.8%
*-rgt-identity42.8%
associate-/l*42.8%
exp-to-pow57.1%
Simplified57.1%
associate-/l/53.4%
pow-to-exp42.0%
div-inv42.0%
*-un-lft-identity42.0%
associate-/r*42.8%
div-inv42.8%
pow-to-exp57.1%
pow157.1%
pow-div56.9%
Applied egg-rr56.9%
*-lft-identity56.9%
sub-neg56.9%
metadata-eval56.9%
Simplified56.9%
Taylor expanded in n around inf 29.5%
Final simplification29.5%
(FPCore (x n) :precision binary64 (/ x n))
double code(double x, double n) {
return x / n;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
code = x / n
end function
public static double code(double x, double n) {
return x / n;
}
def code(x, n): return x / n
function code(x, n) return Float64(x / n) end
function tmp = code(x, n) tmp = x / n; end
code[x_, n_] := N[(x / n), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{n}
\end{array}
Initial program 50.8%
add-sqr-sqrt50.5%
sqrt-unprod50.8%
pow-prod-down44.4%
pow244.4%
Applied egg-rr44.4%
Taylor expanded in n around inf 17.0%
Taylor expanded in x around 0 4.1%
Final simplification4.1%
herbie shell --seed 2024066
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))