
(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
(if (<= (/ 1.0 n) -2e-17)
(/ (exp (/ (log x) n)) (* n x))
(if (<= (/ 1.0 n) 400000.0)
(/
(-
(/ (- (pow (log1p x) 2.0) (pow (log x) 2.0)) (/ n 0.5))
(log (/ x (+ x 1.0))))
n)
(- (exp (/ (log1p x) n)) (pow x (/ 1.0 n))))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -2e-17) {
tmp = exp((log(x) / n)) / (n * x);
} else if ((1.0 / n) <= 400000.0) {
tmp = (((pow(log1p(x), 2.0) - pow(log(x), 2.0)) / (n / 0.5)) - log((x / (x + 1.0)))) / n;
} else {
tmp = exp((log1p(x) / n)) - pow(x, (1.0 / n));
}
return tmp;
}
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -2e-17) {
tmp = Math.exp((Math.log(x) / n)) / (n * x);
} else if ((1.0 / n) <= 400000.0) {
tmp = (((Math.pow(Math.log1p(x), 2.0) - Math.pow(Math.log(x), 2.0)) / (n / 0.5)) - Math.log((x / (x + 1.0)))) / n;
} else {
tmp = Math.exp((Math.log1p(x) / n)) - Math.pow(x, (1.0 / n));
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -2e-17: tmp = math.exp((math.log(x) / n)) / (n * x) elif (1.0 / n) <= 400000.0: tmp = (((math.pow(math.log1p(x), 2.0) - math.pow(math.log(x), 2.0)) / (n / 0.5)) - math.log((x / (x + 1.0)))) / n else: tmp = math.exp((math.log1p(x) / n)) - math.pow(x, (1.0 / n)) return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-17) tmp = Float64(exp(Float64(log(x) / n)) / Float64(n * x)); elseif (Float64(1.0 / n) <= 400000.0) tmp = Float64(Float64(Float64(Float64((log1p(x) ^ 2.0) - (log(x) ^ 2.0)) / Float64(n / 0.5)) - log(Float64(x / Float64(x + 1.0)))) / n); else tmp = Float64(exp(Float64(log1p(x) / n)) - (x ^ Float64(1.0 / n))); end return tmp end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-17], N[(N[Exp[N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 400000.0], N[(N[(N[(N[(N[Power[N[Log[1 + x], $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(n / 0.5), $MachinePrecision]), $MachinePrecision] - N[Log[N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-17}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{n \cdot x}\\
\mathbf{elif}\;\frac{1}{n} \leq 400000:\\
\;\;\;\;\frac{\frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{\frac{n}{0.5}} - \log \left(\frac{x}{x + 1}\right)}{n}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -2.00000000000000014e-17Initial program 95.3%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6497.2%
Simplified97.2%
pow-flipN/A
pow-to-expN/A
distribute-neg-fracN/A
metadata-evalN/A
exp-lowering-exp.f64N/A
un-div-invN/A
/-lowering-/.f64N/A
log-lowering-log.f6497.3%
Applied egg-rr97.3%
if -2.00000000000000014e-17 < (/.f64 #s(literal 1 binary64) n) < 4e5Initial program 30.2%
Taylor expanded in n around inf
/-lowering-/.f64N/A
Simplified77.8%
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
pow-lowering-pow.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
pow-lowering-pow.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
diff-logN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
Applied egg-rr78.3%
if 4e5 < (/.f64 #s(literal 1 binary64) n) Initial program 52.8%
pow-to-expN/A
exp-lowering-exp.f64N/A
un-div-invN/A
/-lowering-/.f64N/A
+-commutativeN/A
log1p-defineN/A
log1p-lowering-log1p.f64100.0%
Applied egg-rr100.0%
Final simplification86.7%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -2e-17)
(/ (exp (/ (log x) n)) (* n x))
(if (<= (/ 1.0 n) 400000.0)
(/ (log (/ x (+ x 1.0))) (- 0.0 n))
(- (exp (/ (log1p x) n)) (pow x (/ 1.0 n))))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -2e-17) {
tmp = exp((log(x) / n)) / (n * x);
} else if ((1.0 / n) <= 400000.0) {
tmp = log((x / (x + 1.0))) / (0.0 - n);
} else {
tmp = exp((log1p(x) / n)) - pow(x, (1.0 / n));
}
return tmp;
}
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -2e-17) {
tmp = Math.exp((Math.log(x) / n)) / (n * x);
} else if ((1.0 / n) <= 400000.0) {
tmp = Math.log((x / (x + 1.0))) / (0.0 - n);
} else {
tmp = Math.exp((Math.log1p(x) / n)) - Math.pow(x, (1.0 / n));
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -2e-17: tmp = math.exp((math.log(x) / n)) / (n * x) elif (1.0 / n) <= 400000.0: tmp = math.log((x / (x + 1.0))) / (0.0 - n) else: tmp = math.exp((math.log1p(x) / n)) - math.pow(x, (1.0 / n)) return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-17) tmp = Float64(exp(Float64(log(x) / n)) / Float64(n * x)); elseif (Float64(1.0 / n) <= 400000.0) tmp = Float64(log(Float64(x / Float64(x + 1.0))) / Float64(0.0 - n)); else tmp = Float64(exp(Float64(log1p(x) / n)) - (x ^ Float64(1.0 / n))); end return tmp end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-17], N[(N[Exp[N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 400000.0], N[(N[Log[N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - n), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-17}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{n \cdot x}\\
\mathbf{elif}\;\frac{1}{n} \leq 400000:\\
\;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{0 - n}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -2.00000000000000014e-17Initial program 95.3%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6497.2%
Simplified97.2%
pow-flipN/A
pow-to-expN/A
distribute-neg-fracN/A
metadata-evalN/A
exp-lowering-exp.f64N/A
un-div-invN/A
/-lowering-/.f64N/A
log-lowering-log.f6497.3%
Applied egg-rr97.3%
if -2.00000000000000014e-17 < (/.f64 #s(literal 1 binary64) n) < 4e5Initial program 30.2%
Taylor expanded in n around inf
/-lowering-/.f64N/A
Simplified77.8%
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
pow-lowering-pow.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
pow-lowering-pow.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
diff-logN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
Applied egg-rr78.3%
Taylor expanded in n around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
mul-1-negN/A
neg-lowering-neg.f6478.1%
Simplified78.1%
if 4e5 < (/.f64 #s(literal 1 binary64) n) Initial program 52.8%
pow-to-expN/A
exp-lowering-exp.f64N/A
un-div-invN/A
/-lowering-/.f64N/A
+-commutativeN/A
log1p-defineN/A
log1p-lowering-log1p.f64100.0%
Applied egg-rr100.0%
Final simplification86.6%
(FPCore (x n) :precision binary64 (let* ((t_0 (/ (log x) n))) (if (<= x 0.3) (* x (- (/ 1.0 n) (/ t_0 x))) (/ (/ (exp t_0) n) x))))
double code(double x, double n) {
double t_0 = log(x) / n;
double tmp;
if (x <= 0.3) {
tmp = x * ((1.0 / n) - (t_0 / x));
} else {
tmp = (exp(t_0) / n) / x;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = log(x) / n
if (x <= 0.3d0) then
tmp = x * ((1.0d0 / n) - (t_0 / x))
else
tmp = (exp(t_0) / n) / x
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.log(x) / n;
double tmp;
if (x <= 0.3) {
tmp = x * ((1.0 / n) - (t_0 / x));
} else {
tmp = (Math.exp(t_0) / n) / x;
}
return tmp;
}
def code(x, n): t_0 = math.log(x) / n tmp = 0 if x <= 0.3: tmp = x * ((1.0 / n) - (t_0 / x)) else: tmp = (math.exp(t_0) / n) / x return tmp
function code(x, n) t_0 = Float64(log(x) / n) tmp = 0.0 if (x <= 0.3) tmp = Float64(x * Float64(Float64(1.0 / n) - Float64(t_0 / x))); else tmp = Float64(Float64(exp(t_0) / n) / x); end return tmp end
function tmp_2 = code(x, n) t_0 = log(x) / n; tmp = 0.0; if (x <= 0.3) tmp = x * ((1.0 / n) - (t_0 / x)); else tmp = (exp(t_0) / n) / x; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[x, 0.3], N[(x * N[(N[(1.0 / n), $MachinePrecision] - N[(t$95$0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[t$95$0], $MachinePrecision] / n), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\log x}{n}\\
\mathbf{if}\;x \leq 0.3:\\
\;\;\;\;x \cdot \left(\frac{1}{n} - \frac{t\_0}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{e^{t\_0}}{n}}{x}\\
\end{array}
\end{array}
if x < 0.299999999999999989Initial program 40.5%
Taylor expanded in x around 0
*-rgt-identityN/A
associate-*r/N/A
+-lowering-+.f64N/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f6439.6%
Simplified39.6%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log-lowering-log.f6452.5%
Simplified52.5%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f6470.2%
Simplified70.2%
if 0.299999999999999989 < x Initial program 65.3%
Taylor expanded in x around inf
Simplified77.8%
Taylor expanded in x around inf
associate-/r*N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f6497.3%
Simplified97.3%
Taylor expanded in n around 0
*-commutativeN/A
associate-/r*N/A
exp-negN/A
mul-1-negN/A
remove-double-negN/A
/-lowering-/.f64N/A
Simplified97.3%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -2e-17)
(/ t_0 (* n x))
(if (<= (/ 1.0 n) 400000.0)
(/ (log (/ x (+ x 1.0))) (- 0.0 n))
(if (<= (/ 1.0 n) 5e+165)
(- (+ (/ x n) 1.0) t_0)
(/ (/ (+ (/ (+ (/ 0.3333333333333333 x) -0.5) x) 1.0) x) n))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-17) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 400000.0) {
tmp = log((x / (x + 1.0))) / (0.0 - n);
} else if ((1.0 / n) <= 5e+165) {
tmp = ((x / n) + 1.0) - t_0;
} else {
tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = x ** (1.0d0 / n)
if ((1.0d0 / n) <= (-2d-17)) then
tmp = t_0 / (n * x)
else if ((1.0d0 / n) <= 400000.0d0) then
tmp = log((x / (x + 1.0d0))) / (0.0d0 - n)
else if ((1.0d0 / n) <= 5d+165) then
tmp = ((x / n) + 1.0d0) - t_0
else
tmp = (((((0.3333333333333333d0 / x) + (-0.5d0)) / x) + 1.0d0) / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-17) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 400000.0) {
tmp = Math.log((x / (x + 1.0))) / (0.0 - n);
} else if ((1.0 / n) <= 5e+165) {
tmp = ((x / n) + 1.0) - t_0;
} else {
tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -2e-17: tmp = t_0 / (n * x) elif (1.0 / n) <= 400000.0: tmp = math.log((x / (x + 1.0))) / (0.0 - n) elif (1.0 / n) <= 5e+165: tmp = ((x / n) + 1.0) - t_0 else: tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-17) tmp = Float64(t_0 / Float64(n * x)); elseif (Float64(1.0 / n) <= 400000.0) tmp = Float64(log(Float64(x / Float64(x + 1.0))) / Float64(0.0 - n)); elseif (Float64(1.0 / n) <= 5e+165) tmp = Float64(Float64(Float64(x / n) + 1.0) - t_0); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if ((1.0 / n) <= -2e-17) tmp = t_0 / (n * x); elseif ((1.0 / n) <= 400000.0) tmp = log((x / (x + 1.0))) / (0.0 - n); elseif ((1.0 / n) <= 5e+165) tmp = ((x / n) + 1.0) - t_0; else tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-17], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 400000.0], N[(N[Log[N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e+165], N[(N[(N[(x / n), $MachinePrecision] + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(N[(N[(N[(0.3333333333333333 / x), $MachinePrecision] + -0.5), $MachinePrecision] / x), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-17}:\\
\;\;\;\;\frac{t\_0}{n \cdot x}\\
\mathbf{elif}\;\frac{1}{n} \leq 400000:\\
\;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{0 - n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{+165}:\\
\;\;\;\;\left(\frac{x}{n} + 1\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{\frac{0.3333333333333333}{x} + -0.5}{x} + 1}{x}}{n}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -2.00000000000000014e-17Initial program 95.3%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6497.2%
Simplified97.2%
/-lowering-/.f64N/A
pow-flipN/A
distribute-neg-fracN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6497.2%
Applied egg-rr97.2%
if -2.00000000000000014e-17 < (/.f64 #s(literal 1 binary64) n) < 4e5Initial program 30.2%
Taylor expanded in n around inf
/-lowering-/.f64N/A
Simplified77.8%
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
pow-lowering-pow.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
pow-lowering-pow.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
diff-logN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
Applied egg-rr78.3%
Taylor expanded in n around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
mul-1-negN/A
neg-lowering-neg.f6478.1%
Simplified78.1%
if 4e5 < (/.f64 #s(literal 1 binary64) n) < 4.9999999999999997e165Initial program 76.7%
Taylor expanded in x around 0
*-rgt-identityN/A
associate-*r/N/A
+-lowering-+.f64N/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f6469.3%
Simplified69.3%
if 4.9999999999999997e165 < (/.f64 #s(literal 1 binary64) n) Initial program 19.9%
Taylor expanded in x around inf
Simplified0.0%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r/N/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6476.1%
Simplified76.1%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f6476.1%
Applied egg-rr76.1%
Final simplification82.4%
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -2e-17)
(/ t_0 (* n x))
(if (<= (/ 1.0 n) 400000.0)
(/ (log (/ x (+ x 1.0))) (- 0.0 n))
(if (<= (/ 1.0 n) 1e+144)
(- 1.0 t_0)
(/ (/ (+ (/ (+ (/ 0.3333333333333333 x) -0.5) x) 1.0) x) n))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-17) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 400000.0) {
tmp = log((x / (x + 1.0))) / (0.0 - n);
} else if ((1.0 / n) <= 1e+144) {
tmp = 1.0 - t_0;
} else {
tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = x ** (1.0d0 / n)
if ((1.0d0 / n) <= (-2d-17)) then
tmp = t_0 / (n * x)
else if ((1.0d0 / n) <= 400000.0d0) then
tmp = log((x / (x + 1.0d0))) / (0.0d0 - n)
else if ((1.0d0 / n) <= 1d+144) then
tmp = 1.0d0 - t_0
else
tmp = (((((0.3333333333333333d0 / x) + (-0.5d0)) / x) + 1.0d0) / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-17) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 400000.0) {
tmp = Math.log((x / (x + 1.0))) / (0.0 - n);
} else if ((1.0 / n) <= 1e+144) {
tmp = 1.0 - t_0;
} else {
tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -2e-17: tmp = t_0 / (n * x) elif (1.0 / n) <= 400000.0: tmp = math.log((x / (x + 1.0))) / (0.0 - n) elif (1.0 / n) <= 1e+144: tmp = 1.0 - t_0 else: tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-17) tmp = Float64(t_0 / Float64(n * x)); elseif (Float64(1.0 / n) <= 400000.0) tmp = Float64(log(Float64(x / Float64(x + 1.0))) / Float64(0.0 - n)); elseif (Float64(1.0 / n) <= 1e+144) tmp = Float64(1.0 - t_0); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if ((1.0 / n) <= -2e-17) tmp = t_0 / (n * x); elseif ((1.0 / n) <= 400000.0) tmp = log((x / (x + 1.0))) / (0.0 - n); elseif ((1.0 / n) <= 1e+144) tmp = 1.0 - t_0; else tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-17], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 400000.0], N[(N[Log[N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+144], N[(1.0 - t$95$0), $MachinePrecision], N[(N[(N[(N[(N[(N[(0.3333333333333333 / x), $MachinePrecision] + -0.5), $MachinePrecision] / x), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-17}:\\
\;\;\;\;\frac{t\_0}{n \cdot x}\\
\mathbf{elif}\;\frac{1}{n} \leq 400000:\\
\;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{0 - n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+144}:\\
\;\;\;\;1 - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{\frac{0.3333333333333333}{x} + -0.5}{x} + 1}{x}}{n}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -2.00000000000000014e-17Initial program 95.3%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6497.2%
Simplified97.2%
/-lowering-/.f64N/A
pow-flipN/A
distribute-neg-fracN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6497.2%
Applied egg-rr97.2%
if -2.00000000000000014e-17 < (/.f64 #s(literal 1 binary64) n) < 4e5Initial program 30.2%
Taylor expanded in n around inf
/-lowering-/.f64N/A
Simplified77.8%
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
pow-lowering-pow.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
pow-lowering-pow.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
diff-logN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
Applied egg-rr78.3%
Taylor expanded in n around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
mul-1-negN/A
neg-lowering-neg.f6478.1%
Simplified78.1%
if 4e5 < (/.f64 #s(literal 1 binary64) n) < 1.00000000000000002e144Initial program 79.2%
Taylor expanded in x around 0
Simplified69.5%
if 1.00000000000000002e144 < (/.f64 #s(literal 1 binary64) n) Initial program 23.4%
Taylor expanded in x around inf
Simplified0.0%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r/N/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6473.4%
Simplified73.4%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f6473.4%
Applied egg-rr73.4%
Final simplification82.3%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -2e-17)
(/ (pow x (+ (/ 1.0 n) -1.0)) n)
(if (<= (/ 1.0 n) 400000.0)
(/ (log (/ x (+ x 1.0))) (- 0.0 n))
(if (<= (/ 1.0 n) 1e+144)
(- 1.0 (pow x (/ 1.0 n)))
(/ (/ (+ (/ (+ (/ 0.3333333333333333 x) -0.5) x) 1.0) x) n)))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -2e-17) {
tmp = pow(x, ((1.0 / n) + -1.0)) / n;
} else if ((1.0 / n) <= 400000.0) {
tmp = log((x / (x + 1.0))) / (0.0 - n);
} else if ((1.0 / n) <= 1e+144) {
tmp = 1.0 - pow(x, (1.0 / n));
} else {
tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if ((1.0d0 / n) <= (-2d-17)) then
tmp = (x ** ((1.0d0 / n) + (-1.0d0))) / n
else if ((1.0d0 / n) <= 400000.0d0) then
tmp = log((x / (x + 1.0d0))) / (0.0d0 - n)
else if ((1.0d0 / n) <= 1d+144) then
tmp = 1.0d0 - (x ** (1.0d0 / n))
else
tmp = (((((0.3333333333333333d0 / x) + (-0.5d0)) / x) + 1.0d0) / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -2e-17) {
tmp = Math.pow(x, ((1.0 / n) + -1.0)) / n;
} else if ((1.0 / n) <= 400000.0) {
tmp = Math.log((x / (x + 1.0))) / (0.0 - n);
} else if ((1.0 / n) <= 1e+144) {
tmp = 1.0 - Math.pow(x, (1.0 / n));
} else {
tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n;
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -2e-17: tmp = math.pow(x, ((1.0 / n) + -1.0)) / n elif (1.0 / n) <= 400000.0: tmp = math.log((x / (x + 1.0))) / (0.0 - n) elif (1.0 / n) <= 1e+144: tmp = 1.0 - math.pow(x, (1.0 / n)) else: tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-17) tmp = Float64((x ^ Float64(Float64(1.0 / n) + -1.0)) / n); elseif (Float64(1.0 / n) <= 400000.0) tmp = Float64(log(Float64(x / Float64(x + 1.0))) / Float64(0.0 - n)); elseif (Float64(1.0 / n) <= 1e+144) tmp = Float64(1.0 - (x ^ Float64(1.0 / n))); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -2e-17) tmp = (x ^ ((1.0 / n) + -1.0)) / n; elseif ((1.0 / n) <= 400000.0) tmp = log((x / (x + 1.0))) / (0.0 - n); elseif ((1.0 / n) <= 1e+144) tmp = 1.0 - (x ^ (1.0 / n)); else tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-17], N[(N[Power[x, N[(N[(1.0 / n), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 400000.0], N[(N[Log[N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+144], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(0.3333333333333333 / x), $MachinePrecision] + -0.5), $MachinePrecision] / x), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-17}:\\
\;\;\;\;\frac{{x}^{\left(\frac{1}{n} + -1\right)}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 400000:\\
\;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{0 - n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+144}:\\
\;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{\frac{0.3333333333333333}{x} + -0.5}{x} + 1}{x}}{n}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -2.00000000000000014e-17Initial program 95.3%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6497.2%
Simplified97.2%
associate-/r*N/A
/-lowering-/.f64N/A
div-invN/A
pow-flipN/A
distribute-neg-fracN/A
metadata-evalN/A
inv-powN/A
pow-prod-upN/A
pow-lowering-pow.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f6497.0%
Applied egg-rr97.0%
if -2.00000000000000014e-17 < (/.f64 #s(literal 1 binary64) n) < 4e5Initial program 30.2%
Taylor expanded in n around inf
/-lowering-/.f64N/A
Simplified77.8%
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
pow-lowering-pow.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
pow-lowering-pow.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
diff-logN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
Applied egg-rr78.3%
Taylor expanded in n around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
mul-1-negN/A
neg-lowering-neg.f6478.1%
Simplified78.1%
if 4e5 < (/.f64 #s(literal 1 binary64) n) < 1.00000000000000002e144Initial program 79.2%
Taylor expanded in x around 0
Simplified69.5%
if 1.00000000000000002e144 < (/.f64 #s(literal 1 binary64) n) Initial program 23.4%
Taylor expanded in x around inf
Simplified0.0%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r/N/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6473.4%
Simplified73.4%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f6473.4%
Applied egg-rr73.4%
Final simplification82.3%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -0.5)
(/ 0.3333333333333333 (* n (* x (* x x))))
(if (<= (/ 1.0 n) 400000.0)
(/ (log (/ x (+ x 1.0))) (- 0.0 n))
(if (<= (/ 1.0 n) 1e+144)
(- 1.0 (pow x (/ 1.0 n)))
(/ (/ (+ (/ (+ (/ 0.3333333333333333 x) -0.5) x) 1.0) x) n)))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -0.5) {
tmp = 0.3333333333333333 / (n * (x * (x * x)));
} else if ((1.0 / n) <= 400000.0) {
tmp = log((x / (x + 1.0))) / (0.0 - n);
} else if ((1.0 / n) <= 1e+144) {
tmp = 1.0 - pow(x, (1.0 / n));
} else {
tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if ((1.0d0 / n) <= (-0.5d0)) then
tmp = 0.3333333333333333d0 / (n * (x * (x * x)))
else if ((1.0d0 / n) <= 400000.0d0) then
tmp = log((x / (x + 1.0d0))) / (0.0d0 - n)
else if ((1.0d0 / n) <= 1d+144) then
tmp = 1.0d0 - (x ** (1.0d0 / n))
else
tmp = (((((0.3333333333333333d0 / x) + (-0.5d0)) / x) + 1.0d0) / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -0.5) {
tmp = 0.3333333333333333 / (n * (x * (x * x)));
} else if ((1.0 / n) <= 400000.0) {
tmp = Math.log((x / (x + 1.0))) / (0.0 - n);
} else if ((1.0 / n) <= 1e+144) {
tmp = 1.0 - Math.pow(x, (1.0 / n));
} else {
tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n;
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -0.5: tmp = 0.3333333333333333 / (n * (x * (x * x))) elif (1.0 / n) <= 400000.0: tmp = math.log((x / (x + 1.0))) / (0.0 - n) elif (1.0 / n) <= 1e+144: tmp = 1.0 - math.pow(x, (1.0 / n)) else: tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -0.5) tmp = Float64(0.3333333333333333 / Float64(n * Float64(x * Float64(x * x)))); elseif (Float64(1.0 / n) <= 400000.0) tmp = Float64(log(Float64(x / Float64(x + 1.0))) / Float64(0.0 - n)); elseif (Float64(1.0 / n) <= 1e+144) tmp = Float64(1.0 - (x ^ Float64(1.0 / n))); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -0.5) tmp = 0.3333333333333333 / (n * (x * (x * x))); elseif ((1.0 / n) <= 400000.0) tmp = log((x / (x + 1.0))) / (0.0 - n); elseif ((1.0 / n) <= 1e+144) tmp = 1.0 - (x ^ (1.0 / n)); else tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -0.5], N[(0.3333333333333333 / N[(n * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 400000.0], N[(N[Log[N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+144], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(0.3333333333333333 / x), $MachinePrecision] + -0.5), $MachinePrecision] / x), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -0.5:\\
\;\;\;\;\frac{0.3333333333333333}{n \cdot \left(x \cdot \left(x \cdot x\right)\right)}\\
\mathbf{elif}\;\frac{1}{n} \leq 400000:\\
\;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{0 - n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+144}:\\
\;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{\frac{0.3333333333333333}{x} + -0.5}{x} + 1}{x}}{n}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -0.5Initial program 98.6%
Taylor expanded in x around inf
Simplified43.8%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r/N/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6447.2%
Simplified47.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.6%
Simplified76.6%
if -0.5 < (/.f64 #s(literal 1 binary64) n) < 4e5Initial program 30.5%
Taylor expanded in n around inf
/-lowering-/.f64N/A
Simplified76.6%
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
pow-lowering-pow.f64N/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
pow-lowering-pow.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
diff-logN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
Applied egg-rr77.1%
Taylor expanded in n around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
mul-1-negN/A
neg-lowering-neg.f6476.6%
Simplified76.6%
if 4e5 < (/.f64 #s(literal 1 binary64) n) < 1.00000000000000002e144Initial program 79.2%
Taylor expanded in x around 0
Simplified69.5%
if 1.00000000000000002e144 < (/.f64 #s(literal 1 binary64) n) Initial program 23.4%
Taylor expanded in x around inf
Simplified0.0%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r/N/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6473.4%
Simplified73.4%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f6473.4%
Applied egg-rr73.4%
Final simplification75.8%
(FPCore (x n)
:precision binary64
(if (<= x 3.35e-283)
(- 0.0 (/ (log x) n))
(if (<= x 2.7e-252)
(- 1.0 (pow x (/ 1.0 n)))
(if (<= x 0.85)
(/ (- x (log x)) n)
(if (<= x 4.4e+101)
(/ (/ (- (+ (/ 0.3333333333333333 (* x x)) 1.0) (/ 0.5 x)) n) x)
0.0)))))
double code(double x, double n) {
double tmp;
if (x <= 3.35e-283) {
tmp = 0.0 - (log(x) / n);
} else if (x <= 2.7e-252) {
tmp = 1.0 - pow(x, (1.0 / n));
} else if (x <= 0.85) {
tmp = (x - log(x)) / n;
} else if (x <= 4.4e+101) {
tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / x;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 3.35d-283) then
tmp = 0.0d0 - (log(x) / n)
else if (x <= 2.7d-252) then
tmp = 1.0d0 - (x ** (1.0d0 / n))
else if (x <= 0.85d0) then
tmp = (x - log(x)) / n
else if (x <= 4.4d+101) then
tmp = ((((0.3333333333333333d0 / (x * x)) + 1.0d0) - (0.5d0 / x)) / n) / x
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 3.35e-283) {
tmp = 0.0 - (Math.log(x) / n);
} else if (x <= 2.7e-252) {
tmp = 1.0 - Math.pow(x, (1.0 / n));
} else if (x <= 0.85) {
tmp = (x - Math.log(x)) / n;
} else if (x <= 4.4e+101) {
tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / x;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 3.35e-283: tmp = 0.0 - (math.log(x) / n) elif x <= 2.7e-252: tmp = 1.0 - math.pow(x, (1.0 / n)) elif x <= 0.85: tmp = (x - math.log(x)) / n elif x <= 4.4e+101: tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / x else: tmp = 0.0 return tmp
function code(x, n) tmp = 0.0 if (x <= 3.35e-283) tmp = Float64(0.0 - Float64(log(x) / n)); elseif (x <= 2.7e-252) tmp = Float64(1.0 - (x ^ Float64(1.0 / n))); elseif (x <= 0.85) tmp = Float64(Float64(x - log(x)) / n); elseif (x <= 4.4e+101) tmp = Float64(Float64(Float64(Float64(Float64(0.3333333333333333 / Float64(x * x)) + 1.0) - Float64(0.5 / x)) / n) / x); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 3.35e-283) tmp = 0.0 - (log(x) / n); elseif (x <= 2.7e-252) tmp = 1.0 - (x ^ (1.0 / n)); elseif (x <= 0.85) tmp = (x - log(x)) / n; elseif (x <= 4.4e+101) tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / x; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 3.35e-283], N[(0.0 - N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.7e-252], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.85], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 4.4e+101], N[(N[(N[(N[(N[(0.3333333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] / x), $MachinePrecision], 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.35 \cdot 10^{-283}:\\
\;\;\;\;0 - \frac{\log x}{n}\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-252}:\\
\;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{elif}\;x \leq 0.85:\\
\;\;\;\;\frac{x - \log x}{n}\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{+101}:\\
\;\;\;\;\frac{\frac{\left(\frac{0.3333333333333333}{x \cdot x} + 1\right) - \frac{0.5}{x}}{n}}{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 3.35000000000000023e-283Initial program 26.9%
Taylor expanded in x around 0
Simplified26.9%
Taylor expanded in n around inf
*-lowering-*.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f6478.9%
Simplified78.9%
if 3.35000000000000023e-283 < x < 2.69999999999999981e-252Initial program 68.3%
Taylor expanded in x around 0
Simplified68.3%
if 2.69999999999999981e-252 < x < 0.849999999999999978Initial program 36.4%
Taylor expanded in x around 0
*-rgt-identityN/A
associate-*r/N/A
+-lowering-+.f64N/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f6435.1%
Simplified35.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log-lowering-log.f6454.9%
Simplified54.9%
if 0.849999999999999978 < x < 4.4000000000000001e101Initial program 43.8%
Taylor expanded in x around inf
Simplified75.9%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r/N/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6462.2%
Simplified62.2%
if 4.4000000000000001e101 < x Initial program 79.7%
Taylor expanded in x around 0
Simplified50.8%
Taylor expanded in n around inf
Simplified79.8%
metadata-eval79.8%
Applied egg-rr79.8%
Final simplification64.6%
(FPCore (x n) :precision binary64 (if (<= x 0.3) (* x (- (/ 1.0 n) (/ (/ (log x) n) x))) (/ (pow x (+ (/ 1.0 n) -1.0)) n)))
double code(double x, double n) {
double tmp;
if (x <= 0.3) {
tmp = x * ((1.0 / n) - ((log(x) / n) / x));
} else {
tmp = pow(x, ((1.0 / n) + -1.0)) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 0.3d0) then
tmp = x * ((1.0d0 / n) - ((log(x) / n) / x))
else
tmp = (x ** ((1.0d0 / n) + (-1.0d0))) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 0.3) {
tmp = x * ((1.0 / n) - ((Math.log(x) / n) / x));
} else {
tmp = Math.pow(x, ((1.0 / n) + -1.0)) / n;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 0.3: tmp = x * ((1.0 / n) - ((math.log(x) / n) / x)) else: tmp = math.pow(x, ((1.0 / n) + -1.0)) / n return tmp
function code(x, n) tmp = 0.0 if (x <= 0.3) tmp = Float64(x * Float64(Float64(1.0 / n) - Float64(Float64(log(x) / n) / x))); else tmp = Float64((x ^ Float64(Float64(1.0 / n) + -1.0)) / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 0.3) tmp = x * ((1.0 / n) - ((log(x) / n) / x)); else tmp = (x ^ ((1.0 / n) + -1.0)) / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 0.3], N[(x * N[(N[(1.0 / n), $MachinePrecision] - N[(N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x, N[(N[(1.0 / n), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.3:\\
\;\;\;\;x \cdot \left(\frac{1}{n} - \frac{\frac{\log x}{n}}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{{x}^{\left(\frac{1}{n} + -1\right)}}{n}\\
\end{array}
\end{array}
if x < 0.299999999999999989Initial program 40.5%
Taylor expanded in x around 0
*-rgt-identityN/A
associate-*r/N/A
+-lowering-+.f64N/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f6439.6%
Simplified39.6%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log-lowering-log.f6452.5%
Simplified52.5%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f6470.2%
Simplified70.2%
if 0.299999999999999989 < x Initial program 65.3%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6496.7%
Simplified96.7%
associate-/r*N/A
/-lowering-/.f64N/A
div-invN/A
pow-flipN/A
distribute-neg-fracN/A
metadata-evalN/A
inv-powN/A
pow-prod-upN/A
pow-lowering-pow.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f6497.1%
Applied egg-rr97.1%
(FPCore (x n)
:precision binary64
(if (<= x 0.85)
(/ (- x (log x)) n)
(if (<= x 4.5e+104)
(/ (/ (- (+ (/ 0.3333333333333333 (* x x)) 1.0) (/ 0.5 x)) n) x)
0.0)))
double code(double x, double n) {
double tmp;
if (x <= 0.85) {
tmp = (x - log(x)) / n;
} else if (x <= 4.5e+104) {
tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / x;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 0.85d0) then
tmp = (x - log(x)) / n
else if (x <= 4.5d+104) then
tmp = ((((0.3333333333333333d0 / (x * x)) + 1.0d0) - (0.5d0 / x)) / n) / x
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 0.85) {
tmp = (x - Math.log(x)) / n;
} else if (x <= 4.5e+104) {
tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / x;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 0.85: tmp = (x - math.log(x)) / n elif x <= 4.5e+104: tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / x else: tmp = 0.0 return tmp
function code(x, n) tmp = 0.0 if (x <= 0.85) tmp = Float64(Float64(x - log(x)) / n); elseif (x <= 4.5e+104) tmp = Float64(Float64(Float64(Float64(Float64(0.3333333333333333 / Float64(x * x)) + 1.0) - Float64(0.5 / x)) / n) / x); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 0.85) tmp = (x - log(x)) / n; elseif (x <= 4.5e+104) tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / x; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 0.85], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 4.5e+104], N[(N[(N[(N[(N[(0.3333333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] / x), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.85:\\
\;\;\;\;\frac{x - \log x}{n}\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{+104}:\\
\;\;\;\;\frac{\frac{\left(\frac{0.3333333333333333}{x \cdot x} + 1\right) - \frac{0.5}{x}}{n}}{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 0.849999999999999978Initial program 40.5%
Taylor expanded in x around 0
*-rgt-identityN/A
associate-*r/N/A
+-lowering-+.f64N/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f6439.6%
Simplified39.6%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
log-lowering-log.f6452.5%
Simplified52.5%
if 0.849999999999999978 < x < 4.4999999999999998e104Initial program 43.8%
Taylor expanded in x around inf
Simplified75.9%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r/N/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6462.2%
Simplified62.2%
if 4.4999999999999998e104 < x Initial program 79.7%
Taylor expanded in x around 0
Simplified50.8%
Taylor expanded in n around inf
Simplified79.8%
metadata-eval79.8%
Applied egg-rr79.8%
Final simplification61.3%
(FPCore (x n)
:precision binary64
(if (<= x 0.58)
(- 0.0 (/ (log x) n))
(if (<= x 2.6e+114)
(/ (/ (- (+ (/ 0.3333333333333333 (* x x)) 1.0) (/ 0.5 x)) n) x)
0.0)))
double code(double x, double n) {
double tmp;
if (x <= 0.58) {
tmp = 0.0 - (log(x) / n);
} else if (x <= 2.6e+114) {
tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / x;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 0.58d0) then
tmp = 0.0d0 - (log(x) / n)
else if (x <= 2.6d+114) then
tmp = ((((0.3333333333333333d0 / (x * x)) + 1.0d0) - (0.5d0 / x)) / n) / x
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 0.58) {
tmp = 0.0 - (Math.log(x) / n);
} else if (x <= 2.6e+114) {
tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / x;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 0.58: tmp = 0.0 - (math.log(x) / n) elif x <= 2.6e+114: tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / x else: tmp = 0.0 return tmp
function code(x, n) tmp = 0.0 if (x <= 0.58) tmp = Float64(0.0 - Float64(log(x) / n)); elseif (x <= 2.6e+114) tmp = Float64(Float64(Float64(Float64(Float64(0.3333333333333333 / Float64(x * x)) + 1.0) - Float64(0.5 / x)) / n) / x); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 0.58) tmp = 0.0 - (log(x) / n); elseif (x <= 2.6e+114) tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / x; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 0.58], N[(0.0 - N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.6e+114], N[(N[(N[(N[(N[(0.3333333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] / x), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.58:\\
\;\;\;\;0 - \frac{\log x}{n}\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{+114}:\\
\;\;\;\;\frac{\frac{\left(\frac{0.3333333333333333}{x \cdot x} + 1\right) - \frac{0.5}{x}}{n}}{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 0.57999999999999996Initial program 40.5%
Taylor expanded in x around 0
Simplified39.1%
Taylor expanded in n around inf
*-lowering-*.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f6451.6%
Simplified51.6%
if 0.57999999999999996 < x < 2.6e114Initial program 43.8%
Taylor expanded in x around inf
Simplified75.9%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r/N/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6462.2%
Simplified62.2%
if 2.6e114 < x Initial program 79.7%
Taylor expanded in x around 0
Simplified50.8%
Taylor expanded in n around inf
Simplified79.8%
metadata-eval79.8%
Applied egg-rr79.8%
Final simplification60.8%
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -20000000.0)
(/ 0.3333333333333333 (* n (* x (* x x))))
(if (<= (/ 1.0 n) 2e-19)
(/ (/ 1.0 n) x)
(/ (+ x (- (/ 0.3333333333333333 x) 0.5)) (* n (* x x))))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -20000000.0) {
tmp = 0.3333333333333333 / (n * (x * (x * x)));
} else if ((1.0 / n) <= 2e-19) {
tmp = (1.0 / n) / x;
} else {
tmp = (x + ((0.3333333333333333 / x) - 0.5)) / (n * (x * x));
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if ((1.0d0 / n) <= (-20000000.0d0)) then
tmp = 0.3333333333333333d0 / (n * (x * (x * x)))
else if ((1.0d0 / n) <= 2d-19) then
tmp = (1.0d0 / n) / x
else
tmp = (x + ((0.3333333333333333d0 / x) - 0.5d0)) / (n * (x * x))
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -20000000.0) {
tmp = 0.3333333333333333 / (n * (x * (x * x)));
} else if ((1.0 / n) <= 2e-19) {
tmp = (1.0 / n) / x;
} else {
tmp = (x + ((0.3333333333333333 / x) - 0.5)) / (n * (x * x));
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -20000000.0: tmp = 0.3333333333333333 / (n * (x * (x * x))) elif (1.0 / n) <= 2e-19: tmp = (1.0 / n) / x else: tmp = (x + ((0.3333333333333333 / x) - 0.5)) / (n * (x * x)) return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -20000000.0) tmp = Float64(0.3333333333333333 / Float64(n * Float64(x * Float64(x * x)))); elseif (Float64(1.0 / n) <= 2e-19) tmp = Float64(Float64(1.0 / n) / x); else tmp = Float64(Float64(x + Float64(Float64(0.3333333333333333 / x) - 0.5)) / Float64(n * Float64(x * x))); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -20000000.0) tmp = 0.3333333333333333 / (n * (x * (x * x))); elseif ((1.0 / n) <= 2e-19) tmp = (1.0 / n) / x; else tmp = (x + ((0.3333333333333333 / x) - 0.5)) / (n * (x * x)); end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -20000000.0], N[(0.3333333333333333 / N[(n * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-19], N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision], N[(N[(x + N[(N[(0.3333333333333333 / x), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision] / N[(n * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -20000000:\\
\;\;\;\;\frac{0.3333333333333333}{n \cdot \left(x \cdot \left(x \cdot x\right)\right)}\\
\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-19}:\\
\;\;\;\;\frac{\frac{1}{n}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \left(\frac{0.3333333333333333}{x} - 0.5\right)}{n \cdot \left(x \cdot x\right)}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -2e7Initial program 100.0%
Taylor expanded in x around inf
Simplified43.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r/N/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6447.9%
Simplified47.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.7%
Simplified77.7%
if -2e7 < (/.f64 #s(literal 1 binary64) n) < 2e-19Initial program 30.9%
Taylor expanded in x around inf
Simplified51.3%
Taylor expanded in x around inf
associate-/r*N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f6451.6%
Simplified51.6%
Taylor expanded in n around inf
/-lowering-/.f6450.6%
Simplified50.6%
if 2e-19 < (/.f64 #s(literal 1 binary64) n) Initial program 48.0%
Taylor expanded in x around inf
Simplified9.6%
Applied egg-rr9.6%
Taylor expanded in n around -inf
/-lowering-/.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
--lowering--.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6437.3%
Simplified37.3%
Final simplification55.2%
(FPCore (x n)
:precision binary64
(let* ((t_0 (/ 0.3333333333333333 (* n (* x (* x x))))))
(if (<= (/ 1.0 n) -20000000.0)
t_0
(if (<= (/ 1.0 n) 4e+78) (/ (/ 1.0 n) x) t_0))))
double code(double x, double n) {
double t_0 = 0.3333333333333333 / (n * (x * (x * x)));
double tmp;
if ((1.0 / n) <= -20000000.0) {
tmp = t_0;
} else if ((1.0 / n) <= 4e+78) {
tmp = (1.0 / n) / x;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = 0.3333333333333333d0 / (n * (x * (x * x)))
if ((1.0d0 / n) <= (-20000000.0d0)) then
tmp = t_0
else if ((1.0d0 / n) <= 4d+78) then
tmp = (1.0d0 / n) / x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = 0.3333333333333333 / (n * (x * (x * x)));
double tmp;
if ((1.0 / n) <= -20000000.0) {
tmp = t_0;
} else if ((1.0 / n) <= 4e+78) {
tmp = (1.0 / n) / x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, n): t_0 = 0.3333333333333333 / (n * (x * (x * x))) tmp = 0 if (1.0 / n) <= -20000000.0: tmp = t_0 elif (1.0 / n) <= 4e+78: tmp = (1.0 / n) / x else: tmp = t_0 return tmp
function code(x, n) t_0 = Float64(0.3333333333333333 / Float64(n * Float64(x * Float64(x * x)))) tmp = 0.0 if (Float64(1.0 / n) <= -20000000.0) tmp = t_0; elseif (Float64(1.0 / n) <= 4e+78) tmp = Float64(Float64(1.0 / n) / x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, n) t_0 = 0.3333333333333333 / (n * (x * (x * x))); tmp = 0.0; if ((1.0 / n) <= -20000000.0) tmp = t_0; elseif ((1.0 / n) <= 4e+78) tmp = (1.0 / n) / x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(0.3333333333333333 / N[(n * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -20000000.0], t$95$0, If[LessEqual[N[(1.0 / n), $MachinePrecision], 4e+78], N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{0.3333333333333333}{n \cdot \left(x \cdot \left(x \cdot x\right)\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -20000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{+78}:\\
\;\;\;\;\frac{\frac{1}{n}}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -2e7 or 4.00000000000000003e78 < (/.f64 #s(literal 1 binary64) n) Initial program 82.1%
Taylor expanded in x around inf
Simplified30.1%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r/N/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6449.1%
Simplified49.1%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6470.0%
Simplified70.0%
if -2e7 < (/.f64 #s(literal 1 binary64) n) < 4.00000000000000003e78Initial program 33.8%
Taylor expanded in x around inf
Simplified49.1%
Taylor expanded in x around inf
associate-/r*N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f6449.4%
Simplified49.4%
Taylor expanded in n around inf
/-lowering-/.f6446.7%
Simplified46.7%
(FPCore (x n) :precision binary64 (if (<= (/ 1.0 n) -1e+16) (/ 0.3333333333333333 (* n (* x (* x x)))) (/ (/ (- (+ (/ 0.3333333333333333 (* x x)) 1.0) (/ 0.5 x)) n) x)))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e+16) {
tmp = 0.3333333333333333 / (n * (x * (x * x)));
} else {
tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / x;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if ((1.0d0 / n) <= (-1d+16)) then
tmp = 0.3333333333333333d0 / (n * (x * (x * x)))
else
tmp = ((((0.3333333333333333d0 / (x * x)) + 1.0d0) - (0.5d0 / x)) / n) / x
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e+16) {
tmp = 0.3333333333333333 / (n * (x * (x * x)));
} else {
tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / x;
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -1e+16: tmp = 0.3333333333333333 / (n * (x * (x * x))) else: tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / x return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -1e+16) tmp = Float64(0.3333333333333333 / Float64(n * Float64(x * Float64(x * x)))); else tmp = Float64(Float64(Float64(Float64(Float64(0.3333333333333333 / Float64(x * x)) + 1.0) - Float64(0.5 / x)) / n) / x); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -1e+16) tmp = 0.3333333333333333 / (n * (x * (x * x))); else tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / x; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+16], N[(0.3333333333333333 / N[(n * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(0.3333333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+16}:\\
\;\;\;\;\frac{0.3333333333333333}{n \cdot \left(x \cdot \left(x \cdot x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(\frac{0.3333333333333333}{x \cdot x} + 1\right) - \frac{0.5}{x}}{n}}{x}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -1e16Initial program 100.0%
Taylor expanded in x around inf
Simplified42.2%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r/N/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6447.0%
Simplified47.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.4%
Simplified77.4%
if -1e16 < (/.f64 #s(literal 1 binary64) n) Initial program 35.1%
Taylor expanded in x around inf
Simplified42.2%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r/N/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6447.6%
Simplified47.6%
Final simplification55.0%
(FPCore (x n) :precision binary64 (if (<= (/ 1.0 n) -1e+16) (/ 0.3333333333333333 (* n (* x (* x x)))) (/ (/ (+ (/ (+ (/ 0.3333333333333333 x) -0.5) x) 1.0) x) n)))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e+16) {
tmp = 0.3333333333333333 / (n * (x * (x * x)));
} else {
tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if ((1.0d0 / n) <= (-1d+16)) then
tmp = 0.3333333333333333d0 / (n * (x * (x * x)))
else
tmp = (((((0.3333333333333333d0 / x) + (-0.5d0)) / x) + 1.0d0) / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e+16) {
tmp = 0.3333333333333333 / (n * (x * (x * x)));
} else {
tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n;
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -1e+16: tmp = 0.3333333333333333 / (n * (x * (x * x))) else: tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -1e+16) tmp = Float64(0.3333333333333333 / Float64(n * Float64(x * Float64(x * x)))); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -1e+16) tmp = 0.3333333333333333 / (n * (x * (x * x))); else tmp = (((((0.3333333333333333 / x) + -0.5) / x) + 1.0) / x) / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+16], N[(0.3333333333333333 / N[(n * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(0.3333333333333333 / x), $MachinePrecision] + -0.5), $MachinePrecision] / x), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+16}:\\
\;\;\;\;\frac{0.3333333333333333}{n \cdot \left(x \cdot \left(x \cdot x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{\frac{0.3333333333333333}{x} + -0.5}{x} + 1}{x}}{n}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -1e16Initial program 100.0%
Taylor expanded in x around inf
Simplified42.2%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r/N/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6447.0%
Simplified47.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.4%
Simplified77.4%
if -1e16 < (/.f64 #s(literal 1 binary64) n) Initial program 35.1%
Taylor expanded in x around inf
Simplified42.2%
Taylor expanded in n around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
associate-*r/N/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6447.2%
Simplified47.2%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f6447.5%
Applied egg-rr47.5%
Final simplification55.0%
(FPCore (x n) :precision binary64 (let* ((t_0 (/ 1.0 (* n x)))) (if (<= n -2.6e-8) t_0 (if (<= n -2.4e-241) 0.0 t_0))))
double code(double x, double n) {
double t_0 = 1.0 / (n * x);
double tmp;
if (n <= -2.6e-8) {
tmp = t_0;
} else if (n <= -2.4e-241) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 / (n * x)
if (n <= (-2.6d-8)) then
tmp = t_0
else if (n <= (-2.4d-241)) then
tmp = 0.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = 1.0 / (n * x);
double tmp;
if (n <= -2.6e-8) {
tmp = t_0;
} else if (n <= -2.4e-241) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, n): t_0 = 1.0 / (n * x) tmp = 0 if n <= -2.6e-8: tmp = t_0 elif n <= -2.4e-241: tmp = 0.0 else: tmp = t_0 return tmp
function code(x, n) t_0 = Float64(1.0 / Float64(n * x)) tmp = 0.0 if (n <= -2.6e-8) tmp = t_0; elseif (n <= -2.4e-241) tmp = 0.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, n) t_0 = 1.0 / (n * x); tmp = 0.0; if (n <= -2.6e-8) tmp = t_0; elseif (n <= -2.4e-241) tmp = 0.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(1.0 / N[(n * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -2.6e-8], t$95$0, If[LessEqual[n, -2.4e-241], 0.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{n \cdot x}\\
\mathbf{if}\;n \leq -2.6 \cdot 10^{-8}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq -2.4 \cdot 10^{-241}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -2.6000000000000001e-8 or -2.4e-241 < n Initial program 40.1%
Taylor expanded in x around inf
/-lowering-/.f64N/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
exp-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
exp-to-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6446.6%
Simplified46.6%
Taylor expanded in n around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6445.5%
Simplified45.5%
if -2.6000000000000001e-8 < n < -2.4e-241Initial program 100.0%
Taylor expanded in x around 0
Simplified45.5%
Taylor expanded in n around inf
Simplified56.9%
metadata-eval56.9%
Applied egg-rr56.9%
Final simplification47.6%
(FPCore (x n) :precision binary64 (if (<= (/ 1.0 n) -1e+16) 0.0 (/ (/ 1.0 n) x)))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e+16) {
tmp = 0.0;
} else {
tmp = (1.0 / n) / x;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if ((1.0d0 / n) <= (-1d+16)) then
tmp = 0.0d0
else
tmp = (1.0d0 / n) / x
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -1e+16) {
tmp = 0.0;
} else {
tmp = (1.0 / n) / x;
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -1e+16: tmp = 0.0 else: tmp = (1.0 / n) / x return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -1e+16) tmp = 0.0; else tmp = Float64(Float64(1.0 / n) / x); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -1e+16) tmp = 0.0; else tmp = (1.0 / n) / x; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+16], 0.0, N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+16}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{n}}{x}\\
\end{array}
\end{array}
if (/.f64 #s(literal 1 binary64) n) < -1e16Initial program 100.0%
Taylor expanded in x around 0
Simplified50.0%
Taylor expanded in n around inf
Simplified52.3%
metadata-eval52.3%
Applied egg-rr52.3%
if -1e16 < (/.f64 #s(literal 1 binary64) n) Initial program 35.1%
Taylor expanded in x around inf
Simplified42.2%
Taylor expanded in x around inf
associate-/r*N/A
log-recN/A
mul-1-negN/A
associate-*r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f6442.8%
Simplified42.8%
Taylor expanded in n around inf
/-lowering-/.f6444.8%
Simplified44.8%
(FPCore (x n) :precision binary64 0.0)
double code(double x, double n) {
return 0.0;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
code = 0.0d0
end function
public static double code(double x, double n) {
return 0.0;
}
def code(x, n): return 0.0
function code(x, n) return 0.0 end
function tmp = code(x, n) tmp = 0.0; end
code[x_, n_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 51.3%
Taylor expanded in x around 0
Simplified38.1%
Taylor expanded in n around inf
Simplified30.7%
metadata-eval30.7%
Applied egg-rr30.7%
herbie shell --seed 2024164
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))