
(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 10 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 -2000.0)
(/ (/ t_0 x) n)
(if (<= x -2e-311)
(- (exp (/ (* x (+ 1.0 (* x -0.5))) n)) t_0)
(if (<= x 450.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 (/ 1.0 (* x n))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if (x <= -2000.0) {
tmp = (t_0 / x) / n;
} else if (x <= -2e-311) {
tmp = exp(((x * (1.0 + (x * -0.5))) / n)) - t_0;
} else if (x <= 450.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 * (1.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 <= -2000.0) {
tmp = (t_0 / x) / n;
} else if (x <= -2e-311) {
tmp = Math.exp(((x * (1.0 + (x * -0.5))) / n)) - t_0;
} else if (x <= 450.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 * (1.0 / (x * n));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if x <= -2000.0: tmp = (t_0 / x) / n elif x <= -2e-311: tmp = math.exp(((x * (1.0 + (x * -0.5))) / n)) - t_0 elif x <= 450.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 * (1.0 / (x * n)) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (x <= -2000.0) tmp = Float64(Float64(t_0 / x) / n); elseif (x <= -2e-311) tmp = Float64(exp(Float64(Float64(x * Float64(1.0 + Float64(x * -0.5))) / n)) - t_0); elseif (x <= 450.0) tmp = Float64(Float64(Float64(log1p(x) + Float64(Float64(Float64(0.5 * Float64((log1p(x) ^ 2.0) - (log(x) ^ 2.0))) + Float64(Float64(0.16666666666666666 * Float64((log1p(x) ^ 3.0) - (log(x) ^ 3.0))) / n)) / n)) - log(x)) / n); else tmp = Float64(t_0 * Float64(1.0 / Float64(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, -2000.0], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, -2e-311], N[(N[Exp[N[(N[(x * N[(1.0 + N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x, 450.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[(N[(0.16666666666666666 * N[(N[Power[N[Log[1 + x], $MachinePrecision], 3.0], $MachinePrecision] - N[Power[N[Log[x], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(t$95$0 * N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;x \leq -2000:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-311}:\\
\;\;\;\;e^{\frac{x \cdot \left(1 + x \cdot -0.5\right)}{n}} - t\_0\\
\mathbf{elif}\;x \leq 450:\\
\;\;\;\;\frac{\left(\mathsf{log1p}\left(x\right) + \frac{0.5 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}\right) + \frac{0.16666666666666666 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{n}\right) - \log x}{n}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{1}{x \cdot n}\\
\end{array}
\end{array}
if x < -2e3Initial program 100.0%
Taylor expanded in x around inf 0.0%
+-commutative0.0%
log-rec0.0%
mul-1-neg0.0%
associate-*r/0.0%
associate-*r*0.0%
metadata-eval0.0%
*-commutative0.0%
associate-/l*0.0%
exp-to-pow0.0%
*-commutative0.0%
log-rec0.0%
mul-1-neg0.0%
associate-*r/0.0%
associate-*r*0.0%
metadata-eval0.0%
*-commutative0.0%
associate-/l*0.0%
Simplified100.0%
associate--l+100.0%
div-inv100.0%
fma-define100.0%
Applied egg-rr100.0%
fma-undefine100.0%
associate-*r/100.0%
*-rgt-identity100.0%
+-inverses100.0%
Simplified100.0%
+-rgt-identity100.0%
associate-/r*100.0%
pow1100.0%
pow-div100.0%
Applied egg-rr100.0%
pow-sub100.0%
pow1100.0%
div-inv100.0%
Applied egg-rr100.0%
associate-*r/100.0%
*-rgt-identity100.0%
Simplified100.0%
if -2e3 < x < -1.9999999999999e-311Initial program 46.2%
Taylor expanded in n around 0 0.0%
log1p-define0.0%
*-rgt-identity0.0%
associate-*l/0.0%
associate-/l*0.0%
exp-to-pow93.9%
Simplified93.9%
Taylor expanded in x around 0 93.9%
*-commutative93.9%
Simplified93.9%
if -1.9999999999999e-311 < x < 450Initial program 43.1%
Taylor expanded in n around -inf 80.3%
Simplified80.3%
if 450 < x Initial program 65.4%
Taylor expanded in x around inf 65.4%
+-commutative65.4%
log-rec65.4%
mul-1-neg65.4%
associate-*r/65.4%
associate-*r*65.4%
metadata-eval65.4%
*-commutative65.4%
associate-/l*65.4%
exp-to-pow65.4%
*-commutative65.4%
log-rec65.4%
mul-1-neg65.4%
associate-*r/65.4%
associate-*r*65.4%
metadata-eval65.4%
*-commutative65.4%
associate-/l*65.4%
Simplified65.4%
associate--l+98.7%
div-inv98.7%
fma-define98.7%
Applied egg-rr98.7%
fma-undefine98.7%
associate-*r/98.7%
*-rgt-identity98.7%
+-inverses99.9%
Simplified99.9%
+-rgt-identity99.9%
div-inv99.9%
Applied egg-rr99.9%
Final simplification90.4%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= x -2000.0)
(/ (/ t_0 x) n)
(if (<= x 5.8e-308)
(- (exp (/ (* x (+ 1.0 (* x -0.5))) n)) t_0)
(if (<= x 0.215)
(/
(-
(+
x
(/
(+
(* -0.16666666666666666 (/ (pow (log x) 3.0) n))
(* -0.5 (pow (log x) 2.0)))
n))
(log x))
n)
(* t_0 (/ 1.0 (* x n))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if (x <= -2000.0) {
tmp = (t_0 / x) / n;
} else if (x <= 5.8e-308) {
tmp = exp(((x * (1.0 + (x * -0.5))) / n)) - t_0;
} else if (x <= 0.215) {
tmp = ((x + (((-0.16666666666666666 * (pow(log(x), 3.0) / n)) + (-0.5 * pow(log(x), 2.0))) / n)) - log(x)) / n;
} else {
tmp = t_0 * (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 (x <= (-2000.0d0)) then
tmp = (t_0 / x) / n
else if (x <= 5.8d-308) then
tmp = exp(((x * (1.0d0 + (x * (-0.5d0)))) / n)) - t_0
else if (x <= 0.215d0) then
tmp = ((x + ((((-0.16666666666666666d0) * ((log(x) ** 3.0d0) / n)) + ((-0.5d0) * (log(x) ** 2.0d0))) / n)) - log(x)) / n
else
tmp = t_0 * (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 (x <= -2000.0) {
tmp = (t_0 / x) / n;
} else if (x <= 5.8e-308) {
tmp = Math.exp(((x * (1.0 + (x * -0.5))) / n)) - t_0;
} else if (x <= 0.215) {
tmp = ((x + (((-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 * (1.0 / (x * n));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if x <= -2000.0: tmp = (t_0 / x) / n elif x <= 5.8e-308: tmp = math.exp(((x * (1.0 + (x * -0.5))) / n)) - t_0 elif x <= 0.215: tmp = ((x + (((-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 * (1.0 / (x * n)) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (x <= -2000.0) tmp = Float64(Float64(t_0 / x) / n); elseif (x <= 5.8e-308) tmp = Float64(exp(Float64(Float64(x * Float64(1.0 + Float64(x * -0.5))) / n)) - t_0); elseif (x <= 0.215) tmp = Float64(Float64(Float64(x + 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(t_0 * Float64(1.0 / Float64(x * n))); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if (x <= -2000.0) tmp = (t_0 / x) / n; elseif (x <= 5.8e-308) tmp = exp(((x * (1.0 + (x * -0.5))) / n)) - t_0; elseif (x <= 0.215) tmp = ((x + (((-0.16666666666666666 * ((log(x) ^ 3.0) / n)) + (-0.5 * (log(x) ^ 2.0))) / n)) - log(x)) / n; else tmp = t_0 * (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[x, -2000.0], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 5.8e-308], N[(N[Exp[N[(N[(x * N[(1.0 + N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x, 0.215], N[(N[(N[(x + 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]), $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(t$95$0 * N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;x \leq -2000:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-308}:\\
\;\;\;\;e^{\frac{x \cdot \left(1 + x \cdot -0.5\right)}{n}} - t\_0\\
\mathbf{elif}\;x \leq 0.215:\\
\;\;\;\;\frac{\left(x + \frac{-0.16666666666666666 \cdot \frac{{\log x}^{3}}{n} + -0.5 \cdot {\log x}^{2}}{n}\right) - \log x}{n}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{1}{x \cdot n}\\
\end{array}
\end{array}
if x < -2e3Initial program 100.0%
Taylor expanded in x around inf 0.0%
+-commutative0.0%
log-rec0.0%
mul-1-neg0.0%
associate-*r/0.0%
associate-*r*0.0%
metadata-eval0.0%
*-commutative0.0%
associate-/l*0.0%
exp-to-pow0.0%
*-commutative0.0%
log-rec0.0%
mul-1-neg0.0%
associate-*r/0.0%
associate-*r*0.0%
metadata-eval0.0%
*-commutative0.0%
associate-/l*0.0%
Simplified100.0%
associate--l+100.0%
div-inv100.0%
fma-define100.0%
Applied egg-rr100.0%
fma-undefine100.0%
associate-*r/100.0%
*-rgt-identity100.0%
+-inverses100.0%
Simplified100.0%
+-rgt-identity100.0%
associate-/r*100.0%
pow1100.0%
pow-div100.0%
Applied egg-rr100.0%
pow-sub100.0%
pow1100.0%
div-inv100.0%
Applied egg-rr100.0%
associate-*r/100.0%
*-rgt-identity100.0%
Simplified100.0%
if -2e3 < x < 5.8000000000000001e-308Initial program 46.2%
Taylor expanded in n around 0 0.0%
log1p-define0.0%
*-rgt-identity0.0%
associate-*l/0.0%
associate-/l*0.0%
exp-to-pow93.9%
Simplified93.9%
Taylor expanded in x around 0 93.9%
*-commutative93.9%
Simplified93.9%
if 5.8000000000000001e-308 < x < 0.214999999999999997Initial program 43.1%
Taylor expanded in x around 0 43.5%
Taylor expanded in n around -inf 79.6%
mul-1-neg79.6%
Simplified79.6%
if 0.214999999999999997 < x Initial program 65.4%
Taylor expanded in x around inf 65.4%
+-commutative65.4%
log-rec65.4%
mul-1-neg65.4%
associate-*r/65.4%
associate-*r*65.4%
metadata-eval65.4%
*-commutative65.4%
associate-/l*65.4%
exp-to-pow65.4%
*-commutative65.4%
log-rec65.4%
mul-1-neg65.4%
associate-*r/65.4%
associate-*r*65.4%
metadata-eval65.4%
*-commutative65.4%
associate-/l*65.4%
Simplified65.4%
associate--l+98.7%
div-inv98.7%
fma-define98.7%
Applied egg-rr98.7%
fma-undefine98.7%
associate-*r/98.7%
*-rgt-identity98.7%
+-inverses99.9%
Simplified99.9%
+-rgt-identity99.9%
div-inv99.9%
Applied egg-rr99.9%
Final simplification90.1%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= x -2000.0)
(/ (/ t_0 x) n)
(if (<= x -2e-311)
(- (exp (/ (* x (+ 1.0 (* x -0.5))) n)) t_0)
(if (<= x 0.048)
(*
x
(fma
(/ (pow (/ (log x) n) 2.0) x)
-0.5
(- (/ 1.0 n) (/ (log x) (* x n)))))
(* t_0 (/ 1.0 (* x n))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if (x <= -2000.0) {
tmp = (t_0 / x) / n;
} else if (x <= -2e-311) {
tmp = exp(((x * (1.0 + (x * -0.5))) / n)) - t_0;
} else if (x <= 0.048) {
tmp = x * fma((pow((log(x) / n), 2.0) / x), -0.5, ((1.0 / n) - (log(x) / (x * n))));
} else {
tmp = t_0 * (1.0 / (x * n));
}
return tmp;
}
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (x <= -2000.0) tmp = Float64(Float64(t_0 / x) / n); elseif (x <= -2e-311) tmp = Float64(exp(Float64(Float64(x * Float64(1.0 + Float64(x * -0.5))) / n)) - t_0); elseif (x <= 0.048) tmp = Float64(x * fma(Float64((Float64(log(x) / n) ^ 2.0) / x), -0.5, Float64(Float64(1.0 / n) - Float64(log(x) / Float64(x * n))))); else tmp = Float64(t_0 * Float64(1.0 / Float64(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, -2000.0], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, -2e-311], N[(N[Exp[N[(N[(x * N[(1.0 + N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x, 0.048], N[(x * N[(N[(N[Power[N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision], 2.0], $MachinePrecision] / x), $MachinePrecision] * -0.5 + N[(N[(1.0 / n), $MachinePrecision] - N[(N[Log[x], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;x \leq -2000:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-311}:\\
\;\;\;\;e^{\frac{x \cdot \left(1 + x \cdot -0.5\right)}{n}} - t\_0\\
\mathbf{elif}\;x \leq 0.048:\\
\;\;\;\;x \cdot \mathsf{fma}\left(\frac{{\left(\frac{\log x}{n}\right)}^{2}}{x}, -0.5, \frac{1}{n} - \frac{\log x}{x \cdot n}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{1}{x \cdot n}\\
\end{array}
\end{array}
if x < -2e3Initial program 100.0%
Taylor expanded in x around inf 0.0%
+-commutative0.0%
log-rec0.0%
mul-1-neg0.0%
associate-*r/0.0%
associate-*r*0.0%
metadata-eval0.0%
*-commutative0.0%
associate-/l*0.0%
exp-to-pow0.0%
*-commutative0.0%
log-rec0.0%
mul-1-neg0.0%
associate-*r/0.0%
associate-*r*0.0%
metadata-eval0.0%
*-commutative0.0%
associate-/l*0.0%
Simplified100.0%
associate--l+100.0%
div-inv100.0%
fma-define100.0%
Applied egg-rr100.0%
fma-undefine100.0%
associate-*r/100.0%
*-rgt-identity100.0%
+-inverses100.0%
Simplified100.0%
+-rgt-identity100.0%
associate-/r*100.0%
pow1100.0%
pow-div100.0%
Applied egg-rr100.0%
pow-sub100.0%
pow1100.0%
div-inv100.0%
Applied egg-rr100.0%
associate-*r/100.0%
*-rgt-identity100.0%
Simplified100.0%
if -2e3 < x < -1.9999999999999e-311Initial program 46.2%
Taylor expanded in n around 0 0.0%
log1p-define0.0%
*-rgt-identity0.0%
associate-*l/0.0%
associate-/l*0.0%
exp-to-pow93.9%
Simplified93.9%
Taylor expanded in x around 0 93.9%
*-commutative93.9%
Simplified93.9%
if -1.9999999999999e-311 < x < 0.048000000000000001Initial program 43.1%
Taylor expanded in x around 0 43.5%
Taylor expanded in n around inf 65.8%
Taylor expanded in x around inf 71.5%
associate--l+71.5%
*-commutative71.5%
fma-define71.5%
associate-/r*71.5%
log-rec71.5%
unpow271.5%
sqr-neg71.5%
unpow271.5%
times-frac71.5%
unpow271.5%
log-rec71.5%
Simplified71.5%
if 0.048000000000000001 < x Initial program 65.4%
Taylor expanded in x around inf 65.4%
+-commutative65.4%
log-rec65.4%
mul-1-neg65.4%
associate-*r/65.4%
associate-*r*65.4%
metadata-eval65.4%
*-commutative65.4%
associate-/l*65.4%
exp-to-pow65.4%
*-commutative65.4%
log-rec65.4%
mul-1-neg65.4%
associate-*r/65.4%
associate-*r*65.4%
metadata-eval65.4%
*-commutative65.4%
associate-/l*65.4%
Simplified65.4%
associate--l+98.7%
div-inv98.7%
fma-define98.7%
Applied egg-rr98.7%
fma-undefine98.7%
associate-*r/98.7%
*-rgt-identity98.7%
+-inverses99.9%
Simplified99.9%
+-rgt-identity99.9%
div-inv99.9%
Applied egg-rr99.9%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -1e-172)
(/ t_0 (* x n))
(if (<= (/ 1.0 n) 2e-169)
(/ (+ (log1p x) (- (/ (log x) (* x n)) (log x))) n)
(if (<= (/ 1.0 n) 1000000.0)
(/ (/ t_0 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) <= -1e-172) {
tmp = t_0 / (x * n);
} else if ((1.0 / n) <= 2e-169) {
tmp = (log1p(x) + ((log(x) / (x * n)) - log(x))) / n;
} else if ((1.0 / n) <= 1000000.0) {
tmp = (t_0 / 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) <= -1e-172) {
tmp = t_0 / (x * n);
} else if ((1.0 / n) <= 2e-169) {
tmp = (Math.log1p(x) + ((Math.log(x) / (x * n)) - Math.log(x))) / n;
} else if ((1.0 / n) <= 1000000.0) {
tmp = (t_0 / 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) <= -1e-172: tmp = t_0 / (x * n) elif (1.0 / n) <= 2e-169: tmp = (math.log1p(x) + ((math.log(x) / (x * n)) - math.log(x))) / n elif (1.0 / n) <= 1000000.0: tmp = (t_0 / 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) <= -1e-172) tmp = Float64(t_0 / Float64(x * n)); elseif (Float64(1.0 / n) <= 2e-169) tmp = Float64(Float64(log1p(x) + Float64(Float64(log(x) / Float64(x * n)) - log(x))) / n); elseif (Float64(1.0 / n) <= 1000000.0) tmp = Float64(Float64(t_0 / 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], -1e-172], N[(t$95$0 / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-169], N[(N[(N[Log[1 + x], $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1000000.0], N[(N[(t$95$0 / 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 -1 \cdot 10^{-172}:\\
\;\;\;\;\frac{t\_0}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-169}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(x\right) + \left(\frac{\log x}{x \cdot n} - \log x\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 1000000:\\
\;\;\;\;\frac{\frac{t\_0}{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) < -1e-172Initial program 77.1%
Taylor expanded in x around inf 29.8%
+-commutative29.8%
log-rec29.8%
mul-1-neg29.8%
associate-*r/29.8%
associate-*r*29.8%
metadata-eval29.8%
*-commutative29.8%
associate-/l*29.8%
exp-to-pow29.8%
*-commutative29.8%
log-rec29.8%
mul-1-neg29.8%
associate-*r/29.8%
associate-*r*29.8%
metadata-eval29.8%
*-commutative29.8%
associate-/l*29.8%
Simplified49.5%
associate--l+60.7%
div-inv60.7%
fma-define60.7%
Applied egg-rr60.7%
fma-undefine60.7%
associate-*r/60.7%
*-rgt-identity60.7%
+-inverses85.9%
Simplified85.9%
Taylor expanded in x around 0 66.3%
*-rgt-identity66.3%
associate-*r/66.3%
exp-to-pow85.9%
*-commutative85.9%
Simplified85.9%
if -1e-172 < (/.f64 #s(literal 1 binary64) n) < 2.00000000000000004e-169Initial program 34.9%
Taylor expanded in n around inf 95.5%
Simplified93.4%
Taylor expanded in x around inf 78.3%
distribute-lft-out--78.3%
log-rec78.3%
*-commutative78.3%
log-rec78.3%
Simplified78.3%
if 2.00000000000000004e-169 < (/.f64 #s(literal 1 binary64) n) < 1e6Initial program 20.7%
Taylor expanded in x around inf 18.2%
+-commutative18.2%
log-rec18.2%
mul-1-neg18.2%
associate-*r/18.2%
associate-*r*18.2%
metadata-eval18.2%
*-commutative18.2%
associate-/l*18.2%
exp-to-pow18.2%
*-commutative18.2%
log-rec18.2%
mul-1-neg18.2%
associate-*r/18.2%
associate-*r*18.2%
metadata-eval18.2%
*-commutative18.2%
associate-/l*18.2%
Simplified18.2%
associate--l+60.3%
div-inv60.3%
fma-define60.3%
Applied egg-rr60.3%
fma-undefine60.3%
associate-*r/60.3%
*-rgt-identity60.3%
+-inverses63.7%
Simplified63.7%
+-rgt-identity63.7%
associate-/r*63.8%
pow163.8%
pow-div63.4%
Applied egg-rr63.4%
pow-sub63.8%
pow163.8%
div-inv63.8%
Applied egg-rr63.8%
associate-*r/63.8%
*-rgt-identity63.8%
Simplified63.8%
if 1e6 < (/.f64 #s(literal 1 binary64) n) Initial program 44.6%
Taylor expanded in n around 0 17.9%
log1p-define41.9%
*-rgt-identity41.9%
associate-*l/41.9%
associate-/l*41.9%
exp-to-pow96.3%
Simplified96.3%
Final simplification84.4%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= x -2000.0)
(/ (/ t_0 x) n)
(if (<= x 2.4e-307)
(- (exp (/ (* x (+ 1.0 (* x -0.5))) n)) t_0)
(if (<= x 1.95e-28)
(/ 1.0 (/ n (- (+ x (* -0.5 (/ (pow (log x) 2.0) n))) (log x))))
(* t_0 (/ 1.0 (* x n))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if (x <= -2000.0) {
tmp = (t_0 / x) / n;
} else if (x <= 2.4e-307) {
tmp = exp(((x * (1.0 + (x * -0.5))) / n)) - t_0;
} else if (x <= 1.95e-28) {
tmp = 1.0 / (n / ((x + (-0.5 * (pow(log(x), 2.0) / n))) - log(x)));
} else {
tmp = t_0 * (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 (x <= (-2000.0d0)) then
tmp = (t_0 / x) / n
else if (x <= 2.4d-307) then
tmp = exp(((x * (1.0d0 + (x * (-0.5d0)))) / n)) - t_0
else if (x <= 1.95d-28) then
tmp = 1.0d0 / (n / ((x + ((-0.5d0) * ((log(x) ** 2.0d0) / n))) - log(x)))
else
tmp = t_0 * (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 (x <= -2000.0) {
tmp = (t_0 / x) / n;
} else if (x <= 2.4e-307) {
tmp = Math.exp(((x * (1.0 + (x * -0.5))) / n)) - t_0;
} else if (x <= 1.95e-28) {
tmp = 1.0 / (n / ((x + (-0.5 * (Math.pow(Math.log(x), 2.0) / n))) - Math.log(x)));
} else {
tmp = t_0 * (1.0 / (x * n));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if x <= -2000.0: tmp = (t_0 / x) / n elif x <= 2.4e-307: tmp = math.exp(((x * (1.0 + (x * -0.5))) / n)) - t_0 elif x <= 1.95e-28: tmp = 1.0 / (n / ((x + (-0.5 * (math.pow(math.log(x), 2.0) / n))) - math.log(x))) else: tmp = t_0 * (1.0 / (x * n)) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (x <= -2000.0) tmp = Float64(Float64(t_0 / x) / n); elseif (x <= 2.4e-307) tmp = Float64(exp(Float64(Float64(x * Float64(1.0 + Float64(x * -0.5))) / n)) - t_0); elseif (x <= 1.95e-28) tmp = Float64(1.0 / Float64(n / Float64(Float64(x + Float64(-0.5 * Float64((log(x) ^ 2.0) / n))) - log(x)))); else tmp = Float64(t_0 * Float64(1.0 / Float64(x * n))); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if (x <= -2000.0) tmp = (t_0 / x) / n; elseif (x <= 2.4e-307) tmp = exp(((x * (1.0 + (x * -0.5))) / n)) - t_0; elseif (x <= 1.95e-28) tmp = 1.0 / (n / ((x + (-0.5 * ((log(x) ^ 2.0) / n))) - log(x))); else tmp = t_0 * (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[x, -2000.0], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 2.4e-307], N[(N[Exp[N[(N[(x * N[(1.0 + N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x, 1.95e-28], N[(1.0 / N[(n / N[(N[(x + N[(-0.5 * N[(N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;x \leq -2000:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-307}:\\
\;\;\;\;e^{\frac{x \cdot \left(1 + x \cdot -0.5\right)}{n}} - t\_0\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{-28}:\\
\;\;\;\;\frac{1}{\frac{n}{\left(x + -0.5 \cdot \frac{{\log x}^{2}}{n}\right) - \log x}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{1}{x \cdot n}\\
\end{array}
\end{array}
if x < -2e3Initial program 100.0%
Taylor expanded in x around inf 0.0%
+-commutative0.0%
log-rec0.0%
mul-1-neg0.0%
associate-*r/0.0%
associate-*r*0.0%
metadata-eval0.0%
*-commutative0.0%
associate-/l*0.0%
exp-to-pow0.0%
*-commutative0.0%
log-rec0.0%
mul-1-neg0.0%
associate-*r/0.0%
associate-*r*0.0%
metadata-eval0.0%
*-commutative0.0%
associate-/l*0.0%
Simplified100.0%
associate--l+100.0%
div-inv100.0%
fma-define100.0%
Applied egg-rr100.0%
fma-undefine100.0%
associate-*r/100.0%
*-rgt-identity100.0%
+-inverses100.0%
Simplified100.0%
+-rgt-identity100.0%
associate-/r*100.0%
pow1100.0%
pow-div100.0%
Applied egg-rr100.0%
pow-sub100.0%
pow1100.0%
div-inv100.0%
Applied egg-rr100.0%
associate-*r/100.0%
*-rgt-identity100.0%
Simplified100.0%
if -2e3 < x < 2.40000000000000018e-307Initial program 46.2%
Taylor expanded in n around 0 0.0%
log1p-define0.0%
*-rgt-identity0.0%
associate-*l/0.0%
associate-/l*0.0%
exp-to-pow93.9%
Simplified93.9%
Taylor expanded in x around 0 93.9%
*-commutative93.9%
Simplified93.9%
if 2.40000000000000018e-307 < x < 1.94999999999999999e-28Initial program 40.2%
Taylor expanded in x around 0 40.4%
Taylor expanded in n around inf 67.5%
clear-num67.5%
inv-pow67.5%
+-commutative67.5%
fma-define67.5%
Applied egg-rr67.5%
unpow-167.5%
Simplified67.5%
fma-undefine67.5%
Applied egg-rr67.5%
if 1.94999999999999999e-28 < x Initial program 65.2%
Taylor expanded in x around inf 56.4%
+-commutative56.4%
log-rec56.4%
mul-1-neg56.4%
associate-*r/56.4%
associate-*r*56.4%
metadata-eval56.4%
*-commutative56.4%
associate-/l*56.4%
exp-to-pow56.4%
*-commutative56.4%
log-rec56.4%
mul-1-neg56.4%
associate-*r/56.4%
associate-*r*56.4%
metadata-eval56.4%
*-commutative56.4%
associate-/l*56.4%
Simplified56.4%
associate--l+85.3%
div-inv85.3%
fma-define85.3%
Applied egg-rr85.3%
fma-undefine85.3%
associate-*r/85.3%
*-rgt-identity85.3%
+-inverses93.4%
Simplified93.4%
+-rgt-identity93.4%
div-inv93.4%
Applied egg-rr93.4%
Final simplification84.0%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= x -2000.0)
(/ (/ t_0 x) n)
(if (<= x 1.6e-308)
(- (exp (/ (* x (+ 1.0 (* x -0.5))) n)) t_0)
(if (<= x 1.95e-28)
(/ (- (+ x (* -0.5 (/ (pow (log x) 2.0) n))) (log x)) n)
(* t_0 (/ 1.0 (* x n))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if (x <= -2000.0) {
tmp = (t_0 / x) / n;
} else if (x <= 1.6e-308) {
tmp = exp(((x * (1.0 + (x * -0.5))) / n)) - t_0;
} else if (x <= 1.95e-28) {
tmp = ((x + (-0.5 * (pow(log(x), 2.0) / n))) - log(x)) / n;
} else {
tmp = t_0 * (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 (x <= (-2000.0d0)) then
tmp = (t_0 / x) / n
else if (x <= 1.6d-308) then
tmp = exp(((x * (1.0d0 + (x * (-0.5d0)))) / n)) - t_0
else if (x <= 1.95d-28) then
tmp = ((x + ((-0.5d0) * ((log(x) ** 2.0d0) / n))) - log(x)) / n
else
tmp = t_0 * (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 (x <= -2000.0) {
tmp = (t_0 / x) / n;
} else if (x <= 1.6e-308) {
tmp = Math.exp(((x * (1.0 + (x * -0.5))) / n)) - t_0;
} else if (x <= 1.95e-28) {
tmp = ((x + (-0.5 * (Math.pow(Math.log(x), 2.0) / n))) - Math.log(x)) / n;
} else {
tmp = t_0 * (1.0 / (x * n));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if x <= -2000.0: tmp = (t_0 / x) / n elif x <= 1.6e-308: tmp = math.exp(((x * (1.0 + (x * -0.5))) / n)) - t_0 elif x <= 1.95e-28: tmp = ((x + (-0.5 * (math.pow(math.log(x), 2.0) / n))) - math.log(x)) / n else: tmp = t_0 * (1.0 / (x * n)) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (x <= -2000.0) tmp = Float64(Float64(t_0 / x) / n); elseif (x <= 1.6e-308) tmp = Float64(exp(Float64(Float64(x * Float64(1.0 + Float64(x * -0.5))) / n)) - t_0); elseif (x <= 1.95e-28) tmp = Float64(Float64(Float64(x + Float64(-0.5 * Float64((log(x) ^ 2.0) / n))) - log(x)) / n); else tmp = Float64(t_0 * Float64(1.0 / Float64(x * n))); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if (x <= -2000.0) tmp = (t_0 / x) / n; elseif (x <= 1.6e-308) tmp = exp(((x * (1.0 + (x * -0.5))) / n)) - t_0; elseif (x <= 1.95e-28) tmp = ((x + (-0.5 * ((log(x) ^ 2.0) / n))) - log(x)) / n; else tmp = t_0 * (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[x, -2000.0], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 1.6e-308], N[(N[Exp[N[(N[(x * N[(1.0 + N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x, 1.95e-28], N[(N[(N[(x + N[(-0.5 * N[(N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(t$95$0 * N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;x \leq -2000:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-308}:\\
\;\;\;\;e^{\frac{x \cdot \left(1 + x \cdot -0.5\right)}{n}} - t\_0\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{-28}:\\
\;\;\;\;\frac{\left(x + -0.5 \cdot \frac{{\log x}^{2}}{n}\right) - \log x}{n}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{1}{x \cdot n}\\
\end{array}
\end{array}
if x < -2e3Initial program 100.0%
Taylor expanded in x around inf 0.0%
+-commutative0.0%
log-rec0.0%
mul-1-neg0.0%
associate-*r/0.0%
associate-*r*0.0%
metadata-eval0.0%
*-commutative0.0%
associate-/l*0.0%
exp-to-pow0.0%
*-commutative0.0%
log-rec0.0%
mul-1-neg0.0%
associate-*r/0.0%
associate-*r*0.0%
metadata-eval0.0%
*-commutative0.0%
associate-/l*0.0%
Simplified100.0%
associate--l+100.0%
div-inv100.0%
fma-define100.0%
Applied egg-rr100.0%
fma-undefine100.0%
associate-*r/100.0%
*-rgt-identity100.0%
+-inverses100.0%
Simplified100.0%
+-rgt-identity100.0%
associate-/r*100.0%
pow1100.0%
pow-div100.0%
Applied egg-rr100.0%
pow-sub100.0%
pow1100.0%
div-inv100.0%
Applied egg-rr100.0%
associate-*r/100.0%
*-rgt-identity100.0%
Simplified100.0%
if -2e3 < x < 1.6000000000000001e-308Initial program 46.2%
Taylor expanded in n around 0 0.0%
log1p-define0.0%
*-rgt-identity0.0%
associate-*l/0.0%
associate-/l*0.0%
exp-to-pow93.9%
Simplified93.9%
Taylor expanded in x around 0 93.9%
*-commutative93.9%
Simplified93.9%
if 1.6000000000000001e-308 < x < 1.94999999999999999e-28Initial program 40.2%
Taylor expanded in x around 0 40.4%
Taylor expanded in n around inf 67.5%
if 1.94999999999999999e-28 < x Initial program 65.2%
Taylor expanded in x around inf 56.4%
+-commutative56.4%
log-rec56.4%
mul-1-neg56.4%
associate-*r/56.4%
associate-*r*56.4%
metadata-eval56.4%
*-commutative56.4%
associate-/l*56.4%
exp-to-pow56.4%
*-commutative56.4%
log-rec56.4%
mul-1-neg56.4%
associate-*r/56.4%
associate-*r*56.4%
metadata-eval56.4%
*-commutative56.4%
associate-/l*56.4%
Simplified56.4%
associate--l+85.3%
div-inv85.3%
fma-define85.3%
Applied egg-rr85.3%
fma-undefine85.3%
associate-*r/85.3%
*-rgt-identity85.3%
+-inverses93.4%
Simplified93.4%
+-rgt-identity93.4%
div-inv93.4%
Applied egg-rr93.4%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= x -2000.0)
(/ (/ t_0 x) n)
(if (<= x 3.4e-12)
(- (exp (/ (* x (+ 1.0 (* x -0.5))) n)) t_0)
(* t_0 (/ 1.0 (* x n)))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if (x <= -2000.0) {
tmp = (t_0 / x) / n;
} else if (x <= 3.4e-12) {
tmp = exp(((x * (1.0 + (x * -0.5))) / n)) - t_0;
} else {
tmp = t_0 * (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 (x <= (-2000.0d0)) then
tmp = (t_0 / x) / n
else if (x <= 3.4d-12) then
tmp = exp(((x * (1.0d0 + (x * (-0.5d0)))) / n)) - t_0
else
tmp = t_0 * (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 (x <= -2000.0) {
tmp = (t_0 / x) / n;
} else if (x <= 3.4e-12) {
tmp = Math.exp(((x * (1.0 + (x * -0.5))) / n)) - t_0;
} else {
tmp = t_0 * (1.0 / (x * n));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if x <= -2000.0: tmp = (t_0 / x) / n elif x <= 3.4e-12: tmp = math.exp(((x * (1.0 + (x * -0.5))) / n)) - t_0 else: tmp = t_0 * (1.0 / (x * n)) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (x <= -2000.0) tmp = Float64(Float64(t_0 / x) / n); elseif (x <= 3.4e-12) tmp = Float64(exp(Float64(Float64(x * Float64(1.0 + Float64(x * -0.5))) / n)) - t_0); else tmp = Float64(t_0 * Float64(1.0 / Float64(x * n))); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if (x <= -2000.0) tmp = (t_0 / x) / n; elseif (x <= 3.4e-12) tmp = exp(((x * (1.0 + (x * -0.5))) / n)) - t_0; else tmp = t_0 * (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[x, -2000.0], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 3.4e-12], N[(N[Exp[N[(N[(x * N[(1.0 + N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision], N[(t$95$0 * N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;x \leq -2000:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-12}:\\
\;\;\;\;e^{\frac{x \cdot \left(1 + x \cdot -0.5\right)}{n}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{1}{x \cdot n}\\
\end{array}
\end{array}
if x < -2e3Initial program 100.0%
Taylor expanded in x around inf 0.0%
+-commutative0.0%
log-rec0.0%
mul-1-neg0.0%
associate-*r/0.0%
associate-*r*0.0%
metadata-eval0.0%
*-commutative0.0%
associate-/l*0.0%
exp-to-pow0.0%
*-commutative0.0%
log-rec0.0%
mul-1-neg0.0%
associate-*r/0.0%
associate-*r*0.0%
metadata-eval0.0%
*-commutative0.0%
associate-/l*0.0%
Simplified100.0%
associate--l+100.0%
div-inv100.0%
fma-define100.0%
Applied egg-rr100.0%
fma-undefine100.0%
associate-*r/100.0%
*-rgt-identity100.0%
+-inverses100.0%
Simplified100.0%
+-rgt-identity100.0%
associate-/r*100.0%
pow1100.0%
pow-div100.0%
Applied egg-rr100.0%
pow-sub100.0%
pow1100.0%
div-inv100.0%
Applied egg-rr100.0%
associate-*r/100.0%
*-rgt-identity100.0%
Simplified100.0%
if -2e3 < x < 3.4000000000000001e-12Initial program 43.5%
Taylor expanded in n around 0 32.9%
log1p-define42.4%
*-rgt-identity42.4%
associate-*l/42.4%
associate-/l*42.4%
exp-to-pow64.1%
Simplified64.1%
Taylor expanded in x around 0 64.1%
*-commutative64.1%
Simplified64.1%
if 3.4000000000000001e-12 < x Initial program 64.8%
Taylor expanded in x around inf 62.6%
+-commutative62.6%
log-rec62.6%
mul-1-neg62.6%
associate-*r/62.6%
associate-*r*62.6%
metadata-eval62.6%
*-commutative62.6%
associate-/l*62.6%
exp-to-pow62.6%
*-commutative62.6%
log-rec62.6%
mul-1-neg62.6%
associate-*r/62.6%
associate-*r*62.6%
metadata-eval62.6%
*-commutative62.6%
associate-/l*62.6%
Simplified62.6%
associate--l+94.6%
div-inv94.6%
fma-define94.6%
Applied egg-rr94.6%
fma-undefine94.6%
associate-*r/94.6%
*-rgt-identity94.6%
+-inverses98.0%
Simplified98.0%
+-rgt-identity98.0%
div-inv98.0%
Applied egg-rr98.0%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= x -3.05e-167)
(/ (/ t_0 x) n)
(if (<= x 2.1e-247)
(- (+ 1.0 (/ x n)) t_0)
(if (<= x 3.6e-13)
(-
(+
1.0
(*
x
(+
(/ 1.0 n)
(*
x
(+
(/
(-
(/ (+ 0.5 (+ (* x -0.5) (* 0.16666666666666666 (/ x n)))) n)
(* x -0.3333333333333333))
n)
(* 0.5 (/ -1.0 n)))))))
t_0)
(* t_0 (/ 1.0 (* x n))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if (x <= -3.05e-167) {
tmp = (t_0 / x) / n;
} else if (x <= 2.1e-247) {
tmp = (1.0 + (x / n)) - t_0;
} else if (x <= 3.6e-13) {
tmp = (1.0 + (x * ((1.0 / n) + (x * (((((0.5 + ((x * -0.5) + (0.16666666666666666 * (x / n)))) / n) - (x * -0.3333333333333333)) / n) + (0.5 * (-1.0 / n))))))) - t_0;
} else {
tmp = t_0 * (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 (x <= (-3.05d-167)) then
tmp = (t_0 / x) / n
else if (x <= 2.1d-247) then
tmp = (1.0d0 + (x / n)) - t_0
else if (x <= 3.6d-13) then
tmp = (1.0d0 + (x * ((1.0d0 / n) + (x * (((((0.5d0 + ((x * (-0.5d0)) + (0.16666666666666666d0 * (x / n)))) / n) - (x * (-0.3333333333333333d0))) / n) + (0.5d0 * ((-1.0d0) / n))))))) - t_0
else
tmp = t_0 * (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 (x <= -3.05e-167) {
tmp = (t_0 / x) / n;
} else if (x <= 2.1e-247) {
tmp = (1.0 + (x / n)) - t_0;
} else if (x <= 3.6e-13) {
tmp = (1.0 + (x * ((1.0 / n) + (x * (((((0.5 + ((x * -0.5) + (0.16666666666666666 * (x / n)))) / n) - (x * -0.3333333333333333)) / n) + (0.5 * (-1.0 / n))))))) - t_0;
} else {
tmp = t_0 * (1.0 / (x * n));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if x <= -3.05e-167: tmp = (t_0 / x) / n elif x <= 2.1e-247: tmp = (1.0 + (x / n)) - t_0 elif x <= 3.6e-13: tmp = (1.0 + (x * ((1.0 / n) + (x * (((((0.5 + ((x * -0.5) + (0.16666666666666666 * (x / n)))) / n) - (x * -0.3333333333333333)) / n) + (0.5 * (-1.0 / n))))))) - t_0 else: tmp = t_0 * (1.0 / (x * n)) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (x <= -3.05e-167) tmp = Float64(Float64(t_0 / x) / n); elseif (x <= 2.1e-247) tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0); elseif (x <= 3.6e-13) tmp = Float64(Float64(1.0 + Float64(x * Float64(Float64(1.0 / n) + Float64(x * Float64(Float64(Float64(Float64(Float64(0.5 + Float64(Float64(x * -0.5) + Float64(0.16666666666666666 * Float64(x / n)))) / n) - Float64(x * -0.3333333333333333)) / n) + Float64(0.5 * Float64(-1.0 / n))))))) - t_0); else tmp = Float64(t_0 * Float64(1.0 / Float64(x * n))); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if (x <= -3.05e-167) tmp = (t_0 / x) / n; elseif (x <= 2.1e-247) tmp = (1.0 + (x / n)) - t_0; elseif (x <= 3.6e-13) tmp = (1.0 + (x * ((1.0 / n) + (x * (((((0.5 + ((x * -0.5) + (0.16666666666666666 * (x / n)))) / n) - (x * -0.3333333333333333)) / n) + (0.5 * (-1.0 / n))))))) - t_0; else tmp = t_0 * (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[x, -3.05e-167], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 2.1e-247], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x, 3.6e-13], N[(N[(1.0 + N[(x * N[(N[(1.0 / n), $MachinePrecision] + N[(x * N[(N[(N[(N[(N[(0.5 + N[(N[(x * -0.5), $MachinePrecision] + N[(0.16666666666666666 * N[(x / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] - N[(x * -0.3333333333333333), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] + N[(0.5 * N[(-1.0 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(t$95$0 * N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;x \leq -3.05 \cdot 10^{-167}:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-247}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - t\_0\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-13}:\\
\;\;\;\;\left(1 + x \cdot \left(\frac{1}{n} + x \cdot \left(\frac{\frac{0.5 + \left(x \cdot -0.5 + 0.16666666666666666 \cdot \frac{x}{n}\right)}{n} - x \cdot -0.3333333333333333}{n} + 0.5 \cdot \frac{-1}{n}\right)\right)\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{1}{x \cdot n}\\
\end{array}
\end{array}
if x < -3.0499999999999999e-167Initial program 71.8%
Taylor expanded in x around inf 0.0%
+-commutative0.0%
log-rec0.0%
mul-1-neg0.0%
associate-*r/0.0%
associate-*r*0.0%
metadata-eval0.0%
*-commutative0.0%
associate-/l*0.0%
exp-to-pow0.0%
*-commutative0.0%
log-rec0.0%
mul-1-neg0.0%
associate-*r/0.0%
associate-*r*0.0%
metadata-eval0.0%
*-commutative0.0%
associate-/l*0.0%
Simplified89.6%
associate--l+89.6%
div-inv87.0%
fma-define87.0%
Applied egg-rr87.0%
fma-undefine87.0%
associate-*r/89.6%
*-rgt-identity89.6%
+-inverses89.6%
Simplified89.6%
+-rgt-identity89.6%
associate-/r*94.9%
pow194.9%
pow-div94.9%
Applied egg-rr94.9%
pow-sub94.9%
pow194.9%
div-inv94.9%
Applied egg-rr94.9%
associate-*r/94.9%
*-rgt-identity94.9%
Simplified94.9%
if -3.0499999999999999e-167 < x < 2.10000000000000014e-247Initial program 48.6%
Taylor expanded in x around 0 49.1%
if 2.10000000000000014e-247 < x < 3.5999999999999998e-13Initial program 45.2%
Taylor expanded in x around 0 25.7%
Taylor expanded in n around -inf 55.8%
if 3.5999999999999998e-13 < x Initial program 64.8%
Taylor expanded in x around inf 62.6%
+-commutative62.6%
log-rec62.6%
mul-1-neg62.6%
associate-*r/62.6%
associate-*r*62.6%
metadata-eval62.6%
*-commutative62.6%
associate-/l*62.6%
exp-to-pow62.6%
*-commutative62.6%
log-rec62.6%
mul-1-neg62.6%
associate-*r/62.6%
associate-*r*62.6%
metadata-eval62.6%
*-commutative62.6%
associate-/l*62.6%
Simplified62.6%
associate--l+94.6%
div-inv94.6%
fma-define94.6%
Applied egg-rr94.6%
fma-undefine94.6%
associate-*r/94.6%
*-rgt-identity94.6%
+-inverses98.0%
Simplified98.0%
+-rgt-identity98.0%
div-inv98.0%
Applied egg-rr98.0%
Final simplification75.2%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= x -1.45e-166)
(/ (/ t_0 x) n)
(if (<= x 2.4e-13) (- (+ 1.0 (/ x n)) t_0) (* t_0 (/ 1.0 (* x n)))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if (x <= -1.45e-166) {
tmp = (t_0 / x) / n;
} else if (x <= 2.4e-13) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = t_0 * (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 (x <= (-1.45d-166)) then
tmp = (t_0 / x) / n
else if (x <= 2.4d-13) then
tmp = (1.0d0 + (x / n)) - t_0
else
tmp = t_0 * (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 (x <= -1.45e-166) {
tmp = (t_0 / x) / n;
} else if (x <= 2.4e-13) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = t_0 * (1.0 / (x * n));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if x <= -1.45e-166: tmp = (t_0 / x) / n elif x <= 2.4e-13: tmp = (1.0 + (x / n)) - t_0 else: tmp = t_0 * (1.0 / (x * n)) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (x <= -1.45e-166) tmp = Float64(Float64(t_0 / x) / n); elseif (x <= 2.4e-13) tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0); else tmp = Float64(t_0 * Float64(1.0 / Float64(x * n))); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if (x <= -1.45e-166) tmp = (t_0 / x) / n; elseif (x <= 2.4e-13) tmp = (1.0 + (x / n)) - t_0; else tmp = t_0 * (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[x, -1.45e-166], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 2.4e-13], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(t$95$0 * N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{-166}:\\
\;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-13}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{1}{x \cdot n}\\
\end{array}
\end{array}
if x < -1.45e-166Initial program 71.8%
Taylor expanded in x around inf 0.0%
+-commutative0.0%
log-rec0.0%
mul-1-neg0.0%
associate-*r/0.0%
associate-*r*0.0%
metadata-eval0.0%
*-commutative0.0%
associate-/l*0.0%
exp-to-pow0.0%
*-commutative0.0%
log-rec0.0%
mul-1-neg0.0%
associate-*r/0.0%
associate-*r*0.0%
metadata-eval0.0%
*-commutative0.0%
associate-/l*0.0%
Simplified89.6%
associate--l+89.6%
div-inv87.0%
fma-define87.0%
Applied egg-rr87.0%
fma-undefine87.0%
associate-*r/89.6%
*-rgt-identity89.6%
+-inverses89.6%
Simplified89.6%
+-rgt-identity89.6%
associate-/r*94.9%
pow194.9%
pow-div94.9%
Applied egg-rr94.9%
pow-sub94.9%
pow194.9%
div-inv94.9%
Applied egg-rr94.9%
associate-*r/94.9%
*-rgt-identity94.9%
Simplified94.9%
if -1.45e-166 < x < 2.3999999999999999e-13Initial program 46.1%
Taylor expanded in x around 0 46.6%
if 2.3999999999999999e-13 < x Initial program 64.8%
Taylor expanded in x around inf 62.6%
+-commutative62.6%
log-rec62.6%
mul-1-neg62.6%
associate-*r/62.6%
associate-*r*62.6%
metadata-eval62.6%
*-commutative62.6%
associate-/l*62.6%
exp-to-pow62.6%
*-commutative62.6%
log-rec62.6%
mul-1-neg62.6%
associate-*r/62.6%
associate-*r*62.6%
metadata-eval62.6%
*-commutative62.6%
associate-/l*62.6%
Simplified62.6%
associate--l+94.6%
div-inv94.6%
fma-define94.6%
Applied egg-rr94.6%
fma-undefine94.6%
associate-*r/94.6%
*-rgt-identity94.6%
+-inverses98.0%
Simplified98.0%
+-rgt-identity98.0%
div-inv98.0%
Applied egg-rr98.0%
(FPCore (x n) :precision binary64 (/ (/ (pow x (/ 1.0 n)) x) n))
double code(double x, double n) {
return (pow(x, (1.0 / n)) / x) / n;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
code = ((x ** (1.0d0 / n)) / x) / n
end function
public static double code(double x, double n) {
return (Math.pow(x, (1.0 / n)) / x) / n;
}
def code(x, n): return (math.pow(x, (1.0 / n)) / x) / n
function code(x, n) return Float64(Float64((x ^ Float64(1.0 / n)) / x) / n) end
function tmp = code(x, n) tmp = ((x ^ (1.0 / n)) / x) / n; end
code[x_, n_] := N[(N[(N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{{x}^{\left(\frac{1}{n}\right)}}{x}}{n}
\end{array}
Initial program 56.4%
Taylor expanded in x around inf 22.7%
+-commutative22.7%
log-rec22.7%
mul-1-neg22.7%
associate-*r/22.7%
associate-*r*22.7%
metadata-eval22.7%
*-commutative22.7%
associate-/l*22.7%
exp-to-pow22.7%
*-commutative22.7%
log-rec22.7%
mul-1-neg22.7%
associate-*r/22.7%
associate-*r*22.7%
metadata-eval22.7%
*-commutative22.7%
associate-/l*22.7%
Simplified36.1%
associate--l+47.1%
div-inv46.7%
fma-define46.7%
Applied egg-rr46.7%
fma-undefine46.7%
associate-*r/47.1%
*-rgt-identity47.1%
+-inverses60.0%
Simplified60.0%
+-rgt-identity60.0%
associate-/r*62.9%
pow162.9%
pow-div62.7%
Applied egg-rr62.7%
pow-sub62.9%
pow162.9%
div-inv62.9%
Applied egg-rr62.9%
associate-*r/62.9%
*-rgt-identity62.9%
Simplified62.9%
herbie shell --seed 2024179
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))