
(FPCore (wj x) :precision binary64 (let* ((t_0 (* wj (exp wj)))) (- wj (/ (- t_0 x) (+ (exp wj) t_0)))))
double code(double wj, double x) {
double t_0 = wj * exp(wj);
return wj - ((t_0 - x) / (exp(wj) + t_0));
}
real(8) function code(wj, x)
real(8), intent (in) :: wj
real(8), intent (in) :: x
real(8) :: t_0
t_0 = wj * exp(wj)
code = wj - ((t_0 - x) / (exp(wj) + t_0))
end function
public static double code(double wj, double x) {
double t_0 = wj * Math.exp(wj);
return wj - ((t_0 - x) / (Math.exp(wj) + t_0));
}
def code(wj, x): t_0 = wj * math.exp(wj) return wj - ((t_0 - x) / (math.exp(wj) + t_0))
function code(wj, x) t_0 = Float64(wj * exp(wj)) return Float64(wj - Float64(Float64(t_0 - x) / Float64(exp(wj) + t_0))) end
function tmp = code(wj, x) t_0 = wj * exp(wj); tmp = wj - ((t_0 - x) / (exp(wj) + t_0)); end
code[wj_, x_] := Block[{t$95$0 = N[(wj * N[Exp[wj], $MachinePrecision]), $MachinePrecision]}, N[(wj - N[(N[(t$95$0 - x), $MachinePrecision] / N[(N[Exp[wj], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := wj \cdot e^{wj}\\
wj - \frac{t\_0 - x}{e^{wj} + t\_0}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (wj x) :precision binary64 (let* ((t_0 (* wj (exp wj)))) (- wj (/ (- t_0 x) (+ (exp wj) t_0)))))
double code(double wj, double x) {
double t_0 = wj * exp(wj);
return wj - ((t_0 - x) / (exp(wj) + t_0));
}
real(8) function code(wj, x)
real(8), intent (in) :: wj
real(8), intent (in) :: x
real(8) :: t_0
t_0 = wj * exp(wj)
code = wj - ((t_0 - x) / (exp(wj) + t_0))
end function
public static double code(double wj, double x) {
double t_0 = wj * Math.exp(wj);
return wj - ((t_0 - x) / (Math.exp(wj) + t_0));
}
def code(wj, x): t_0 = wj * math.exp(wj) return wj - ((t_0 - x) / (math.exp(wj) + t_0))
function code(wj, x) t_0 = Float64(wj * exp(wj)) return Float64(wj - Float64(Float64(t_0 - x) / Float64(exp(wj) + t_0))) end
function tmp = code(wj, x) t_0 = wj * exp(wj); tmp = wj - ((t_0 - x) / (exp(wj) + t_0)); end
code[wj_, x_] := Block[{t$95$0 = N[(wj * N[Exp[wj], $MachinePrecision]), $MachinePrecision]}, N[(wj - N[(N[(t$95$0 - x), $MachinePrecision] / N[(N[Exp[wj], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := wj \cdot e^{wj}\\
wj - \frac{t\_0 - x}{e^{wj} + t\_0}
\end{array}
\end{array}
(FPCore (wj x)
:precision binary64
(let* ((t_0 (- wj (/ x (exp wj))))
(t_1 (/ wj (+ wj 1.0)))
(t_2 (sqrt (/ t_0 (+ wj 1.0)))))
(if (<= wj -3.8e-6)
(+ (- wj t_1) (fma (/ -1.0 (+ wj 1.0)) t_0 t_1))
(if (<= wj -7.8e-32)
(+
x
(*
wj
(-
(*
(pow wj 2.0)
(-
(+
(-
-1.0
(+
(* x -3.0)
(+ (* -2.0 (+ (* x -4.0) (* x 1.5))) (* x 0.6666666666666666))))
(/ 1.0 wj))
(+ (* -4.0 (/ x wj)) (* 1.5 (/ x wj)))))
(* x 2.0))))
(if (<= wj 5e-83)
(- x (* wj (- (* x 2.0) wj)))
(if (<= wj 3.7e-7)
(-
x
(*
wj
(+
(* x 2.0)
(*
wj
(+
wj
(* x (- (- (/ -1.0 x) (* wj -2.6666666666666665)) 2.5)))))))
(if (<= wj 4.1e-5)
(-
x
(*
wj
(+
(* x 2.0)
(-
0.0
(pow
(exp
(*
3.0
(log
(*
wj
(-
(fma
-1.0
(fma
wj
(fma
-3.0
x
(fma -2.0 (* x -2.5) (* x 0.6666666666666666)))
wj)
1.0)
(* x -2.5))))))
0.3333333333333333)))))
(if (<= wj 0.00055)
(* x (/ (exp (- wj)) (+ wj 1.0)))
(if (<= wj 0.014)
(* (+ t_2 (sqrt wj)) (- (sqrt wj) t_2))
(+ wj (/ t_0 (- -1.0 wj))))))))))))
double code(double wj, double x) {
double t_0 = wj - (x / exp(wj));
double t_1 = wj / (wj + 1.0);
double t_2 = sqrt((t_0 / (wj + 1.0)));
double tmp;
if (wj <= -3.8e-6) {
tmp = (wj - t_1) + fma((-1.0 / (wj + 1.0)), t_0, t_1);
} else if (wj <= -7.8e-32) {
tmp = x + (wj * ((pow(wj, 2.0) * (((-1.0 - ((x * -3.0) + ((-2.0 * ((x * -4.0) + (x * 1.5))) + (x * 0.6666666666666666)))) + (1.0 / wj)) - ((-4.0 * (x / wj)) + (1.5 * (x / wj))))) - (x * 2.0)));
} else if (wj <= 5e-83) {
tmp = x - (wj * ((x * 2.0) - wj));
} else if (wj <= 3.7e-7) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5))))));
} else if (wj <= 4.1e-5) {
tmp = x - (wj * ((x * 2.0) + (0.0 - pow(exp((3.0 * log((wj * (fma(-1.0, fma(wj, fma(-3.0, x, fma(-2.0, (x * -2.5), (x * 0.6666666666666666))), wj), 1.0) - (x * -2.5)))))), 0.3333333333333333))));
} else if (wj <= 0.00055) {
tmp = x * (exp(-wj) / (wj + 1.0));
} else if (wj <= 0.014) {
tmp = (t_2 + sqrt(wj)) * (sqrt(wj) - t_2);
} else {
tmp = wj + (t_0 / (-1.0 - wj));
}
return tmp;
}
function code(wj, x) t_0 = Float64(wj - Float64(x / exp(wj))) t_1 = Float64(wj / Float64(wj + 1.0)) t_2 = sqrt(Float64(t_0 / Float64(wj + 1.0))) tmp = 0.0 if (wj <= -3.8e-6) tmp = Float64(Float64(wj - t_1) + fma(Float64(-1.0 / Float64(wj + 1.0)), t_0, t_1)); elseif (wj <= -7.8e-32) tmp = Float64(x + Float64(wj * Float64(Float64((wj ^ 2.0) * Float64(Float64(Float64(-1.0 - Float64(Float64(x * -3.0) + Float64(Float64(-2.0 * Float64(Float64(x * -4.0) + Float64(x * 1.5))) + Float64(x * 0.6666666666666666)))) + Float64(1.0 / wj)) - Float64(Float64(-4.0 * Float64(x / wj)) + Float64(1.5 * Float64(x / wj))))) - Float64(x * 2.0)))); elseif (wj <= 5e-83) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) - wj))); elseif (wj <= 3.7e-7) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) + Float64(wj * Float64(wj + Float64(x * Float64(Float64(Float64(-1.0 / x) - Float64(wj * -2.6666666666666665)) - 2.5))))))); elseif (wj <= 4.1e-5) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) + Float64(0.0 - (exp(Float64(3.0 * log(Float64(wj * Float64(fma(-1.0, fma(wj, fma(-3.0, x, fma(-2.0, Float64(x * -2.5), Float64(x * 0.6666666666666666))), wj), 1.0) - Float64(x * -2.5)))))) ^ 0.3333333333333333))))); elseif (wj <= 0.00055) tmp = Float64(x * Float64(exp(Float64(-wj)) / Float64(wj + 1.0))); elseif (wj <= 0.014) tmp = Float64(Float64(t_2 + sqrt(wj)) * Float64(sqrt(wj) - t_2)); else tmp = Float64(wj + Float64(t_0 / Float64(-1.0 - wj))); end return tmp end
code[wj_, x_] := Block[{t$95$0 = N[(wj - N[(x / N[Exp[wj], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(wj / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(t$95$0 / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[wj, -3.8e-6], N[(N[(wj - t$95$1), $MachinePrecision] + N[(N[(-1.0 / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision] * t$95$0 + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, -7.8e-32], N[(x + N[(wj * N[(N[(N[Power[wj, 2.0], $MachinePrecision] * N[(N[(N[(-1.0 - N[(N[(x * -3.0), $MachinePrecision] + N[(N[(-2.0 * N[(N[(x * -4.0), $MachinePrecision] + N[(x * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / wj), $MachinePrecision]), $MachinePrecision] - N[(N[(-4.0 * N[(x / wj), $MachinePrecision]), $MachinePrecision] + N[(1.5 * N[(x / wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 5e-83], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 3.7e-7], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] + N[(wj * N[(wj + N[(x * N[(N[(N[(-1.0 / x), $MachinePrecision] - N[(wj * -2.6666666666666665), $MachinePrecision]), $MachinePrecision] - 2.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 4.1e-5], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] + N[(0.0 - N[Power[N[Exp[N[(3.0 * N[Log[N[(wj * N[(N[(-1.0 * N[(wj * N[(-3.0 * x + N[(-2.0 * N[(x * -2.5), $MachinePrecision] + N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + wj), $MachinePrecision] + 1.0), $MachinePrecision] - N[(x * -2.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 0.3333333333333333], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.00055], N[(x * N[(N[Exp[(-wj)], $MachinePrecision] / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.014], N[(N[(t$95$2 + N[Sqrt[wj], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[wj], $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], N[(wj + N[(t$95$0 / N[(-1.0 - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := wj - \frac{x}{e^{wj}}\\
t_1 := \frac{wj}{wj + 1}\\
t_2 := \sqrt{\frac{t\_0}{wj + 1}}\\
\mathbf{if}\;wj \leq -3.8 \cdot 10^{-6}:\\
\;\;\;\;\left(wj - t\_1\right) + \mathsf{fma}\left(\frac{-1}{wj + 1}, t\_0, t\_1\right)\\
\mathbf{elif}\;wj \leq -7.8 \cdot 10^{-32}:\\
\;\;\;\;x + wj \cdot \left({wj}^{2} \cdot \left(\left(\left(-1 - \left(x \cdot -3 + \left(-2 \cdot \left(x \cdot -4 + x \cdot 1.5\right) + x \cdot 0.6666666666666666\right)\right)\right) + \frac{1}{wj}\right) - \left(-4 \cdot \frac{x}{wj} + 1.5 \cdot \frac{x}{wj}\right)\right) - x \cdot 2\right)\\
\mathbf{elif}\;wj \leq 5 \cdot 10^{-83}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 - wj\right)\\
\mathbf{elif}\;wj \leq 3.7 \cdot 10^{-7}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 + wj \cdot \left(wj + x \cdot \left(\left(\frac{-1}{x} - wj \cdot -2.6666666666666665\right) - 2.5\right)\right)\right)\\
\mathbf{elif}\;wj \leq 4.1 \cdot 10^{-5}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 + \left(0 - {\left(e^{3 \cdot \log \left(wj \cdot \left(\mathsf{fma}\left(-1, \mathsf{fma}\left(wj, \mathsf{fma}\left(-3, x, \mathsf{fma}\left(-2, x \cdot -2.5, x \cdot 0.6666666666666666\right)\right), wj\right), 1\right) - x \cdot -2.5\right)\right)}\right)}^{0.3333333333333333}\right)\right)\\
\mathbf{elif}\;wj \leq 0.00055:\\
\;\;\;\;x \cdot \frac{e^{-wj}}{wj + 1}\\
\mathbf{elif}\;wj \leq 0.014:\\
\;\;\;\;\left(t\_2 + \sqrt{wj}\right) \cdot \left(\sqrt{wj} - t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;wj + \frac{t\_0}{-1 - wj}\\
\end{array}
\end{array}
if wj < -3.8e-6Initial program 59.6%
distribute-rgt1-in97.1%
*-commutative97.1%
associate-/r*97.1%
div-sub59.6%
associate-/l*59.6%
*-inverses97.1%
*-rgt-identity97.1%
Simplified97.1%
*-un-lft-identity97.1%
div-inv97.2%
prod-diff59.8%
associate-/r/59.5%
clear-num59.6%
fma-neg59.6%
*-un-lft-identity59.6%
associate-/r/59.6%
clear-num59.8%
Applied egg-rr59.8%
distribute-neg-frac59.8%
metadata-eval59.8%
Simplified59.8%
Taylor expanded in x around 0 66.8%
+-commutative66.8%
Simplified66.8%
Taylor expanded in x around 0 97.1%
+-commutative97.1%
Simplified97.1%
if -3.8e-6 < wj < -7.8000000000000003e-32Initial program 70.8%
distribute-rgt1-in70.7%
*-commutative70.7%
associate-/r*70.8%
div-sub70.8%
associate-/l*70.8%
*-inverses70.8%
*-rgt-identity70.8%
Simplified70.8%
Taylor expanded in wj around 0 98.4%
Taylor expanded in wj around inf 98.5%
if -7.8000000000000003e-32 < wj < 5e-83Initial program 81.3%
distribute-rgt1-in81.3%
*-commutative81.3%
associate-/r*81.3%
div-sub81.3%
associate-/l*81.3%
*-inverses81.3%
*-rgt-identity81.3%
Simplified81.3%
Taylor expanded in wj around 0 99.6%
Taylor expanded in x around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in wj around 0 100.0%
if 5e-83 < wj < 3.70000000000000004e-7Initial program 51.6%
distribute-rgt1-in51.6%
*-commutative51.6%
associate-/r*51.6%
div-sub51.6%
associate-/l*51.6%
*-inverses51.6%
*-rgt-identity51.6%
Simplified51.6%
Taylor expanded in wj around 0 99.9%
Taylor expanded in x around 0 99.9%
distribute-lft-out99.9%
*-commutative99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in x around inf 100.0%
if 3.70000000000000004e-7 < wj < 4.10000000000000005e-5Initial program 68.1%
distribute-rgt1-in66.6%
*-commutative66.6%
associate-/r*69.7%
div-sub69.7%
associate-/l*69.7%
*-inverses69.7%
*-rgt-identity69.7%
Simplified69.7%
Taylor expanded in wj around 0 85.0%
add-cbrt-cube85.0%
pow1/385.0%
Applied egg-rr85.0%
add-exp-log85.0%
log-pow85.0%
Applied egg-rr85.0%
if 4.10000000000000005e-5 < wj < 5.50000000000000033e-4Initial program 100.0%
distribute-rgt1-in98.4%
*-commutative98.4%
associate-/r*98.4%
div-sub98.4%
associate-/l*98.4%
*-inverses98.4%
*-rgt-identity98.4%
Simplified98.4%
Taylor expanded in x around inf 98.4%
+-commutative98.4%
associate-/r*100.0%
exp-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 98.4%
associate-/l*100.0%
+-commutative100.0%
Simplified100.0%
if 5.50000000000000033e-4 < wj < 0.0140000000000000003Initial program 94.8%
distribute-rgt1-in94.8%
*-commutative94.8%
associate-/r*90.9%
div-sub90.9%
associate-/l*90.9%
*-inverses90.9%
*-rgt-identity90.9%
Simplified90.9%
add-sqr-sqrt90.9%
add-sqr-sqrt94.8%
difference-of-squares100.0%
Applied egg-rr100.0%
+-commutative100.0%
Simplified100.0%
if 0.0140000000000000003 < wj Initial program 74.6%
distribute-rgt1-in75.0%
*-commutative75.0%
associate-/r*75.0%
div-sub75.0%
associate-/l*75.0%
*-inverses100.0%
*-rgt-identity100.0%
Simplified100.0%
Final simplification99.8%
(FPCore (wj x)
:precision binary64
(let* ((t_0 (/ wj (+ wj 1.0)))
(t_1 (- wj (/ x (exp wj))))
(t_2 (sqrt (/ t_1 (+ wj 1.0)))))
(if (<= wj -3.8e-6)
(+ (- wj t_0) (fma (/ -1.0 (+ wj 1.0)) t_1 t_0))
(if (<= wj -5e-32)
(+
x
(*
wj
(-
(*
(pow wj 2.0)
(-
(+
(-
-1.0
(+
(* x -3.0)
(+ (* -2.0 (+ (* x -4.0) (* x 1.5))) (* x 0.6666666666666666))))
(/ 1.0 wj))
(+ (* -4.0 (/ x wj)) (* 1.5 (/ x wj)))))
(* x 2.0))))
(if (<= wj 5e-83)
(- x (* wj (- (* x 2.0) wj)))
(if (<= wj 3.7e-7)
(-
x
(*
wj
(+
(* x 2.0)
(*
wj
(+
wj
(* x (- (- (/ -1.0 x) (* wj -2.6666666666666665)) 2.5)))))))
(if (<= wj 0.000155)
(-
x
(*
(- wj)
(+
(pow (* (pow wj 3.0) (pow (- 1.0 wj) 3.0)) 0.3333333333333333)
(* 2.0 (- x)))))
(if (<= wj 0.00058)
(* x (/ (exp (- wj)) (+ wj 1.0)))
(if (<= wj 0.014)
(* (+ t_2 (sqrt wj)) (- (sqrt wj) t_2))
(+ wj (/ t_1 (- -1.0 wj))))))))))))
double code(double wj, double x) {
double t_0 = wj / (wj + 1.0);
double t_1 = wj - (x / exp(wj));
double t_2 = sqrt((t_1 / (wj + 1.0)));
double tmp;
if (wj <= -3.8e-6) {
tmp = (wj - t_0) + fma((-1.0 / (wj + 1.0)), t_1, t_0);
} else if (wj <= -5e-32) {
tmp = x + (wj * ((pow(wj, 2.0) * (((-1.0 - ((x * -3.0) + ((-2.0 * ((x * -4.0) + (x * 1.5))) + (x * 0.6666666666666666)))) + (1.0 / wj)) - ((-4.0 * (x / wj)) + (1.5 * (x / wj))))) - (x * 2.0)));
} else if (wj <= 5e-83) {
tmp = x - (wj * ((x * 2.0) - wj));
} else if (wj <= 3.7e-7) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5))))));
} else if (wj <= 0.000155) {
tmp = x - (-wj * (pow((pow(wj, 3.0) * pow((1.0 - wj), 3.0)), 0.3333333333333333) + (2.0 * -x)));
} else if (wj <= 0.00058) {
tmp = x * (exp(-wj) / (wj + 1.0));
} else if (wj <= 0.014) {
tmp = (t_2 + sqrt(wj)) * (sqrt(wj) - t_2);
} else {
tmp = wj + (t_1 / (-1.0 - wj));
}
return tmp;
}
function code(wj, x) t_0 = Float64(wj / Float64(wj + 1.0)) t_1 = Float64(wj - Float64(x / exp(wj))) t_2 = sqrt(Float64(t_1 / Float64(wj + 1.0))) tmp = 0.0 if (wj <= -3.8e-6) tmp = Float64(Float64(wj - t_0) + fma(Float64(-1.0 / Float64(wj + 1.0)), t_1, t_0)); elseif (wj <= -5e-32) tmp = Float64(x + Float64(wj * Float64(Float64((wj ^ 2.0) * Float64(Float64(Float64(-1.0 - Float64(Float64(x * -3.0) + Float64(Float64(-2.0 * Float64(Float64(x * -4.0) + Float64(x * 1.5))) + Float64(x * 0.6666666666666666)))) + Float64(1.0 / wj)) - Float64(Float64(-4.0 * Float64(x / wj)) + Float64(1.5 * Float64(x / wj))))) - Float64(x * 2.0)))); elseif (wj <= 5e-83) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) - wj))); elseif (wj <= 3.7e-7) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) + Float64(wj * Float64(wj + Float64(x * Float64(Float64(Float64(-1.0 / x) - Float64(wj * -2.6666666666666665)) - 2.5))))))); elseif (wj <= 0.000155) tmp = Float64(x - Float64(Float64(-wj) * Float64((Float64((wj ^ 3.0) * (Float64(1.0 - wj) ^ 3.0)) ^ 0.3333333333333333) + Float64(2.0 * Float64(-x))))); elseif (wj <= 0.00058) tmp = Float64(x * Float64(exp(Float64(-wj)) / Float64(wj + 1.0))); elseif (wj <= 0.014) tmp = Float64(Float64(t_2 + sqrt(wj)) * Float64(sqrt(wj) - t_2)); else tmp = Float64(wj + Float64(t_1 / Float64(-1.0 - wj))); end return tmp end
code[wj_, x_] := Block[{t$95$0 = N[(wj / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(wj - N[(x / N[Exp[wj], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(t$95$1 / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[wj, -3.8e-6], N[(N[(wj - t$95$0), $MachinePrecision] + N[(N[(-1.0 / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision] * t$95$1 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, -5e-32], N[(x + N[(wj * N[(N[(N[Power[wj, 2.0], $MachinePrecision] * N[(N[(N[(-1.0 - N[(N[(x * -3.0), $MachinePrecision] + N[(N[(-2.0 * N[(N[(x * -4.0), $MachinePrecision] + N[(x * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / wj), $MachinePrecision]), $MachinePrecision] - N[(N[(-4.0 * N[(x / wj), $MachinePrecision]), $MachinePrecision] + N[(1.5 * N[(x / wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 5e-83], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 3.7e-7], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] + N[(wj * N[(wj + N[(x * N[(N[(N[(-1.0 / x), $MachinePrecision] - N[(wj * -2.6666666666666665), $MachinePrecision]), $MachinePrecision] - 2.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.000155], N[(x - N[((-wj) * N[(N[Power[N[(N[Power[wj, 3.0], $MachinePrecision] * N[Power[N[(1.0 - wj), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], 0.3333333333333333], $MachinePrecision] + N[(2.0 * (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.00058], N[(x * N[(N[Exp[(-wj)], $MachinePrecision] / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.014], N[(N[(t$95$2 + N[Sqrt[wj], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[wj], $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], N[(wj + N[(t$95$1 / N[(-1.0 - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{wj}{wj + 1}\\
t_1 := wj - \frac{x}{e^{wj}}\\
t_2 := \sqrt{\frac{t\_1}{wj + 1}}\\
\mathbf{if}\;wj \leq -3.8 \cdot 10^{-6}:\\
\;\;\;\;\left(wj - t\_0\right) + \mathsf{fma}\left(\frac{-1}{wj + 1}, t\_1, t\_0\right)\\
\mathbf{elif}\;wj \leq -5 \cdot 10^{-32}:\\
\;\;\;\;x + wj \cdot \left({wj}^{2} \cdot \left(\left(\left(-1 - \left(x \cdot -3 + \left(-2 \cdot \left(x \cdot -4 + x \cdot 1.5\right) + x \cdot 0.6666666666666666\right)\right)\right) + \frac{1}{wj}\right) - \left(-4 \cdot \frac{x}{wj} + 1.5 \cdot \frac{x}{wj}\right)\right) - x \cdot 2\right)\\
\mathbf{elif}\;wj \leq 5 \cdot 10^{-83}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 - wj\right)\\
\mathbf{elif}\;wj \leq 3.7 \cdot 10^{-7}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 + wj \cdot \left(wj + x \cdot \left(\left(\frac{-1}{x} - wj \cdot -2.6666666666666665\right) - 2.5\right)\right)\right)\\
\mathbf{elif}\;wj \leq 0.000155:\\
\;\;\;\;x - \left(-wj\right) \cdot \left({\left({wj}^{3} \cdot {\left(1 - wj\right)}^{3}\right)}^{0.3333333333333333} + 2 \cdot \left(-x\right)\right)\\
\mathbf{elif}\;wj \leq 0.00058:\\
\;\;\;\;x \cdot \frac{e^{-wj}}{wj + 1}\\
\mathbf{elif}\;wj \leq 0.014:\\
\;\;\;\;\left(t\_2 + \sqrt{wj}\right) \cdot \left(\sqrt{wj} - t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;wj + \frac{t\_1}{-1 - wj}\\
\end{array}
\end{array}
if wj < -3.8e-6Initial program 59.6%
distribute-rgt1-in97.1%
*-commutative97.1%
associate-/r*97.1%
div-sub59.6%
associate-/l*59.6%
*-inverses97.1%
*-rgt-identity97.1%
Simplified97.1%
*-un-lft-identity97.1%
div-inv97.2%
prod-diff59.8%
associate-/r/59.5%
clear-num59.6%
fma-neg59.6%
*-un-lft-identity59.6%
associate-/r/59.6%
clear-num59.8%
Applied egg-rr59.8%
distribute-neg-frac59.8%
metadata-eval59.8%
Simplified59.8%
Taylor expanded in x around 0 66.8%
+-commutative66.8%
Simplified66.8%
Taylor expanded in x around 0 97.1%
+-commutative97.1%
Simplified97.1%
if -3.8e-6 < wj < -5e-32Initial program 70.8%
distribute-rgt1-in70.7%
*-commutative70.7%
associate-/r*70.8%
div-sub70.8%
associate-/l*70.8%
*-inverses70.8%
*-rgt-identity70.8%
Simplified70.8%
Taylor expanded in wj around 0 98.4%
Taylor expanded in wj around inf 98.5%
if -5e-32 < wj < 5e-83Initial program 81.3%
distribute-rgt1-in81.3%
*-commutative81.3%
associate-/r*81.3%
div-sub81.3%
associate-/l*81.3%
*-inverses81.3%
*-rgt-identity81.3%
Simplified81.3%
Taylor expanded in wj around 0 99.6%
Taylor expanded in x around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in wj around 0 100.0%
if 5e-83 < wj < 3.70000000000000004e-7Initial program 51.6%
distribute-rgt1-in51.6%
*-commutative51.6%
associate-/r*51.6%
div-sub51.6%
associate-/l*51.6%
*-inverses51.6%
*-rgt-identity51.6%
Simplified51.6%
Taylor expanded in wj around 0 99.9%
Taylor expanded in x around 0 99.9%
distribute-lft-out99.9%
*-commutative99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in x around inf 100.0%
if 3.70000000000000004e-7 < wj < 1.55e-4Initial program 68.1%
distribute-rgt1-in66.6%
*-commutative66.6%
associate-/r*69.7%
div-sub69.7%
associate-/l*69.7%
*-inverses69.7%
*-rgt-identity69.7%
Simplified69.7%
Taylor expanded in wj around 0 85.0%
add-cbrt-cube85.0%
pow1/385.0%
Applied egg-rr85.0%
Taylor expanded in x around 0 85.0%
neg-mul-185.0%
sub-neg85.0%
Simplified85.0%
if 1.55e-4 < wj < 5.8e-4Initial program 100.0%
distribute-rgt1-in98.4%
*-commutative98.4%
associate-/r*98.4%
div-sub98.4%
associate-/l*98.4%
*-inverses98.4%
*-rgt-identity98.4%
Simplified98.4%
Taylor expanded in x around inf 98.4%
+-commutative98.4%
associate-/r*100.0%
exp-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 98.4%
associate-/l*100.0%
+-commutative100.0%
Simplified100.0%
if 5.8e-4 < wj < 0.0140000000000000003Initial program 94.8%
distribute-rgt1-in94.8%
*-commutative94.8%
associate-/r*90.9%
div-sub90.9%
associate-/l*90.9%
*-inverses90.9%
*-rgt-identity90.9%
Simplified90.9%
add-sqr-sqrt90.9%
add-sqr-sqrt94.8%
difference-of-squares100.0%
Applied egg-rr100.0%
+-commutative100.0%
Simplified100.0%
if 0.0140000000000000003 < wj Initial program 74.6%
distribute-rgt1-in75.0%
*-commutative75.0%
associate-/r*75.0%
div-sub75.0%
associate-/l*75.0%
*-inverses100.0%
*-rgt-identity100.0%
Simplified100.0%
Final simplification99.8%
(FPCore (wj x)
:precision binary64
(let* ((t_0 (/ wj (+ wj 1.0)))
(t_1 (/ -1.0 (+ wj 1.0)))
(t_2 (- wj (/ x (exp wj)))))
(if (<= wj -3.8e-6)
(+ (- wj t_0) (fma t_1 t_2 t_0))
(if (<= wj -5e-32)
(+
x
(*
wj
(-
(*
(pow wj 2.0)
(-
(+
(-
-1.0
(+
(* x -3.0)
(+ (* -2.0 (+ (* x -4.0) (* x 1.5))) (* x 0.6666666666666666))))
(/ 1.0 wj))
(+ (* -4.0 (/ x wj)) (* 1.5 (/ x wj)))))
(* x 2.0))))
(if (<= wj 5e-83)
(- x (* wj (- (* x 2.0) wj)))
(if (<= wj 3.7e-7)
(-
x
(*
wj
(+
(* x 2.0)
(*
wj
(+
wj
(* x (- (- (/ -1.0 x) (* wj -2.6666666666666665)) 2.5)))))))
(if (<= wj 0.00029)
(-
x
(*
(- wj)
(+
(pow (* (pow wj 3.0) (pow (- 1.0 wj) 3.0)) 0.3333333333333333)
(* 2.0 (- x)))))
(if (<= wj 0.00055)
(* x (/ (exp (- wj)) (+ wj 1.0)))
(+
(- wj (pow (/ (+ wj 1.0) t_2) -1.0))
(fma t_1 t_2 (/ t_2 (+ wj 1.0))))))))))))
double code(double wj, double x) {
double t_0 = wj / (wj + 1.0);
double t_1 = -1.0 / (wj + 1.0);
double t_2 = wj - (x / exp(wj));
double tmp;
if (wj <= -3.8e-6) {
tmp = (wj - t_0) + fma(t_1, t_2, t_0);
} else if (wj <= -5e-32) {
tmp = x + (wj * ((pow(wj, 2.0) * (((-1.0 - ((x * -3.0) + ((-2.0 * ((x * -4.0) + (x * 1.5))) + (x * 0.6666666666666666)))) + (1.0 / wj)) - ((-4.0 * (x / wj)) + (1.5 * (x / wj))))) - (x * 2.0)));
} else if (wj <= 5e-83) {
tmp = x - (wj * ((x * 2.0) - wj));
} else if (wj <= 3.7e-7) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5))))));
} else if (wj <= 0.00029) {
tmp = x - (-wj * (pow((pow(wj, 3.0) * pow((1.0 - wj), 3.0)), 0.3333333333333333) + (2.0 * -x)));
} else if (wj <= 0.00055) {
tmp = x * (exp(-wj) / (wj + 1.0));
} else {
tmp = (wj - pow(((wj + 1.0) / t_2), -1.0)) + fma(t_1, t_2, (t_2 / (wj + 1.0)));
}
return tmp;
}
function code(wj, x) t_0 = Float64(wj / Float64(wj + 1.0)) t_1 = Float64(-1.0 / Float64(wj + 1.0)) t_2 = Float64(wj - Float64(x / exp(wj))) tmp = 0.0 if (wj <= -3.8e-6) tmp = Float64(Float64(wj - t_0) + fma(t_1, t_2, t_0)); elseif (wj <= -5e-32) tmp = Float64(x + Float64(wj * Float64(Float64((wj ^ 2.0) * Float64(Float64(Float64(-1.0 - Float64(Float64(x * -3.0) + Float64(Float64(-2.0 * Float64(Float64(x * -4.0) + Float64(x * 1.5))) + Float64(x * 0.6666666666666666)))) + Float64(1.0 / wj)) - Float64(Float64(-4.0 * Float64(x / wj)) + Float64(1.5 * Float64(x / wj))))) - Float64(x * 2.0)))); elseif (wj <= 5e-83) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) - wj))); elseif (wj <= 3.7e-7) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) + Float64(wj * Float64(wj + Float64(x * Float64(Float64(Float64(-1.0 / x) - Float64(wj * -2.6666666666666665)) - 2.5))))))); elseif (wj <= 0.00029) tmp = Float64(x - Float64(Float64(-wj) * Float64((Float64((wj ^ 3.0) * (Float64(1.0 - wj) ^ 3.0)) ^ 0.3333333333333333) + Float64(2.0 * Float64(-x))))); elseif (wj <= 0.00055) tmp = Float64(x * Float64(exp(Float64(-wj)) / Float64(wj + 1.0))); else tmp = Float64(Float64(wj - (Float64(Float64(wj + 1.0) / t_2) ^ -1.0)) + fma(t_1, t_2, Float64(t_2 / Float64(wj + 1.0)))); end return tmp end
code[wj_, x_] := Block[{t$95$0 = N[(wj / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(wj - N[(x / N[Exp[wj], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[wj, -3.8e-6], N[(N[(wj - t$95$0), $MachinePrecision] + N[(t$95$1 * t$95$2 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, -5e-32], N[(x + N[(wj * N[(N[(N[Power[wj, 2.0], $MachinePrecision] * N[(N[(N[(-1.0 - N[(N[(x * -3.0), $MachinePrecision] + N[(N[(-2.0 * N[(N[(x * -4.0), $MachinePrecision] + N[(x * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / wj), $MachinePrecision]), $MachinePrecision] - N[(N[(-4.0 * N[(x / wj), $MachinePrecision]), $MachinePrecision] + N[(1.5 * N[(x / wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 5e-83], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 3.7e-7], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] + N[(wj * N[(wj + N[(x * N[(N[(N[(-1.0 / x), $MachinePrecision] - N[(wj * -2.6666666666666665), $MachinePrecision]), $MachinePrecision] - 2.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.00029], N[(x - N[((-wj) * N[(N[Power[N[(N[Power[wj, 3.0], $MachinePrecision] * N[Power[N[(1.0 - wj), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], 0.3333333333333333], $MachinePrecision] + N[(2.0 * (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.00055], N[(x * N[(N[Exp[(-wj)], $MachinePrecision] / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(wj - N[Power[N[(N[(wj + 1.0), $MachinePrecision] / t$95$2), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$2 + N[(t$95$2 / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{wj}{wj + 1}\\
t_1 := \frac{-1}{wj + 1}\\
t_2 := wj - \frac{x}{e^{wj}}\\
\mathbf{if}\;wj \leq -3.8 \cdot 10^{-6}:\\
\;\;\;\;\left(wj - t\_0\right) + \mathsf{fma}\left(t\_1, t\_2, t\_0\right)\\
\mathbf{elif}\;wj \leq -5 \cdot 10^{-32}:\\
\;\;\;\;x + wj \cdot \left({wj}^{2} \cdot \left(\left(\left(-1 - \left(x \cdot -3 + \left(-2 \cdot \left(x \cdot -4 + x \cdot 1.5\right) + x \cdot 0.6666666666666666\right)\right)\right) + \frac{1}{wj}\right) - \left(-4 \cdot \frac{x}{wj} + 1.5 \cdot \frac{x}{wj}\right)\right) - x \cdot 2\right)\\
\mathbf{elif}\;wj \leq 5 \cdot 10^{-83}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 - wj\right)\\
\mathbf{elif}\;wj \leq 3.7 \cdot 10^{-7}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 + wj \cdot \left(wj + x \cdot \left(\left(\frac{-1}{x} - wj \cdot -2.6666666666666665\right) - 2.5\right)\right)\right)\\
\mathbf{elif}\;wj \leq 0.00029:\\
\;\;\;\;x - \left(-wj\right) \cdot \left({\left({wj}^{3} \cdot {\left(1 - wj\right)}^{3}\right)}^{0.3333333333333333} + 2 \cdot \left(-x\right)\right)\\
\mathbf{elif}\;wj \leq 0.00055:\\
\;\;\;\;x \cdot \frac{e^{-wj}}{wj + 1}\\
\mathbf{else}:\\
\;\;\;\;\left(wj - {\left(\frac{wj + 1}{t\_2}\right)}^{-1}\right) + \mathsf{fma}\left(t\_1, t\_2, \frac{t\_2}{wj + 1}\right)\\
\end{array}
\end{array}
if wj < -3.8e-6Initial program 59.6%
distribute-rgt1-in97.1%
*-commutative97.1%
associate-/r*97.1%
div-sub59.6%
associate-/l*59.6%
*-inverses97.1%
*-rgt-identity97.1%
Simplified97.1%
*-un-lft-identity97.1%
div-inv97.2%
prod-diff59.8%
associate-/r/59.5%
clear-num59.6%
fma-neg59.6%
*-un-lft-identity59.6%
associate-/r/59.6%
clear-num59.8%
Applied egg-rr59.8%
distribute-neg-frac59.8%
metadata-eval59.8%
Simplified59.8%
Taylor expanded in x around 0 66.8%
+-commutative66.8%
Simplified66.8%
Taylor expanded in x around 0 97.1%
+-commutative97.1%
Simplified97.1%
if -3.8e-6 < wj < -5e-32Initial program 70.8%
distribute-rgt1-in70.7%
*-commutative70.7%
associate-/r*70.8%
div-sub70.8%
associate-/l*70.8%
*-inverses70.8%
*-rgt-identity70.8%
Simplified70.8%
Taylor expanded in wj around 0 98.4%
Taylor expanded in wj around inf 98.5%
if -5e-32 < wj < 5e-83Initial program 81.3%
distribute-rgt1-in81.3%
*-commutative81.3%
associate-/r*81.3%
div-sub81.3%
associate-/l*81.3%
*-inverses81.3%
*-rgt-identity81.3%
Simplified81.3%
Taylor expanded in wj around 0 99.6%
Taylor expanded in x around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in wj around 0 100.0%
if 5e-83 < wj < 3.70000000000000004e-7Initial program 51.6%
distribute-rgt1-in51.6%
*-commutative51.6%
associate-/r*51.6%
div-sub51.6%
associate-/l*51.6%
*-inverses51.6%
*-rgt-identity51.6%
Simplified51.6%
Taylor expanded in wj around 0 99.9%
Taylor expanded in x around 0 99.9%
distribute-lft-out99.9%
*-commutative99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in x around inf 100.0%
if 3.70000000000000004e-7 < wj < 2.9e-4Initial program 68.1%
distribute-rgt1-in66.6%
*-commutative66.6%
associate-/r*69.7%
div-sub69.7%
associate-/l*69.7%
*-inverses69.7%
*-rgt-identity69.7%
Simplified69.7%
Taylor expanded in wj around 0 85.0%
add-cbrt-cube85.0%
pow1/385.0%
Applied egg-rr85.0%
Taylor expanded in x around 0 85.0%
neg-mul-185.0%
sub-neg85.0%
Simplified85.0%
if 2.9e-4 < wj < 5.50000000000000033e-4Initial program 100.0%
distribute-rgt1-in98.4%
*-commutative98.4%
associate-/r*98.4%
div-sub98.4%
associate-/l*98.4%
*-inverses98.4%
*-rgt-identity98.4%
Simplified98.4%
Taylor expanded in x around inf 98.4%
+-commutative98.4%
associate-/r*100.0%
exp-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 98.4%
associate-/l*100.0%
+-commutative100.0%
Simplified100.0%
if 5.50000000000000033e-4 < wj Initial program 78.6%
distribute-rgt1-in79.0%
*-commutative79.0%
associate-/r*78.2%
div-sub78.2%
associate-/l*78.2%
*-inverses98.2%
*-rgt-identity98.2%
Simplified98.2%
*-un-lft-identity98.2%
div-inv98.2%
prod-diff98.1%
associate-/r/99.7%
clear-num98.1%
fma-neg98.1%
*-un-lft-identity98.1%
associate-/r/97.8%
clear-num98.1%
Applied egg-rr98.1%
distribute-neg-frac98.1%
metadata-eval98.1%
Simplified98.1%
clear-num99.7%
inv-pow99.7%
Applied egg-rr99.7%
Final simplification99.8%
(FPCore (wj x)
:precision binary64
(let* ((t_0 (/ wj (+ wj 1.0)))
(t_1 (- wj (/ x (exp wj))))
(t_2 (fma (/ -1.0 (+ wj 1.0)) t_1 t_0)))
(if (<= wj -3.8e-6)
(+ (- wj t_0) t_2)
(if (<= wj -5e-32)
(+
x
(*
wj
(-
(*
(pow wj 2.0)
(-
(+
(-
-1.0
(+
(* x -3.0)
(+ (* -2.0 (+ (* x -4.0) (* x 1.5))) (* x 0.6666666666666666))))
(/ 1.0 wj))
(+ (* -4.0 (/ x wj)) (* 1.5 (/ x wj)))))
(* x 2.0))))
(if (<= wj 5e-83)
(- x (* wj (- (* x 2.0) wj)))
(if (<= wj 3.7e-7)
(-
x
(*
wj
(+
(* x 2.0)
(*
wj
(+
wj
(* x (- (- (/ -1.0 x) (* wj -2.6666666666666665)) 2.5)))))))
(if (<= wj 0.00043)
(-
x
(*
(- wj)
(+
(pow (* (pow wj 3.0) (pow (- 1.0 wj) 3.0)) 0.3333333333333333)
(* 2.0 (- x)))))
(if (<= wj 0.00056)
(* x (/ (exp (- wj)) (+ wj 1.0)))
(if (<= wj 0.014)
(+ t_2 (- wj (pow (/ (+ wj 1.0) t_1) -1.0)))
(+ wj (/ t_1 (- -1.0 wj))))))))))))
double code(double wj, double x) {
double t_0 = wj / (wj + 1.0);
double t_1 = wj - (x / exp(wj));
double t_2 = fma((-1.0 / (wj + 1.0)), t_1, t_0);
double tmp;
if (wj <= -3.8e-6) {
tmp = (wj - t_0) + t_2;
} else if (wj <= -5e-32) {
tmp = x + (wj * ((pow(wj, 2.0) * (((-1.0 - ((x * -3.0) + ((-2.0 * ((x * -4.0) + (x * 1.5))) + (x * 0.6666666666666666)))) + (1.0 / wj)) - ((-4.0 * (x / wj)) + (1.5 * (x / wj))))) - (x * 2.0)));
} else if (wj <= 5e-83) {
tmp = x - (wj * ((x * 2.0) - wj));
} else if (wj <= 3.7e-7) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5))))));
} else if (wj <= 0.00043) {
tmp = x - (-wj * (pow((pow(wj, 3.0) * pow((1.0 - wj), 3.0)), 0.3333333333333333) + (2.0 * -x)));
} else if (wj <= 0.00056) {
tmp = x * (exp(-wj) / (wj + 1.0));
} else if (wj <= 0.014) {
tmp = t_2 + (wj - pow(((wj + 1.0) / t_1), -1.0));
} else {
tmp = wj + (t_1 / (-1.0 - wj));
}
return tmp;
}
function code(wj, x) t_0 = Float64(wj / Float64(wj + 1.0)) t_1 = Float64(wj - Float64(x / exp(wj))) t_2 = fma(Float64(-1.0 / Float64(wj + 1.0)), t_1, t_0) tmp = 0.0 if (wj <= -3.8e-6) tmp = Float64(Float64(wj - t_0) + t_2); elseif (wj <= -5e-32) tmp = Float64(x + Float64(wj * Float64(Float64((wj ^ 2.0) * Float64(Float64(Float64(-1.0 - Float64(Float64(x * -3.0) + Float64(Float64(-2.0 * Float64(Float64(x * -4.0) + Float64(x * 1.5))) + Float64(x * 0.6666666666666666)))) + Float64(1.0 / wj)) - Float64(Float64(-4.0 * Float64(x / wj)) + Float64(1.5 * Float64(x / wj))))) - Float64(x * 2.0)))); elseif (wj <= 5e-83) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) - wj))); elseif (wj <= 3.7e-7) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) + Float64(wj * Float64(wj + Float64(x * Float64(Float64(Float64(-1.0 / x) - Float64(wj * -2.6666666666666665)) - 2.5))))))); elseif (wj <= 0.00043) tmp = Float64(x - Float64(Float64(-wj) * Float64((Float64((wj ^ 3.0) * (Float64(1.0 - wj) ^ 3.0)) ^ 0.3333333333333333) + Float64(2.0 * Float64(-x))))); elseif (wj <= 0.00056) tmp = Float64(x * Float64(exp(Float64(-wj)) / Float64(wj + 1.0))); elseif (wj <= 0.014) tmp = Float64(t_2 + Float64(wj - (Float64(Float64(wj + 1.0) / t_1) ^ -1.0))); else tmp = Float64(wj + Float64(t_1 / Float64(-1.0 - wj))); end return tmp end
code[wj_, x_] := Block[{t$95$0 = N[(wj / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(wj - N[(x / N[Exp[wj], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(-1.0 / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision] * t$95$1 + t$95$0), $MachinePrecision]}, If[LessEqual[wj, -3.8e-6], N[(N[(wj - t$95$0), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[wj, -5e-32], N[(x + N[(wj * N[(N[(N[Power[wj, 2.0], $MachinePrecision] * N[(N[(N[(-1.0 - N[(N[(x * -3.0), $MachinePrecision] + N[(N[(-2.0 * N[(N[(x * -4.0), $MachinePrecision] + N[(x * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / wj), $MachinePrecision]), $MachinePrecision] - N[(N[(-4.0 * N[(x / wj), $MachinePrecision]), $MachinePrecision] + N[(1.5 * N[(x / wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 5e-83], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 3.7e-7], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] + N[(wj * N[(wj + N[(x * N[(N[(N[(-1.0 / x), $MachinePrecision] - N[(wj * -2.6666666666666665), $MachinePrecision]), $MachinePrecision] - 2.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.00043], N[(x - N[((-wj) * N[(N[Power[N[(N[Power[wj, 3.0], $MachinePrecision] * N[Power[N[(1.0 - wj), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], 0.3333333333333333], $MachinePrecision] + N[(2.0 * (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.00056], N[(x * N[(N[Exp[(-wj)], $MachinePrecision] / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.014], N[(t$95$2 + N[(wj - N[Power[N[(N[(wj + 1.0), $MachinePrecision] / t$95$1), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(wj + N[(t$95$1 / N[(-1.0 - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{wj}{wj + 1}\\
t_1 := wj - \frac{x}{e^{wj}}\\
t_2 := \mathsf{fma}\left(\frac{-1}{wj + 1}, t\_1, t\_0\right)\\
\mathbf{if}\;wj \leq -3.8 \cdot 10^{-6}:\\
\;\;\;\;\left(wj - t\_0\right) + t\_2\\
\mathbf{elif}\;wj \leq -5 \cdot 10^{-32}:\\
\;\;\;\;x + wj \cdot \left({wj}^{2} \cdot \left(\left(\left(-1 - \left(x \cdot -3 + \left(-2 \cdot \left(x \cdot -4 + x \cdot 1.5\right) + x \cdot 0.6666666666666666\right)\right)\right) + \frac{1}{wj}\right) - \left(-4 \cdot \frac{x}{wj} + 1.5 \cdot \frac{x}{wj}\right)\right) - x \cdot 2\right)\\
\mathbf{elif}\;wj \leq 5 \cdot 10^{-83}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 - wj\right)\\
\mathbf{elif}\;wj \leq 3.7 \cdot 10^{-7}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 + wj \cdot \left(wj + x \cdot \left(\left(\frac{-1}{x} - wj \cdot -2.6666666666666665\right) - 2.5\right)\right)\right)\\
\mathbf{elif}\;wj \leq 0.00043:\\
\;\;\;\;x - \left(-wj\right) \cdot \left({\left({wj}^{3} \cdot {\left(1 - wj\right)}^{3}\right)}^{0.3333333333333333} + 2 \cdot \left(-x\right)\right)\\
\mathbf{elif}\;wj \leq 0.00056:\\
\;\;\;\;x \cdot \frac{e^{-wj}}{wj + 1}\\
\mathbf{elif}\;wj \leq 0.014:\\
\;\;\;\;t\_2 + \left(wj - {\left(\frac{wj + 1}{t\_1}\right)}^{-1}\right)\\
\mathbf{else}:\\
\;\;\;\;wj + \frac{t\_1}{-1 - wj}\\
\end{array}
\end{array}
if wj < -3.8e-6Initial program 59.6%
distribute-rgt1-in97.1%
*-commutative97.1%
associate-/r*97.1%
div-sub59.6%
associate-/l*59.6%
*-inverses97.1%
*-rgt-identity97.1%
Simplified97.1%
*-un-lft-identity97.1%
div-inv97.2%
prod-diff59.8%
associate-/r/59.5%
clear-num59.6%
fma-neg59.6%
*-un-lft-identity59.6%
associate-/r/59.6%
clear-num59.8%
Applied egg-rr59.8%
distribute-neg-frac59.8%
metadata-eval59.8%
Simplified59.8%
Taylor expanded in x around 0 66.8%
+-commutative66.8%
Simplified66.8%
Taylor expanded in x around 0 97.1%
+-commutative97.1%
Simplified97.1%
if -3.8e-6 < wj < -5e-32Initial program 70.8%
distribute-rgt1-in70.7%
*-commutative70.7%
associate-/r*70.8%
div-sub70.8%
associate-/l*70.8%
*-inverses70.8%
*-rgt-identity70.8%
Simplified70.8%
Taylor expanded in wj around 0 98.4%
Taylor expanded in wj around inf 98.5%
if -5e-32 < wj < 5e-83Initial program 81.3%
distribute-rgt1-in81.3%
*-commutative81.3%
associate-/r*81.3%
div-sub81.3%
associate-/l*81.3%
*-inverses81.3%
*-rgt-identity81.3%
Simplified81.3%
Taylor expanded in wj around 0 99.6%
Taylor expanded in x around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in wj around 0 100.0%
if 5e-83 < wj < 3.70000000000000004e-7Initial program 51.6%
distribute-rgt1-in51.6%
*-commutative51.6%
associate-/r*51.6%
div-sub51.6%
associate-/l*51.6%
*-inverses51.6%
*-rgt-identity51.6%
Simplified51.6%
Taylor expanded in wj around 0 99.9%
Taylor expanded in x around 0 99.9%
distribute-lft-out99.9%
*-commutative99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in x around inf 100.0%
if 3.70000000000000004e-7 < wj < 4.29999999999999989e-4Initial program 68.1%
distribute-rgt1-in66.6%
*-commutative66.6%
associate-/r*69.7%
div-sub69.7%
associate-/l*69.7%
*-inverses69.7%
*-rgt-identity69.7%
Simplified69.7%
Taylor expanded in wj around 0 85.0%
add-cbrt-cube85.0%
pow1/385.0%
Applied egg-rr85.0%
Taylor expanded in x around 0 85.0%
neg-mul-185.0%
sub-neg85.0%
Simplified85.0%
if 4.29999999999999989e-4 < wj < 5.5999999999999995e-4Initial program 100.0%
distribute-rgt1-in98.4%
*-commutative98.4%
associate-/r*98.4%
div-sub98.4%
associate-/l*98.4%
*-inverses98.4%
*-rgt-identity98.4%
Simplified98.4%
Taylor expanded in x around inf 98.4%
+-commutative98.4%
associate-/r*100.0%
exp-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 98.4%
associate-/l*100.0%
+-commutative100.0%
Simplified100.0%
if 5.5999999999999995e-4 < wj < 0.0140000000000000003Initial program 94.8%
distribute-rgt1-in94.8%
*-commutative94.8%
associate-/r*90.9%
div-sub90.9%
associate-/l*90.9%
*-inverses90.9%
*-rgt-identity90.9%
Simplified90.9%
*-un-lft-identity90.9%
div-inv90.9%
prod-diff90.6%
associate-/r/98.4%
clear-num90.6%
fma-neg90.6%
*-un-lft-identity90.6%
associate-/r/89.0%
clear-num90.6%
Applied egg-rr90.6%
distribute-neg-frac90.6%
metadata-eval90.6%
Simplified90.6%
Taylor expanded in x around 0 90.6%
+-commutative90.6%
Simplified90.6%
clear-num98.4%
inv-pow98.4%
Applied egg-rr98.4%
if 0.0140000000000000003 < wj Initial program 74.6%
distribute-rgt1-in75.0%
*-commutative75.0%
associate-/r*75.0%
div-sub75.0%
associate-/l*75.0%
*-inverses100.0%
*-rgt-identity100.0%
Simplified100.0%
Final simplification99.8%
(FPCore (wj x)
:precision binary64
(let* ((t_0 (/ wj (+ wj 1.0)))
(t_1 (* wj (exp wj)))
(t_2 (- wj (/ x (exp wj)))))
(if (<= wj -3.8e-6)
(+ (- wj t_0) (fma (/ -1.0 (+ wj 1.0)) t_2 t_0))
(if (<= wj -6e-32)
(+
x
(*
wj
(-
(*
(pow wj 2.0)
(-
(+
(-
-1.0
(+
(* x -3.0)
(+ (* -2.0 (+ (* x -4.0) (* x 1.5))) (* x 0.6666666666666666))))
(/ 1.0 wj))
(+ (* -4.0 (/ x wj)) (* 1.5 (/ x wj)))))
(* x 2.0))))
(if (<= wj 5e-83)
(- x (* wj (- (* x 2.0) wj)))
(if (<= wj 3.7e-7)
(-
x
(*
wj
(+
(* x 2.0)
(*
wj
(+
wj
(* x (- (- (/ -1.0 x) (* wj -2.6666666666666665)) 2.5)))))))
(if (<= wj 3.9e-7)
(-
x
(*
(- wj)
(+
(pow (* (pow wj 3.0) (pow (- 1.0 wj) 3.0)) 0.3333333333333333)
(* 2.0 (- x)))))
(if (<= wj 0.68)
(+ wj (/ (- x t_1) (+ (exp wj) t_1)))
(+ wj (/ t_2 (- -1.0 wj)))))))))))
double code(double wj, double x) {
double t_0 = wj / (wj + 1.0);
double t_1 = wj * exp(wj);
double t_2 = wj - (x / exp(wj));
double tmp;
if (wj <= -3.8e-6) {
tmp = (wj - t_0) + fma((-1.0 / (wj + 1.0)), t_2, t_0);
} else if (wj <= -6e-32) {
tmp = x + (wj * ((pow(wj, 2.0) * (((-1.0 - ((x * -3.0) + ((-2.0 * ((x * -4.0) + (x * 1.5))) + (x * 0.6666666666666666)))) + (1.0 / wj)) - ((-4.0 * (x / wj)) + (1.5 * (x / wj))))) - (x * 2.0)));
} else if (wj <= 5e-83) {
tmp = x - (wj * ((x * 2.0) - wj));
} else if (wj <= 3.7e-7) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5))))));
} else if (wj <= 3.9e-7) {
tmp = x - (-wj * (pow((pow(wj, 3.0) * pow((1.0 - wj), 3.0)), 0.3333333333333333) + (2.0 * -x)));
} else if (wj <= 0.68) {
tmp = wj + ((x - t_1) / (exp(wj) + t_1));
} else {
tmp = wj + (t_2 / (-1.0 - wj));
}
return tmp;
}
function code(wj, x) t_0 = Float64(wj / Float64(wj + 1.0)) t_1 = Float64(wj * exp(wj)) t_2 = Float64(wj - Float64(x / exp(wj))) tmp = 0.0 if (wj <= -3.8e-6) tmp = Float64(Float64(wj - t_0) + fma(Float64(-1.0 / Float64(wj + 1.0)), t_2, t_0)); elseif (wj <= -6e-32) tmp = Float64(x + Float64(wj * Float64(Float64((wj ^ 2.0) * Float64(Float64(Float64(-1.0 - Float64(Float64(x * -3.0) + Float64(Float64(-2.0 * Float64(Float64(x * -4.0) + Float64(x * 1.5))) + Float64(x * 0.6666666666666666)))) + Float64(1.0 / wj)) - Float64(Float64(-4.0 * Float64(x / wj)) + Float64(1.5 * Float64(x / wj))))) - Float64(x * 2.0)))); elseif (wj <= 5e-83) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) - wj))); elseif (wj <= 3.7e-7) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) + Float64(wj * Float64(wj + Float64(x * Float64(Float64(Float64(-1.0 / x) - Float64(wj * -2.6666666666666665)) - 2.5))))))); elseif (wj <= 3.9e-7) tmp = Float64(x - Float64(Float64(-wj) * Float64((Float64((wj ^ 3.0) * (Float64(1.0 - wj) ^ 3.0)) ^ 0.3333333333333333) + Float64(2.0 * Float64(-x))))); elseif (wj <= 0.68) tmp = Float64(wj + Float64(Float64(x - t_1) / Float64(exp(wj) + t_1))); else tmp = Float64(wj + Float64(t_2 / Float64(-1.0 - wj))); end return tmp end
code[wj_, x_] := Block[{t$95$0 = N[(wj / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(wj * N[Exp[wj], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(wj - N[(x / N[Exp[wj], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[wj, -3.8e-6], N[(N[(wj - t$95$0), $MachinePrecision] + N[(N[(-1.0 / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision] * t$95$2 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, -6e-32], N[(x + N[(wj * N[(N[(N[Power[wj, 2.0], $MachinePrecision] * N[(N[(N[(-1.0 - N[(N[(x * -3.0), $MachinePrecision] + N[(N[(-2.0 * N[(N[(x * -4.0), $MachinePrecision] + N[(x * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / wj), $MachinePrecision]), $MachinePrecision] - N[(N[(-4.0 * N[(x / wj), $MachinePrecision]), $MachinePrecision] + N[(1.5 * N[(x / wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 5e-83], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 3.7e-7], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] + N[(wj * N[(wj + N[(x * N[(N[(N[(-1.0 / x), $MachinePrecision] - N[(wj * -2.6666666666666665), $MachinePrecision]), $MachinePrecision] - 2.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 3.9e-7], N[(x - N[((-wj) * N[(N[Power[N[(N[Power[wj, 3.0], $MachinePrecision] * N[Power[N[(1.0 - wj), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], 0.3333333333333333], $MachinePrecision] + N[(2.0 * (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.68], N[(wj + N[(N[(x - t$95$1), $MachinePrecision] / N[(N[Exp[wj], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(wj + N[(t$95$2 / N[(-1.0 - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{wj}{wj + 1}\\
t_1 := wj \cdot e^{wj}\\
t_2 := wj - \frac{x}{e^{wj}}\\
\mathbf{if}\;wj \leq -3.8 \cdot 10^{-6}:\\
\;\;\;\;\left(wj - t\_0\right) + \mathsf{fma}\left(\frac{-1}{wj + 1}, t\_2, t\_0\right)\\
\mathbf{elif}\;wj \leq -6 \cdot 10^{-32}:\\
\;\;\;\;x + wj \cdot \left({wj}^{2} \cdot \left(\left(\left(-1 - \left(x \cdot -3 + \left(-2 \cdot \left(x \cdot -4 + x \cdot 1.5\right) + x \cdot 0.6666666666666666\right)\right)\right) + \frac{1}{wj}\right) - \left(-4 \cdot \frac{x}{wj} + 1.5 \cdot \frac{x}{wj}\right)\right) - x \cdot 2\right)\\
\mathbf{elif}\;wj \leq 5 \cdot 10^{-83}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 - wj\right)\\
\mathbf{elif}\;wj \leq 3.7 \cdot 10^{-7}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 + wj \cdot \left(wj + x \cdot \left(\left(\frac{-1}{x} - wj \cdot -2.6666666666666665\right) - 2.5\right)\right)\right)\\
\mathbf{elif}\;wj \leq 3.9 \cdot 10^{-7}:\\
\;\;\;\;x - \left(-wj\right) \cdot \left({\left({wj}^{3} \cdot {\left(1 - wj\right)}^{3}\right)}^{0.3333333333333333} + 2 \cdot \left(-x\right)\right)\\
\mathbf{elif}\;wj \leq 0.68:\\
\;\;\;\;wj + \frac{x - t\_1}{e^{wj} + t\_1}\\
\mathbf{else}:\\
\;\;\;\;wj + \frac{t\_2}{-1 - wj}\\
\end{array}
\end{array}
if wj < -3.8e-6Initial program 59.6%
distribute-rgt1-in97.1%
*-commutative97.1%
associate-/r*97.1%
div-sub59.6%
associate-/l*59.6%
*-inverses97.1%
*-rgt-identity97.1%
Simplified97.1%
*-un-lft-identity97.1%
div-inv97.2%
prod-diff59.8%
associate-/r/59.5%
clear-num59.6%
fma-neg59.6%
*-un-lft-identity59.6%
associate-/r/59.6%
clear-num59.8%
Applied egg-rr59.8%
distribute-neg-frac59.8%
metadata-eval59.8%
Simplified59.8%
Taylor expanded in x around 0 66.8%
+-commutative66.8%
Simplified66.8%
Taylor expanded in x around 0 97.1%
+-commutative97.1%
Simplified97.1%
if -3.8e-6 < wj < -6.0000000000000001e-32Initial program 70.8%
distribute-rgt1-in70.7%
*-commutative70.7%
associate-/r*70.8%
div-sub70.8%
associate-/l*70.8%
*-inverses70.8%
*-rgt-identity70.8%
Simplified70.8%
Taylor expanded in wj around 0 98.4%
Taylor expanded in wj around inf 98.5%
if -6.0000000000000001e-32 < wj < 5e-83Initial program 81.3%
distribute-rgt1-in81.3%
*-commutative81.3%
associate-/r*81.3%
div-sub81.3%
associate-/l*81.3%
*-inverses81.3%
*-rgt-identity81.3%
Simplified81.3%
Taylor expanded in wj around 0 99.6%
Taylor expanded in x around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in wj around 0 100.0%
if 5e-83 < wj < 3.70000000000000004e-7Initial program 51.6%
distribute-rgt1-in51.6%
*-commutative51.6%
associate-/r*51.6%
div-sub51.6%
associate-/l*51.6%
*-inverses51.6%
*-rgt-identity51.6%
Simplified51.6%
Taylor expanded in wj around 0 99.9%
Taylor expanded in x around 0 99.9%
distribute-lft-out99.9%
*-commutative99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in x around inf 100.0%
if 3.70000000000000004e-7 < wj < 3.90000000000000025e-7Initial program 68.1%
distribute-rgt1-in66.6%
*-commutative66.6%
associate-/r*69.7%
div-sub69.7%
associate-/l*69.7%
*-inverses69.7%
*-rgt-identity69.7%
Simplified69.7%
Taylor expanded in wj around 0 85.0%
add-cbrt-cube85.0%
pow1/385.0%
Applied egg-rr85.0%
Taylor expanded in x around 0 85.0%
neg-mul-185.0%
sub-neg85.0%
Simplified85.0%
if 3.90000000000000025e-7 < wj < 0.680000000000000049Initial program 97.4%
if 0.680000000000000049 < wj Initial program 74.6%
distribute-rgt1-in75.0%
*-commutative75.0%
associate-/r*75.0%
div-sub75.0%
associate-/l*75.0%
*-inverses100.0%
*-rgt-identity100.0%
Simplified100.0%
Final simplification99.7%
(FPCore (wj x)
:precision binary64
(let* ((t_0 (/ wj (+ wj 1.0)))
(t_1 (* wj (exp wj)))
(t_2 (- wj (/ x (exp wj)))))
(if (<= wj -3.8e-6)
(+ (- wj t_0) (fma (/ -1.0 (+ wj 1.0)) t_2 t_0))
(if (<= wj -5e-32)
(+
x
(*
wj
(-
(*
(pow wj 2.0)
(-
(+
(-
-1.0
(+
(* x -3.0)
(+ (* -2.0 (+ (* x -4.0) (* x 1.5))) (* x 0.6666666666666666))))
(/ 1.0 wj))
(+ (* -4.0 (/ x wj)) (* 1.5 (/ x wj)))))
(* x 2.0))))
(if (<= wj 5e-83)
(- x (* wj (- (* x 2.0) wj)))
(if (<= wj 3.2e-6)
(-
x
(*
wj
(+
(* x 2.0)
(*
wj
(+
wj
(* x (- (- (/ -1.0 x) (* wj -2.6666666666666665)) 2.5)))))))
(if (<= wj 0.5)
(+ wj (/ (- x t_1) (+ (exp wj) t_1)))
(+ wj (/ t_2 (- -1.0 wj))))))))))
double code(double wj, double x) {
double t_0 = wj / (wj + 1.0);
double t_1 = wj * exp(wj);
double t_2 = wj - (x / exp(wj));
double tmp;
if (wj <= -3.8e-6) {
tmp = (wj - t_0) + fma((-1.0 / (wj + 1.0)), t_2, t_0);
} else if (wj <= -5e-32) {
tmp = x + (wj * ((pow(wj, 2.0) * (((-1.0 - ((x * -3.0) + ((-2.0 * ((x * -4.0) + (x * 1.5))) + (x * 0.6666666666666666)))) + (1.0 / wj)) - ((-4.0 * (x / wj)) + (1.5 * (x / wj))))) - (x * 2.0)));
} else if (wj <= 5e-83) {
tmp = x - (wj * ((x * 2.0) - wj));
} else if (wj <= 3.2e-6) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5))))));
} else if (wj <= 0.5) {
tmp = wj + ((x - t_1) / (exp(wj) + t_1));
} else {
tmp = wj + (t_2 / (-1.0 - wj));
}
return tmp;
}
function code(wj, x) t_0 = Float64(wj / Float64(wj + 1.0)) t_1 = Float64(wj * exp(wj)) t_2 = Float64(wj - Float64(x / exp(wj))) tmp = 0.0 if (wj <= -3.8e-6) tmp = Float64(Float64(wj - t_0) + fma(Float64(-1.0 / Float64(wj + 1.0)), t_2, t_0)); elseif (wj <= -5e-32) tmp = Float64(x + Float64(wj * Float64(Float64((wj ^ 2.0) * Float64(Float64(Float64(-1.0 - Float64(Float64(x * -3.0) + Float64(Float64(-2.0 * Float64(Float64(x * -4.0) + Float64(x * 1.5))) + Float64(x * 0.6666666666666666)))) + Float64(1.0 / wj)) - Float64(Float64(-4.0 * Float64(x / wj)) + Float64(1.5 * Float64(x / wj))))) - Float64(x * 2.0)))); elseif (wj <= 5e-83) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) - wj))); elseif (wj <= 3.2e-6) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) + Float64(wj * Float64(wj + Float64(x * Float64(Float64(Float64(-1.0 / x) - Float64(wj * -2.6666666666666665)) - 2.5))))))); elseif (wj <= 0.5) tmp = Float64(wj + Float64(Float64(x - t_1) / Float64(exp(wj) + t_1))); else tmp = Float64(wj + Float64(t_2 / Float64(-1.0 - wj))); end return tmp end
code[wj_, x_] := Block[{t$95$0 = N[(wj / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(wj * N[Exp[wj], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(wj - N[(x / N[Exp[wj], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[wj, -3.8e-6], N[(N[(wj - t$95$0), $MachinePrecision] + N[(N[(-1.0 / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision] * t$95$2 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, -5e-32], N[(x + N[(wj * N[(N[(N[Power[wj, 2.0], $MachinePrecision] * N[(N[(N[(-1.0 - N[(N[(x * -3.0), $MachinePrecision] + N[(N[(-2.0 * N[(N[(x * -4.0), $MachinePrecision] + N[(x * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / wj), $MachinePrecision]), $MachinePrecision] - N[(N[(-4.0 * N[(x / wj), $MachinePrecision]), $MachinePrecision] + N[(1.5 * N[(x / wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 5e-83], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 3.2e-6], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] + N[(wj * N[(wj + N[(x * N[(N[(N[(-1.0 / x), $MachinePrecision] - N[(wj * -2.6666666666666665), $MachinePrecision]), $MachinePrecision] - 2.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.5], N[(wj + N[(N[(x - t$95$1), $MachinePrecision] / N[(N[Exp[wj], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(wj + N[(t$95$2 / N[(-1.0 - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{wj}{wj + 1}\\
t_1 := wj \cdot e^{wj}\\
t_2 := wj - \frac{x}{e^{wj}}\\
\mathbf{if}\;wj \leq -3.8 \cdot 10^{-6}:\\
\;\;\;\;\left(wj - t\_0\right) + \mathsf{fma}\left(\frac{-1}{wj + 1}, t\_2, t\_0\right)\\
\mathbf{elif}\;wj \leq -5 \cdot 10^{-32}:\\
\;\;\;\;x + wj \cdot \left({wj}^{2} \cdot \left(\left(\left(-1 - \left(x \cdot -3 + \left(-2 \cdot \left(x \cdot -4 + x \cdot 1.5\right) + x \cdot 0.6666666666666666\right)\right)\right) + \frac{1}{wj}\right) - \left(-4 \cdot \frac{x}{wj} + 1.5 \cdot \frac{x}{wj}\right)\right) - x \cdot 2\right)\\
\mathbf{elif}\;wj \leq 5 \cdot 10^{-83}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 - wj\right)\\
\mathbf{elif}\;wj \leq 3.2 \cdot 10^{-6}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 + wj \cdot \left(wj + x \cdot \left(\left(\frac{-1}{x} - wj \cdot -2.6666666666666665\right) - 2.5\right)\right)\right)\\
\mathbf{elif}\;wj \leq 0.5:\\
\;\;\;\;wj + \frac{x - t\_1}{e^{wj} + t\_1}\\
\mathbf{else}:\\
\;\;\;\;wj + \frac{t\_2}{-1 - wj}\\
\end{array}
\end{array}
if wj < -3.8e-6Initial program 59.6%
distribute-rgt1-in97.1%
*-commutative97.1%
associate-/r*97.1%
div-sub59.6%
associate-/l*59.6%
*-inverses97.1%
*-rgt-identity97.1%
Simplified97.1%
*-un-lft-identity97.1%
div-inv97.2%
prod-diff59.8%
associate-/r/59.5%
clear-num59.6%
fma-neg59.6%
*-un-lft-identity59.6%
associate-/r/59.6%
clear-num59.8%
Applied egg-rr59.8%
distribute-neg-frac59.8%
metadata-eval59.8%
Simplified59.8%
Taylor expanded in x around 0 66.8%
+-commutative66.8%
Simplified66.8%
Taylor expanded in x around 0 97.1%
+-commutative97.1%
Simplified97.1%
if -3.8e-6 < wj < -5e-32Initial program 70.8%
distribute-rgt1-in70.7%
*-commutative70.7%
associate-/r*70.8%
div-sub70.8%
associate-/l*70.8%
*-inverses70.8%
*-rgt-identity70.8%
Simplified70.8%
Taylor expanded in wj around 0 98.4%
Taylor expanded in wj around inf 98.5%
if -5e-32 < wj < 5e-83Initial program 81.3%
distribute-rgt1-in81.3%
*-commutative81.3%
associate-/r*81.3%
div-sub81.3%
associate-/l*81.3%
*-inverses81.3%
*-rgt-identity81.3%
Simplified81.3%
Taylor expanded in wj around 0 99.6%
Taylor expanded in x around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in wj around 0 100.0%
if 5e-83 < wj < 3.1999999999999999e-6Initial program 52.2%
distribute-rgt1-in52.1%
*-commutative52.1%
associate-/r*52.3%
div-sub52.3%
associate-/l*52.3%
*-inverses52.3%
*-rgt-identity52.3%
Simplified52.3%
Taylor expanded in wj around 0 99.4%
Taylor expanded in x around 0 99.4%
distribute-lft-out99.4%
*-commutative99.4%
mul-1-neg99.4%
Simplified99.4%
Taylor expanded in x around 0 99.4%
Taylor expanded in x around inf 99.5%
if 3.1999999999999999e-6 < wj < 0.5Initial program 97.4%
if 0.5 < wj Initial program 74.6%
distribute-rgt1-in75.0%
*-commutative75.0%
associate-/r*75.0%
div-sub75.0%
associate-/l*75.0%
*-inverses100.0%
*-rgt-identity100.0%
Simplified100.0%
Final simplification99.7%
(FPCore (wj x)
:precision binary64
(let* ((t_0 (/ wj (+ wj 1.0))) (t_1 (- wj (/ x (exp wj)))))
(if (<= wj -3.8e-6)
(+ (- wj t_0) (fma (/ -1.0 (+ wj 1.0)) t_1 t_0))
(if (<= wj -5e-32)
(+
x
(*
wj
(-
(*
(pow wj 2.0)
(-
(+
(-
-1.0
(+
(* x -3.0)
(+ (* -2.0 (+ (* x -4.0) (* x 1.5))) (* x 0.6666666666666666))))
(/ 1.0 wj))
(+ (* -4.0 (/ x wj)) (* 1.5 (/ x wj)))))
(* x 2.0))))
(if (<= wj 5e-83)
(- x (* wj (- (* x 2.0) wj)))
(if (<= wj 0.00052)
(-
x
(*
wj
(+
(* x 2.0)
(*
wj
(+
wj
(* x (- (- (/ -1.0 x) (* wj -2.6666666666666665)) 2.5)))))))
(if (<= wj 0.00055)
(* x (/ (exp (- wj)) (+ wj 1.0)))
(if (<= wj 0.105)
(+ wj (/ (- (* wj (exp wj)) x) (* (exp wj) (- -1.0 wj))))
(+ wj (/ t_1 (- -1.0 wj)))))))))))
double code(double wj, double x) {
double t_0 = wj / (wj + 1.0);
double t_1 = wj - (x / exp(wj));
double tmp;
if (wj <= -3.8e-6) {
tmp = (wj - t_0) + fma((-1.0 / (wj + 1.0)), t_1, t_0);
} else if (wj <= -5e-32) {
tmp = x + (wj * ((pow(wj, 2.0) * (((-1.0 - ((x * -3.0) + ((-2.0 * ((x * -4.0) + (x * 1.5))) + (x * 0.6666666666666666)))) + (1.0 / wj)) - ((-4.0 * (x / wj)) + (1.5 * (x / wj))))) - (x * 2.0)));
} else if (wj <= 5e-83) {
tmp = x - (wj * ((x * 2.0) - wj));
} else if (wj <= 0.00052) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5))))));
} else if (wj <= 0.00055) {
tmp = x * (exp(-wj) / (wj + 1.0));
} else if (wj <= 0.105) {
tmp = wj + (((wj * exp(wj)) - x) / (exp(wj) * (-1.0 - wj)));
} else {
tmp = wj + (t_1 / (-1.0 - wj));
}
return tmp;
}
function code(wj, x) t_0 = Float64(wj / Float64(wj + 1.0)) t_1 = Float64(wj - Float64(x / exp(wj))) tmp = 0.0 if (wj <= -3.8e-6) tmp = Float64(Float64(wj - t_0) + fma(Float64(-1.0 / Float64(wj + 1.0)), t_1, t_0)); elseif (wj <= -5e-32) tmp = Float64(x + Float64(wj * Float64(Float64((wj ^ 2.0) * Float64(Float64(Float64(-1.0 - Float64(Float64(x * -3.0) + Float64(Float64(-2.0 * Float64(Float64(x * -4.0) + Float64(x * 1.5))) + Float64(x * 0.6666666666666666)))) + Float64(1.0 / wj)) - Float64(Float64(-4.0 * Float64(x / wj)) + Float64(1.5 * Float64(x / wj))))) - Float64(x * 2.0)))); elseif (wj <= 5e-83) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) - wj))); elseif (wj <= 0.00052) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) + Float64(wj * Float64(wj + Float64(x * Float64(Float64(Float64(-1.0 / x) - Float64(wj * -2.6666666666666665)) - 2.5))))))); elseif (wj <= 0.00055) tmp = Float64(x * Float64(exp(Float64(-wj)) / Float64(wj + 1.0))); elseif (wj <= 0.105) tmp = Float64(wj + Float64(Float64(Float64(wj * exp(wj)) - x) / Float64(exp(wj) * Float64(-1.0 - wj)))); else tmp = Float64(wj + Float64(t_1 / Float64(-1.0 - wj))); end return tmp end
code[wj_, x_] := Block[{t$95$0 = N[(wj / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(wj - N[(x / N[Exp[wj], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[wj, -3.8e-6], N[(N[(wj - t$95$0), $MachinePrecision] + N[(N[(-1.0 / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision] * t$95$1 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, -5e-32], N[(x + N[(wj * N[(N[(N[Power[wj, 2.0], $MachinePrecision] * N[(N[(N[(-1.0 - N[(N[(x * -3.0), $MachinePrecision] + N[(N[(-2.0 * N[(N[(x * -4.0), $MachinePrecision] + N[(x * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / wj), $MachinePrecision]), $MachinePrecision] - N[(N[(-4.0 * N[(x / wj), $MachinePrecision]), $MachinePrecision] + N[(1.5 * N[(x / wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 5e-83], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.00052], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] + N[(wj * N[(wj + N[(x * N[(N[(N[(-1.0 / x), $MachinePrecision] - N[(wj * -2.6666666666666665), $MachinePrecision]), $MachinePrecision] - 2.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.00055], N[(x * N[(N[Exp[(-wj)], $MachinePrecision] / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.105], N[(wj + N[(N[(N[(wj * N[Exp[wj], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / N[(N[Exp[wj], $MachinePrecision] * N[(-1.0 - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(wj + N[(t$95$1 / N[(-1.0 - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{wj}{wj + 1}\\
t_1 := wj - \frac{x}{e^{wj}}\\
\mathbf{if}\;wj \leq -3.8 \cdot 10^{-6}:\\
\;\;\;\;\left(wj - t\_0\right) + \mathsf{fma}\left(\frac{-1}{wj + 1}, t\_1, t\_0\right)\\
\mathbf{elif}\;wj \leq -5 \cdot 10^{-32}:\\
\;\;\;\;x + wj \cdot \left({wj}^{2} \cdot \left(\left(\left(-1 - \left(x \cdot -3 + \left(-2 \cdot \left(x \cdot -4 + x \cdot 1.5\right) + x \cdot 0.6666666666666666\right)\right)\right) + \frac{1}{wj}\right) - \left(-4 \cdot \frac{x}{wj} + 1.5 \cdot \frac{x}{wj}\right)\right) - x \cdot 2\right)\\
\mathbf{elif}\;wj \leq 5 \cdot 10^{-83}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 - wj\right)\\
\mathbf{elif}\;wj \leq 0.00052:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 + wj \cdot \left(wj + x \cdot \left(\left(\frac{-1}{x} - wj \cdot -2.6666666666666665\right) - 2.5\right)\right)\right)\\
\mathbf{elif}\;wj \leq 0.00055:\\
\;\;\;\;x \cdot \frac{e^{-wj}}{wj + 1}\\
\mathbf{elif}\;wj \leq 0.105:\\
\;\;\;\;wj + \frac{wj \cdot e^{wj} - x}{e^{wj} \cdot \left(-1 - wj\right)}\\
\mathbf{else}:\\
\;\;\;\;wj + \frac{t\_1}{-1 - wj}\\
\end{array}
\end{array}
if wj < -3.8e-6Initial program 59.6%
distribute-rgt1-in97.1%
*-commutative97.1%
associate-/r*97.1%
div-sub59.6%
associate-/l*59.6%
*-inverses97.1%
*-rgt-identity97.1%
Simplified97.1%
*-un-lft-identity97.1%
div-inv97.2%
prod-diff59.8%
associate-/r/59.5%
clear-num59.6%
fma-neg59.6%
*-un-lft-identity59.6%
associate-/r/59.6%
clear-num59.8%
Applied egg-rr59.8%
distribute-neg-frac59.8%
metadata-eval59.8%
Simplified59.8%
Taylor expanded in x around 0 66.8%
+-commutative66.8%
Simplified66.8%
Taylor expanded in x around 0 97.1%
+-commutative97.1%
Simplified97.1%
if -3.8e-6 < wj < -5e-32Initial program 70.8%
distribute-rgt1-in70.7%
*-commutative70.7%
associate-/r*70.8%
div-sub70.8%
associate-/l*70.8%
*-inverses70.8%
*-rgt-identity70.8%
Simplified70.8%
Taylor expanded in wj around 0 98.4%
Taylor expanded in wj around inf 98.5%
if -5e-32 < wj < 5e-83Initial program 81.3%
distribute-rgt1-in81.3%
*-commutative81.3%
associate-/r*81.3%
div-sub81.3%
associate-/l*81.3%
*-inverses81.3%
*-rgt-identity81.3%
Simplified81.3%
Taylor expanded in wj around 0 99.6%
Taylor expanded in x around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in wj around 0 100.0%
if 5e-83 < wj < 5.19999999999999954e-4Initial program 52.2%
distribute-rgt1-in52.1%
*-commutative52.1%
associate-/r*52.3%
div-sub52.3%
associate-/l*52.3%
*-inverses52.3%
*-rgt-identity52.3%
Simplified52.3%
Taylor expanded in wj around 0 99.4%
Taylor expanded in x around 0 99.4%
distribute-lft-out99.4%
*-commutative99.4%
mul-1-neg99.4%
Simplified99.4%
Taylor expanded in x around 0 99.4%
Taylor expanded in x around inf 99.5%
if 5.19999999999999954e-4 < wj < 5.50000000000000033e-4Initial program 100.0%
distribute-rgt1-in98.4%
*-commutative98.4%
associate-/r*98.4%
div-sub98.4%
associate-/l*98.4%
*-inverses98.4%
*-rgt-identity98.4%
Simplified98.4%
Taylor expanded in x around inf 98.4%
+-commutative98.4%
associate-/r*100.0%
exp-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 98.4%
associate-/l*100.0%
+-commutative100.0%
Simplified100.0%
if 5.50000000000000033e-4 < wj < 0.104999999999999996Initial program 94.8%
distribute-rgt1-in94.8%
*-commutative94.8%
Simplified94.8%
if 0.104999999999999996 < wj Initial program 74.6%
distribute-rgt1-in75.0%
*-commutative75.0%
associate-/r*75.0%
div-sub75.0%
associate-/l*75.0%
*-inverses100.0%
*-rgt-identity100.0%
Simplified100.0%
Final simplification99.7%
(FPCore (wj x)
:precision binary64
(let* ((t_0 (+ wj (/ (- wj (/ x (exp wj))) (- -1.0 wj)))))
(if (<= wj -4.5e-6)
t_0
(if (<= wj -5e-32)
(+
x
(*
wj
(-
(*
(pow wj 2.0)
(-
(+
(-
-1.0
(+
(* x -3.0)
(+ (* -2.0 (+ (* x -4.0) (* x 1.5))) (* x 0.6666666666666666))))
(/ 1.0 wj))
(+ (* -4.0 (/ x wj)) (* 1.5 (/ x wj)))))
(* x 2.0))))
(if (<= wj 5e-83)
(- x (* wj (- (* x 2.0) wj)))
(if (<= wj 0.00052)
(-
x
(*
wj
(+
(* x 2.0)
(*
wj
(+
wj
(* x (- (- (/ -1.0 x) (* wj -2.6666666666666665)) 2.5)))))))
(if (<= wj 0.00055)
(* x (/ (exp (- wj)) (+ wj 1.0)))
(if (<= wj 0.11)
(+ wj (/ (- (* wj (exp wj)) x) (* (exp wj) (- -1.0 wj))))
t_0))))))))
double code(double wj, double x) {
double t_0 = wj + ((wj - (x / exp(wj))) / (-1.0 - wj));
double tmp;
if (wj <= -4.5e-6) {
tmp = t_0;
} else if (wj <= -5e-32) {
tmp = x + (wj * ((pow(wj, 2.0) * (((-1.0 - ((x * -3.0) + ((-2.0 * ((x * -4.0) + (x * 1.5))) + (x * 0.6666666666666666)))) + (1.0 / wj)) - ((-4.0 * (x / wj)) + (1.5 * (x / wj))))) - (x * 2.0)));
} else if (wj <= 5e-83) {
tmp = x - (wj * ((x * 2.0) - wj));
} else if (wj <= 0.00052) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5))))));
} else if (wj <= 0.00055) {
tmp = x * (exp(-wj) / (wj + 1.0));
} else if (wj <= 0.11) {
tmp = wj + (((wj * exp(wj)) - x) / (exp(wj) * (-1.0 - wj)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(wj, x)
real(8), intent (in) :: wj
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = wj + ((wj - (x / exp(wj))) / ((-1.0d0) - wj))
if (wj <= (-4.5d-6)) then
tmp = t_0
else if (wj <= (-5d-32)) then
tmp = x + (wj * (((wj ** 2.0d0) * ((((-1.0d0) - ((x * (-3.0d0)) + (((-2.0d0) * ((x * (-4.0d0)) + (x * 1.5d0))) + (x * 0.6666666666666666d0)))) + (1.0d0 / wj)) - (((-4.0d0) * (x / wj)) + (1.5d0 * (x / wj))))) - (x * 2.0d0)))
else if (wj <= 5d-83) then
tmp = x - (wj * ((x * 2.0d0) - wj))
else if (wj <= 0.00052d0) then
tmp = x - (wj * ((x * 2.0d0) + (wj * (wj + (x * ((((-1.0d0) / x) - (wj * (-2.6666666666666665d0))) - 2.5d0))))))
else if (wj <= 0.00055d0) then
tmp = x * (exp(-wj) / (wj + 1.0d0))
else if (wj <= 0.11d0) then
tmp = wj + (((wj * exp(wj)) - x) / (exp(wj) * ((-1.0d0) - wj)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double wj, double x) {
double t_0 = wj + ((wj - (x / Math.exp(wj))) / (-1.0 - wj));
double tmp;
if (wj <= -4.5e-6) {
tmp = t_0;
} else if (wj <= -5e-32) {
tmp = x + (wj * ((Math.pow(wj, 2.0) * (((-1.0 - ((x * -3.0) + ((-2.0 * ((x * -4.0) + (x * 1.5))) + (x * 0.6666666666666666)))) + (1.0 / wj)) - ((-4.0 * (x / wj)) + (1.5 * (x / wj))))) - (x * 2.0)));
} else if (wj <= 5e-83) {
tmp = x - (wj * ((x * 2.0) - wj));
} else if (wj <= 0.00052) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5))))));
} else if (wj <= 0.00055) {
tmp = x * (Math.exp(-wj) / (wj + 1.0));
} else if (wj <= 0.11) {
tmp = wj + (((wj * Math.exp(wj)) - x) / (Math.exp(wj) * (-1.0 - wj)));
} else {
tmp = t_0;
}
return tmp;
}
def code(wj, x): t_0 = wj + ((wj - (x / math.exp(wj))) / (-1.0 - wj)) tmp = 0 if wj <= -4.5e-6: tmp = t_0 elif wj <= -5e-32: tmp = x + (wj * ((math.pow(wj, 2.0) * (((-1.0 - ((x * -3.0) + ((-2.0 * ((x * -4.0) + (x * 1.5))) + (x * 0.6666666666666666)))) + (1.0 / wj)) - ((-4.0 * (x / wj)) + (1.5 * (x / wj))))) - (x * 2.0))) elif wj <= 5e-83: tmp = x - (wj * ((x * 2.0) - wj)) elif wj <= 0.00052: tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5)))))) elif wj <= 0.00055: tmp = x * (math.exp(-wj) / (wj + 1.0)) elif wj <= 0.11: tmp = wj + (((wj * math.exp(wj)) - x) / (math.exp(wj) * (-1.0 - wj))) else: tmp = t_0 return tmp
function code(wj, x) t_0 = Float64(wj + Float64(Float64(wj - Float64(x / exp(wj))) / Float64(-1.0 - wj))) tmp = 0.0 if (wj <= -4.5e-6) tmp = t_0; elseif (wj <= -5e-32) tmp = Float64(x + Float64(wj * Float64(Float64((wj ^ 2.0) * Float64(Float64(Float64(-1.0 - Float64(Float64(x * -3.0) + Float64(Float64(-2.0 * Float64(Float64(x * -4.0) + Float64(x * 1.5))) + Float64(x * 0.6666666666666666)))) + Float64(1.0 / wj)) - Float64(Float64(-4.0 * Float64(x / wj)) + Float64(1.5 * Float64(x / wj))))) - Float64(x * 2.0)))); elseif (wj <= 5e-83) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) - wj))); elseif (wj <= 0.00052) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) + Float64(wj * Float64(wj + Float64(x * Float64(Float64(Float64(-1.0 / x) - Float64(wj * -2.6666666666666665)) - 2.5))))))); elseif (wj <= 0.00055) tmp = Float64(x * Float64(exp(Float64(-wj)) / Float64(wj + 1.0))); elseif (wj <= 0.11) tmp = Float64(wj + Float64(Float64(Float64(wj * exp(wj)) - x) / Float64(exp(wj) * Float64(-1.0 - wj)))); else tmp = t_0; end return tmp end
function tmp_2 = code(wj, x) t_0 = wj + ((wj - (x / exp(wj))) / (-1.0 - wj)); tmp = 0.0; if (wj <= -4.5e-6) tmp = t_0; elseif (wj <= -5e-32) tmp = x + (wj * (((wj ^ 2.0) * (((-1.0 - ((x * -3.0) + ((-2.0 * ((x * -4.0) + (x * 1.5))) + (x * 0.6666666666666666)))) + (1.0 / wj)) - ((-4.0 * (x / wj)) + (1.5 * (x / wj))))) - (x * 2.0))); elseif (wj <= 5e-83) tmp = x - (wj * ((x * 2.0) - wj)); elseif (wj <= 0.00052) tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5)))))); elseif (wj <= 0.00055) tmp = x * (exp(-wj) / (wj + 1.0)); elseif (wj <= 0.11) tmp = wj + (((wj * exp(wj)) - x) / (exp(wj) * (-1.0 - wj))); else tmp = t_0; end tmp_2 = tmp; end
code[wj_, x_] := Block[{t$95$0 = N[(wj + N[(N[(wj - N[(x / N[Exp[wj], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[wj, -4.5e-6], t$95$0, If[LessEqual[wj, -5e-32], N[(x + N[(wj * N[(N[(N[Power[wj, 2.0], $MachinePrecision] * N[(N[(N[(-1.0 - N[(N[(x * -3.0), $MachinePrecision] + N[(N[(-2.0 * N[(N[(x * -4.0), $MachinePrecision] + N[(x * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / wj), $MachinePrecision]), $MachinePrecision] - N[(N[(-4.0 * N[(x / wj), $MachinePrecision]), $MachinePrecision] + N[(1.5 * N[(x / wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 5e-83], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.00052], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] + N[(wj * N[(wj + N[(x * N[(N[(N[(-1.0 / x), $MachinePrecision] - N[(wj * -2.6666666666666665), $MachinePrecision]), $MachinePrecision] - 2.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.00055], N[(x * N[(N[Exp[(-wj)], $MachinePrecision] / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.11], N[(wj + N[(N[(N[(wj * N[Exp[wj], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / N[(N[Exp[wj], $MachinePrecision] * N[(-1.0 - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := wj + \frac{wj - \frac{x}{e^{wj}}}{-1 - wj}\\
\mathbf{if}\;wj \leq -4.5 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;wj \leq -5 \cdot 10^{-32}:\\
\;\;\;\;x + wj \cdot \left({wj}^{2} \cdot \left(\left(\left(-1 - \left(x \cdot -3 + \left(-2 \cdot \left(x \cdot -4 + x \cdot 1.5\right) + x \cdot 0.6666666666666666\right)\right)\right) + \frac{1}{wj}\right) - \left(-4 \cdot \frac{x}{wj} + 1.5 \cdot \frac{x}{wj}\right)\right) - x \cdot 2\right)\\
\mathbf{elif}\;wj \leq 5 \cdot 10^{-83}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 - wj\right)\\
\mathbf{elif}\;wj \leq 0.00052:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 + wj \cdot \left(wj + x \cdot \left(\left(\frac{-1}{x} - wj \cdot -2.6666666666666665\right) - 2.5\right)\right)\right)\\
\mathbf{elif}\;wj \leq 0.00055:\\
\;\;\;\;x \cdot \frac{e^{-wj}}{wj + 1}\\
\mathbf{elif}\;wj \leq 0.11:\\
\;\;\;\;wj + \frac{wj \cdot e^{wj} - x}{e^{wj} \cdot \left(-1 - wj\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if wj < -4.50000000000000011e-6 or 0.110000000000000001 < wj Initial program 64.6%
distribute-rgt1-in89.7%
*-commutative89.7%
associate-/r*89.7%
div-sub64.7%
associate-/l*64.7%
*-inverses98.0%
*-rgt-identity98.0%
Simplified98.0%
if -4.50000000000000011e-6 < wj < -5e-32Initial program 70.8%
distribute-rgt1-in70.7%
*-commutative70.7%
associate-/r*70.8%
div-sub70.8%
associate-/l*70.8%
*-inverses70.8%
*-rgt-identity70.8%
Simplified70.8%
Taylor expanded in wj around 0 98.4%
Taylor expanded in wj around inf 98.5%
if -5e-32 < wj < 5e-83Initial program 81.3%
distribute-rgt1-in81.3%
*-commutative81.3%
associate-/r*81.3%
div-sub81.3%
associate-/l*81.3%
*-inverses81.3%
*-rgt-identity81.3%
Simplified81.3%
Taylor expanded in wj around 0 99.6%
Taylor expanded in x around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in wj around 0 100.0%
if 5e-83 < wj < 5.19999999999999954e-4Initial program 52.2%
distribute-rgt1-in52.1%
*-commutative52.1%
associate-/r*52.3%
div-sub52.3%
associate-/l*52.3%
*-inverses52.3%
*-rgt-identity52.3%
Simplified52.3%
Taylor expanded in wj around 0 99.4%
Taylor expanded in x around 0 99.4%
distribute-lft-out99.4%
*-commutative99.4%
mul-1-neg99.4%
Simplified99.4%
Taylor expanded in x around 0 99.4%
Taylor expanded in x around inf 99.5%
if 5.19999999999999954e-4 < wj < 5.50000000000000033e-4Initial program 100.0%
distribute-rgt1-in98.4%
*-commutative98.4%
associate-/r*98.4%
div-sub98.4%
associate-/l*98.4%
*-inverses98.4%
*-rgt-identity98.4%
Simplified98.4%
Taylor expanded in x around inf 98.4%
+-commutative98.4%
associate-/r*100.0%
exp-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 98.4%
associate-/l*100.0%
+-commutative100.0%
Simplified100.0%
if 5.50000000000000033e-4 < wj < 0.110000000000000001Initial program 94.8%
distribute-rgt1-in94.8%
*-commutative94.8%
Simplified94.8%
Final simplification99.7%
(FPCore (wj x)
:precision binary64
(let* ((t_0 (+ wj (/ (- wj (/ x (exp wj))) (- -1.0 wj)))))
(if (<= wj -3.5e-6)
t_0
(if (<= wj -5e-32)
(+
x
(*
wj
(-
(*
(pow wj 2.0)
(-
(+
(-
-1.0
(+
(* x -3.0)
(+ (* -2.0 (+ (* x -4.0) (* x 1.5))) (* x 0.6666666666666666))))
(/ 1.0 wj))
(+ (* -4.0 (/ x wj)) (* 1.5 (/ x wj)))))
(* x 2.0))))
(if (<= wj 5e-83)
(- x (* wj (- (* x 2.0) wj)))
(if (<= wj 0.00052)
(-
x
(*
wj
(+
(* x 2.0)
(*
wj
(+
wj
(* x (- (- (/ -1.0 x) (* wj -2.6666666666666665)) 2.5)))))))
(if (<= wj 0.00146)
(* x (/ (exp (- wj)) (+ wj 1.0)))
(if (<= wj 0.014)
(+ wj (* wj (/ (exp wj) (* (exp wj) (- -1.0 wj)))))
t_0))))))))
double code(double wj, double x) {
double t_0 = wj + ((wj - (x / exp(wj))) / (-1.0 - wj));
double tmp;
if (wj <= -3.5e-6) {
tmp = t_0;
} else if (wj <= -5e-32) {
tmp = x + (wj * ((pow(wj, 2.0) * (((-1.0 - ((x * -3.0) + ((-2.0 * ((x * -4.0) + (x * 1.5))) + (x * 0.6666666666666666)))) + (1.0 / wj)) - ((-4.0 * (x / wj)) + (1.5 * (x / wj))))) - (x * 2.0)));
} else if (wj <= 5e-83) {
tmp = x - (wj * ((x * 2.0) - wj));
} else if (wj <= 0.00052) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5))))));
} else if (wj <= 0.00146) {
tmp = x * (exp(-wj) / (wj + 1.0));
} else if (wj <= 0.014) {
tmp = wj + (wj * (exp(wj) / (exp(wj) * (-1.0 - wj))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(wj, x)
real(8), intent (in) :: wj
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = wj + ((wj - (x / exp(wj))) / ((-1.0d0) - wj))
if (wj <= (-3.5d-6)) then
tmp = t_0
else if (wj <= (-5d-32)) then
tmp = x + (wj * (((wj ** 2.0d0) * ((((-1.0d0) - ((x * (-3.0d0)) + (((-2.0d0) * ((x * (-4.0d0)) + (x * 1.5d0))) + (x * 0.6666666666666666d0)))) + (1.0d0 / wj)) - (((-4.0d0) * (x / wj)) + (1.5d0 * (x / wj))))) - (x * 2.0d0)))
else if (wj <= 5d-83) then
tmp = x - (wj * ((x * 2.0d0) - wj))
else if (wj <= 0.00052d0) then
tmp = x - (wj * ((x * 2.0d0) + (wj * (wj + (x * ((((-1.0d0) / x) - (wj * (-2.6666666666666665d0))) - 2.5d0))))))
else if (wj <= 0.00146d0) then
tmp = x * (exp(-wj) / (wj + 1.0d0))
else if (wj <= 0.014d0) then
tmp = wj + (wj * (exp(wj) / (exp(wj) * ((-1.0d0) - wj))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double wj, double x) {
double t_0 = wj + ((wj - (x / Math.exp(wj))) / (-1.0 - wj));
double tmp;
if (wj <= -3.5e-6) {
tmp = t_0;
} else if (wj <= -5e-32) {
tmp = x + (wj * ((Math.pow(wj, 2.0) * (((-1.0 - ((x * -3.0) + ((-2.0 * ((x * -4.0) + (x * 1.5))) + (x * 0.6666666666666666)))) + (1.0 / wj)) - ((-4.0 * (x / wj)) + (1.5 * (x / wj))))) - (x * 2.0)));
} else if (wj <= 5e-83) {
tmp = x - (wj * ((x * 2.0) - wj));
} else if (wj <= 0.00052) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5))))));
} else if (wj <= 0.00146) {
tmp = x * (Math.exp(-wj) / (wj + 1.0));
} else if (wj <= 0.014) {
tmp = wj + (wj * (Math.exp(wj) / (Math.exp(wj) * (-1.0 - wj))));
} else {
tmp = t_0;
}
return tmp;
}
def code(wj, x): t_0 = wj + ((wj - (x / math.exp(wj))) / (-1.0 - wj)) tmp = 0 if wj <= -3.5e-6: tmp = t_0 elif wj <= -5e-32: tmp = x + (wj * ((math.pow(wj, 2.0) * (((-1.0 - ((x * -3.0) + ((-2.0 * ((x * -4.0) + (x * 1.5))) + (x * 0.6666666666666666)))) + (1.0 / wj)) - ((-4.0 * (x / wj)) + (1.5 * (x / wj))))) - (x * 2.0))) elif wj <= 5e-83: tmp = x - (wj * ((x * 2.0) - wj)) elif wj <= 0.00052: tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5)))))) elif wj <= 0.00146: tmp = x * (math.exp(-wj) / (wj + 1.0)) elif wj <= 0.014: tmp = wj + (wj * (math.exp(wj) / (math.exp(wj) * (-1.0 - wj)))) else: tmp = t_0 return tmp
function code(wj, x) t_0 = Float64(wj + Float64(Float64(wj - Float64(x / exp(wj))) / Float64(-1.0 - wj))) tmp = 0.0 if (wj <= -3.5e-6) tmp = t_0; elseif (wj <= -5e-32) tmp = Float64(x + Float64(wj * Float64(Float64((wj ^ 2.0) * Float64(Float64(Float64(-1.0 - Float64(Float64(x * -3.0) + Float64(Float64(-2.0 * Float64(Float64(x * -4.0) + Float64(x * 1.5))) + Float64(x * 0.6666666666666666)))) + Float64(1.0 / wj)) - Float64(Float64(-4.0 * Float64(x / wj)) + Float64(1.5 * Float64(x / wj))))) - Float64(x * 2.0)))); elseif (wj <= 5e-83) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) - wj))); elseif (wj <= 0.00052) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) + Float64(wj * Float64(wj + Float64(x * Float64(Float64(Float64(-1.0 / x) - Float64(wj * -2.6666666666666665)) - 2.5))))))); elseif (wj <= 0.00146) tmp = Float64(x * Float64(exp(Float64(-wj)) / Float64(wj + 1.0))); elseif (wj <= 0.014) tmp = Float64(wj + Float64(wj * Float64(exp(wj) / Float64(exp(wj) * Float64(-1.0 - wj))))); else tmp = t_0; end return tmp end
function tmp_2 = code(wj, x) t_0 = wj + ((wj - (x / exp(wj))) / (-1.0 - wj)); tmp = 0.0; if (wj <= -3.5e-6) tmp = t_0; elseif (wj <= -5e-32) tmp = x + (wj * (((wj ^ 2.0) * (((-1.0 - ((x * -3.0) + ((-2.0 * ((x * -4.0) + (x * 1.5))) + (x * 0.6666666666666666)))) + (1.0 / wj)) - ((-4.0 * (x / wj)) + (1.5 * (x / wj))))) - (x * 2.0))); elseif (wj <= 5e-83) tmp = x - (wj * ((x * 2.0) - wj)); elseif (wj <= 0.00052) tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5)))))); elseif (wj <= 0.00146) tmp = x * (exp(-wj) / (wj + 1.0)); elseif (wj <= 0.014) tmp = wj + (wj * (exp(wj) / (exp(wj) * (-1.0 - wj)))); else tmp = t_0; end tmp_2 = tmp; end
code[wj_, x_] := Block[{t$95$0 = N[(wj + N[(N[(wj - N[(x / N[Exp[wj], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[wj, -3.5e-6], t$95$0, If[LessEqual[wj, -5e-32], N[(x + N[(wj * N[(N[(N[Power[wj, 2.0], $MachinePrecision] * N[(N[(N[(-1.0 - N[(N[(x * -3.0), $MachinePrecision] + N[(N[(-2.0 * N[(N[(x * -4.0), $MachinePrecision] + N[(x * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / wj), $MachinePrecision]), $MachinePrecision] - N[(N[(-4.0 * N[(x / wj), $MachinePrecision]), $MachinePrecision] + N[(1.5 * N[(x / wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 5e-83], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.00052], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] + N[(wj * N[(wj + N[(x * N[(N[(N[(-1.0 / x), $MachinePrecision] - N[(wj * -2.6666666666666665), $MachinePrecision]), $MachinePrecision] - 2.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.00146], N[(x * N[(N[Exp[(-wj)], $MachinePrecision] / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.014], N[(wj + N[(wj * N[(N[Exp[wj], $MachinePrecision] / N[(N[Exp[wj], $MachinePrecision] * N[(-1.0 - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := wj + \frac{wj - \frac{x}{e^{wj}}}{-1 - wj}\\
\mathbf{if}\;wj \leq -3.5 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;wj \leq -5 \cdot 10^{-32}:\\
\;\;\;\;x + wj \cdot \left({wj}^{2} \cdot \left(\left(\left(-1 - \left(x \cdot -3 + \left(-2 \cdot \left(x \cdot -4 + x \cdot 1.5\right) + x \cdot 0.6666666666666666\right)\right)\right) + \frac{1}{wj}\right) - \left(-4 \cdot \frac{x}{wj} + 1.5 \cdot \frac{x}{wj}\right)\right) - x \cdot 2\right)\\
\mathbf{elif}\;wj \leq 5 \cdot 10^{-83}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 - wj\right)\\
\mathbf{elif}\;wj \leq 0.00052:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 + wj \cdot \left(wj + x \cdot \left(\left(\frac{-1}{x} - wj \cdot -2.6666666666666665\right) - 2.5\right)\right)\right)\\
\mathbf{elif}\;wj \leq 0.00146:\\
\;\;\;\;x \cdot \frac{e^{-wj}}{wj + 1}\\
\mathbf{elif}\;wj \leq 0.014:\\
\;\;\;\;wj + wj \cdot \frac{e^{wj}}{e^{wj} \cdot \left(-1 - wj\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if wj < -3.49999999999999995e-6 or 0.0140000000000000003 < wj Initial program 64.6%
distribute-rgt1-in89.7%
*-commutative89.7%
associate-/r*89.7%
div-sub64.7%
associate-/l*64.7%
*-inverses98.0%
*-rgt-identity98.0%
Simplified98.0%
if -3.49999999999999995e-6 < wj < -5e-32Initial program 70.8%
distribute-rgt1-in70.7%
*-commutative70.7%
associate-/r*70.8%
div-sub70.8%
associate-/l*70.8%
*-inverses70.8%
*-rgt-identity70.8%
Simplified70.8%
Taylor expanded in wj around 0 98.4%
Taylor expanded in wj around inf 98.5%
if -5e-32 < wj < 5e-83Initial program 81.3%
distribute-rgt1-in81.3%
*-commutative81.3%
associate-/r*81.3%
div-sub81.3%
associate-/l*81.3%
*-inverses81.3%
*-rgt-identity81.3%
Simplified81.3%
Taylor expanded in wj around 0 99.6%
Taylor expanded in x around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in wj around 0 100.0%
if 5e-83 < wj < 5.19999999999999954e-4Initial program 52.2%
distribute-rgt1-in52.1%
*-commutative52.1%
associate-/r*52.3%
div-sub52.3%
associate-/l*52.3%
*-inverses52.3%
*-rgt-identity52.3%
Simplified52.3%
Taylor expanded in wj around 0 99.4%
Taylor expanded in x around 0 99.4%
distribute-lft-out99.4%
*-commutative99.4%
mul-1-neg99.4%
Simplified99.4%
Taylor expanded in x around 0 99.4%
Taylor expanded in x around inf 99.5%
if 5.19999999999999954e-4 < wj < 0.0014599999999999999Initial program 100.0%
distribute-rgt1-in98.4%
*-commutative98.4%
associate-/r*98.4%
div-sub98.4%
associate-/l*98.4%
*-inverses98.4%
*-rgt-identity98.4%
Simplified98.4%
Taylor expanded in x around inf 98.4%
+-commutative98.4%
associate-/r*100.0%
exp-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 98.4%
associate-/l*100.0%
+-commutative100.0%
Simplified100.0%
if 0.0014599999999999999 < wj < 0.0140000000000000003Initial program 94.8%
Taylor expanded in x around 0 94.8%
associate-/l*94.8%
distribute-rgt1-in94.8%
*-commutative94.8%
Simplified94.8%
Final simplification99.7%
(FPCore (wj x)
:precision binary64
(let* ((t_0 (+ wj (/ (- wj (/ x (exp wj))) (- -1.0 wj)))))
(if (<= wj -4.5e-6)
t_0
(if (<= wj -5e-32)
(+
x
(*
wj
(-
(*
(pow wj 2.0)
(-
(+
(-
-1.0
(+
(* x -3.0)
(+ (* -2.0 (+ (* x -4.0) (* x 1.5))) (* x 0.6666666666666666))))
(/ 1.0 wj))
(+ (* -4.0 (/ x wj)) (* 1.5 (/ x wj)))))
(* x 2.0))))
(if (<= wj 5e-83)
(- x (* wj (- (* x 2.0) wj)))
(if (<= wj 3.75e-6)
(-
x
(*
wj
(+
(* x 2.0)
(*
wj
(+
wj
(* x (- (- (/ -1.0 x) (* wj -2.6666666666666665)) 2.5)))))))
(if (<= wj 0.42)
(*
x
(+
(- (/ wj x) (/ (exp (- wj)) (- -1.0 wj)))
(/ wj (* x (- -1.0 wj)))))
t_0)))))))
double code(double wj, double x) {
double t_0 = wj + ((wj - (x / exp(wj))) / (-1.0 - wj));
double tmp;
if (wj <= -4.5e-6) {
tmp = t_0;
} else if (wj <= -5e-32) {
tmp = x + (wj * ((pow(wj, 2.0) * (((-1.0 - ((x * -3.0) + ((-2.0 * ((x * -4.0) + (x * 1.5))) + (x * 0.6666666666666666)))) + (1.0 / wj)) - ((-4.0 * (x / wj)) + (1.5 * (x / wj))))) - (x * 2.0)));
} else if (wj <= 5e-83) {
tmp = x - (wj * ((x * 2.0) - wj));
} else if (wj <= 3.75e-6) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5))))));
} else if (wj <= 0.42) {
tmp = x * (((wj / x) - (exp(-wj) / (-1.0 - wj))) + (wj / (x * (-1.0 - wj))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(wj, x)
real(8), intent (in) :: wj
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = wj + ((wj - (x / exp(wj))) / ((-1.0d0) - wj))
if (wj <= (-4.5d-6)) then
tmp = t_0
else if (wj <= (-5d-32)) then
tmp = x + (wj * (((wj ** 2.0d0) * ((((-1.0d0) - ((x * (-3.0d0)) + (((-2.0d0) * ((x * (-4.0d0)) + (x * 1.5d0))) + (x * 0.6666666666666666d0)))) + (1.0d0 / wj)) - (((-4.0d0) * (x / wj)) + (1.5d0 * (x / wj))))) - (x * 2.0d0)))
else if (wj <= 5d-83) then
tmp = x - (wj * ((x * 2.0d0) - wj))
else if (wj <= 3.75d-6) then
tmp = x - (wj * ((x * 2.0d0) + (wj * (wj + (x * ((((-1.0d0) / x) - (wj * (-2.6666666666666665d0))) - 2.5d0))))))
else if (wj <= 0.42d0) then
tmp = x * (((wj / x) - (exp(-wj) / ((-1.0d0) - wj))) + (wj / (x * ((-1.0d0) - wj))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double wj, double x) {
double t_0 = wj + ((wj - (x / Math.exp(wj))) / (-1.0 - wj));
double tmp;
if (wj <= -4.5e-6) {
tmp = t_0;
} else if (wj <= -5e-32) {
tmp = x + (wj * ((Math.pow(wj, 2.0) * (((-1.0 - ((x * -3.0) + ((-2.0 * ((x * -4.0) + (x * 1.5))) + (x * 0.6666666666666666)))) + (1.0 / wj)) - ((-4.0 * (x / wj)) + (1.5 * (x / wj))))) - (x * 2.0)));
} else if (wj <= 5e-83) {
tmp = x - (wj * ((x * 2.0) - wj));
} else if (wj <= 3.75e-6) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5))))));
} else if (wj <= 0.42) {
tmp = x * (((wj / x) - (Math.exp(-wj) / (-1.0 - wj))) + (wj / (x * (-1.0 - wj))));
} else {
tmp = t_0;
}
return tmp;
}
def code(wj, x): t_0 = wj + ((wj - (x / math.exp(wj))) / (-1.0 - wj)) tmp = 0 if wj <= -4.5e-6: tmp = t_0 elif wj <= -5e-32: tmp = x + (wj * ((math.pow(wj, 2.0) * (((-1.0 - ((x * -3.0) + ((-2.0 * ((x * -4.0) + (x * 1.5))) + (x * 0.6666666666666666)))) + (1.0 / wj)) - ((-4.0 * (x / wj)) + (1.5 * (x / wj))))) - (x * 2.0))) elif wj <= 5e-83: tmp = x - (wj * ((x * 2.0) - wj)) elif wj <= 3.75e-6: tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5)))))) elif wj <= 0.42: tmp = x * (((wj / x) - (math.exp(-wj) / (-1.0 - wj))) + (wj / (x * (-1.0 - wj)))) else: tmp = t_0 return tmp
function code(wj, x) t_0 = Float64(wj + Float64(Float64(wj - Float64(x / exp(wj))) / Float64(-1.0 - wj))) tmp = 0.0 if (wj <= -4.5e-6) tmp = t_0; elseif (wj <= -5e-32) tmp = Float64(x + Float64(wj * Float64(Float64((wj ^ 2.0) * Float64(Float64(Float64(-1.0 - Float64(Float64(x * -3.0) + Float64(Float64(-2.0 * Float64(Float64(x * -4.0) + Float64(x * 1.5))) + Float64(x * 0.6666666666666666)))) + Float64(1.0 / wj)) - Float64(Float64(-4.0 * Float64(x / wj)) + Float64(1.5 * Float64(x / wj))))) - Float64(x * 2.0)))); elseif (wj <= 5e-83) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) - wj))); elseif (wj <= 3.75e-6) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) + Float64(wj * Float64(wj + Float64(x * Float64(Float64(Float64(-1.0 / x) - Float64(wj * -2.6666666666666665)) - 2.5))))))); elseif (wj <= 0.42) tmp = Float64(x * Float64(Float64(Float64(wj / x) - Float64(exp(Float64(-wj)) / Float64(-1.0 - wj))) + Float64(wj / Float64(x * Float64(-1.0 - wj))))); else tmp = t_0; end return tmp end
function tmp_2 = code(wj, x) t_0 = wj + ((wj - (x / exp(wj))) / (-1.0 - wj)); tmp = 0.0; if (wj <= -4.5e-6) tmp = t_0; elseif (wj <= -5e-32) tmp = x + (wj * (((wj ^ 2.0) * (((-1.0 - ((x * -3.0) + ((-2.0 * ((x * -4.0) + (x * 1.5))) + (x * 0.6666666666666666)))) + (1.0 / wj)) - ((-4.0 * (x / wj)) + (1.5 * (x / wj))))) - (x * 2.0))); elseif (wj <= 5e-83) tmp = x - (wj * ((x * 2.0) - wj)); elseif (wj <= 3.75e-6) tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5)))))); elseif (wj <= 0.42) tmp = x * (((wj / x) - (exp(-wj) / (-1.0 - wj))) + (wj / (x * (-1.0 - wj)))); else tmp = t_0; end tmp_2 = tmp; end
code[wj_, x_] := Block[{t$95$0 = N[(wj + N[(N[(wj - N[(x / N[Exp[wj], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[wj, -4.5e-6], t$95$0, If[LessEqual[wj, -5e-32], N[(x + N[(wj * N[(N[(N[Power[wj, 2.0], $MachinePrecision] * N[(N[(N[(-1.0 - N[(N[(x * -3.0), $MachinePrecision] + N[(N[(-2.0 * N[(N[(x * -4.0), $MachinePrecision] + N[(x * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / wj), $MachinePrecision]), $MachinePrecision] - N[(N[(-4.0 * N[(x / wj), $MachinePrecision]), $MachinePrecision] + N[(1.5 * N[(x / wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 5e-83], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 3.75e-6], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] + N[(wj * N[(wj + N[(x * N[(N[(N[(-1.0 / x), $MachinePrecision] - N[(wj * -2.6666666666666665), $MachinePrecision]), $MachinePrecision] - 2.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.42], N[(x * N[(N[(N[(wj / x), $MachinePrecision] - N[(N[Exp[(-wj)], $MachinePrecision] / N[(-1.0 - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(wj / N[(x * N[(-1.0 - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := wj + \frac{wj - \frac{x}{e^{wj}}}{-1 - wj}\\
\mathbf{if}\;wj \leq -4.5 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;wj \leq -5 \cdot 10^{-32}:\\
\;\;\;\;x + wj \cdot \left({wj}^{2} \cdot \left(\left(\left(-1 - \left(x \cdot -3 + \left(-2 \cdot \left(x \cdot -4 + x \cdot 1.5\right) + x \cdot 0.6666666666666666\right)\right)\right) + \frac{1}{wj}\right) - \left(-4 \cdot \frac{x}{wj} + 1.5 \cdot \frac{x}{wj}\right)\right) - x \cdot 2\right)\\
\mathbf{elif}\;wj \leq 5 \cdot 10^{-83}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 - wj\right)\\
\mathbf{elif}\;wj \leq 3.75 \cdot 10^{-6}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 + wj \cdot \left(wj + x \cdot \left(\left(\frac{-1}{x} - wj \cdot -2.6666666666666665\right) - 2.5\right)\right)\right)\\
\mathbf{elif}\;wj \leq 0.42:\\
\;\;\;\;x \cdot \left(\left(\frac{wj}{x} - \frac{e^{-wj}}{-1 - wj}\right) + \frac{wj}{x \cdot \left(-1 - wj\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if wj < -4.50000000000000011e-6 or 0.419999999999999984 < wj Initial program 64.6%
distribute-rgt1-in89.7%
*-commutative89.7%
associate-/r*89.7%
div-sub64.7%
associate-/l*64.7%
*-inverses98.0%
*-rgt-identity98.0%
Simplified98.0%
if -4.50000000000000011e-6 < wj < -5e-32Initial program 70.8%
distribute-rgt1-in70.7%
*-commutative70.7%
associate-/r*70.8%
div-sub70.8%
associate-/l*70.8%
*-inverses70.8%
*-rgt-identity70.8%
Simplified70.8%
Taylor expanded in wj around 0 98.4%
Taylor expanded in wj around inf 98.5%
if -5e-32 < wj < 5e-83Initial program 81.3%
distribute-rgt1-in81.3%
*-commutative81.3%
associate-/r*81.3%
div-sub81.3%
associate-/l*81.3%
*-inverses81.3%
*-rgt-identity81.3%
Simplified81.3%
Taylor expanded in wj around 0 99.6%
Taylor expanded in x around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in wj around 0 100.0%
if 5e-83 < wj < 3.7500000000000001e-6Initial program 52.2%
distribute-rgt1-in52.1%
*-commutative52.1%
associate-/r*52.3%
div-sub52.3%
associate-/l*52.3%
*-inverses52.3%
*-rgt-identity52.3%
Simplified52.3%
Taylor expanded in wj around 0 99.4%
Taylor expanded in x around 0 99.4%
distribute-lft-out99.4%
*-commutative99.4%
mul-1-neg99.4%
Simplified99.4%
Taylor expanded in x around 0 99.4%
Taylor expanded in x around inf 99.5%
if 3.7500000000000001e-6 < wj < 0.419999999999999984Initial program 97.4%
distribute-rgt1-in96.6%
*-commutative96.6%
associate-/r*94.7%
div-sub94.7%
associate-/l*94.7%
*-inverses94.7%
*-rgt-identity94.7%
Simplified94.7%
Taylor expanded in x around inf 95.0%
+-commutative95.0%
associate-/r*95.8%
exp-neg95.8%
+-commutative95.8%
+-commutative95.8%
Simplified95.8%
Final simplification99.7%
(FPCore (wj x)
:precision binary64
(let* ((t_0 (+ wj (/ (- wj (/ x (exp wj))) (- -1.0 wj))))
(t_1 (- (- (/ -1.0 x) (* wj -2.6666666666666665)) 2.5)))
(if (<= wj -4.5e-6)
t_0
(if (<= wj -5e-32)
(- x (* wj (+ (* x 2.0) (* wj (* x (+ (/ wj x) t_1))))))
(if (<= wj 5e-83)
(- x (* wj (- (* x 2.0) wj)))
(if (<= wj 4.6e-6)
(- x (* wj (+ (* x 2.0) (* wj (+ wj (* x t_1))))))
(if (<= wj 0.245)
(*
x
(+
(- (/ wj x) (/ (exp (- wj)) (- -1.0 wj)))
(/ wj (* x (- -1.0 wj)))))
t_0)))))))
double code(double wj, double x) {
double t_0 = wj + ((wj - (x / exp(wj))) / (-1.0 - wj));
double t_1 = ((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5;
double tmp;
if (wj <= -4.5e-6) {
tmp = t_0;
} else if (wj <= -5e-32) {
tmp = x - (wj * ((x * 2.0) + (wj * (x * ((wj / x) + t_1)))));
} else if (wj <= 5e-83) {
tmp = x - (wj * ((x * 2.0) - wj));
} else if (wj <= 4.6e-6) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * t_1)))));
} else if (wj <= 0.245) {
tmp = x * (((wj / x) - (exp(-wj) / (-1.0 - wj))) + (wj / (x * (-1.0 - wj))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(wj, x)
real(8), intent (in) :: wj
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = wj + ((wj - (x / exp(wj))) / ((-1.0d0) - wj))
t_1 = (((-1.0d0) / x) - (wj * (-2.6666666666666665d0))) - 2.5d0
if (wj <= (-4.5d-6)) then
tmp = t_0
else if (wj <= (-5d-32)) then
tmp = x - (wj * ((x * 2.0d0) + (wj * (x * ((wj / x) + t_1)))))
else if (wj <= 5d-83) then
tmp = x - (wj * ((x * 2.0d0) - wj))
else if (wj <= 4.6d-6) then
tmp = x - (wj * ((x * 2.0d0) + (wj * (wj + (x * t_1)))))
else if (wj <= 0.245d0) then
tmp = x * (((wj / x) - (exp(-wj) / ((-1.0d0) - wj))) + (wj / (x * ((-1.0d0) - wj))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double wj, double x) {
double t_0 = wj + ((wj - (x / Math.exp(wj))) / (-1.0 - wj));
double t_1 = ((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5;
double tmp;
if (wj <= -4.5e-6) {
tmp = t_0;
} else if (wj <= -5e-32) {
tmp = x - (wj * ((x * 2.0) + (wj * (x * ((wj / x) + t_1)))));
} else if (wj <= 5e-83) {
tmp = x - (wj * ((x * 2.0) - wj));
} else if (wj <= 4.6e-6) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * t_1)))));
} else if (wj <= 0.245) {
tmp = x * (((wj / x) - (Math.exp(-wj) / (-1.0 - wj))) + (wj / (x * (-1.0 - wj))));
} else {
tmp = t_0;
}
return tmp;
}
def code(wj, x): t_0 = wj + ((wj - (x / math.exp(wj))) / (-1.0 - wj)) t_1 = ((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5 tmp = 0 if wj <= -4.5e-6: tmp = t_0 elif wj <= -5e-32: tmp = x - (wj * ((x * 2.0) + (wj * (x * ((wj / x) + t_1))))) elif wj <= 5e-83: tmp = x - (wj * ((x * 2.0) - wj)) elif wj <= 4.6e-6: tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * t_1))))) elif wj <= 0.245: tmp = x * (((wj / x) - (math.exp(-wj) / (-1.0 - wj))) + (wj / (x * (-1.0 - wj)))) else: tmp = t_0 return tmp
function code(wj, x) t_0 = Float64(wj + Float64(Float64(wj - Float64(x / exp(wj))) / Float64(-1.0 - wj))) t_1 = Float64(Float64(Float64(-1.0 / x) - Float64(wj * -2.6666666666666665)) - 2.5) tmp = 0.0 if (wj <= -4.5e-6) tmp = t_0; elseif (wj <= -5e-32) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) + Float64(wj * Float64(x * Float64(Float64(wj / x) + t_1)))))); elseif (wj <= 5e-83) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) - wj))); elseif (wj <= 4.6e-6) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) + Float64(wj * Float64(wj + Float64(x * t_1)))))); elseif (wj <= 0.245) tmp = Float64(x * Float64(Float64(Float64(wj / x) - Float64(exp(Float64(-wj)) / Float64(-1.0 - wj))) + Float64(wj / Float64(x * Float64(-1.0 - wj))))); else tmp = t_0; end return tmp end
function tmp_2 = code(wj, x) t_0 = wj + ((wj - (x / exp(wj))) / (-1.0 - wj)); t_1 = ((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5; tmp = 0.0; if (wj <= -4.5e-6) tmp = t_0; elseif (wj <= -5e-32) tmp = x - (wj * ((x * 2.0) + (wj * (x * ((wj / x) + t_1))))); elseif (wj <= 5e-83) tmp = x - (wj * ((x * 2.0) - wj)); elseif (wj <= 4.6e-6) tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * t_1))))); elseif (wj <= 0.245) tmp = x * (((wj / x) - (exp(-wj) / (-1.0 - wj))) + (wj / (x * (-1.0 - wj)))); else tmp = t_0; end tmp_2 = tmp; end
code[wj_, x_] := Block[{t$95$0 = N[(wj + N[(N[(wj - N[(x / N[Exp[wj], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(-1.0 / x), $MachinePrecision] - N[(wj * -2.6666666666666665), $MachinePrecision]), $MachinePrecision] - 2.5), $MachinePrecision]}, If[LessEqual[wj, -4.5e-6], t$95$0, If[LessEqual[wj, -5e-32], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] + N[(wj * N[(x * N[(N[(wj / x), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 5e-83], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 4.6e-6], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] + N[(wj * N[(wj + N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.245], N[(x * N[(N[(N[(wj / x), $MachinePrecision] - N[(N[Exp[(-wj)], $MachinePrecision] / N[(-1.0 - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(wj / N[(x * N[(-1.0 - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := wj + \frac{wj - \frac{x}{e^{wj}}}{-1 - wj}\\
t_1 := \left(\frac{-1}{x} - wj \cdot -2.6666666666666665\right) - 2.5\\
\mathbf{if}\;wj \leq -4.5 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;wj \leq -5 \cdot 10^{-32}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 + wj \cdot \left(x \cdot \left(\frac{wj}{x} + t\_1\right)\right)\right)\\
\mathbf{elif}\;wj \leq 5 \cdot 10^{-83}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 - wj\right)\\
\mathbf{elif}\;wj \leq 4.6 \cdot 10^{-6}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 + wj \cdot \left(wj + x \cdot t\_1\right)\right)\\
\mathbf{elif}\;wj \leq 0.245:\\
\;\;\;\;x \cdot \left(\left(\frac{wj}{x} - \frac{e^{-wj}}{-1 - wj}\right) + \frac{wj}{x \cdot \left(-1 - wj\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if wj < -4.50000000000000011e-6 or 0.245 < wj Initial program 64.6%
distribute-rgt1-in89.7%
*-commutative89.7%
associate-/r*89.7%
div-sub64.7%
associate-/l*64.7%
*-inverses98.0%
*-rgt-identity98.0%
Simplified98.0%
if -4.50000000000000011e-6 < wj < -5e-32Initial program 70.8%
distribute-rgt1-in70.7%
*-commutative70.7%
associate-/r*70.8%
div-sub70.8%
associate-/l*70.8%
*-inverses70.8%
*-rgt-identity70.8%
Simplified70.8%
Taylor expanded in wj around 0 98.4%
Taylor expanded in x around 0 98.4%
distribute-lft-out98.4%
*-commutative98.4%
mul-1-neg98.4%
Simplified98.4%
Taylor expanded in x around inf 98.4%
if -5e-32 < wj < 5e-83Initial program 81.3%
distribute-rgt1-in81.3%
*-commutative81.3%
associate-/r*81.3%
div-sub81.3%
associate-/l*81.3%
*-inverses81.3%
*-rgt-identity81.3%
Simplified81.3%
Taylor expanded in wj around 0 99.6%
Taylor expanded in x around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in wj around 0 100.0%
if 5e-83 < wj < 4.6e-6Initial program 52.2%
distribute-rgt1-in52.1%
*-commutative52.1%
associate-/r*52.3%
div-sub52.3%
associate-/l*52.3%
*-inverses52.3%
*-rgt-identity52.3%
Simplified52.3%
Taylor expanded in wj around 0 99.4%
Taylor expanded in x around 0 99.4%
distribute-lft-out99.4%
*-commutative99.4%
mul-1-neg99.4%
Simplified99.4%
Taylor expanded in x around 0 99.4%
Taylor expanded in x around inf 99.5%
if 4.6e-6 < wj < 0.245Initial program 97.4%
distribute-rgt1-in96.6%
*-commutative96.6%
associate-/r*94.7%
div-sub94.7%
associate-/l*94.7%
*-inverses94.7%
*-rgt-identity94.7%
Simplified94.7%
Taylor expanded in x around inf 95.0%
+-commutative95.0%
associate-/r*95.8%
exp-neg95.8%
+-commutative95.8%
+-commutative95.8%
Simplified95.8%
Final simplification99.7%
(FPCore (wj x)
:precision binary64
(let* ((t_0 (+ wj (/ (- wj (/ x (exp wj))) (- -1.0 wj))))
(t_1 (- (- (/ -1.0 x) (* wj -2.6666666666666665)) 2.5)))
(if (<= wj -3.3e-6)
t_0
(if (<= wj -5e-32)
(- x (* wj (+ (* x 2.0) (* wj (* x (+ (/ wj x) t_1))))))
(if (<= wj 5e-83)
(- x (* wj (- (* x 2.0) wj)))
(if (<= wj 0.00052)
(- x (* wj (+ (* x 2.0) (* wj (+ wj (* x t_1))))))
(if (<= wj 0.00185)
(* x (/ (exp (- wj)) (+ wj 1.0)))
(if (<= wj 0.014) (- wj (/ wj (+ wj 1.0))) t_0))))))))
double code(double wj, double x) {
double t_0 = wj + ((wj - (x / exp(wj))) / (-1.0 - wj));
double t_1 = ((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5;
double tmp;
if (wj <= -3.3e-6) {
tmp = t_0;
} else if (wj <= -5e-32) {
tmp = x - (wj * ((x * 2.0) + (wj * (x * ((wj / x) + t_1)))));
} else if (wj <= 5e-83) {
tmp = x - (wj * ((x * 2.0) - wj));
} else if (wj <= 0.00052) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * t_1)))));
} else if (wj <= 0.00185) {
tmp = x * (exp(-wj) / (wj + 1.0));
} else if (wj <= 0.014) {
tmp = wj - (wj / (wj + 1.0));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(wj, x)
real(8), intent (in) :: wj
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = wj + ((wj - (x / exp(wj))) / ((-1.0d0) - wj))
t_1 = (((-1.0d0) / x) - (wj * (-2.6666666666666665d0))) - 2.5d0
if (wj <= (-3.3d-6)) then
tmp = t_0
else if (wj <= (-5d-32)) then
tmp = x - (wj * ((x * 2.0d0) + (wj * (x * ((wj / x) + t_1)))))
else if (wj <= 5d-83) then
tmp = x - (wj * ((x * 2.0d0) - wj))
else if (wj <= 0.00052d0) then
tmp = x - (wj * ((x * 2.0d0) + (wj * (wj + (x * t_1)))))
else if (wj <= 0.00185d0) then
tmp = x * (exp(-wj) / (wj + 1.0d0))
else if (wj <= 0.014d0) then
tmp = wj - (wj / (wj + 1.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double wj, double x) {
double t_0 = wj + ((wj - (x / Math.exp(wj))) / (-1.0 - wj));
double t_1 = ((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5;
double tmp;
if (wj <= -3.3e-6) {
tmp = t_0;
} else if (wj <= -5e-32) {
tmp = x - (wj * ((x * 2.0) + (wj * (x * ((wj / x) + t_1)))));
} else if (wj <= 5e-83) {
tmp = x - (wj * ((x * 2.0) - wj));
} else if (wj <= 0.00052) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * t_1)))));
} else if (wj <= 0.00185) {
tmp = x * (Math.exp(-wj) / (wj + 1.0));
} else if (wj <= 0.014) {
tmp = wj - (wj / (wj + 1.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(wj, x): t_0 = wj + ((wj - (x / math.exp(wj))) / (-1.0 - wj)) t_1 = ((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5 tmp = 0 if wj <= -3.3e-6: tmp = t_0 elif wj <= -5e-32: tmp = x - (wj * ((x * 2.0) + (wj * (x * ((wj / x) + t_1))))) elif wj <= 5e-83: tmp = x - (wj * ((x * 2.0) - wj)) elif wj <= 0.00052: tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * t_1))))) elif wj <= 0.00185: tmp = x * (math.exp(-wj) / (wj + 1.0)) elif wj <= 0.014: tmp = wj - (wj / (wj + 1.0)) else: tmp = t_0 return tmp
function code(wj, x) t_0 = Float64(wj + Float64(Float64(wj - Float64(x / exp(wj))) / Float64(-1.0 - wj))) t_1 = Float64(Float64(Float64(-1.0 / x) - Float64(wj * -2.6666666666666665)) - 2.5) tmp = 0.0 if (wj <= -3.3e-6) tmp = t_0; elseif (wj <= -5e-32) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) + Float64(wj * Float64(x * Float64(Float64(wj / x) + t_1)))))); elseif (wj <= 5e-83) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) - wj))); elseif (wj <= 0.00052) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) + Float64(wj * Float64(wj + Float64(x * t_1)))))); elseif (wj <= 0.00185) tmp = Float64(x * Float64(exp(Float64(-wj)) / Float64(wj + 1.0))); elseif (wj <= 0.014) tmp = Float64(wj - Float64(wj / Float64(wj + 1.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(wj, x) t_0 = wj + ((wj - (x / exp(wj))) / (-1.0 - wj)); t_1 = ((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5; tmp = 0.0; if (wj <= -3.3e-6) tmp = t_0; elseif (wj <= -5e-32) tmp = x - (wj * ((x * 2.0) + (wj * (x * ((wj / x) + t_1))))); elseif (wj <= 5e-83) tmp = x - (wj * ((x * 2.0) - wj)); elseif (wj <= 0.00052) tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * t_1))))); elseif (wj <= 0.00185) tmp = x * (exp(-wj) / (wj + 1.0)); elseif (wj <= 0.014) tmp = wj - (wj / (wj + 1.0)); else tmp = t_0; end tmp_2 = tmp; end
code[wj_, x_] := Block[{t$95$0 = N[(wj + N[(N[(wj - N[(x / N[Exp[wj], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(-1.0 / x), $MachinePrecision] - N[(wj * -2.6666666666666665), $MachinePrecision]), $MachinePrecision] - 2.5), $MachinePrecision]}, If[LessEqual[wj, -3.3e-6], t$95$0, If[LessEqual[wj, -5e-32], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] + N[(wj * N[(x * N[(N[(wj / x), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 5e-83], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.00052], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] + N[(wj * N[(wj + N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.00185], N[(x * N[(N[Exp[(-wj)], $MachinePrecision] / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.014], N[(wj - N[(wj / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := wj + \frac{wj - \frac{x}{e^{wj}}}{-1 - wj}\\
t_1 := \left(\frac{-1}{x} - wj \cdot -2.6666666666666665\right) - 2.5\\
\mathbf{if}\;wj \leq -3.3 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;wj \leq -5 \cdot 10^{-32}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 + wj \cdot \left(x \cdot \left(\frac{wj}{x} + t\_1\right)\right)\right)\\
\mathbf{elif}\;wj \leq 5 \cdot 10^{-83}:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 - wj\right)\\
\mathbf{elif}\;wj \leq 0.00052:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 + wj \cdot \left(wj + x \cdot t\_1\right)\right)\\
\mathbf{elif}\;wj \leq 0.00185:\\
\;\;\;\;x \cdot \frac{e^{-wj}}{wj + 1}\\
\mathbf{elif}\;wj \leq 0.014:\\
\;\;\;\;wj - \frac{wj}{wj + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if wj < -3.30000000000000017e-6 or 0.0140000000000000003 < wj Initial program 64.6%
distribute-rgt1-in89.7%
*-commutative89.7%
associate-/r*89.7%
div-sub64.7%
associate-/l*64.7%
*-inverses98.0%
*-rgt-identity98.0%
Simplified98.0%
if -3.30000000000000017e-6 < wj < -5e-32Initial program 70.8%
distribute-rgt1-in70.7%
*-commutative70.7%
associate-/r*70.8%
div-sub70.8%
associate-/l*70.8%
*-inverses70.8%
*-rgt-identity70.8%
Simplified70.8%
Taylor expanded in wj around 0 98.4%
Taylor expanded in x around 0 98.4%
distribute-lft-out98.4%
*-commutative98.4%
mul-1-neg98.4%
Simplified98.4%
Taylor expanded in x around inf 98.4%
if -5e-32 < wj < 5e-83Initial program 81.3%
distribute-rgt1-in81.3%
*-commutative81.3%
associate-/r*81.3%
div-sub81.3%
associate-/l*81.3%
*-inverses81.3%
*-rgt-identity81.3%
Simplified81.3%
Taylor expanded in wj around 0 99.6%
Taylor expanded in x around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in wj around 0 100.0%
if 5e-83 < wj < 5.19999999999999954e-4Initial program 52.2%
distribute-rgt1-in52.1%
*-commutative52.1%
associate-/r*52.3%
div-sub52.3%
associate-/l*52.3%
*-inverses52.3%
*-rgt-identity52.3%
Simplified52.3%
Taylor expanded in wj around 0 99.4%
Taylor expanded in x around 0 99.4%
distribute-lft-out99.4%
*-commutative99.4%
mul-1-neg99.4%
Simplified99.4%
Taylor expanded in x around 0 99.4%
Taylor expanded in x around inf 99.5%
if 5.19999999999999954e-4 < wj < 0.0018500000000000001Initial program 100.0%
distribute-rgt1-in98.4%
*-commutative98.4%
associate-/r*98.4%
div-sub98.4%
associate-/l*98.4%
*-inverses98.4%
*-rgt-identity98.4%
Simplified98.4%
Taylor expanded in x around inf 98.4%
+-commutative98.4%
associate-/r*100.0%
exp-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 98.4%
associate-/l*100.0%
+-commutative100.0%
Simplified100.0%
if 0.0018500000000000001 < wj < 0.0140000000000000003Initial program 94.8%
distribute-rgt1-in94.8%
*-commutative94.8%
associate-/r*90.9%
div-sub90.9%
associate-/l*90.9%
*-inverses90.9%
*-rgt-identity90.9%
Simplified90.9%
Taylor expanded in x around 0 90.9%
+-commutative90.6%
Simplified90.9%
Final simplification99.7%
(FPCore (wj x)
:precision binary64
(let* ((t_0 (/ x (* (+ wj 1.0) (exp wj)))))
(if (<= wj -0.018)
t_0
(if (<= wj 5e-83)
(+
x
(*
wj
(-
(* wj (- (+ 1.0 (* x (+ 2.5 (* wj -2.6666666666666665)))) wj))
(* x 2.0))))
(if (<= wj 0.00052)
(-
x
(*
wj
(+
(* x 2.0)
(*
wj
(+ wj (* x (- (- (/ -1.0 x) (* wj -2.6666666666666665)) 2.5)))))))
(if (<= wj 0.00215)
(* x (/ (exp (- wj)) (+ wj 1.0)))
(if (or (<= wj 0.021) (not (<= wj 3.5)))
(- wj (/ wj (+ wj 1.0)))
t_0)))))))
double code(double wj, double x) {
double t_0 = x / ((wj + 1.0) * exp(wj));
double tmp;
if (wj <= -0.018) {
tmp = t_0;
} else if (wj <= 5e-83) {
tmp = x + (wj * ((wj * ((1.0 + (x * (2.5 + (wj * -2.6666666666666665)))) - wj)) - (x * 2.0)));
} else if (wj <= 0.00052) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5))))));
} else if (wj <= 0.00215) {
tmp = x * (exp(-wj) / (wj + 1.0));
} else if ((wj <= 0.021) || !(wj <= 3.5)) {
tmp = wj - (wj / (wj + 1.0));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(wj, x)
real(8), intent (in) :: wj
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / ((wj + 1.0d0) * exp(wj))
if (wj <= (-0.018d0)) then
tmp = t_0
else if (wj <= 5d-83) then
tmp = x + (wj * ((wj * ((1.0d0 + (x * (2.5d0 + (wj * (-2.6666666666666665d0))))) - wj)) - (x * 2.0d0)))
else if (wj <= 0.00052d0) then
tmp = x - (wj * ((x * 2.0d0) + (wj * (wj + (x * ((((-1.0d0) / x) - (wj * (-2.6666666666666665d0))) - 2.5d0))))))
else if (wj <= 0.00215d0) then
tmp = x * (exp(-wj) / (wj + 1.0d0))
else if ((wj <= 0.021d0) .or. (.not. (wj <= 3.5d0))) then
tmp = wj - (wj / (wj + 1.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double wj, double x) {
double t_0 = x / ((wj + 1.0) * Math.exp(wj));
double tmp;
if (wj <= -0.018) {
tmp = t_0;
} else if (wj <= 5e-83) {
tmp = x + (wj * ((wj * ((1.0 + (x * (2.5 + (wj * -2.6666666666666665)))) - wj)) - (x * 2.0)));
} else if (wj <= 0.00052) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5))))));
} else if (wj <= 0.00215) {
tmp = x * (Math.exp(-wj) / (wj + 1.0));
} else if ((wj <= 0.021) || !(wj <= 3.5)) {
tmp = wj - (wj / (wj + 1.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(wj, x): t_0 = x / ((wj + 1.0) * math.exp(wj)) tmp = 0 if wj <= -0.018: tmp = t_0 elif wj <= 5e-83: tmp = x + (wj * ((wj * ((1.0 + (x * (2.5 + (wj * -2.6666666666666665)))) - wj)) - (x * 2.0))) elif wj <= 0.00052: tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5)))))) elif wj <= 0.00215: tmp = x * (math.exp(-wj) / (wj + 1.0)) elif (wj <= 0.021) or not (wj <= 3.5): tmp = wj - (wj / (wj + 1.0)) else: tmp = t_0 return tmp
function code(wj, x) t_0 = Float64(x / Float64(Float64(wj + 1.0) * exp(wj))) tmp = 0.0 if (wj <= -0.018) tmp = t_0; elseif (wj <= 5e-83) tmp = Float64(x + Float64(wj * Float64(Float64(wj * Float64(Float64(1.0 + Float64(x * Float64(2.5 + Float64(wj * -2.6666666666666665)))) - wj)) - Float64(x * 2.0)))); elseif (wj <= 0.00052) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) + Float64(wj * Float64(wj + Float64(x * Float64(Float64(Float64(-1.0 / x) - Float64(wj * -2.6666666666666665)) - 2.5))))))); elseif (wj <= 0.00215) tmp = Float64(x * Float64(exp(Float64(-wj)) / Float64(wj + 1.0))); elseif ((wj <= 0.021) || !(wj <= 3.5)) tmp = Float64(wj - Float64(wj / Float64(wj + 1.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(wj, x) t_0 = x / ((wj + 1.0) * exp(wj)); tmp = 0.0; if (wj <= -0.018) tmp = t_0; elseif (wj <= 5e-83) tmp = x + (wj * ((wj * ((1.0 + (x * (2.5 + (wj * -2.6666666666666665)))) - wj)) - (x * 2.0))); elseif (wj <= 0.00052) tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5)))))); elseif (wj <= 0.00215) tmp = x * (exp(-wj) / (wj + 1.0)); elseif ((wj <= 0.021) || ~((wj <= 3.5))) tmp = wj - (wj / (wj + 1.0)); else tmp = t_0; end tmp_2 = tmp; end
code[wj_, x_] := Block[{t$95$0 = N[(x / N[(N[(wj + 1.0), $MachinePrecision] * N[Exp[wj], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[wj, -0.018], t$95$0, If[LessEqual[wj, 5e-83], N[(x + N[(wj * N[(N[(wj * N[(N[(1.0 + N[(x * N[(2.5 + N[(wj * -2.6666666666666665), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - wj), $MachinePrecision]), $MachinePrecision] - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.00052], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] + N[(wj * N[(wj + N[(x * N[(N[(N[(-1.0 / x), $MachinePrecision] - N[(wj * -2.6666666666666665), $MachinePrecision]), $MachinePrecision] - 2.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.00215], N[(x * N[(N[Exp[(-wj)], $MachinePrecision] / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[wj, 0.021], N[Not[LessEqual[wj, 3.5]], $MachinePrecision]], N[(wj - N[(wj / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\left(wj + 1\right) \cdot e^{wj}}\\
\mathbf{if}\;wj \leq -0.018:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;wj \leq 5 \cdot 10^{-83}:\\
\;\;\;\;x + wj \cdot \left(wj \cdot \left(\left(1 + x \cdot \left(2.5 + wj \cdot -2.6666666666666665\right)\right) - wj\right) - x \cdot 2\right)\\
\mathbf{elif}\;wj \leq 0.00052:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 + wj \cdot \left(wj + x \cdot \left(\left(\frac{-1}{x} - wj \cdot -2.6666666666666665\right) - 2.5\right)\right)\right)\\
\mathbf{elif}\;wj \leq 0.00215:\\
\;\;\;\;x \cdot \frac{e^{-wj}}{wj + 1}\\
\mathbf{elif}\;wj \leq 0.021 \lor \neg \left(wj \leq 3.5\right):\\
\;\;\;\;wj - \frac{wj}{wj + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if wj < -0.0179999999999999986 or 0.0210000000000000013 < wj < 3.5Initial program 56.7%
distribute-rgt1-in100.0%
*-commutative100.0%
associate-/r*99.8%
div-sub56.9%
associate-/l*56.9%
*-inverses99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in x around inf 86.0%
+-commutative86.0%
Simplified86.0%
if -0.0179999999999999986 < wj < 5e-83Initial program 80.7%
distribute-rgt1-in80.7%
*-commutative80.7%
associate-/r*80.7%
div-sub80.7%
associate-/l*80.7%
*-inverses80.7%
*-rgt-identity80.7%
Simplified80.7%
Taylor expanded in wj around 0 99.2%
Taylor expanded in x around 0 99.6%
distribute-lft-out99.6%
*-commutative99.6%
mul-1-neg99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
if 5e-83 < wj < 5.19999999999999954e-4Initial program 52.2%
distribute-rgt1-in52.1%
*-commutative52.1%
associate-/r*52.3%
div-sub52.3%
associate-/l*52.3%
*-inverses52.3%
*-rgt-identity52.3%
Simplified52.3%
Taylor expanded in wj around 0 99.4%
Taylor expanded in x around 0 99.4%
distribute-lft-out99.4%
*-commutative99.4%
mul-1-neg99.4%
Simplified99.4%
Taylor expanded in x around 0 99.4%
Taylor expanded in x around inf 99.5%
if 5.19999999999999954e-4 < wj < 0.00215Initial program 100.0%
distribute-rgt1-in98.4%
*-commutative98.4%
associate-/r*98.4%
div-sub98.4%
associate-/l*98.4%
*-inverses98.4%
*-rgt-identity98.4%
Simplified98.4%
Taylor expanded in x around inf 98.4%
+-commutative98.4%
associate-/r*100.0%
exp-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 98.4%
associate-/l*100.0%
+-commutative100.0%
Simplified100.0%
if 0.00215 < wj < 0.0210000000000000013 or 3.5 < wj Initial program 73.7%
distribute-rgt1-in73.7%
*-commutative73.7%
associate-/r*72.7%
div-sub72.7%
associate-/l*72.7%
*-inverses97.7%
*-rgt-identity97.7%
Simplified97.7%
Taylor expanded in x around 0 97.7%
+-commutative97.6%
Simplified97.7%
Final simplification99.2%
(FPCore (wj x)
:precision binary64
(let* ((t_0 (/ x (* (+ wj 1.0) (exp wj)))))
(if (<= wj -0.0074)
t_0
(if (<= wj 5e-83)
(+
x
(*
wj
(-
(* wj (- (+ 1.0 (* x (+ 2.5 (* wj -2.6666666666666665)))) wj))
(* x 2.0))))
(if (<= wj 0.00052)
(-
x
(*
wj
(+
(* x 2.0)
(*
wj
(+ wj (* x (- (- (/ -1.0 x) (* wj -2.6666666666666665)) 2.5)))))))
(if (or (<= wj 0.0106) (and (not (<= wj 0.16)) (<= wj 4.0)))
t_0
(- wj (/ wj (+ wj 1.0)))))))))
double code(double wj, double x) {
double t_0 = x / ((wj + 1.0) * exp(wj));
double tmp;
if (wj <= -0.0074) {
tmp = t_0;
} else if (wj <= 5e-83) {
tmp = x + (wj * ((wj * ((1.0 + (x * (2.5 + (wj * -2.6666666666666665)))) - wj)) - (x * 2.0)));
} else if (wj <= 0.00052) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5))))));
} else if ((wj <= 0.0106) || (!(wj <= 0.16) && (wj <= 4.0))) {
tmp = t_0;
} else {
tmp = wj - (wj / (wj + 1.0));
}
return tmp;
}
real(8) function code(wj, x)
real(8), intent (in) :: wj
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / ((wj + 1.0d0) * exp(wj))
if (wj <= (-0.0074d0)) then
tmp = t_0
else if (wj <= 5d-83) then
tmp = x + (wj * ((wj * ((1.0d0 + (x * (2.5d0 + (wj * (-2.6666666666666665d0))))) - wj)) - (x * 2.0d0)))
else if (wj <= 0.00052d0) then
tmp = x - (wj * ((x * 2.0d0) + (wj * (wj + (x * ((((-1.0d0) / x) - (wj * (-2.6666666666666665d0))) - 2.5d0))))))
else if ((wj <= 0.0106d0) .or. (.not. (wj <= 0.16d0)) .and. (wj <= 4.0d0)) then
tmp = t_0
else
tmp = wj - (wj / (wj + 1.0d0))
end if
code = tmp
end function
public static double code(double wj, double x) {
double t_0 = x / ((wj + 1.0) * Math.exp(wj));
double tmp;
if (wj <= -0.0074) {
tmp = t_0;
} else if (wj <= 5e-83) {
tmp = x + (wj * ((wj * ((1.0 + (x * (2.5 + (wj * -2.6666666666666665)))) - wj)) - (x * 2.0)));
} else if (wj <= 0.00052) {
tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5))))));
} else if ((wj <= 0.0106) || (!(wj <= 0.16) && (wj <= 4.0))) {
tmp = t_0;
} else {
tmp = wj - (wj / (wj + 1.0));
}
return tmp;
}
def code(wj, x): t_0 = x / ((wj + 1.0) * math.exp(wj)) tmp = 0 if wj <= -0.0074: tmp = t_0 elif wj <= 5e-83: tmp = x + (wj * ((wj * ((1.0 + (x * (2.5 + (wj * -2.6666666666666665)))) - wj)) - (x * 2.0))) elif wj <= 0.00052: tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5)))))) elif (wj <= 0.0106) or (not (wj <= 0.16) and (wj <= 4.0)): tmp = t_0 else: tmp = wj - (wj / (wj + 1.0)) return tmp
function code(wj, x) t_0 = Float64(x / Float64(Float64(wj + 1.0) * exp(wj))) tmp = 0.0 if (wj <= -0.0074) tmp = t_0; elseif (wj <= 5e-83) tmp = Float64(x + Float64(wj * Float64(Float64(wj * Float64(Float64(1.0 + Float64(x * Float64(2.5 + Float64(wj * -2.6666666666666665)))) - wj)) - Float64(x * 2.0)))); elseif (wj <= 0.00052) tmp = Float64(x - Float64(wj * Float64(Float64(x * 2.0) + Float64(wj * Float64(wj + Float64(x * Float64(Float64(Float64(-1.0 / x) - Float64(wj * -2.6666666666666665)) - 2.5))))))); elseif ((wj <= 0.0106) || (!(wj <= 0.16) && (wj <= 4.0))) tmp = t_0; else tmp = Float64(wj - Float64(wj / Float64(wj + 1.0))); end return tmp end
function tmp_2 = code(wj, x) t_0 = x / ((wj + 1.0) * exp(wj)); tmp = 0.0; if (wj <= -0.0074) tmp = t_0; elseif (wj <= 5e-83) tmp = x + (wj * ((wj * ((1.0 + (x * (2.5 + (wj * -2.6666666666666665)))) - wj)) - (x * 2.0))); elseif (wj <= 0.00052) tmp = x - (wj * ((x * 2.0) + (wj * (wj + (x * (((-1.0 / x) - (wj * -2.6666666666666665)) - 2.5)))))); elseif ((wj <= 0.0106) || (~((wj <= 0.16)) && (wj <= 4.0))) tmp = t_0; else tmp = wj - (wj / (wj + 1.0)); end tmp_2 = tmp; end
code[wj_, x_] := Block[{t$95$0 = N[(x / N[(N[(wj + 1.0), $MachinePrecision] * N[Exp[wj], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[wj, -0.0074], t$95$0, If[LessEqual[wj, 5e-83], N[(x + N[(wj * N[(N[(wj * N[(N[(1.0 + N[(x * N[(2.5 + N[(wj * -2.6666666666666665), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - wj), $MachinePrecision]), $MachinePrecision] - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[wj, 0.00052], N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] + N[(wj * N[(wj + N[(x * N[(N[(N[(-1.0 / x), $MachinePrecision] - N[(wj * -2.6666666666666665), $MachinePrecision]), $MachinePrecision] - 2.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[wj, 0.0106], And[N[Not[LessEqual[wj, 0.16]], $MachinePrecision], LessEqual[wj, 4.0]]], t$95$0, N[(wj - N[(wj / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\left(wj + 1\right) \cdot e^{wj}}\\
\mathbf{if}\;wj \leq -0.0074:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;wj \leq 5 \cdot 10^{-83}:\\
\;\;\;\;x + wj \cdot \left(wj \cdot \left(\left(1 + x \cdot \left(2.5 + wj \cdot -2.6666666666666665\right)\right) - wj\right) - x \cdot 2\right)\\
\mathbf{elif}\;wj \leq 0.00052:\\
\;\;\;\;x - wj \cdot \left(x \cdot 2 + wj \cdot \left(wj + x \cdot \left(\left(\frac{-1}{x} - wj \cdot -2.6666666666666665\right) - 2.5\right)\right)\right)\\
\mathbf{elif}\;wj \leq 0.0106 \lor \neg \left(wj \leq 0.16\right) \land wj \leq 4:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;wj - \frac{wj}{wj + 1}\\
\end{array}
\end{array}
if wj < -0.0074000000000000003 or 5.19999999999999954e-4 < wj < 0.0106 or 0.160000000000000003 < wj < 4Initial program 62.1%
distribute-rgt1-in99.8%
*-commutative99.8%
associate-/r*99.6%
div-sub62.1%
associate-/l*62.1%
*-inverses99.6%
*-rgt-identity99.6%
Simplified99.6%
Taylor expanded in x around inf 87.5%
+-commutative87.5%
Simplified87.5%
if -0.0074000000000000003 < wj < 5e-83Initial program 80.7%
distribute-rgt1-in80.7%
*-commutative80.7%
associate-/r*80.7%
div-sub80.7%
associate-/l*80.7%
*-inverses80.7%
*-rgt-identity80.7%
Simplified80.7%
Taylor expanded in wj around 0 99.2%
Taylor expanded in x around 0 99.6%
distribute-lft-out99.6%
*-commutative99.6%
mul-1-neg99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
if 5e-83 < wj < 5.19999999999999954e-4Initial program 52.2%
distribute-rgt1-in52.1%
*-commutative52.1%
associate-/r*52.3%
div-sub52.3%
associate-/l*52.3%
*-inverses52.3%
*-rgt-identity52.3%
Simplified52.3%
Taylor expanded in wj around 0 99.4%
Taylor expanded in x around 0 99.4%
distribute-lft-out99.4%
*-commutative99.4%
mul-1-neg99.4%
Simplified99.4%
Taylor expanded in x around 0 99.4%
Taylor expanded in x around inf 99.5%
if 0.0106 < wj < 0.160000000000000003 or 4 < wj Initial program 73.7%
distribute-rgt1-in73.7%
*-commutative73.7%
associate-/r*72.7%
div-sub72.7%
associate-/l*72.7%
*-inverses97.7%
*-rgt-identity97.7%
Simplified97.7%
Taylor expanded in x around 0 97.7%
+-commutative97.6%
Simplified97.7%
Final simplification99.2%
(FPCore (wj x)
:precision binary64
(+
x
(*
wj
(-
(* wj (- (+ 1.0 (* x (+ 2.5 (* wj -2.6666666666666665)))) wj))
(* x 2.0)))))
double code(double wj, double x) {
return x + (wj * ((wj * ((1.0 + (x * (2.5 + (wj * -2.6666666666666665)))) - wj)) - (x * 2.0)));
}
real(8) function code(wj, x)
real(8), intent (in) :: wj
real(8), intent (in) :: x
code = x + (wj * ((wj * ((1.0d0 + (x * (2.5d0 + (wj * (-2.6666666666666665d0))))) - wj)) - (x * 2.0d0)))
end function
public static double code(double wj, double x) {
return x + (wj * ((wj * ((1.0 + (x * (2.5 + (wj * -2.6666666666666665)))) - wj)) - (x * 2.0)));
}
def code(wj, x): return x + (wj * ((wj * ((1.0 + (x * (2.5 + (wj * -2.6666666666666665)))) - wj)) - (x * 2.0)))
function code(wj, x) return Float64(x + Float64(wj * Float64(Float64(wj * Float64(Float64(1.0 + Float64(x * Float64(2.5 + Float64(wj * -2.6666666666666665)))) - wj)) - Float64(x * 2.0)))) end
function tmp = code(wj, x) tmp = x + (wj * ((wj * ((1.0 + (x * (2.5 + (wj * -2.6666666666666665)))) - wj)) - (x * 2.0))); end
code[wj_, x_] := N[(x + N[(wj * N[(N[(wj * N[(N[(1.0 + N[(x * N[(2.5 + N[(wj * -2.6666666666666665), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - wj), $MachinePrecision]), $MachinePrecision] - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + wj \cdot \left(wj \cdot \left(\left(1 + x \cdot \left(2.5 + wj \cdot -2.6666666666666665\right)\right) - wj\right) - x \cdot 2\right)
\end{array}
Initial program 76.8%
distribute-rgt1-in77.9%
*-commutative77.9%
associate-/r*77.9%
div-sub76.8%
associate-/l*76.8%
*-inverses78.3%
*-rgt-identity78.3%
Simplified78.3%
Taylor expanded in wj around 0 95.3%
Taylor expanded in x around 0 95.6%
distribute-lft-out95.6%
*-commutative95.6%
mul-1-neg95.6%
Simplified95.6%
Taylor expanded in x around 0 95.6%
Final simplification95.6%
(FPCore (wj x) :precision binary64 (+ x (* wj (- (* wj (- 1.0 wj)) (* x 2.0)))))
double code(double wj, double x) {
return x + (wj * ((wj * (1.0 - wj)) - (x * 2.0)));
}
real(8) function code(wj, x)
real(8), intent (in) :: wj
real(8), intent (in) :: x
code = x + (wj * ((wj * (1.0d0 - wj)) - (x * 2.0d0)))
end function
public static double code(double wj, double x) {
return x + (wj * ((wj * (1.0 - wj)) - (x * 2.0)));
}
def code(wj, x): return x + (wj * ((wj * (1.0 - wj)) - (x * 2.0)))
function code(wj, x) return Float64(x + Float64(wj * Float64(Float64(wj * Float64(1.0 - wj)) - Float64(x * 2.0)))) end
function tmp = code(wj, x) tmp = x + (wj * ((wj * (1.0 - wj)) - (x * 2.0))); end
code[wj_, x_] := N[(x + N[(wj * N[(N[(wj * N[(1.0 - wj), $MachinePrecision]), $MachinePrecision] - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + wj \cdot \left(wj \cdot \left(1 - wj\right) - x \cdot 2\right)
\end{array}
Initial program 76.8%
distribute-rgt1-in77.9%
*-commutative77.9%
associate-/r*77.9%
div-sub76.8%
associate-/l*76.8%
*-inverses78.3%
*-rgt-identity78.3%
Simplified78.3%
Taylor expanded in wj around 0 95.3%
Taylor expanded in x around 0 95.3%
mul-1-neg95.3%
unsub-neg95.3%
Simplified95.3%
Final simplification95.3%
(FPCore (wj x) :precision binary64 (+ x (* wj (- (* wj (+ wj 1.0)) (* x 2.0)))))
double code(double wj, double x) {
return x + (wj * ((wj * (wj + 1.0)) - (x * 2.0)));
}
real(8) function code(wj, x)
real(8), intent (in) :: wj
real(8), intent (in) :: x
code = x + (wj * ((wj * (wj + 1.0d0)) - (x * 2.0d0)))
end function
public static double code(double wj, double x) {
return x + (wj * ((wj * (wj + 1.0)) - (x * 2.0)));
}
def code(wj, x): return x + (wj * ((wj * (wj + 1.0)) - (x * 2.0)))
function code(wj, x) return Float64(x + Float64(wj * Float64(Float64(wj * Float64(wj + 1.0)) - Float64(x * 2.0)))) end
function tmp = code(wj, x) tmp = x + (wj * ((wj * (wj + 1.0)) - (x * 2.0))); end
code[wj_, x_] := N[(x + N[(wj * N[(N[(wj * N[(wj + 1.0), $MachinePrecision]), $MachinePrecision] - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + wj \cdot \left(wj \cdot \left(wj + 1\right) - x \cdot 2\right)
\end{array}
Initial program 76.8%
distribute-rgt1-in77.9%
*-commutative77.9%
associate-/r*77.9%
div-sub76.8%
associate-/l*76.8%
*-inverses78.3%
*-rgt-identity78.3%
Simplified78.3%
Taylor expanded in wj around 0 95.3%
Taylor expanded in x around 0 95.3%
mul-1-neg95.3%
unsub-neg95.3%
Simplified95.3%
sub-neg95.3%
+-commutative95.3%
add-sqr-sqrt51.6%
sqrt-unprod95.0%
sqr-neg95.0%
sqrt-unprod43.4%
add-sqr-sqrt94.7%
pow194.7%
Applied egg-rr94.7%
unpow194.7%
Simplified94.7%
Final simplification94.7%
(FPCore (wj x) :precision binary64 (if (<= wj 3.5e-10) (+ x (* -2.0 (* wj x))) (- wj (/ wj (+ wj 1.0)))))
double code(double wj, double x) {
double tmp;
if (wj <= 3.5e-10) {
tmp = x + (-2.0 * (wj * x));
} else {
tmp = wj - (wj / (wj + 1.0));
}
return tmp;
}
real(8) function code(wj, x)
real(8), intent (in) :: wj
real(8), intent (in) :: x
real(8) :: tmp
if (wj <= 3.5d-10) then
tmp = x + ((-2.0d0) * (wj * x))
else
tmp = wj - (wj / (wj + 1.0d0))
end if
code = tmp
end function
public static double code(double wj, double x) {
double tmp;
if (wj <= 3.5e-10) {
tmp = x + (-2.0 * (wj * x));
} else {
tmp = wj - (wj / (wj + 1.0));
}
return tmp;
}
def code(wj, x): tmp = 0 if wj <= 3.5e-10: tmp = x + (-2.0 * (wj * x)) else: tmp = wj - (wj / (wj + 1.0)) return tmp
function code(wj, x) tmp = 0.0 if (wj <= 3.5e-10) tmp = Float64(x + Float64(-2.0 * Float64(wj * x))); else tmp = Float64(wj - Float64(wj / Float64(wj + 1.0))); end return tmp end
function tmp_2 = code(wj, x) tmp = 0.0; if (wj <= 3.5e-10) tmp = x + (-2.0 * (wj * x)); else tmp = wj - (wj / (wj + 1.0)); end tmp_2 = tmp; end
code[wj_, x_] := If[LessEqual[wj, 3.5e-10], N[(x + N[(-2.0 * N[(wj * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(wj - N[(wj / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;wj \leq 3.5 \cdot 10^{-10}:\\
\;\;\;\;x + -2 \cdot \left(wj \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;wj - \frac{wj}{wj + 1}\\
\end{array}
\end{array}
if wj < 3.4999999999999998e-10Initial program 76.8%
distribute-rgt1-in78.0%
*-commutative78.0%
associate-/r*78.0%
div-sub76.8%
associate-/l*76.8%
*-inverses78.0%
*-rgt-identity78.0%
Simplified78.0%
Taylor expanded in wj around 0 81.4%
*-commutative81.4%
Simplified81.4%
if 3.4999999999999998e-10 < wj Initial program 76.9%
distribute-rgt1-in76.7%
*-commutative76.7%
associate-/r*76.6%
div-sub76.6%
associate-/l*76.6%
*-inverses89.1%
*-rgt-identity89.1%
Simplified89.1%
Taylor expanded in x around 0 64.9%
+-commutative88.9%
Simplified64.9%
Final simplification80.8%
(FPCore (wj x) :precision binary64 (- x (* wj (- (* x 2.0) wj))))
double code(double wj, double x) {
return x - (wj * ((x * 2.0) - wj));
}
real(8) function code(wj, x)
real(8), intent (in) :: wj
real(8), intent (in) :: x
code = x - (wj * ((x * 2.0d0) - wj))
end function
public static double code(double wj, double x) {
return x - (wj * ((x * 2.0) - wj));
}
def code(wj, x): return x - (wj * ((x * 2.0) - wj))
function code(wj, x) return Float64(x - Float64(wj * Float64(Float64(x * 2.0) - wj))) end
function tmp = code(wj, x) tmp = x - (wj * ((x * 2.0) - wj)); end
code[wj_, x_] := N[(x - N[(wj * N[(N[(x * 2.0), $MachinePrecision] - wj), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - wj \cdot \left(x \cdot 2 - wj\right)
\end{array}
Initial program 76.8%
distribute-rgt1-in77.9%
*-commutative77.9%
associate-/r*77.9%
div-sub76.8%
associate-/l*76.8%
*-inverses78.3%
*-rgt-identity78.3%
Simplified78.3%
Taylor expanded in wj around 0 95.3%
Taylor expanded in x around 0 95.3%
mul-1-neg95.3%
unsub-neg95.3%
Simplified95.3%
Taylor expanded in wj around 0 94.7%
Final simplification94.7%
(FPCore (wj x) :precision binary64 (+ x (* -2.0 (* wj x))))
double code(double wj, double x) {
return x + (-2.0 * (wj * x));
}
real(8) function code(wj, x)
real(8), intent (in) :: wj
real(8), intent (in) :: x
code = x + ((-2.0d0) * (wj * x))
end function
public static double code(double wj, double x) {
return x + (-2.0 * (wj * x));
}
def code(wj, x): return x + (-2.0 * (wj * x))
function code(wj, x) return Float64(x + Float64(-2.0 * Float64(wj * x))) end
function tmp = code(wj, x) tmp = x + (-2.0 * (wj * x)); end
code[wj_, x_] := N[(x + N[(-2.0 * N[(wj * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + -2 \cdot \left(wj \cdot x\right)
\end{array}
Initial program 76.8%
distribute-rgt1-in77.9%
*-commutative77.9%
associate-/r*77.9%
div-sub76.8%
associate-/l*76.8%
*-inverses78.3%
*-rgt-identity78.3%
Simplified78.3%
Taylor expanded in wj around 0 79.1%
*-commutative79.1%
Simplified79.1%
Final simplification79.1%
(FPCore (wj x) :precision binary64 x)
double code(double wj, double x) {
return x;
}
real(8) function code(wj, x)
real(8), intent (in) :: wj
real(8), intent (in) :: x
code = x
end function
public static double code(double wj, double x) {
return x;
}
def code(wj, x): return x
function code(wj, x) return x end
function tmp = code(wj, x) tmp = x; end
code[wj_, x_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 76.8%
distribute-rgt1-in77.9%
*-commutative77.9%
associate-/r*77.9%
div-sub76.8%
associate-/l*76.8%
*-inverses78.3%
*-rgt-identity78.3%
Simplified78.3%
Taylor expanded in wj around 0 78.3%
(FPCore (wj x) :precision binary64 wj)
double code(double wj, double x) {
return wj;
}
real(8) function code(wj, x)
real(8), intent (in) :: wj
real(8), intent (in) :: x
code = wj
end function
public static double code(double wj, double x) {
return wj;
}
def code(wj, x): return wj
function code(wj, x) return wj end
function tmp = code(wj, x) tmp = wj; end
code[wj_, x_] := wj
\begin{array}{l}
\\
wj
\end{array}
Initial program 76.8%
distribute-rgt1-in77.9%
*-commutative77.9%
associate-/r*77.9%
div-sub76.8%
associate-/l*76.8%
*-inverses78.3%
*-rgt-identity78.3%
Simplified78.3%
Taylor expanded in wj around inf 4.4%
(FPCore (wj x) :precision binary64 (- wj (- (/ wj (+ wj 1.0)) (/ x (+ (exp wj) (* wj (exp wj)))))))
double code(double wj, double x) {
return wj - ((wj / (wj + 1.0)) - (x / (exp(wj) + (wj * exp(wj)))));
}
real(8) function code(wj, x)
real(8), intent (in) :: wj
real(8), intent (in) :: x
code = wj - ((wj / (wj + 1.0d0)) - (x / (exp(wj) + (wj * exp(wj)))))
end function
public static double code(double wj, double x) {
return wj - ((wj / (wj + 1.0)) - (x / (Math.exp(wj) + (wj * Math.exp(wj)))));
}
def code(wj, x): return wj - ((wj / (wj + 1.0)) - (x / (math.exp(wj) + (wj * math.exp(wj)))))
function code(wj, x) return Float64(wj - Float64(Float64(wj / Float64(wj + 1.0)) - Float64(x / Float64(exp(wj) + Float64(wj * exp(wj)))))) end
function tmp = code(wj, x) tmp = wj - ((wj / (wj + 1.0)) - (x / (exp(wj) + (wj * exp(wj))))); end
code[wj_, x_] := N[(wj - N[(N[(wj / N[(wj + 1.0), $MachinePrecision]), $MachinePrecision] - N[(x / N[(N[Exp[wj], $MachinePrecision] + N[(wj * N[Exp[wj], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
wj - \left(\frac{wj}{wj + 1} - \frac{x}{e^{wj} + wj \cdot e^{wj}}\right)
\end{array}
herbie shell --seed 2024096
(FPCore (wj x)
:name "Jmat.Real.lambertw, newton loop step"
:precision binary64
:alt
(- wj (- (/ wj (+ wj 1.0)) (/ x (+ (exp wj) (* wj (exp wj))))))
(- wj (/ (- (* wj (exp wj)) x) (+ (exp wj) (* wj (exp wj))))))