
(FPCore (a b) :precision binary64 (/ (exp a) (+ (exp a) (exp b))))
double code(double a, double b) {
return exp(a) / (exp(a) + exp(b));
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = exp(a) / (exp(a) + exp(b))
end function
public static double code(double a, double b) {
return Math.exp(a) / (Math.exp(a) + Math.exp(b));
}
def code(a, b): return math.exp(a) / (math.exp(a) + math.exp(b))
function code(a, b) return Float64(exp(a) / Float64(exp(a) + exp(b))) end
function tmp = code(a, b) tmp = exp(a) / (exp(a) + exp(b)); end
code[a_, b_] := N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{e^{a}}{e^{a} + e^{b}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b) :precision binary64 (/ (exp a) (+ (exp a) (exp b))))
double code(double a, double b) {
return exp(a) / (exp(a) + exp(b));
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = exp(a) / (exp(a) + exp(b))
end function
public static double code(double a, double b) {
return Math.exp(a) / (Math.exp(a) + Math.exp(b));
}
def code(a, b): return math.exp(a) / (math.exp(a) + math.exp(b))
function code(a, b) return Float64(exp(a) / Float64(exp(a) + exp(b))) end
function tmp = code(a, b) tmp = exp(a) / (exp(a) + exp(b)); end
code[a_, b_] := N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{e^{a}}{e^{a} + e^{b}}
\end{array}
(FPCore (a b) :precision binary64 (exp (- (log1p (exp (- b a))))))
double code(double a, double b) {
return exp(-log1p(exp((b - a))));
}
public static double code(double a, double b) {
return Math.exp(-Math.log1p(Math.exp((b - a))));
}
def code(a, b): return math.exp(-math.log1p(math.exp((b - a))))
function code(a, b) return exp(Float64(-log1p(exp(Float64(b - a))))) end
code[a_, b_] := N[Exp[(-N[Log[1 + N[Exp[N[(b - a), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])], $MachinePrecision]
\begin{array}{l}
\\
e^{-\mathsf{log1p}\left(e^{b - a}\right)}
\end{array}
Initial program 98.8%
*-lft-identity98.8%
associate-*l/98.8%
associate-/r/98.8%
remove-double-neg98.8%
unsub-neg98.8%
div-sub71.4%
*-lft-identity71.4%
associate-*l/71.4%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
add-exp-log100.0%
log-rec100.0%
log1p-define100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (a b) :precision binary64 (if (<= a 7e-7) (/ 1.0 (+ 1.0 (exp b))) (/ 1.0 (+ 1.0 (exp (- a))))))
double code(double a, double b) {
double tmp;
if (a <= 7e-7) {
tmp = 1.0 / (1.0 + exp(b));
} else {
tmp = 1.0 / (1.0 + exp(-a));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= 7d-7) then
tmp = 1.0d0 / (1.0d0 + exp(b))
else
tmp = 1.0d0 / (1.0d0 + exp(-a))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (a <= 7e-7) {
tmp = 1.0 / (1.0 + Math.exp(b));
} else {
tmp = 1.0 / (1.0 + Math.exp(-a));
}
return tmp;
}
def code(a, b): tmp = 0 if a <= 7e-7: tmp = 1.0 / (1.0 + math.exp(b)) else: tmp = 1.0 / (1.0 + math.exp(-a)) return tmp
function code(a, b) tmp = 0.0 if (a <= 7e-7) tmp = Float64(1.0 / Float64(1.0 + exp(b))); else tmp = Float64(1.0 / Float64(1.0 + exp(Float64(-a)))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (a <= 7e-7) tmp = 1.0 / (1.0 + exp(b)); else tmp = 1.0 / (1.0 + exp(-a)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[a, 7e-7], N[(1.0 / N[(1.0 + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 + N[Exp[(-a)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 7 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{1 + e^{b}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + e^{-a}}\\
\end{array}
\end{array}
if a < 6.99999999999999968e-7Initial program 100.0%
*-lft-identity100.0%
associate-*l/100.0%
associate-/r/100.0%
remove-double-neg100.0%
unsub-neg100.0%
div-sub71.6%
*-lft-identity71.6%
associate-*l/71.6%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
Taylor expanded in a around 0 82.4%
if 6.99999999999999968e-7 < a Initial program 66.5%
*-lft-identity66.5%
associate-*l/66.3%
associate-/r/66.3%
remove-double-neg66.3%
unsub-neg66.3%
div-sub66.3%
*-lft-identity66.3%
associate-*l/66.1%
lft-mult-inverse99.7%
sub-neg99.7%
distribute-frac-neg99.7%
remove-double-neg99.7%
div-exp99.8%
Simplified99.8%
Taylor expanded in b around 0 94.9%
Final simplification82.9%
(FPCore (a b) :precision binary64 (if (<= b 2.4e+99) (/ 1.0 (+ 2.0 (* a (+ (* a (+ 0.5 (* a -0.16666666666666666))) -1.0)))) (/ 6.0 (pow b 3.0))))
double code(double a, double b) {
double tmp;
if (b <= 2.4e+99) {
tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0)));
} else {
tmp = 6.0 / pow(b, 3.0);
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= 2.4d+99) then
tmp = 1.0d0 / (2.0d0 + (a * ((a * (0.5d0 + (a * (-0.16666666666666666d0)))) + (-1.0d0))))
else
tmp = 6.0d0 / (b ** 3.0d0)
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= 2.4e+99) {
tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0)));
} else {
tmp = 6.0 / Math.pow(b, 3.0);
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 2.4e+99: tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0))) else: tmp = 6.0 / math.pow(b, 3.0) return tmp
function code(a, b) tmp = 0.0 if (b <= 2.4e+99) tmp = Float64(1.0 / Float64(2.0 + Float64(a * Float64(Float64(a * Float64(0.5 + Float64(a * -0.16666666666666666))) + -1.0)))); else tmp = Float64(6.0 / (b ^ 3.0)); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 2.4e+99) tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0))); else tmp = 6.0 / (b ^ 3.0); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 2.4e+99], N[(1.0 / N[(2.0 + N[(a * N[(N[(a * N[(0.5 + N[(a * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.4 \cdot 10^{+99}:\\
\;\;\;\;\frac{1}{2 + a \cdot \left(a \cdot \left(0.5 + a \cdot -0.16666666666666666\right) + -1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{6}{{b}^{3}}\\
\end{array}
\end{array}
if b < 2.4000000000000001e99Initial program 98.5%
*-lft-identity98.5%
associate-*l/98.5%
associate-/r/98.5%
remove-double-neg98.5%
unsub-neg98.5%
div-sub72.8%
*-lft-identity72.8%
associate-*l/72.8%
lft-mult-inverse99.9%
sub-neg99.9%
distribute-frac-neg99.9%
remove-double-neg99.9%
div-exp100.0%
Simplified100.0%
Taylor expanded in b around 0 74.0%
Taylor expanded in a around 0 61.3%
if 2.4000000000000001e99 < b Initial program 100.0%
*-lft-identity100.0%
associate-*l/100.0%
associate-/r/100.0%
remove-double-neg100.0%
unsub-neg100.0%
div-sub66.0%
*-lft-identity66.0%
associate-*l/66.0%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in b around 0 96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in b around inf 98.3%
Final simplification69.0%
(FPCore (a b) :precision binary64 (if (<= b 0.047) (/ 1.0 (+ 2.0 (* a (+ (* a (+ 0.5 (* a -0.16666666666666666))) -1.0)))) (/ (exp a) a)))
double code(double a, double b) {
double tmp;
if (b <= 0.047) {
tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0)));
} else {
tmp = exp(a) / a;
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= 0.047d0) then
tmp = 1.0d0 / (2.0d0 + (a * ((a * (0.5d0 + (a * (-0.16666666666666666d0)))) + (-1.0d0))))
else
tmp = exp(a) / a
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= 0.047) {
tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0)));
} else {
tmp = Math.exp(a) / a;
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 0.047: tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0))) else: tmp = math.exp(a) / a return tmp
function code(a, b) tmp = 0.0 if (b <= 0.047) tmp = Float64(1.0 / Float64(2.0 + Float64(a * Float64(Float64(a * Float64(0.5 + Float64(a * -0.16666666666666666))) + -1.0)))); else tmp = Float64(exp(a) / a); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 0.047) tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0))); else tmp = exp(a) / a; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 0.047], N[(1.0 / N[(2.0 + N[(a * N[(N[(a * N[(0.5 + N[(a * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Exp[a], $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 0.047:\\
\;\;\;\;\frac{1}{2 + a \cdot \left(a \cdot \left(0.5 + a \cdot -0.16666666666666666\right) + -1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{a}}{a}\\
\end{array}
\end{array}
if b < 0.047Initial program 98.3%
*-lft-identity98.3%
associate-*l/98.3%
associate-/r/98.3%
remove-double-neg98.3%
unsub-neg98.3%
div-sub75.6%
*-lft-identity75.6%
associate-*l/75.6%
lft-mult-inverse99.9%
sub-neg99.9%
distribute-frac-neg99.9%
remove-double-neg99.9%
div-exp99.9%
Simplified99.9%
Taylor expanded in b around 0 76.7%
Taylor expanded in a around 0 64.1%
if 0.047 < b Initial program 100.0%
Taylor expanded in b around 0 40.6%
Taylor expanded in a around 0 40.6%
+-commutative40.6%
Simplified40.6%
Taylor expanded in a around inf 40.1%
Final simplification57.0%
(FPCore (a b) :precision binary64 (/ 1.0 (+ (exp (- b a)) 1.0)))
double code(double a, double b) {
return 1.0 / (exp((b - a)) + 1.0);
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = 1.0d0 / (exp((b - a)) + 1.0d0)
end function
public static double code(double a, double b) {
return 1.0 / (Math.exp((b - a)) + 1.0);
}
def code(a, b): return 1.0 / (math.exp((b - a)) + 1.0)
function code(a, b) return Float64(1.0 / Float64(exp(Float64(b - a)) + 1.0)) end
function tmp = code(a, b) tmp = 1.0 / (exp((b - a)) + 1.0); end
code[a_, b_] := N[(1.0 / N[(N[Exp[N[(b - a), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{e^{b - a} + 1}
\end{array}
Initial program 98.8%
*-lft-identity98.8%
associate-*l/98.8%
associate-/r/98.8%
remove-double-neg98.8%
unsub-neg98.8%
div-sub71.4%
*-lft-identity71.4%
associate-*l/71.4%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (a b) :precision binary64 (/ 1.0 (+ 1.0 (exp b))))
double code(double a, double b) {
return 1.0 / (1.0 + exp(b));
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = 1.0d0 / (1.0d0 + exp(b))
end function
public static double code(double a, double b) {
return 1.0 / (1.0 + Math.exp(b));
}
def code(a, b): return 1.0 / (1.0 + math.exp(b))
function code(a, b) return Float64(1.0 / Float64(1.0 + exp(b))) end
function tmp = code(a, b) tmp = 1.0 / (1.0 + exp(b)); end
code[a_, b_] := N[(1.0 / N[(1.0 + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{1 + e^{b}}
\end{array}
Initial program 98.8%
*-lft-identity98.8%
associate-*l/98.8%
associate-/r/98.8%
remove-double-neg98.8%
unsub-neg98.8%
div-sub71.4%
*-lft-identity71.4%
associate-*l/71.4%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
Taylor expanded in a around 0 80.9%
Final simplification80.9%
(FPCore (a b) :precision binary64 (if (<= b -1.3) 1.0 (/ 1.0 (+ 2.0 (* a (+ (* a (+ 0.5 (* a -0.16666666666666666))) -1.0))))))
double code(double a, double b) {
double tmp;
if (b <= -1.3) {
tmp = 1.0;
} else {
tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0)));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-1.3d0)) then
tmp = 1.0d0
else
tmp = 1.0d0 / (2.0d0 + (a * ((a * (0.5d0 + (a * (-0.16666666666666666d0)))) + (-1.0d0))))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= -1.3) {
tmp = 1.0;
} else {
tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0)));
}
return tmp;
}
def code(a, b): tmp = 0 if b <= -1.3: tmp = 1.0 else: tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0))) return tmp
function code(a, b) tmp = 0.0 if (b <= -1.3) tmp = 1.0; else tmp = Float64(1.0 / Float64(2.0 + Float64(a * Float64(Float64(a * Float64(0.5 + Float64(a * -0.16666666666666666))) + -1.0)))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= -1.3) tmp = 1.0; else tmp = 1.0 / (2.0 + (a * ((a * (0.5 + (a * -0.16666666666666666))) + -1.0))); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, -1.3], 1.0, N[(1.0 / N[(2.0 + N[(a * N[(N[(a * N[(0.5 + N[(a * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.3:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2 + a \cdot \left(a \cdot \left(0.5 + a \cdot -0.16666666666666666\right) + -1\right)}\\
\end{array}
\end{array}
if b < -1.30000000000000004Initial program 97.9%
*-lft-identity97.9%
associate-*l/97.9%
associate-/r/97.9%
remove-double-neg97.9%
unsub-neg97.9%
div-sub97.9%
*-lft-identity97.9%
associate-*l/97.9%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
add-exp-log100.0%
log-rec100.0%
log1p-define100.0%
Applied egg-rr100.0%
exp-neg100.0%
log1p-undefine100.0%
add-exp-log100.0%
add-sqr-sqrt99.9%
associate-/r*99.9%
Applied egg-rr97.5%
*-inverses97.5%
Simplified97.5%
if -1.30000000000000004 < b Initial program 99.0%
*-lft-identity99.0%
associate-*l/99.0%
associate-/r/99.0%
remove-double-neg99.0%
unsub-neg99.0%
div-sub65.2%
*-lft-identity65.2%
associate-*l/65.2%
lft-mult-inverse99.9%
sub-neg99.9%
distribute-frac-neg99.9%
remove-double-neg99.9%
div-exp100.0%
Simplified100.0%
Taylor expanded in b around 0 76.8%
Taylor expanded in a around 0 61.4%
Final simplification68.3%
(FPCore (a b) :precision binary64 (if (<= b -1.3) 1.0 (/ 1.0 (+ 2.0 (* b (+ 1.0 (* b (+ 0.5 (* b 0.16666666666666666)))))))))
double code(double a, double b) {
double tmp;
if (b <= -1.3) {
tmp = 1.0;
} else {
tmp = 1.0 / (2.0 + (b * (1.0 + (b * (0.5 + (b * 0.16666666666666666))))));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-1.3d0)) then
tmp = 1.0d0
else
tmp = 1.0d0 / (2.0d0 + (b * (1.0d0 + (b * (0.5d0 + (b * 0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= -1.3) {
tmp = 1.0;
} else {
tmp = 1.0 / (2.0 + (b * (1.0 + (b * (0.5 + (b * 0.16666666666666666))))));
}
return tmp;
}
def code(a, b): tmp = 0 if b <= -1.3: tmp = 1.0 else: tmp = 1.0 / (2.0 + (b * (1.0 + (b * (0.5 + (b * 0.16666666666666666)))))) return tmp
function code(a, b) tmp = 0.0 if (b <= -1.3) tmp = 1.0; else tmp = Float64(1.0 / Float64(2.0 + Float64(b * Float64(1.0 + Float64(b * Float64(0.5 + Float64(b * 0.16666666666666666))))))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= -1.3) tmp = 1.0; else tmp = 1.0 / (2.0 + (b * (1.0 + (b * (0.5 + (b * 0.16666666666666666)))))); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, -1.3], 1.0, N[(1.0 / N[(2.0 + N[(b * N[(1.0 + N[(b * N[(0.5 + N[(b * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.3:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2 + b \cdot \left(1 + b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)}\\
\end{array}
\end{array}
if b < -1.30000000000000004Initial program 97.9%
*-lft-identity97.9%
associate-*l/97.9%
associate-/r/97.9%
remove-double-neg97.9%
unsub-neg97.9%
div-sub97.9%
*-lft-identity97.9%
associate-*l/97.9%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
add-exp-log100.0%
log-rec100.0%
log1p-define100.0%
Applied egg-rr100.0%
exp-neg100.0%
log1p-undefine100.0%
add-exp-log100.0%
add-sqr-sqrt99.9%
associate-/r*99.9%
Applied egg-rr97.5%
*-inverses97.5%
Simplified97.5%
if -1.30000000000000004 < b Initial program 99.0%
*-lft-identity99.0%
associate-*l/99.0%
associate-/r/99.0%
remove-double-neg99.0%
unsub-neg99.0%
div-sub65.2%
*-lft-identity65.2%
associate-*l/65.2%
lft-mult-inverse99.9%
sub-neg99.9%
distribute-frac-neg99.9%
remove-double-neg99.9%
div-exp100.0%
Simplified100.0%
Taylor expanded in a around 0 76.4%
Taylor expanded in b around 0 65.2%
*-commutative65.2%
Simplified65.2%
Final simplification71.4%
(FPCore (a b) :precision binary64 (if (<= b -1.7) 1.0 (/ 1.0 (+ 2.0 (* a (+ -1.0 (* a 0.5)))))))
double code(double a, double b) {
double tmp;
if (b <= -1.7) {
tmp = 1.0;
} else {
tmp = 1.0 / (2.0 + (a * (-1.0 + (a * 0.5))));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-1.7d0)) then
tmp = 1.0d0
else
tmp = 1.0d0 / (2.0d0 + (a * ((-1.0d0) + (a * 0.5d0))))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= -1.7) {
tmp = 1.0;
} else {
tmp = 1.0 / (2.0 + (a * (-1.0 + (a * 0.5))));
}
return tmp;
}
def code(a, b): tmp = 0 if b <= -1.7: tmp = 1.0 else: tmp = 1.0 / (2.0 + (a * (-1.0 + (a * 0.5)))) return tmp
function code(a, b) tmp = 0.0 if (b <= -1.7) tmp = 1.0; else tmp = Float64(1.0 / Float64(2.0 + Float64(a * Float64(-1.0 + Float64(a * 0.5))))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= -1.7) tmp = 1.0; else tmp = 1.0 / (2.0 + (a * (-1.0 + (a * 0.5)))); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, -1.7], 1.0, N[(1.0 / N[(2.0 + N[(a * N[(-1.0 + N[(a * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.7:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2 + a \cdot \left(-1 + a \cdot 0.5\right)}\\
\end{array}
\end{array}
if b < -1.69999999999999996Initial program 97.9%
*-lft-identity97.9%
associate-*l/97.9%
associate-/r/97.9%
remove-double-neg97.9%
unsub-neg97.9%
div-sub97.9%
*-lft-identity97.9%
associate-*l/97.9%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
add-exp-log100.0%
log-rec100.0%
log1p-define100.0%
Applied egg-rr100.0%
exp-neg100.0%
log1p-undefine100.0%
add-exp-log100.0%
add-sqr-sqrt99.9%
associate-/r*99.9%
Applied egg-rr97.5%
*-inverses97.5%
Simplified97.5%
if -1.69999999999999996 < b Initial program 99.0%
*-lft-identity99.0%
associate-*l/99.0%
associate-/r/99.0%
remove-double-neg99.0%
unsub-neg99.0%
div-sub65.2%
*-lft-identity65.2%
associate-*l/65.2%
lft-mult-inverse99.9%
sub-neg99.9%
distribute-frac-neg99.9%
remove-double-neg99.9%
div-exp100.0%
Simplified100.0%
Taylor expanded in b around 0 76.8%
Taylor expanded in a around 0 55.4%
Final simplification63.5%
(FPCore (a b) :precision binary64 (if (<= b -1.35) 1.0 (/ 1.0 (+ 2.0 (* b (+ 1.0 (* b 0.5)))))))
double code(double a, double b) {
double tmp;
if (b <= -1.35) {
tmp = 1.0;
} else {
tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5))));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-1.35d0)) then
tmp = 1.0d0
else
tmp = 1.0d0 / (2.0d0 + (b * (1.0d0 + (b * 0.5d0))))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= -1.35) {
tmp = 1.0;
} else {
tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5))));
}
return tmp;
}
def code(a, b): tmp = 0 if b <= -1.35: tmp = 1.0 else: tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5)))) return tmp
function code(a, b) tmp = 0.0 if (b <= -1.35) tmp = 1.0; else tmp = Float64(1.0 / Float64(2.0 + Float64(b * Float64(1.0 + Float64(b * 0.5))))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= -1.35) tmp = 1.0; else tmp = 1.0 / (2.0 + (b * (1.0 + (b * 0.5)))); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, -1.35], 1.0, N[(1.0 / N[(2.0 + N[(b * N[(1.0 + N[(b * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.35:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2 + b \cdot \left(1 + b \cdot 0.5\right)}\\
\end{array}
\end{array}
if b < -1.3500000000000001Initial program 97.9%
*-lft-identity97.9%
associate-*l/97.9%
associate-/r/97.9%
remove-double-neg97.9%
unsub-neg97.9%
div-sub97.9%
*-lft-identity97.9%
associate-*l/97.9%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
add-exp-log100.0%
log-rec100.0%
log1p-define100.0%
Applied egg-rr100.0%
exp-neg100.0%
log1p-undefine100.0%
add-exp-log100.0%
add-sqr-sqrt99.9%
associate-/r*99.9%
Applied egg-rr97.5%
*-inverses97.5%
Simplified97.5%
if -1.3500000000000001 < b Initial program 99.0%
*-lft-identity99.0%
associate-*l/99.0%
associate-/r/99.0%
remove-double-neg99.0%
unsub-neg99.0%
div-sub65.2%
*-lft-identity65.2%
associate-*l/65.2%
lft-mult-inverse99.9%
sub-neg99.9%
distribute-frac-neg99.9%
remove-double-neg99.9%
div-exp100.0%
Simplified100.0%
Taylor expanded in a around 0 76.4%
Taylor expanded in b around 0 59.1%
*-commutative59.1%
Simplified59.1%
Final simplification66.4%
(FPCore (a b) :precision binary64 (if (<= b -1.7) 1.0 (/ 1.0 (+ 2.0 (- (* a (* a 0.5)) a)))))
double code(double a, double b) {
double tmp;
if (b <= -1.7) {
tmp = 1.0;
} else {
tmp = 1.0 / (2.0 + ((a * (a * 0.5)) - a));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-1.7d0)) then
tmp = 1.0d0
else
tmp = 1.0d0 / (2.0d0 + ((a * (a * 0.5d0)) - a))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= -1.7) {
tmp = 1.0;
} else {
tmp = 1.0 / (2.0 + ((a * (a * 0.5)) - a));
}
return tmp;
}
def code(a, b): tmp = 0 if b <= -1.7: tmp = 1.0 else: tmp = 1.0 / (2.0 + ((a * (a * 0.5)) - a)) return tmp
function code(a, b) tmp = 0.0 if (b <= -1.7) tmp = 1.0; else tmp = Float64(1.0 / Float64(2.0 + Float64(Float64(a * Float64(a * 0.5)) - a))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= -1.7) tmp = 1.0; else tmp = 1.0 / (2.0 + ((a * (a * 0.5)) - a)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, -1.7], 1.0, N[(1.0 / N[(2.0 + N[(N[(a * N[(a * 0.5), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.7:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2 + \left(a \cdot \left(a \cdot 0.5\right) - a\right)}\\
\end{array}
\end{array}
if b < -1.69999999999999996Initial program 97.9%
*-lft-identity97.9%
associate-*l/97.9%
associate-/r/97.9%
remove-double-neg97.9%
unsub-neg97.9%
div-sub97.9%
*-lft-identity97.9%
associate-*l/97.9%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
add-exp-log100.0%
log-rec100.0%
log1p-define100.0%
Applied egg-rr100.0%
exp-neg100.0%
log1p-undefine100.0%
add-exp-log100.0%
add-sqr-sqrt99.9%
associate-/r*99.9%
Applied egg-rr97.5%
*-inverses97.5%
Simplified97.5%
if -1.69999999999999996 < b Initial program 99.0%
*-lft-identity99.0%
associate-*l/99.0%
associate-/r/99.0%
remove-double-neg99.0%
unsub-neg99.0%
div-sub65.2%
*-lft-identity65.2%
associate-*l/65.2%
lft-mult-inverse99.9%
sub-neg99.9%
distribute-frac-neg99.9%
remove-double-neg99.9%
div-exp100.0%
Simplified100.0%
Taylor expanded in b around 0 76.8%
Taylor expanded in a around 0 55.4%
sub-neg55.4%
distribute-rgt-in55.4%
*-commutative55.4%
metadata-eval55.4%
Applied egg-rr55.4%
Final simplification63.5%
(FPCore (a b) :precision binary64 (if (<= b -0.56) 1.0 (+ 0.5 (* a 0.25))))
double code(double a, double b) {
double tmp;
if (b <= -0.56) {
tmp = 1.0;
} else {
tmp = 0.5 + (a * 0.25);
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-0.56d0)) then
tmp = 1.0d0
else
tmp = 0.5d0 + (a * 0.25d0)
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= -0.56) {
tmp = 1.0;
} else {
tmp = 0.5 + (a * 0.25);
}
return tmp;
}
def code(a, b): tmp = 0 if b <= -0.56: tmp = 1.0 else: tmp = 0.5 + (a * 0.25) return tmp
function code(a, b) tmp = 0.0 if (b <= -0.56) tmp = 1.0; else tmp = Float64(0.5 + Float64(a * 0.25)); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= -0.56) tmp = 1.0; else tmp = 0.5 + (a * 0.25); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, -0.56], 1.0, N[(0.5 + N[(a * 0.25), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -0.56:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0.5 + a \cdot 0.25\\
\end{array}
\end{array}
if b < -0.56000000000000005Initial program 97.9%
*-lft-identity97.9%
associate-*l/97.9%
associate-/r/97.9%
remove-double-neg97.9%
unsub-neg97.9%
div-sub97.9%
*-lft-identity97.9%
associate-*l/97.9%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
add-exp-log100.0%
log-rec100.0%
log1p-define100.0%
Applied egg-rr100.0%
exp-neg100.0%
log1p-undefine100.0%
add-exp-log100.0%
add-sqr-sqrt99.9%
associate-/r*99.9%
Applied egg-rr97.5%
*-inverses97.5%
Simplified97.5%
if -0.56000000000000005 < b Initial program 99.0%
*-lft-identity99.0%
associate-*l/99.0%
associate-/r/99.0%
remove-double-neg99.0%
unsub-neg99.0%
div-sub65.2%
*-lft-identity65.2%
associate-*l/65.2%
lft-mult-inverse99.9%
sub-neg99.9%
distribute-frac-neg99.9%
remove-double-neg99.9%
div-exp100.0%
Simplified100.0%
Taylor expanded in b around 0 76.8%
Taylor expanded in a around 0 40.7%
*-commutative40.7%
Simplified40.7%
Final simplification51.6%
(FPCore (a b) :precision binary64 (if (<= b -2.0) 1.0 (+ 0.5 (* b -0.25))))
double code(double a, double b) {
double tmp;
if (b <= -2.0) {
tmp = 1.0;
} else {
tmp = 0.5 + (b * -0.25);
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-2.0d0)) then
tmp = 1.0d0
else
tmp = 0.5d0 + (b * (-0.25d0))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= -2.0) {
tmp = 1.0;
} else {
tmp = 0.5 + (b * -0.25);
}
return tmp;
}
def code(a, b): tmp = 0 if b <= -2.0: tmp = 1.0 else: tmp = 0.5 + (b * -0.25) return tmp
function code(a, b) tmp = 0.0 if (b <= -2.0) tmp = 1.0; else tmp = Float64(0.5 + Float64(b * -0.25)); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= -2.0) tmp = 1.0; else tmp = 0.5 + (b * -0.25); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, -2.0], 1.0, N[(0.5 + N[(b * -0.25), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0.5 + b \cdot -0.25\\
\end{array}
\end{array}
if b < -2Initial program 97.9%
*-lft-identity97.9%
associate-*l/97.9%
associate-/r/97.9%
remove-double-neg97.9%
unsub-neg97.9%
div-sub97.9%
*-lft-identity97.9%
associate-*l/97.9%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
add-exp-log100.0%
log-rec100.0%
log1p-define100.0%
Applied egg-rr100.0%
exp-neg100.0%
log1p-undefine100.0%
add-exp-log100.0%
add-sqr-sqrt100.0%
associate-/r*100.0%
Applied egg-rr99.1%
*-inverses99.1%
Simplified99.1%
if -2 < b Initial program 99.0%
*-lft-identity99.0%
associate-*l/99.0%
associate-/r/99.0%
remove-double-neg99.0%
unsub-neg99.0%
div-sub65.3%
*-lft-identity65.3%
associate-*l/65.3%
lft-mult-inverse99.9%
sub-neg99.9%
distribute-frac-neg99.9%
remove-double-neg99.9%
div-exp100.0%
Simplified100.0%
Taylor expanded in a around 0 76.5%
Taylor expanded in b around 0 40.4%
*-commutative40.4%
Simplified40.4%
Final simplification51.5%
(FPCore (a b) :precision binary64 (if (<= b -1.0) 1.0 (/ 1.0 (+ b 2.0))))
double code(double a, double b) {
double tmp;
if (b <= -1.0) {
tmp = 1.0;
} else {
tmp = 1.0 / (b + 2.0);
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-1.0d0)) then
tmp = 1.0d0
else
tmp = 1.0d0 / (b + 2.0d0)
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= -1.0) {
tmp = 1.0;
} else {
tmp = 1.0 / (b + 2.0);
}
return tmp;
}
def code(a, b): tmp = 0 if b <= -1.0: tmp = 1.0 else: tmp = 1.0 / (b + 2.0) return tmp
function code(a, b) tmp = 0.0 if (b <= -1.0) tmp = 1.0; else tmp = Float64(1.0 / Float64(b + 2.0)); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= -1.0) tmp = 1.0; else tmp = 1.0 / (b + 2.0); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, -1.0], 1.0, N[(1.0 / N[(b + 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{b + 2}\\
\end{array}
\end{array}
if b < -1Initial program 97.9%
*-lft-identity97.9%
associate-*l/97.9%
associate-/r/97.9%
remove-double-neg97.9%
unsub-neg97.9%
div-sub97.9%
*-lft-identity97.9%
associate-*l/97.9%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
add-exp-log100.0%
log-rec100.0%
log1p-define100.0%
Applied egg-rr100.0%
exp-neg100.0%
log1p-undefine100.0%
add-exp-log100.0%
add-sqr-sqrt99.9%
associate-/r*99.9%
Applied egg-rr97.5%
*-inverses97.5%
Simplified97.5%
if -1 < b Initial program 99.0%
*-lft-identity99.0%
associate-*l/99.0%
associate-/r/99.0%
remove-double-neg99.0%
unsub-neg99.0%
div-sub65.2%
*-lft-identity65.2%
associate-*l/65.2%
lft-mult-inverse99.9%
sub-neg99.9%
distribute-frac-neg99.9%
remove-double-neg99.9%
div-exp100.0%
Simplified100.0%
Taylor expanded in a around 0 76.4%
Taylor expanded in b around 0 41.5%
+-commutative41.5%
Simplified41.5%
Final simplification52.2%
(FPCore (a b) :precision binary64 (if (<= b -1.35) 1.0 (/ 1.0 (- 2.0 a))))
double code(double a, double b) {
double tmp;
if (b <= -1.35) {
tmp = 1.0;
} else {
tmp = 1.0 / (2.0 - a);
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-1.35d0)) then
tmp = 1.0d0
else
tmp = 1.0d0 / (2.0d0 - a)
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= -1.35) {
tmp = 1.0;
} else {
tmp = 1.0 / (2.0 - a);
}
return tmp;
}
def code(a, b): tmp = 0 if b <= -1.35: tmp = 1.0 else: tmp = 1.0 / (2.0 - a) return tmp
function code(a, b) tmp = 0.0 if (b <= -1.35) tmp = 1.0; else tmp = Float64(1.0 / Float64(2.0 - a)); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= -1.35) tmp = 1.0; else tmp = 1.0 / (2.0 - a); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, -1.35], 1.0, N[(1.0 / N[(2.0 - a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.35:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2 - a}\\
\end{array}
\end{array}
if b < -1.3500000000000001Initial program 97.9%
*-lft-identity97.9%
associate-*l/97.9%
associate-/r/97.9%
remove-double-neg97.9%
unsub-neg97.9%
div-sub97.9%
*-lft-identity97.9%
associate-*l/97.9%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
add-exp-log100.0%
log-rec100.0%
log1p-define100.0%
Applied egg-rr100.0%
exp-neg100.0%
log1p-undefine100.0%
add-exp-log100.0%
add-sqr-sqrt99.9%
associate-/r*99.9%
Applied egg-rr97.5%
*-inverses97.5%
Simplified97.5%
if -1.3500000000000001 < b Initial program 99.0%
*-lft-identity99.0%
associate-*l/99.0%
associate-/r/99.0%
remove-double-neg99.0%
unsub-neg99.0%
div-sub65.2%
*-lft-identity65.2%
associate-*l/65.2%
lft-mult-inverse99.9%
sub-neg99.9%
distribute-frac-neg99.9%
remove-double-neg99.9%
div-exp100.0%
Simplified100.0%
Taylor expanded in b around 0 76.8%
Taylor expanded in a around 0 40.9%
neg-mul-140.9%
unsub-neg40.9%
Simplified40.9%
Final simplification51.7%
(FPCore (a b) :precision binary64 0.5)
double code(double a, double b) {
return 0.5;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = 0.5d0
end function
public static double code(double a, double b) {
return 0.5;
}
def code(a, b): return 0.5
function code(a, b) return 0.5 end
function tmp = code(a, b) tmp = 0.5; end
code[a_, b_] := 0.5
\begin{array}{l}
\\
0.5
\end{array}
Initial program 98.8%
*-lft-identity98.8%
associate-*l/98.8%
associate-/r/98.8%
remove-double-neg98.8%
unsub-neg98.8%
div-sub71.4%
*-lft-identity71.4%
associate-*l/71.4%
lft-mult-inverse100.0%
sub-neg100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
div-exp100.0%
Simplified100.0%
Taylor expanded in a around 0 80.9%
Taylor expanded in b around 0 36.0%
Final simplification36.0%
(FPCore (a b) :precision binary64 (/ 1.0 (+ 1.0 (exp (- b a)))))
double code(double a, double b) {
return 1.0 / (1.0 + exp((b - a)));
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = 1.0d0 / (1.0d0 + exp((b - a)))
end function
public static double code(double a, double b) {
return 1.0 / (1.0 + Math.exp((b - a)));
}
def code(a, b): return 1.0 / (1.0 + math.exp((b - a)))
function code(a, b) return Float64(1.0 / Float64(1.0 + exp(Float64(b - a)))) end
function tmp = code(a, b) tmp = 1.0 / (1.0 + exp((b - a))); end
code[a_, b_] := N[(1.0 / N[(1.0 + N[Exp[N[(b - a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{1 + e^{b - a}}
\end{array}
herbie shell --seed 2024066
(FPCore (a b)
:name "Quotient of sum of exps"
:precision binary64
:alt
(/ 1.0 (+ 1.0 (exp (- b a))))
(/ (exp a) (+ (exp a) (exp b))))