
(FPCore (i n) :precision binary64 (* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))
double code(double i, double n) {
return 100.0 * ((pow((1.0 + (i / n)), n) - 1.0) / (i / n));
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = 100.0d0 * ((((1.0d0 + (i / n)) ** n) - 1.0d0) / (i / n))
end function
public static double code(double i, double n) {
return 100.0 * ((Math.pow((1.0 + (i / n)), n) - 1.0) / (i / n));
}
def code(i, n): return 100.0 * ((math.pow((1.0 + (i / n)), n) - 1.0) / (i / n))
function code(i, n) return Float64(100.0 * Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) - 1.0) / Float64(i / n))) end
function tmp = code(i, n) tmp = 100.0 * ((((1.0 + (i / n)) ^ n) - 1.0) / (i / n)); end
code[i_, n_] := N[(100.0 * N[(N[(N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision] - 1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (i n) :precision binary64 (* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))
double code(double i, double n) {
return 100.0 * ((pow((1.0 + (i / n)), n) - 1.0) / (i / n));
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = 100.0d0 * ((((1.0d0 + (i / n)) ** n) - 1.0d0) / (i / n))
end function
public static double code(double i, double n) {
return 100.0 * ((Math.pow((1.0 + (i / n)), n) - 1.0) / (i / n));
}
def code(i, n): return 100.0 * ((math.pow((1.0 + (i / n)), n) - 1.0) / (i / n))
function code(i, n) return Float64(100.0 * Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) - 1.0) / Float64(i / n))) end
function tmp = code(i, n) tmp = 100.0 * ((((1.0 + (i / n)) ^ n) - 1.0) / (i / n)); end
code[i_, n_] := N[(100.0 * N[(N[(N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision] - 1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\end{array}
(FPCore (i n)
:precision binary64
(let* ((t_0 (pow (+ 1.0 (/ i n)) n)) (t_1 (/ (+ t_0 -1.0) (/ i n))))
(if (<= t_1 5e-236)
(* 100.0 (/ (expm1 (* n (log1p (/ i n)))) (/ i n)))
(if (<= t_1 INFINITY)
(* n (/ (fma t_0 100.0 -100.0) i))
(* 100.0 (/ 1.0 (/ (fma i -0.5 1.0) n)))))))
double code(double i, double n) {
double t_0 = pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= 5e-236) {
tmp = 100.0 * (expm1((n * log1p((i / n)))) / (i / n));
} else if (t_1 <= ((double) INFINITY)) {
tmp = n * (fma(t_0, 100.0, -100.0) / i);
} else {
tmp = 100.0 * (1.0 / (fma(i, -0.5, 1.0) / n));
}
return tmp;
}
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) ^ n t_1 = Float64(Float64(t_0 + -1.0) / Float64(i / n)) tmp = 0.0 if (t_1 <= 5e-236) tmp = Float64(100.0 * Float64(expm1(Float64(n * log1p(Float64(i / n)))) / Float64(i / n))); elseif (t_1 <= Inf) tmp = Float64(n * Float64(fma(t_0, 100.0, -100.0) / i)); else tmp = Float64(100.0 * Float64(1.0 / Float64(fma(i, -0.5, 1.0) / n))); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-236], N[(100.0 * N[(N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(n * N[(N[(t$95$0 * 100.0 + -100.0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(1.0 / N[(N[(i * -0.5 + 1.0), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t\_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-236}:\\
\;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{i}{n}}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;n \cdot \frac{\mathsf{fma}\left(t\_0, 100, -100\right)}{i}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(i, -0.5, 1\right)}{n}}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < 4.9999999999999998e-236Initial program 29.7%
lift--.f64N/A
lift-pow.f64N/A
pow-to-expN/A
lower-expm1.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lower-log1p.f6498.6
Applied rewrites98.6%
if 4.9999999999999998e-236 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < +inf.0Initial program 95.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
metadata-eval95.9
Applied rewrites95.9%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) Initial program 0.0%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-/.f64N/A
clear-numN/A
sub-negN/A
lift-/.f64N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f643.0
Applied rewrites3.0%
lift-fma.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
clear-numN/A
frac-addN/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
lift-/.f64N/A
lower-neg.f64N/A
metadata-evalN/A
div-invN/A
/-rgt-identityN/A
Applied rewrites2.7%
Taylor expanded in i around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in n around inf
Applied rewrites99.8%
Final simplification98.6%
(FPCore (i n)
:precision binary64
(if (<= n -3e-5)
(* n (fma (/ (* i (exp i)) n) -50.0 (* 100.0 (/ (expm1 i) i))))
(if (<= n 1.15e-6)
(* 100.0 (/ 1.0 (/ (fma -0.5 (/ i n) (fma i 0.5 -1.0)) (- n))))
(* n (/ (* 100.0 (expm1 i)) i)))))
double code(double i, double n) {
double tmp;
if (n <= -3e-5) {
tmp = n * fma(((i * exp(i)) / n), -50.0, (100.0 * (expm1(i) / i)));
} else if (n <= 1.15e-6) {
tmp = 100.0 * (1.0 / (fma(-0.5, (i / n), fma(i, 0.5, -1.0)) / -n));
} else {
tmp = n * ((100.0 * expm1(i)) / i);
}
return tmp;
}
function code(i, n) tmp = 0.0 if (n <= -3e-5) tmp = Float64(n * fma(Float64(Float64(i * exp(i)) / n), -50.0, Float64(100.0 * Float64(expm1(i) / i)))); elseif (n <= 1.15e-6) tmp = Float64(100.0 * Float64(1.0 / Float64(fma(-0.5, Float64(i / n), fma(i, 0.5, -1.0)) / Float64(-n)))); else tmp = Float64(n * Float64(Float64(100.0 * expm1(i)) / i)); end return tmp end
code[i_, n_] := If[LessEqual[n, -3e-5], N[(n * N[(N[(N[(i * N[Exp[i], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] * -50.0 + N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.15e-6], N[(100.0 * N[(1.0 / N[(N[(-0.5 * N[(i / n), $MachinePrecision] + N[(i * 0.5 + -1.0), $MachinePrecision]), $MachinePrecision] / (-n)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(N[(100.0 * N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -3 \cdot 10^{-5}:\\
\;\;\;\;n \cdot \mathsf{fma}\left(\frac{i \cdot e^{i}}{n}, -50, 100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\
\mathbf{elif}\;n \leq 1.15 \cdot 10^{-6}:\\
\;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(-0.5, \frac{i}{n}, \mathsf{fma}\left(i, 0.5, -1\right)\right)}{-n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{i}\\
\end{array}
\end{array}
if n < -3.00000000000000008e-5Initial program 31.0%
Taylor expanded in n around inf
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-exp.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-expm1.f6482.7
Applied rewrites82.7%
if -3.00000000000000008e-5 < n < 1.15e-6Initial program 44.6%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-/.f64N/A
clear-numN/A
sub-negN/A
lift-/.f64N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6427.6
Applied rewrites27.6%
lift-fma.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
clear-numN/A
frac-addN/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
lift-/.f64N/A
lower-neg.f64N/A
metadata-evalN/A
div-invN/A
/-rgt-identityN/A
Applied rewrites10.1%
Taylor expanded in i around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f6478.3
Applied rewrites78.3%
Taylor expanded in n around -inf
Applied rewrites83.5%
if 1.15e-6 < n Initial program 18.6%
Taylor expanded in n around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-expm1.f6497.4
Applied rewrites97.4%
Applied rewrites97.7%
Final simplification88.3%
(FPCore (i n)
:precision binary64
(if (<= n -3e-5)
(* 100.0 (/ (* n (expm1 i)) i))
(if (<= n 1.15e-6)
(* 100.0 (/ 1.0 (/ (fma -0.5 (/ i n) (fma i 0.5 -1.0)) (- n))))
(* n (/ (* 100.0 (expm1 i)) i)))))
double code(double i, double n) {
double tmp;
if (n <= -3e-5) {
tmp = 100.0 * ((n * expm1(i)) / i);
} else if (n <= 1.15e-6) {
tmp = 100.0 * (1.0 / (fma(-0.5, (i / n), fma(i, 0.5, -1.0)) / -n));
} else {
tmp = n * ((100.0 * expm1(i)) / i);
}
return tmp;
}
function code(i, n) tmp = 0.0 if (n <= -3e-5) tmp = Float64(100.0 * Float64(Float64(n * expm1(i)) / i)); elseif (n <= 1.15e-6) tmp = Float64(100.0 * Float64(1.0 / Float64(fma(-0.5, Float64(i / n), fma(i, 0.5, -1.0)) / Float64(-n)))); else tmp = Float64(n * Float64(Float64(100.0 * expm1(i)) / i)); end return tmp end
code[i_, n_] := If[LessEqual[n, -3e-5], N[(100.0 * N[(N[(n * N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.15e-6], N[(100.0 * N[(1.0 / N[(N[(-0.5 * N[(i / n), $MachinePrecision] + N[(i * 0.5 + -1.0), $MachinePrecision]), $MachinePrecision] / (-n)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(N[(100.0 * N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -3 \cdot 10^{-5}:\\
\;\;\;\;100 \cdot \frac{n \cdot \mathsf{expm1}\left(i\right)}{i}\\
\mathbf{elif}\;n \leq 1.15 \cdot 10^{-6}:\\
\;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(-0.5, \frac{i}{n}, \mathsf{fma}\left(i, 0.5, -1\right)\right)}{-n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{i}\\
\end{array}
\end{array}
if n < -3.00000000000000008e-5Initial program 31.0%
Taylor expanded in n around inf
lower-/.f64N/A
lower-*.f64N/A
lower-expm1.f6482.7
Applied rewrites82.7%
if -3.00000000000000008e-5 < n < 1.15e-6Initial program 44.6%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-/.f64N/A
clear-numN/A
sub-negN/A
lift-/.f64N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6427.6
Applied rewrites27.6%
lift-fma.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
clear-numN/A
frac-addN/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
lift-/.f64N/A
lower-neg.f64N/A
metadata-evalN/A
div-invN/A
/-rgt-identityN/A
Applied rewrites10.1%
Taylor expanded in i around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f6478.3
Applied rewrites78.3%
Taylor expanded in n around -inf
Applied rewrites83.5%
if 1.15e-6 < n Initial program 18.6%
Taylor expanded in n around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-expm1.f6497.4
Applied rewrites97.4%
Applied rewrites97.7%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* n (/ (* 100.0 (expm1 i)) i))))
(if (<= n -3.4e-5)
t_0
(if (<= n 1.15e-6)
(* 100.0 (/ 1.0 (/ (fma -0.5 (/ i n) (fma i 0.5 -1.0)) (- n))))
t_0))))
double code(double i, double n) {
double t_0 = n * ((100.0 * expm1(i)) / i);
double tmp;
if (n <= -3.4e-5) {
tmp = t_0;
} else if (n <= 1.15e-6) {
tmp = 100.0 * (1.0 / (fma(-0.5, (i / n), fma(i, 0.5, -1.0)) / -n));
} else {
tmp = t_0;
}
return tmp;
}
function code(i, n) t_0 = Float64(n * Float64(Float64(100.0 * expm1(i)) / i)) tmp = 0.0 if (n <= -3.4e-5) tmp = t_0; elseif (n <= 1.15e-6) tmp = Float64(100.0 * Float64(1.0 / Float64(fma(-0.5, Float64(i / n), fma(i, 0.5, -1.0)) / Float64(-n)))); else tmp = t_0; end return tmp end
code[i_, n_] := Block[{t$95$0 = N[(n * N[(N[(100.0 * N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -3.4e-5], t$95$0, If[LessEqual[n, 1.15e-6], N[(100.0 * N[(1.0 / N[(N[(-0.5 * N[(i / n), $MachinePrecision] + N[(i * 0.5 + -1.0), $MachinePrecision]), $MachinePrecision] / (-n)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{i}\\
\mathbf{if}\;n \leq -3.4 \cdot 10^{-5}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 1.15 \cdot 10^{-6}:\\
\;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(-0.5, \frac{i}{n}, \mathsf{fma}\left(i, 0.5, -1\right)\right)}{-n}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -3.4e-5 or 1.15e-6 < n Initial program 24.6%
Taylor expanded in n around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-expm1.f6490.2
Applied rewrites90.2%
Applied rewrites90.4%
if -3.4e-5 < n < 1.15e-6Initial program 44.6%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-/.f64N/A
clear-numN/A
sub-negN/A
lift-/.f64N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6427.6
Applied rewrites27.6%
lift-fma.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
clear-numN/A
frac-addN/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
lift-/.f64N/A
lower-neg.f64N/A
metadata-evalN/A
div-invN/A
/-rgt-identityN/A
Applied rewrites10.1%
Taylor expanded in i around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f6478.3
Applied rewrites78.3%
Taylor expanded in n around -inf
Applied rewrites83.5%
(FPCore (i n)
:precision binary64
(if (<= n -2.8e+142)
(fma
n
(fma 50.0 i 100.0)
(* (* i i) (* n (fma 4.166666666666667 i 16.666666666666668))))
(if (<= n -5.5e-168)
(* 100.0 (/ 1.0 (/ (fma i -0.5 1.0) n)))
(if (<= n 2.65e-52)
(* 100.0 (/ 1.0 (/ (* i 0.5) (* n n))))
(*
100.0
(/
(*
i
(fma
i
(fma
i
(* n (fma 0.041666666666666664 i 0.16666666666666666))
(* n 0.5))
n))
i))))))
double code(double i, double n) {
double tmp;
if (n <= -2.8e+142) {
tmp = fma(n, fma(50.0, i, 100.0), ((i * i) * (n * fma(4.166666666666667, i, 16.666666666666668))));
} else if (n <= -5.5e-168) {
tmp = 100.0 * (1.0 / (fma(i, -0.5, 1.0) / n));
} else if (n <= 2.65e-52) {
tmp = 100.0 * (1.0 / ((i * 0.5) / (n * n)));
} else {
tmp = 100.0 * ((i * fma(i, fma(i, (n * fma(0.041666666666666664, i, 0.16666666666666666)), (n * 0.5)), n)) / i);
}
return tmp;
}
function code(i, n) tmp = 0.0 if (n <= -2.8e+142) tmp = fma(n, fma(50.0, i, 100.0), Float64(Float64(i * i) * Float64(n * fma(4.166666666666667, i, 16.666666666666668)))); elseif (n <= -5.5e-168) tmp = Float64(100.0 * Float64(1.0 / Float64(fma(i, -0.5, 1.0) / n))); elseif (n <= 2.65e-52) tmp = Float64(100.0 * Float64(1.0 / Float64(Float64(i * 0.5) / Float64(n * n)))); else tmp = Float64(100.0 * Float64(Float64(i * fma(i, fma(i, Float64(n * fma(0.041666666666666664, i, 0.16666666666666666)), Float64(n * 0.5)), n)) / i)); end return tmp end
code[i_, n_] := If[LessEqual[n, -2.8e+142], N[(n * N[(50.0 * i + 100.0), $MachinePrecision] + N[(N[(i * i), $MachinePrecision] * N[(n * N[(4.166666666666667 * i + 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -5.5e-168], N[(100.0 * N[(1.0 / N[(N[(i * -0.5 + 1.0), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.65e-52], N[(100.0 * N[(1.0 / N[(N[(i * 0.5), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(N[(i * N[(i * N[(i * N[(n * N[(0.041666666666666664 * i + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + N[(n * 0.5), $MachinePrecision]), $MachinePrecision] + n), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.8 \cdot 10^{+142}:\\
\;\;\;\;\mathsf{fma}\left(n, \mathsf{fma}\left(50, i, 100\right), \left(i \cdot i\right) \cdot \left(n \cdot \mathsf{fma}\left(4.166666666666667, i, 16.666666666666668\right)\right)\right)\\
\mathbf{elif}\;n \leq -5.5 \cdot 10^{-168}:\\
\;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(i, -0.5, 1\right)}{n}}\\
\mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\
\;\;\;\;100 \cdot \frac{1}{\frac{i \cdot 0.5}{n \cdot n}}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{i \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(0.041666666666666664, i, 0.16666666666666666\right), n \cdot 0.5\right), n\right)}{i}\\
\end{array}
\end{array}
if n < -2.8e142Initial program 20.5%
Taylor expanded in n around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-expm1.f6488.7
Applied rewrites88.7%
Taylor expanded in i around 0
Applied rewrites73.3%
if -2.8e142 < n < -5.4999999999999999e-168Initial program 37.4%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-/.f64N/A
clear-numN/A
sub-negN/A
lift-/.f64N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6437.7
Applied rewrites37.7%
lift-fma.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
clear-numN/A
frac-addN/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
lift-/.f64N/A
lower-neg.f64N/A
metadata-evalN/A
div-invN/A
/-rgt-identityN/A
Applied rewrites14.9%
Taylor expanded in i around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f6466.4
Applied rewrites66.4%
Taylor expanded in n around inf
Applied rewrites65.7%
if -5.4999999999999999e-168 < n < 2.6500000000000002e-52Initial program 53.8%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-/.f64N/A
clear-numN/A
sub-negN/A
lift-/.f64N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6427.1
Applied rewrites27.1%
lift-fma.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
clear-numN/A
frac-addN/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
lift-/.f64N/A
lower-neg.f64N/A
metadata-evalN/A
div-invN/A
/-rgt-identityN/A
Applied rewrites10.3%
Taylor expanded in i around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f6480.9
Applied rewrites80.9%
Taylor expanded in n around 0
Applied rewrites72.9%
if 2.6500000000000002e-52 < n Initial program 19.9%
Taylor expanded in n around inf
lower-/.f64N/A
lower-*.f64N/A
lower-expm1.f6493.0
Applied rewrites93.0%
Taylor expanded in i around 0
Applied rewrites85.7%
(FPCore (i n)
:precision binary64
(if (<= n -2.8e+142)
(fma
n
(fma 50.0 i 100.0)
(* (* i i) (* n (fma 4.166666666666667 i 16.666666666666668))))
(if (<= n 1.15e-6)
(* 100.0 (/ 1.0 (/ (fma -0.5 (/ i n) (fma i 0.5 -1.0)) (- n))))
(*
100.0
(/
(*
i
(fma
i
(fma
i
(* n (fma 0.041666666666666664 i 0.16666666666666666))
(* n 0.5))
n))
i)))))
double code(double i, double n) {
double tmp;
if (n <= -2.8e+142) {
tmp = fma(n, fma(50.0, i, 100.0), ((i * i) * (n * fma(4.166666666666667, i, 16.666666666666668))));
} else if (n <= 1.15e-6) {
tmp = 100.0 * (1.0 / (fma(-0.5, (i / n), fma(i, 0.5, -1.0)) / -n));
} else {
tmp = 100.0 * ((i * fma(i, fma(i, (n * fma(0.041666666666666664, i, 0.16666666666666666)), (n * 0.5)), n)) / i);
}
return tmp;
}
function code(i, n) tmp = 0.0 if (n <= -2.8e+142) tmp = fma(n, fma(50.0, i, 100.0), Float64(Float64(i * i) * Float64(n * fma(4.166666666666667, i, 16.666666666666668)))); elseif (n <= 1.15e-6) tmp = Float64(100.0 * Float64(1.0 / Float64(fma(-0.5, Float64(i / n), fma(i, 0.5, -1.0)) / Float64(-n)))); else tmp = Float64(100.0 * Float64(Float64(i * fma(i, fma(i, Float64(n * fma(0.041666666666666664, i, 0.16666666666666666)), Float64(n * 0.5)), n)) / i)); end return tmp end
code[i_, n_] := If[LessEqual[n, -2.8e+142], N[(n * N[(50.0 * i + 100.0), $MachinePrecision] + N[(N[(i * i), $MachinePrecision] * N[(n * N[(4.166666666666667 * i + 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.15e-6], N[(100.0 * N[(1.0 / N[(N[(-0.5 * N[(i / n), $MachinePrecision] + N[(i * 0.5 + -1.0), $MachinePrecision]), $MachinePrecision] / (-n)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(N[(i * N[(i * N[(i * N[(n * N[(0.041666666666666664 * i + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + N[(n * 0.5), $MachinePrecision]), $MachinePrecision] + n), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.8 \cdot 10^{+142}:\\
\;\;\;\;\mathsf{fma}\left(n, \mathsf{fma}\left(50, i, 100\right), \left(i \cdot i\right) \cdot \left(n \cdot \mathsf{fma}\left(4.166666666666667, i, 16.666666666666668\right)\right)\right)\\
\mathbf{elif}\;n \leq 1.15 \cdot 10^{-6}:\\
\;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(-0.5, \frac{i}{n}, \mathsf{fma}\left(i, 0.5, -1\right)\right)}{-n}}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{i \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(0.041666666666666664, i, 0.16666666666666666\right), n \cdot 0.5\right), n\right)}{i}\\
\end{array}
\end{array}
if n < -2.8e142Initial program 20.5%
Taylor expanded in n around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-expm1.f6488.7
Applied rewrites88.7%
Taylor expanded in i around 0
Applied rewrites73.3%
if -2.8e142 < n < 1.15e-6Initial program 43.8%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-/.f64N/A
clear-numN/A
sub-negN/A
lift-/.f64N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6432.9
Applied rewrites32.9%
lift-fma.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
clear-numN/A
frac-addN/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
lift-/.f64N/A
lower-neg.f64N/A
metadata-evalN/A
div-invN/A
/-rgt-identityN/A
Applied rewrites13.7%
Taylor expanded in i around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f6471.6
Applied rewrites71.6%
Taylor expanded in n around -inf
Applied rewrites75.0%
if 1.15e-6 < n Initial program 18.6%
Taylor expanded in n around inf
lower-/.f64N/A
lower-*.f64N/A
lower-expm1.f6497.7
Applied rewrites97.7%
Taylor expanded in i around 0
Applied rewrites89.9%
(FPCore (i n)
:precision binary64
(if (<= n -5.2e+140)
(fma
n
(fma 50.0 i 100.0)
(* (* i i) (* n (fma 4.166666666666667 i 16.666666666666668))))
(if (<= n 1.15e-6)
(* 100.0 (/ 1.0 (/ (fma n (fma i -0.5 1.0) (* i 0.5)) (* n n))))
(*
100.0
(/
(*
i
(fma
i
(fma
i
(* n (fma 0.041666666666666664 i 0.16666666666666666))
(* n 0.5))
n))
i)))))
double code(double i, double n) {
double tmp;
if (n <= -5.2e+140) {
tmp = fma(n, fma(50.0, i, 100.0), ((i * i) * (n * fma(4.166666666666667, i, 16.666666666666668))));
} else if (n <= 1.15e-6) {
tmp = 100.0 * (1.0 / (fma(n, fma(i, -0.5, 1.0), (i * 0.5)) / (n * n)));
} else {
tmp = 100.0 * ((i * fma(i, fma(i, (n * fma(0.041666666666666664, i, 0.16666666666666666)), (n * 0.5)), n)) / i);
}
return tmp;
}
function code(i, n) tmp = 0.0 if (n <= -5.2e+140) tmp = fma(n, fma(50.0, i, 100.0), Float64(Float64(i * i) * Float64(n * fma(4.166666666666667, i, 16.666666666666668)))); elseif (n <= 1.15e-6) tmp = Float64(100.0 * Float64(1.0 / Float64(fma(n, fma(i, -0.5, 1.0), Float64(i * 0.5)) / Float64(n * n)))); else tmp = Float64(100.0 * Float64(Float64(i * fma(i, fma(i, Float64(n * fma(0.041666666666666664, i, 0.16666666666666666)), Float64(n * 0.5)), n)) / i)); end return tmp end
code[i_, n_] := If[LessEqual[n, -5.2e+140], N[(n * N[(50.0 * i + 100.0), $MachinePrecision] + N[(N[(i * i), $MachinePrecision] * N[(n * N[(4.166666666666667 * i + 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.15e-6], N[(100.0 * N[(1.0 / N[(N[(n * N[(i * -0.5 + 1.0), $MachinePrecision] + N[(i * 0.5), $MachinePrecision]), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(N[(i * N[(i * N[(i * N[(n * N[(0.041666666666666664 * i + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + N[(n * 0.5), $MachinePrecision]), $MachinePrecision] + n), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -5.2 \cdot 10^{+140}:\\
\;\;\;\;\mathsf{fma}\left(n, \mathsf{fma}\left(50, i, 100\right), \left(i \cdot i\right) \cdot \left(n \cdot \mathsf{fma}\left(4.166666666666667, i, 16.666666666666668\right)\right)\right)\\
\mathbf{elif}\;n \leq 1.15 \cdot 10^{-6}:\\
\;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(n, \mathsf{fma}\left(i, -0.5, 1\right), i \cdot 0.5\right)}{n \cdot n}}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{i \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(0.041666666666666664, i, 0.16666666666666666\right), n \cdot 0.5\right), n\right)}{i}\\
\end{array}
\end{array}
if n < -5.2000000000000002e140Initial program 20.5%
Taylor expanded in n around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-expm1.f6488.7
Applied rewrites88.7%
Taylor expanded in i around 0
Applied rewrites73.3%
if -5.2000000000000002e140 < n < 1.15e-6Initial program 43.8%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-/.f64N/A
clear-numN/A
sub-negN/A
lift-/.f64N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6432.9
Applied rewrites32.9%
lift-fma.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
clear-numN/A
frac-addN/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
lift-/.f64N/A
lower-neg.f64N/A
metadata-evalN/A
div-invN/A
/-rgt-identityN/A
Applied rewrites13.7%
Taylor expanded in i around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f6471.6
Applied rewrites71.6%
Taylor expanded in n around 0
Applied rewrites71.1%
if 1.15e-6 < n Initial program 18.6%
Taylor expanded in n around inf
lower-/.f64N/A
lower-*.f64N/A
lower-expm1.f6497.7
Applied rewrites97.7%
Taylor expanded in i around 0
Applied rewrites89.9%
(FPCore (i n)
:precision binary64
(if (<= n -2.8e+142)
(fma
n
(fma 50.0 i 100.0)
(* (* i i) (* n (fma 4.166666666666667 i 16.666666666666668))))
(if (<= n -5.5e-168)
(* 100.0 (/ 1.0 (/ (fma i -0.5 1.0) n)))
(if (<= n 2.65e-52)
(* 100.0 (/ 1.0 (/ (* i 0.5) (* n n))))
(*
n
(fma
i
(fma i (fma i 4.166666666666667 16.666666666666668) 50.0)
100.0))))))
double code(double i, double n) {
double tmp;
if (n <= -2.8e+142) {
tmp = fma(n, fma(50.0, i, 100.0), ((i * i) * (n * fma(4.166666666666667, i, 16.666666666666668))));
} else if (n <= -5.5e-168) {
tmp = 100.0 * (1.0 / (fma(i, -0.5, 1.0) / n));
} else if (n <= 2.65e-52) {
tmp = 100.0 * (1.0 / ((i * 0.5) / (n * n)));
} else {
tmp = n * fma(i, fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0), 100.0);
}
return tmp;
}
function code(i, n) tmp = 0.0 if (n <= -2.8e+142) tmp = fma(n, fma(50.0, i, 100.0), Float64(Float64(i * i) * Float64(n * fma(4.166666666666667, i, 16.666666666666668)))); elseif (n <= -5.5e-168) tmp = Float64(100.0 * Float64(1.0 / Float64(fma(i, -0.5, 1.0) / n))); elseif (n <= 2.65e-52) tmp = Float64(100.0 * Float64(1.0 / Float64(Float64(i * 0.5) / Float64(n * n)))); else tmp = Float64(n * fma(i, fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0), 100.0)); end return tmp end
code[i_, n_] := If[LessEqual[n, -2.8e+142], N[(n * N[(50.0 * i + 100.0), $MachinePrecision] + N[(N[(i * i), $MachinePrecision] * N[(n * N[(4.166666666666667 * i + 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -5.5e-168], N[(100.0 * N[(1.0 / N[(N[(i * -0.5 + 1.0), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.65e-52], N[(100.0 * N[(1.0 / N[(N[(i * 0.5), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(i * N[(i * N[(i * 4.166666666666667 + 16.666666666666668), $MachinePrecision] + 50.0), $MachinePrecision] + 100.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.8 \cdot 10^{+142}:\\
\;\;\;\;\mathsf{fma}\left(n, \mathsf{fma}\left(50, i, 100\right), \left(i \cdot i\right) \cdot \left(n \cdot \mathsf{fma}\left(4.166666666666667, i, 16.666666666666668\right)\right)\right)\\
\mathbf{elif}\;n \leq -5.5 \cdot 10^{-168}:\\
\;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(i, -0.5, 1\right)}{n}}\\
\mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\
\;\;\;\;100 \cdot \frac{1}{\frac{i \cdot 0.5}{n \cdot n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right)\\
\end{array}
\end{array}
if n < -2.8e142Initial program 20.5%
Taylor expanded in n around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-expm1.f6488.7
Applied rewrites88.7%
Taylor expanded in i around 0
Applied rewrites73.3%
if -2.8e142 < n < -5.4999999999999999e-168Initial program 37.4%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-/.f64N/A
clear-numN/A
sub-negN/A
lift-/.f64N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6437.7
Applied rewrites37.7%
lift-fma.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
clear-numN/A
frac-addN/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
lift-/.f64N/A
lower-neg.f64N/A
metadata-evalN/A
div-invN/A
/-rgt-identityN/A
Applied rewrites14.9%
Taylor expanded in i around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f6466.4
Applied rewrites66.4%
Taylor expanded in n around inf
Applied rewrites65.7%
if -5.4999999999999999e-168 < n < 2.6500000000000002e-52Initial program 53.8%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-/.f64N/A
clear-numN/A
sub-negN/A
lift-/.f64N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6427.1
Applied rewrites27.1%
lift-fma.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
clear-numN/A
frac-addN/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
lift-/.f64N/A
lower-neg.f64N/A
metadata-evalN/A
div-invN/A
/-rgt-identityN/A
Applied rewrites10.3%
Taylor expanded in i around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f6480.9
Applied rewrites80.9%
Taylor expanded in n around 0
Applied rewrites72.9%
if 2.6500000000000002e-52 < n Initial program 19.9%
Taylor expanded in n around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-expm1.f6492.7
Applied rewrites92.7%
Applied rewrites93.0%
Taylor expanded in i around 0
Applied rewrites84.0%
(FPCore (i n)
:precision binary64
(if (<= n -2.8e+142)
(fma
n
(fma 50.0 i 100.0)
(* (* i i) (* n (fma 4.166666666666667 i 16.666666666666668))))
(if (<= n -5.5e-168)
(* 100.0 (/ 1.0 (/ (fma i -0.5 1.0) n)))
(if (<= n 2.65e-52)
(* 100.0 (/ (+ -1.0 1.0) (/ i n)))
(*
n
(fma
i
(fma i (fma i 4.166666666666667 16.666666666666668) 50.0)
100.0))))))
double code(double i, double n) {
double tmp;
if (n <= -2.8e+142) {
tmp = fma(n, fma(50.0, i, 100.0), ((i * i) * (n * fma(4.166666666666667, i, 16.666666666666668))));
} else if (n <= -5.5e-168) {
tmp = 100.0 * (1.0 / (fma(i, -0.5, 1.0) / n));
} else if (n <= 2.65e-52) {
tmp = 100.0 * ((-1.0 + 1.0) / (i / n));
} else {
tmp = n * fma(i, fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0), 100.0);
}
return tmp;
}
function code(i, n) tmp = 0.0 if (n <= -2.8e+142) tmp = fma(n, fma(50.0, i, 100.0), Float64(Float64(i * i) * Float64(n * fma(4.166666666666667, i, 16.666666666666668)))); elseif (n <= -5.5e-168) tmp = Float64(100.0 * Float64(1.0 / Float64(fma(i, -0.5, 1.0) / n))); elseif (n <= 2.65e-52) tmp = Float64(100.0 * Float64(Float64(-1.0 + 1.0) / Float64(i / n))); else tmp = Float64(n * fma(i, fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0), 100.0)); end return tmp end
code[i_, n_] := If[LessEqual[n, -2.8e+142], N[(n * N[(50.0 * i + 100.0), $MachinePrecision] + N[(N[(i * i), $MachinePrecision] * N[(n * N[(4.166666666666667 * i + 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -5.5e-168], N[(100.0 * N[(1.0 / N[(N[(i * -0.5 + 1.0), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.65e-52], N[(100.0 * N[(N[(-1.0 + 1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(i * N[(i * N[(i * 4.166666666666667 + 16.666666666666668), $MachinePrecision] + 50.0), $MachinePrecision] + 100.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.8 \cdot 10^{+142}:\\
\;\;\;\;\mathsf{fma}\left(n, \mathsf{fma}\left(50, i, 100\right), \left(i \cdot i\right) \cdot \left(n \cdot \mathsf{fma}\left(4.166666666666667, i, 16.666666666666668\right)\right)\right)\\
\mathbf{elif}\;n \leq -5.5 \cdot 10^{-168}:\\
\;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(i, -0.5, 1\right)}{n}}\\
\mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\
\;\;\;\;100 \cdot \frac{-1 + 1}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right)\\
\end{array}
\end{array}
if n < -2.8e142Initial program 20.5%
Taylor expanded in n around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-expm1.f6488.7
Applied rewrites88.7%
Taylor expanded in i around 0
Applied rewrites73.3%
if -2.8e142 < n < -5.4999999999999999e-168Initial program 37.4%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-/.f64N/A
clear-numN/A
sub-negN/A
lift-/.f64N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6437.7
Applied rewrites37.7%
lift-fma.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
clear-numN/A
frac-addN/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
lift-/.f64N/A
lower-neg.f64N/A
metadata-evalN/A
div-invN/A
/-rgt-identityN/A
Applied rewrites14.9%
Taylor expanded in i around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f6466.4
Applied rewrites66.4%
Taylor expanded in n around inf
Applied rewrites65.7%
if -5.4999999999999999e-168 < n < 2.6500000000000002e-52Initial program 53.8%
Taylor expanded in i around 0
Applied rewrites72.6%
if 2.6500000000000002e-52 < n Initial program 19.9%
Taylor expanded in n around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-expm1.f6492.7
Applied rewrites92.7%
Applied rewrites93.0%
Taylor expanded in i around 0
Applied rewrites84.0%
Final simplification75.5%
(FPCore (i n)
:precision binary64
(if (<= n -1.15e-109)
(fma
n
(fma 50.0 i 100.0)
(* (* i i) (* n (fma 4.166666666666667 i 16.666666666666668))))
(if (<= n 2.65e-52)
(* 100.0 (/ (+ -1.0 1.0) (/ i n)))
(*
n
(fma
i
(fma i (fma i 4.166666666666667 16.666666666666668) 50.0)
100.0)))))
double code(double i, double n) {
double tmp;
if (n <= -1.15e-109) {
tmp = fma(n, fma(50.0, i, 100.0), ((i * i) * (n * fma(4.166666666666667, i, 16.666666666666668))));
} else if (n <= 2.65e-52) {
tmp = 100.0 * ((-1.0 + 1.0) / (i / n));
} else {
tmp = n * fma(i, fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0), 100.0);
}
return tmp;
}
function code(i, n) tmp = 0.0 if (n <= -1.15e-109) tmp = fma(n, fma(50.0, i, 100.0), Float64(Float64(i * i) * Float64(n * fma(4.166666666666667, i, 16.666666666666668)))); elseif (n <= 2.65e-52) tmp = Float64(100.0 * Float64(Float64(-1.0 + 1.0) / Float64(i / n))); else tmp = Float64(n * fma(i, fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0), 100.0)); end return tmp end
code[i_, n_] := If[LessEqual[n, -1.15e-109], N[(n * N[(50.0 * i + 100.0), $MachinePrecision] + N[(N[(i * i), $MachinePrecision] * N[(n * N[(4.166666666666667 * i + 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.65e-52], N[(100.0 * N[(N[(-1.0 + 1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(i * N[(i * N[(i * 4.166666666666667 + 16.666666666666668), $MachinePrecision] + 50.0), $MachinePrecision] + 100.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.15 \cdot 10^{-109}:\\
\;\;\;\;\mathsf{fma}\left(n, \mathsf{fma}\left(50, i, 100\right), \left(i \cdot i\right) \cdot \left(n \cdot \mathsf{fma}\left(4.166666666666667, i, 16.666666666666668\right)\right)\right)\\
\mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\
\;\;\;\;100 \cdot \frac{-1 + 1}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right)\\
\end{array}
\end{array}
if n < -1.1500000000000001e-109Initial program 29.3%
Taylor expanded in n around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-expm1.f6481.3
Applied rewrites81.3%
Taylor expanded in i around 0
Applied rewrites63.5%
if -1.1500000000000001e-109 < n < 2.6500000000000002e-52Initial program 52.8%
Taylor expanded in i around 0
Applied rewrites69.1%
if 2.6500000000000002e-52 < n Initial program 19.9%
Taylor expanded in n around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-expm1.f6492.7
Applied rewrites92.7%
Applied rewrites93.0%
Taylor expanded in i around 0
Applied rewrites84.0%
Final simplification72.7%
(FPCore (i n)
:precision binary64
(let* ((t_0
(*
n
(fma
i
(fma i (fma i 4.166666666666667 16.666666666666668) 50.0)
100.0))))
(if (<= n -1.15e-109)
t_0
(if (<= n 2.65e-52) (* 100.0 (/ (+ -1.0 1.0) (/ i n))) t_0))))
double code(double i, double n) {
double t_0 = n * fma(i, fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0), 100.0);
double tmp;
if (n <= -1.15e-109) {
tmp = t_0;
} else if (n <= 2.65e-52) {
tmp = 100.0 * ((-1.0 + 1.0) / (i / n));
} else {
tmp = t_0;
}
return tmp;
}
function code(i, n) t_0 = Float64(n * fma(i, fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0), 100.0)) tmp = 0.0 if (n <= -1.15e-109) tmp = t_0; elseif (n <= 2.65e-52) tmp = Float64(100.0 * Float64(Float64(-1.0 + 1.0) / Float64(i / n))); else tmp = t_0; end return tmp end
code[i_, n_] := Block[{t$95$0 = N[(n * N[(i * N[(i * N[(i * 4.166666666666667 + 16.666666666666668), $MachinePrecision] + 50.0), $MachinePrecision] + 100.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.15e-109], t$95$0, If[LessEqual[n, 2.65e-52], N[(100.0 * N[(N[(-1.0 + 1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right)\\
\mathbf{if}\;n \leq -1.15 \cdot 10^{-109}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\
\;\;\;\;100 \cdot \frac{-1 + 1}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -1.1500000000000001e-109 or 2.6500000000000002e-52 < n Initial program 24.6%
Taylor expanded in n around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-expm1.f6487.0
Applied rewrites87.0%
Applied rewrites87.6%
Taylor expanded in i around 0
Applied rewrites73.7%
if -1.1500000000000001e-109 < n < 2.6500000000000002e-52Initial program 52.8%
Taylor expanded in i around 0
Applied rewrites69.1%
Final simplification72.7%
(FPCore (i n)
:precision binary64
(let* ((t_0
(*
n
(fma
i
(fma i (fma i 4.166666666666667 16.666666666666668) 50.0)
100.0))))
(if (<= n -1.15e-109) t_0 (if (<= n 2.65e-52) 0.0 t_0))))
double code(double i, double n) {
double t_0 = n * fma(i, fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0), 100.0);
double tmp;
if (n <= -1.15e-109) {
tmp = t_0;
} else if (n <= 2.65e-52) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
function code(i, n) t_0 = Float64(n * fma(i, fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0), 100.0)) tmp = 0.0 if (n <= -1.15e-109) tmp = t_0; elseif (n <= 2.65e-52) tmp = 0.0; else tmp = t_0; end return tmp end
code[i_, n_] := Block[{t$95$0 = N[(n * N[(i * N[(i * N[(i * 4.166666666666667 + 16.666666666666668), $MachinePrecision] + 50.0), $MachinePrecision] + 100.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.15e-109], t$95$0, If[LessEqual[n, 2.65e-52], 0.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right)\\
\mathbf{if}\;n \leq -1.15 \cdot 10^{-109}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -1.1500000000000001e-109 or 2.6500000000000002e-52 < n Initial program 24.6%
Taylor expanded in n around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-expm1.f6487.0
Applied rewrites87.0%
Applied rewrites87.6%
Taylor expanded in i around 0
Applied rewrites73.7%
if -1.1500000000000001e-109 < n < 2.6500000000000002e-52Initial program 52.8%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-/.f64N/A
clear-numN/A
sub-negN/A
lift-/.f64N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6429.3
Applied rewrites29.3%
Taylor expanded in i around 0
associate-*r/N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
lower-/.f6469.1
Applied rewrites69.1%
Taylor expanded in i around 0
Applied rewrites69.1%
(FPCore (i n)
:precision binary64
(if (<= n -1.15e-109)
(* n (fma i (fma i 16.666666666666668 50.0) 100.0))
(if (<= n 2.65e-52)
0.0
(fma i (* n (fma 16.666666666666668 i 50.0)) (* n 100.0)))))
double code(double i, double n) {
double tmp;
if (n <= -1.15e-109) {
tmp = n * fma(i, fma(i, 16.666666666666668, 50.0), 100.0);
} else if (n <= 2.65e-52) {
tmp = 0.0;
} else {
tmp = fma(i, (n * fma(16.666666666666668, i, 50.0)), (n * 100.0));
}
return tmp;
}
function code(i, n) tmp = 0.0 if (n <= -1.15e-109) tmp = Float64(n * fma(i, fma(i, 16.666666666666668, 50.0), 100.0)); elseif (n <= 2.65e-52) tmp = 0.0; else tmp = fma(i, Float64(n * fma(16.666666666666668, i, 50.0)), Float64(n * 100.0)); end return tmp end
code[i_, n_] := If[LessEqual[n, -1.15e-109], N[(n * N[(i * N[(i * 16.666666666666668 + 50.0), $MachinePrecision] + 100.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.65e-52], 0.0, N[(i * N[(n * N[(16.666666666666668 * i + 50.0), $MachinePrecision]), $MachinePrecision] + N[(n * 100.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.15 \cdot 10^{-109}:\\
\;\;\;\;n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 16.666666666666668, 50\right), 100\right)\\
\mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(16.666666666666668, i, 50\right), n \cdot 100\right)\\
\end{array}
\end{array}
if n < -1.1500000000000001e-109Initial program 29.3%
Taylor expanded in n around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-expm1.f6481.3
Applied rewrites81.3%
Applied rewrites82.2%
Taylor expanded in i around 0
Applied rewrites62.9%
if -1.1500000000000001e-109 < n < 2.6500000000000002e-52Initial program 52.8%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-/.f64N/A
clear-numN/A
sub-negN/A
lift-/.f64N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6429.3
Applied rewrites29.3%
Taylor expanded in i around 0
associate-*r/N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
lower-/.f6469.1
Applied rewrites69.1%
Taylor expanded in i around 0
Applied rewrites69.1%
if 2.6500000000000002e-52 < n Initial program 19.9%
Taylor expanded in n around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-expm1.f6492.7
Applied rewrites92.7%
Taylor expanded in i around 0
Applied rewrites80.3%
Final simplification71.0%
(FPCore (i n) :precision binary64 (let* ((t_0 (* n (fma i (fma i 16.666666666666668 50.0) 100.0)))) (if (<= n -1.15e-109) t_0 (if (<= n 2.65e-52) 0.0 t_0))))
double code(double i, double n) {
double t_0 = n * fma(i, fma(i, 16.666666666666668, 50.0), 100.0);
double tmp;
if (n <= -1.15e-109) {
tmp = t_0;
} else if (n <= 2.65e-52) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
function code(i, n) t_0 = Float64(n * fma(i, fma(i, 16.666666666666668, 50.0), 100.0)) tmp = 0.0 if (n <= -1.15e-109) tmp = t_0; elseif (n <= 2.65e-52) tmp = 0.0; else tmp = t_0; end return tmp end
code[i_, n_] := Block[{t$95$0 = N[(n * N[(i * N[(i * 16.666666666666668 + 50.0), $MachinePrecision] + 100.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.15e-109], t$95$0, If[LessEqual[n, 2.65e-52], 0.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 16.666666666666668, 50\right), 100\right)\\
\mathbf{if}\;n \leq -1.15 \cdot 10^{-109}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -1.1500000000000001e-109 or 2.6500000000000002e-52 < n Initial program 24.6%
Taylor expanded in n around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-expm1.f6487.0
Applied rewrites87.0%
Applied rewrites87.6%
Taylor expanded in i around 0
Applied rewrites71.6%
if -1.1500000000000001e-109 < n < 2.6500000000000002e-52Initial program 52.8%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-/.f64N/A
clear-numN/A
sub-negN/A
lift-/.f64N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6429.3
Applied rewrites29.3%
Taylor expanded in i around 0
associate-*r/N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
lower-/.f6469.1
Applied rewrites69.1%
Taylor expanded in i around 0
Applied rewrites69.1%
(FPCore (i n) :precision binary64 (if (<= n -1.15e-109) (* n (fma 50.0 i 100.0)) (if (<= n 2.65e-52) 0.0 (* 100.0 (fma n (* i 0.5) n)))))
double code(double i, double n) {
double tmp;
if (n <= -1.15e-109) {
tmp = n * fma(50.0, i, 100.0);
} else if (n <= 2.65e-52) {
tmp = 0.0;
} else {
tmp = 100.0 * fma(n, (i * 0.5), n);
}
return tmp;
}
function code(i, n) tmp = 0.0 if (n <= -1.15e-109) tmp = Float64(n * fma(50.0, i, 100.0)); elseif (n <= 2.65e-52) tmp = 0.0; else tmp = Float64(100.0 * fma(n, Float64(i * 0.5), n)); end return tmp end
code[i_, n_] := If[LessEqual[n, -1.15e-109], N[(n * N[(50.0 * i + 100.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.65e-52], 0.0, N[(100.0 * N[(n * N[(i * 0.5), $MachinePrecision] + n), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.15 \cdot 10^{-109}:\\
\;\;\;\;n \cdot \mathsf{fma}\left(50, i, 100\right)\\
\mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \mathsf{fma}\left(n, i \cdot 0.5, n\right)\\
\end{array}
\end{array}
if n < -1.1500000000000001e-109Initial program 29.3%
Taylor expanded in n around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-expm1.f6481.3
Applied rewrites81.3%
Taylor expanded in i around 0
Applied rewrites60.1%
if -1.1500000000000001e-109 < n < 2.6500000000000002e-52Initial program 52.8%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-/.f64N/A
clear-numN/A
sub-negN/A
lift-/.f64N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6429.3
Applied rewrites29.3%
Taylor expanded in i around 0
associate-*r/N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
lower-/.f6469.1
Applied rewrites69.1%
Taylor expanded in i around 0
Applied rewrites69.1%
if 2.6500000000000002e-52 < n Initial program 19.9%
Taylor expanded in n around inf
lower-/.f64N/A
lower-*.f64N/A
lower-expm1.f6493.0
Applied rewrites93.0%
Taylor expanded in i around 0
Applied rewrites73.3%
Final simplification67.2%
(FPCore (i n) :precision binary64 (let* ((t_0 (* n (fma 50.0 i 100.0)))) (if (<= n -1.15e-109) t_0 (if (<= n 2.65e-52) 0.0 t_0))))
double code(double i, double n) {
double t_0 = n * fma(50.0, i, 100.0);
double tmp;
if (n <= -1.15e-109) {
tmp = t_0;
} else if (n <= 2.65e-52) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
function code(i, n) t_0 = Float64(n * fma(50.0, i, 100.0)) tmp = 0.0 if (n <= -1.15e-109) tmp = t_0; elseif (n <= 2.65e-52) tmp = 0.0; else tmp = t_0; end return tmp end
code[i_, n_] := Block[{t$95$0 = N[(n * N[(50.0 * i + 100.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.15e-109], t$95$0, If[LessEqual[n, 2.65e-52], 0.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \mathsf{fma}\left(50, i, 100\right)\\
\mathbf{if}\;n \leq -1.15 \cdot 10^{-109}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -1.1500000000000001e-109 or 2.6500000000000002e-52 < n Initial program 24.6%
Taylor expanded in n around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-expm1.f6487.0
Applied rewrites87.0%
Taylor expanded in i around 0
Applied rewrites66.6%
if -1.1500000000000001e-109 < n < 2.6500000000000002e-52Initial program 52.8%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-/.f64N/A
clear-numN/A
sub-negN/A
lift-/.f64N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6429.3
Applied rewrites29.3%
Taylor expanded in i around 0
associate-*r/N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
lower-/.f6469.1
Applied rewrites69.1%
Taylor expanded in i around 0
Applied rewrites69.1%
(FPCore (i n) :precision binary64 (if (<= i -1.6e+84) 0.0 (if (<= i 7e+65) (* n 100.0) 0.0)))
double code(double i, double n) {
double tmp;
if (i <= -1.6e+84) {
tmp = 0.0;
} else if (i <= 7e+65) {
tmp = n * 100.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (i <= (-1.6d+84)) then
tmp = 0.0d0
else if (i <= 7d+65) then
tmp = n * 100.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (i <= -1.6e+84) {
tmp = 0.0;
} else if (i <= 7e+65) {
tmp = n * 100.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(i, n): tmp = 0 if i <= -1.6e+84: tmp = 0.0 elif i <= 7e+65: tmp = n * 100.0 else: tmp = 0.0 return tmp
function code(i, n) tmp = 0.0 if (i <= -1.6e+84) tmp = 0.0; elseif (i <= 7e+65) tmp = Float64(n * 100.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (i <= -1.6e+84) tmp = 0.0; elseif (i <= 7e+65) tmp = n * 100.0; else tmp = 0.0; end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, -1.6e+84], 0.0, If[LessEqual[i, 7e+65], N[(n * 100.0), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -1.6 \cdot 10^{+84}:\\
\;\;\;\;0\\
\mathbf{elif}\;i \leq 7 \cdot 10^{+65}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if i < -1.60000000000000005e84 or 7.0000000000000002e65 < i Initial program 71.6%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-/.f64N/A
clear-numN/A
sub-negN/A
lift-/.f64N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6468.1
Applied rewrites68.1%
Taylor expanded in i around 0
associate-*r/N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
lower-/.f6436.7
Applied rewrites36.7%
Taylor expanded in i around 0
Applied rewrites36.7%
if -1.60000000000000005e84 < i < 7.0000000000000002e65Initial program 9.6%
Taylor expanded in i around 0
*-commutativeN/A
lower-*.f6477.9
Applied rewrites77.9%
(FPCore (i n) :precision binary64 0.0)
double code(double i, double n) {
return 0.0;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = 0.0d0
end function
public static double code(double i, double n) {
return 0.0;
}
def code(i, n): return 0.0
function code(i, n) return 0.0 end
function tmp = code(i, n) tmp = 0.0; end
code[i_, n_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 30.7%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-/.f64N/A
clear-numN/A
sub-negN/A
lift-/.f64N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6426.6
Applied rewrites26.6%
Taylor expanded in i around 0
associate-*r/N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
lower-/.f6418.0
Applied rewrites18.0%
Taylor expanded in i around 0
Applied rewrites18.0%
(FPCore (i n)
:precision binary64
(let* ((t_0 (+ 1.0 (/ i n))))
(*
100.0
(/
(-
(exp
(*
n
(if (== t_0 1.0)
(/ i n)
(/ (* (/ i n) (log t_0)) (- (+ (/ i n) 1.0) 1.0)))))
1.0)
(/ i n)))))
double code(double i, double n) {
double t_0 = 1.0 + (i / n);
double tmp;
if (t_0 == 1.0) {
tmp = i / n;
} else {
tmp = ((i / n) * log(t_0)) / (((i / n) + 1.0) - 1.0);
}
return 100.0 * ((exp((n * tmp)) - 1.0) / (i / n));
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (i / n)
if (t_0 == 1.0d0) then
tmp = i / n
else
tmp = ((i / n) * log(t_0)) / (((i / n) + 1.0d0) - 1.0d0)
end if
code = 100.0d0 * ((exp((n * tmp)) - 1.0d0) / (i / n))
end function
public static double code(double i, double n) {
double t_0 = 1.0 + (i / n);
double tmp;
if (t_0 == 1.0) {
tmp = i / n;
} else {
tmp = ((i / n) * Math.log(t_0)) / (((i / n) + 1.0) - 1.0);
}
return 100.0 * ((Math.exp((n * tmp)) - 1.0) / (i / n));
}
def code(i, n): t_0 = 1.0 + (i / n) tmp = 0 if t_0 == 1.0: tmp = i / n else: tmp = ((i / n) * math.log(t_0)) / (((i / n) + 1.0) - 1.0) return 100.0 * ((math.exp((n * tmp)) - 1.0) / (i / n))
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) tmp = 0.0 if (t_0 == 1.0) tmp = Float64(i / n); else tmp = Float64(Float64(Float64(i / n) * log(t_0)) / Float64(Float64(Float64(i / n) + 1.0) - 1.0)); end return Float64(100.0 * Float64(Float64(exp(Float64(n * tmp)) - 1.0) / Float64(i / n))) end
function tmp_2 = code(i, n) t_0 = 1.0 + (i / n); tmp = 0.0; if (t_0 == 1.0) tmp = i / n; else tmp = ((i / n) * log(t_0)) / (((i / n) + 1.0) - 1.0); end tmp_2 = 100.0 * ((exp((n * tmp)) - 1.0) / (i / n)); end
code[i_, n_] := Block[{t$95$0 = N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision]}, N[(100.0 * N[(N[(N[Exp[N[(n * If[Equal[t$95$0, 1.0], N[(i / n), $MachinePrecision], N[(N[(N[(i / n), $MachinePrecision] * N[Log[t$95$0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(i / n), $MachinePrecision] + 1.0), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]], $MachinePrecision] - 1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{i}{n}\\
100 \cdot \frac{e^{n \cdot \begin{array}{l}
\mathbf{if}\;t\_0 = 1:\\
\;\;\;\;\frac{i}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{i}{n} \cdot \log t\_0}{\left(\frac{i}{n} + 1\right) - 1}\\
\end{array}} - 1}{\frac{i}{n}}
\end{array}
\end{array}
herbie shell --seed 2024221
(FPCore (i n)
:name "Compound Interest"
:precision binary64
:alt
(! :herbie-platform default (let ((lnbase (if (== (+ 1 (/ i n)) 1) (/ i n) (/ (* (/ i n) (log (+ 1 (/ i n)))) (- (+ (/ i n) 1) 1))))) (* 100 (/ (- (exp (* n lnbase)) 1) (/ i n)))))
(* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))