
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
(FPCore (x y z t a b) :precision binary64 (* x (exp (fma y (- (log z) t) (* a (- (log1p (- z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(y, (log(z) - t), (a * (log1p(-z) - b))));
}
function code(x, y, z, t, a, b) return Float64(x * exp(fma(y, Float64(log(z) - t), Float64(a * Float64(log1p(Float64(-z)) - b))))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}
\end{array}
Initial program 98.0%
fma-define98.8%
sub-neg98.8%
log1p-define99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -480.0) (not (<= t 4.8e+130))) (* x (exp (* t (- y)))) (* x (exp (- (* y (log z)) (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -480.0) || !(t <= 4.8e+130)) {
tmp = x * exp((t * -y));
} else {
tmp = x * exp(((y * log(z)) - (a * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-480.0d0)) .or. (.not. (t <= 4.8d+130))) then
tmp = x * exp((t * -y))
else
tmp = x * exp(((y * log(z)) - (a * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -480.0) || !(t <= 4.8e+130)) {
tmp = x * Math.exp((t * -y));
} else {
tmp = x * Math.exp(((y * Math.log(z)) - (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -480.0) or not (t <= 4.8e+130): tmp = x * math.exp((t * -y)) else: tmp = x * math.exp(((y * math.log(z)) - (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -480.0) || !(t <= 4.8e+130)) tmp = Float64(x * exp(Float64(t * Float64(-y)))); else tmp = Float64(x * exp(Float64(Float64(y * log(z)) - Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -480.0) || ~((t <= 4.8e+130))) tmp = x * exp((t * -y)); else tmp = x * exp(((y * log(z)) - (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -480.0], N[Not[LessEqual[t, 4.8e+130]], $MachinePrecision]], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] - N[(a * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -480 \lor \neg \left(t \leq 4.8 \cdot 10^{+130}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \log z - a \cdot b}\\
\end{array}
\end{array}
if t < -480 or 4.80000000000000048e130 < t Initial program 98.2%
Taylor expanded in t around inf 83.5%
mul-1-neg83.5%
distribute-lft-neg-out83.5%
*-commutative83.5%
Simplified83.5%
if -480 < t < 4.80000000000000048e130Initial program 97.8%
Taylor expanded in z around 0 97.8%
Taylor expanded in t around 0 97.2%
+-commutative97.2%
mul-1-neg97.2%
unsub-neg97.2%
Simplified97.2%
Final simplification91.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -1.55e+16)
(* x (pow (exp (- a)) b))
(if (<= a 1.85e+112)
(* x (exp (* y (- (log z) t))))
(* x (exp (* a (- (log1p (- z)) b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.55e+16) {
tmp = x * pow(exp(-a), b);
} else if (a <= 1.85e+112) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = x * exp((a * (log1p(-z) - b)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.55e+16) {
tmp = x * Math.pow(Math.exp(-a), b);
} else if (a <= 1.85e+112) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((a * (Math.log1p(-z) - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.55e+16: tmp = x * math.pow(math.exp(-a), b) elif a <= 1.85e+112: tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((a * (math.log1p(-z) - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.55e+16) tmp = Float64(x * (exp(Float64(-a)) ^ b)); elseif (a <= 1.85e+112) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(Float64(a * Float64(log1p(Float64(-z)) - b)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.55e+16], N[(x * N[Power[N[Exp[(-a)], $MachinePrecision], b], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.85e+112], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.55 \cdot 10^{+16}:\\
\;\;\;\;x \cdot {\left(e^{-a}\right)}^{b}\\
\mathbf{elif}\;a \leq 1.85 \cdot 10^{+112}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}\\
\end{array}
\end{array}
if a < -1.55e16Initial program 96.3%
Taylor expanded in z around 0 96.3%
Taylor expanded in y around 0 61.6%
*-commutative61.6%
associate-*r*61.6%
neg-mul-161.6%
exp-prod71.0%
Simplified71.0%
if -1.55e16 < a < 1.85000000000000002e112Initial program 99.3%
Taylor expanded in y around inf 89.1%
if 1.85000000000000002e112 < a Initial program 94.5%
Taylor expanded in y around 0 86.5%
sub-neg86.5%
log1p-define94.5%
Simplified94.5%
Final simplification86.1%
(FPCore (x y z t a b) :precision binary64 (if (<= a -3.2e+16) (* x (pow (exp (- a)) b)) (if (<= a 1.65e+108) (* x (exp (* y (- (log z) t)))) (/ x (exp (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -3.2e+16) {
tmp = x * pow(exp(-a), b);
} else if (a <= 1.65e+108) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = x / exp((a * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-3.2d+16)) then
tmp = x * (exp(-a) ** b)
else if (a <= 1.65d+108) then
tmp = x * exp((y * (log(z) - t)))
else
tmp = x / exp((a * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -3.2e+16) {
tmp = x * Math.pow(Math.exp(-a), b);
} else if (a <= 1.65e+108) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x / Math.exp((a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -3.2e+16: tmp = x * math.pow(math.exp(-a), b) elif a <= 1.65e+108: tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x / math.exp((a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -3.2e+16) tmp = Float64(x * (exp(Float64(-a)) ^ b)); elseif (a <= 1.65e+108) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x / exp(Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -3.2e+16) tmp = x * (exp(-a) ^ b); elseif (a <= 1.65e+108) tmp = x * exp((y * (log(z) - t))); else tmp = x / exp((a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -3.2e+16], N[(x * N[Power[N[Exp[(-a)], $MachinePrecision], b], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.65e+108], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x / N[Exp[N[(a * b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{+16}:\\
\;\;\;\;x \cdot {\left(e^{-a}\right)}^{b}\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{+108}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{e^{a \cdot b}}\\
\end{array}
\end{array}
if a < -3.2e16Initial program 96.3%
Taylor expanded in z around 0 96.3%
Taylor expanded in y around 0 61.6%
*-commutative61.6%
associate-*r*61.6%
neg-mul-161.6%
exp-prod71.0%
Simplified71.0%
if -3.2e16 < a < 1.6500000000000001e108Initial program 99.3%
Taylor expanded in y around inf 89.1%
if 1.6500000000000001e108 < a Initial program 94.5%
Taylor expanded in z around 0 94.5%
Taylor expanded in y around inf 94.5%
sub-neg94.5%
mul-1-neg94.5%
associate-+r+94.5%
mul-1-neg94.5%
sub-neg94.5%
*-commutative94.5%
distribute-lft-out--94.5%
+-commutative94.5%
mul-1-neg94.5%
sub-neg94.5%
exp-diff75.0%
Simplified66.7%
Taylor expanded in y around 0 86.5%
Final simplification84.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.5e-70) (not (<= y 5.2e-153))) (* x (pow (/ z (exp t)) y)) (/ x (exp (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.5e-70) || !(y <= 5.2e-153)) {
tmp = x * pow((z / exp(t)), y);
} else {
tmp = x / exp((a * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.5d-70)) .or. (.not. (y <= 5.2d-153))) then
tmp = x * ((z / exp(t)) ** y)
else
tmp = x / exp((a * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.5e-70) || !(y <= 5.2e-153)) {
tmp = x * Math.pow((z / Math.exp(t)), y);
} else {
tmp = x / Math.exp((a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.5e-70) or not (y <= 5.2e-153): tmp = x * math.pow((z / math.exp(t)), y) else: tmp = x / math.exp((a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.5e-70) || !(y <= 5.2e-153)) tmp = Float64(x * (Float64(z / exp(t)) ^ y)); else tmp = Float64(x / exp(Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.5e-70) || ~((y <= 5.2e-153))) tmp = x * ((z / exp(t)) ^ y); else tmp = x / exp((a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.5e-70], N[Not[LessEqual[y, 5.2e-153]], $MachinePrecision]], N[(x * N[Power[N[(z / N[Exp[t], $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], N[(x / N[Exp[N[(a * b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-70} \lor \neg \left(y \leq 5.2 \cdot 10^{-153}\right):\\
\;\;\;\;x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{e^{a \cdot b}}\\
\end{array}
\end{array}
if y < -2.4999999999999999e-70 or 5.2000000000000003e-153 < y Initial program 97.8%
Taylor expanded in z around 0 97.8%
Taylor expanded in a around 0 82.7%
*-commutative82.7%
*-commutative82.7%
exp-prod82.7%
exp-diff82.7%
rem-exp-log82.7%
Simplified82.7%
if -2.4999999999999999e-70 < y < 5.2000000000000003e-153Initial program 98.6%
Taylor expanded in z around 0 98.6%
Taylor expanded in y around inf 98.6%
sub-neg98.6%
mul-1-neg98.6%
associate-+r+98.6%
mul-1-neg98.6%
sub-neg98.6%
*-commutative98.6%
distribute-lft-out--98.6%
+-commutative98.6%
mul-1-neg98.6%
sub-neg98.6%
exp-diff95.7%
Simplified70.6%
Taylor expanded in y around 0 84.4%
Final simplification83.2%
(FPCore (x y z t a b) :precision binary64 (* x (exp (- (* y (- (log z) t)) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) - (a * b)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) - (a * b)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) - (a * b)));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) - (a * b)))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) - Float64(a * b)))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) - (a * b))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] - N[(a * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot b}
\end{array}
Initial program 98.0%
Taylor expanded in z around 0 98.0%
Final simplification98.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -420.0) (not (<= t 2e-19))) (* x (exp (* t (- y)))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -420.0) || !(t <= 2e-19)) {
tmp = x * exp((t * -y));
} else {
tmp = x * pow(z, y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-420.0d0)) .or. (.not. (t <= 2d-19))) then
tmp = x * exp((t * -y))
else
tmp = x * (z ** y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -420.0) || !(t <= 2e-19)) {
tmp = x * Math.exp((t * -y));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -420.0) or not (t <= 2e-19): tmp = x * math.exp((t * -y)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -420.0) || !(t <= 2e-19)) tmp = Float64(x * exp(Float64(t * Float64(-y)))); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -420.0) || ~((t <= 2e-19))) tmp = x * exp((t * -y)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -420.0], N[Not[LessEqual[t, 2e-19]], $MachinePrecision]], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -420 \lor \neg \left(t \leq 2 \cdot 10^{-19}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -420 or 2e-19 < t Initial program 97.2%
Taylor expanded in t around inf 81.8%
mul-1-neg81.8%
distribute-lft-neg-out81.8%
*-commutative81.8%
Simplified81.8%
if -420 < t < 2e-19Initial program 99.0%
Taylor expanded in y around inf 70.5%
Taylor expanded in t around 0 70.6%
Final simplification76.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.15e+97) (not (<= y 3.2e+57))) (* x (pow z y)) (/ x (exp (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.15e+97) || !(y <= 3.2e+57)) {
tmp = x * pow(z, y);
} else {
tmp = x / exp((a * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.15d+97)) .or. (.not. (y <= 3.2d+57))) then
tmp = x * (z ** y)
else
tmp = x / exp((a * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.15e+97) || !(y <= 3.2e+57)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x / Math.exp((a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.15e+97) or not (y <= 3.2e+57): tmp = x * math.pow(z, y) else: tmp = x / math.exp((a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.15e+97) || !(y <= 3.2e+57)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x / exp(Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.15e+97) || ~((y <= 3.2e+57))) tmp = x * (z ^ y); else tmp = x / exp((a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.15e+97], N[Not[LessEqual[y, 3.2e+57]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x / N[Exp[N[(a * b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{+97} \lor \neg \left(y \leq 3.2 \cdot 10^{+57}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{e^{a \cdot b}}\\
\end{array}
\end{array}
if y < -2.1499999999999999e97 or 3.20000000000000029e57 < y Initial program 97.1%
Taylor expanded in y around inf 90.5%
Taylor expanded in t around 0 65.0%
if -2.1499999999999999e97 < y < 3.20000000000000029e57Initial program 98.6%
Taylor expanded in z around 0 98.6%
Taylor expanded in y around inf 98.6%
sub-neg98.6%
mul-1-neg98.6%
associate-+r+98.6%
mul-1-neg98.6%
sub-neg98.6%
*-commutative98.6%
distribute-lft-out--98.6%
+-commutative98.6%
mul-1-neg98.6%
sub-neg98.6%
exp-diff88.1%
Simplified75.3%
Taylor expanded in y around 0 72.2%
Final simplification69.3%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.4e+265) (- x (* x (* y t))) (if (<= t -14500000.0) (* a (- (/ x a) (* x b))) (* x (pow z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.4e+265) {
tmp = x - (x * (y * t));
} else if (t <= -14500000.0) {
tmp = a * ((x / a) - (x * b));
} else {
tmp = x * pow(z, y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-3.4d+265)) then
tmp = x - (x * (y * t))
else if (t <= (-14500000.0d0)) then
tmp = a * ((x / a) - (x * b))
else
tmp = x * (z ** y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.4e+265) {
tmp = x - (x * (y * t));
} else if (t <= -14500000.0) {
tmp = a * ((x / a) - (x * b));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.4e+265: tmp = x - (x * (y * t)) elif t <= -14500000.0: tmp = a * ((x / a) - (x * b)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.4e+265) tmp = Float64(x - Float64(x * Float64(y * t))); elseif (t <= -14500000.0) tmp = Float64(a * Float64(Float64(x / a) - Float64(x * b))); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -3.4e+265) tmp = x - (x * (y * t)); elseif (t <= -14500000.0) tmp = a * ((x / a) - (x * b)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.4e+265], N[(x - N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -14500000.0], N[(a * N[(N[(x / a), $MachinePrecision] - N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+265}:\\
\;\;\;\;x - x \cdot \left(y \cdot t\right)\\
\mathbf{elif}\;t \leq -14500000:\\
\;\;\;\;a \cdot \left(\frac{x}{a} - x \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -3.3999999999999999e265Initial program 100.0%
Taylor expanded in y around inf 100.0%
Taylor expanded in y around 0 56.9%
*-commutative56.9%
Simplified56.9%
Taylor expanded in t around inf 56.9%
neg-mul-156.9%
Simplified56.9%
if -3.3999999999999999e265 < t < -1.45e7Initial program 100.0%
Taylor expanded in z around 0 100.0%
Taylor expanded in y around 0 50.0%
*-commutative50.0%
associate-*r*50.0%
neg-mul-150.0%
exp-prod41.7%
Simplified41.7%
Taylor expanded in a around 0 25.5%
neg-mul-125.5%
distribute-rgt-neg-in25.5%
Simplified25.5%
Taylor expanded in a around inf 33.0%
+-commutative33.0%
mul-1-neg33.0%
unsub-neg33.0%
*-commutative33.0%
Simplified33.0%
if -1.45e7 < t Initial program 97.2%
Taylor expanded in y around inf 75.6%
Taylor expanded in t around 0 65.6%
Final simplification57.2%
(FPCore (x y z t a b) :precision binary64 (if (<= z 2.9e-137) (* x (- 1.0 (* a b))) (if (<= z 1.75e-25) (- x (* t (* x y))) (* a (* x (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2.9e-137) {
tmp = x * (1.0 - (a * b));
} else if (z <= 1.75e-25) {
tmp = x - (t * (x * y));
} else {
tmp = a * (x * -b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 2.9d-137) then
tmp = x * (1.0d0 - (a * b))
else if (z <= 1.75d-25) then
tmp = x - (t * (x * y))
else
tmp = a * (x * -b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2.9e-137) {
tmp = x * (1.0 - (a * b));
} else if (z <= 1.75e-25) {
tmp = x - (t * (x * y));
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 2.9e-137: tmp = x * (1.0 - (a * b)) elif z <= 1.75e-25: tmp = x - (t * (x * y)) else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2.9e-137) tmp = Float64(x * Float64(1.0 - Float64(a * b))); elseif (z <= 1.75e-25) tmp = Float64(x - Float64(t * Float64(x * y))); else tmp = Float64(a * Float64(x * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= 2.9e-137) tmp = x * (1.0 - (a * b)); elseif (z <= 1.75e-25) tmp = x - (t * (x * y)); else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 2.9e-137], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e-25], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.9 \cdot 10^{-137}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-25}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if z < 2.89999999999999985e-137Initial program 98.4%
Taylor expanded in z around 0 98.4%
Taylor expanded in y around 0 57.6%
*-commutative57.6%
associate-*r*57.6%
neg-mul-157.6%
exp-prod49.6%
Simplified49.6%
Taylor expanded in a around 0 36.8%
neg-mul-136.8%
distribute-rgt-neg-in36.8%
Simplified36.8%
Taylor expanded in a around 0 31.9%
mul-1-neg31.9%
*-lft-identity31.9%
associate-*r*36.8%
distribute-lft-neg-in36.8%
mul-1-neg36.8%
distribute-rgt-in36.8%
mul-1-neg36.8%
unsub-neg36.8%
Simplified36.8%
if 2.89999999999999985e-137 < z < 1.7500000000000001e-25Initial program 96.8%
Taylor expanded in y around inf 73.8%
Taylor expanded in y around 0 30.0%
*-commutative30.0%
Simplified30.0%
Taylor expanded in t around inf 26.8%
associate-*r*26.8%
neg-mul-126.8%
Simplified26.8%
if 1.7500000000000001e-25 < z Initial program 100.0%
Taylor expanded in z around 0 100.0%
Taylor expanded in y around 0 39.0%
*-commutative39.0%
associate-*r*39.0%
neg-mul-139.0%
exp-prod28.6%
Simplified28.6%
Taylor expanded in a around 0 17.6%
neg-mul-117.6%
distribute-rgt-neg-in17.6%
Simplified17.6%
Taylor expanded in a around inf 49.4%
mul-1-neg49.4%
*-commutative49.4%
Simplified49.4%
Final simplification34.5%
(FPCore (x y z t a b) :precision binary64 (if (<= z 8.5e-137) (* x (- 1.0 (* a b))) (if (<= z 1.75e-25) (- x (* x (* y t))) (* a (* x (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 8.5e-137) {
tmp = x * (1.0 - (a * b));
} else if (z <= 1.75e-25) {
tmp = x - (x * (y * t));
} else {
tmp = a * (x * -b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 8.5d-137) then
tmp = x * (1.0d0 - (a * b))
else if (z <= 1.75d-25) then
tmp = x - (x * (y * t))
else
tmp = a * (x * -b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 8.5e-137) {
tmp = x * (1.0 - (a * b));
} else if (z <= 1.75e-25) {
tmp = x - (x * (y * t));
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 8.5e-137: tmp = x * (1.0 - (a * b)) elif z <= 1.75e-25: tmp = x - (x * (y * t)) else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 8.5e-137) tmp = Float64(x * Float64(1.0 - Float64(a * b))); elseif (z <= 1.75e-25) tmp = Float64(x - Float64(x * Float64(y * t))); else tmp = Float64(a * Float64(x * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= 8.5e-137) tmp = x * (1.0 - (a * b)); elseif (z <= 1.75e-25) tmp = x - (x * (y * t)); else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 8.5e-137], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e-25], N[(x - N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 8.5 \cdot 10^{-137}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-25}:\\
\;\;\;\;x - x \cdot \left(y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if z < 8.5000000000000001e-137Initial program 98.4%
Taylor expanded in z around 0 98.4%
Taylor expanded in y around 0 57.6%
*-commutative57.6%
associate-*r*57.6%
neg-mul-157.6%
exp-prod49.6%
Simplified49.6%
Taylor expanded in a around 0 36.8%
neg-mul-136.8%
distribute-rgt-neg-in36.8%
Simplified36.8%
Taylor expanded in a around 0 31.9%
mul-1-neg31.9%
*-lft-identity31.9%
associate-*r*36.8%
distribute-lft-neg-in36.8%
mul-1-neg36.8%
distribute-rgt-in36.8%
mul-1-neg36.8%
unsub-neg36.8%
Simplified36.8%
if 8.5000000000000001e-137 < z < 1.7500000000000001e-25Initial program 96.8%
Taylor expanded in y around inf 73.8%
Taylor expanded in y around 0 30.0%
*-commutative30.0%
Simplified30.0%
Taylor expanded in t around inf 28.8%
neg-mul-128.8%
Simplified28.8%
if 1.7500000000000001e-25 < z Initial program 100.0%
Taylor expanded in z around 0 100.0%
Taylor expanded in y around 0 39.0%
*-commutative39.0%
associate-*r*39.0%
neg-mul-139.0%
exp-prod28.6%
Simplified28.6%
Taylor expanded in a around 0 17.6%
neg-mul-117.6%
distribute-rgt-neg-in17.6%
Simplified17.6%
Taylor expanded in a around inf 49.4%
mul-1-neg49.4%
*-commutative49.4%
Simplified49.4%
Final simplification35.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -8.5e-92) (not (<= y 2.05e-7))) (* a (* x (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -8.5e-92) || !(y <= 2.05e-7)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-8.5d-92)) .or. (.not. (y <= 2.05d-7))) then
tmp = a * (x * -b)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -8.5e-92) || !(y <= 2.05e-7)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -8.5e-92) or not (y <= 2.05e-7): tmp = a * (x * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -8.5e-92) || !(y <= 2.05e-7)) tmp = Float64(a * Float64(x * Float64(-b))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -8.5e-92) || ~((y <= 2.05e-7))) tmp = a * (x * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -8.5e-92], N[Not[LessEqual[y, 2.05e-7]], $MachinePrecision]], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{-92} \lor \neg \left(y \leq 2.05 \cdot 10^{-7}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -8.50000000000000067e-92 or 2.05e-7 < y Initial program 98.1%
Taylor expanded in z around 0 98.1%
Taylor expanded in y around 0 42.5%
*-commutative42.5%
associate-*r*42.5%
neg-mul-142.5%
exp-prod38.4%
Simplified38.4%
Taylor expanded in a around 0 16.7%
neg-mul-116.7%
distribute-rgt-neg-in16.7%
Simplified16.7%
Taylor expanded in a around inf 21.3%
mul-1-neg21.3%
*-commutative21.3%
Simplified21.3%
if -8.50000000000000067e-92 < y < 2.05e-7Initial program 97.9%
Taylor expanded in y around inf 66.2%
Taylor expanded in y around 0 40.2%
Final simplification28.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.2e-92) (* a (* x (- b))) (if (<= y 2.7e-6) x (* (* a b) (- x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.2e-92) {
tmp = a * (x * -b);
} else if (y <= 2.7e-6) {
tmp = x;
} else {
tmp = (a * b) * -x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-2.2d-92)) then
tmp = a * (x * -b)
else if (y <= 2.7d-6) then
tmp = x
else
tmp = (a * b) * -x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.2e-92) {
tmp = a * (x * -b);
} else if (y <= 2.7e-6) {
tmp = x;
} else {
tmp = (a * b) * -x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.2e-92: tmp = a * (x * -b) elif y <= 2.7e-6: tmp = x else: tmp = (a * b) * -x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.2e-92) tmp = Float64(a * Float64(x * Float64(-b))); elseif (y <= 2.7e-6) tmp = x; else tmp = Float64(Float64(a * b) * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.2e-92) tmp = a * (x * -b); elseif (y <= 2.7e-6) tmp = x; else tmp = (a * b) * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.2e-92], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e-6], x, N[(N[(a * b), $MachinePrecision] * (-x)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{-92}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-6}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot b\right) \cdot \left(-x\right)\\
\end{array}
\end{array}
if y < -2.19999999999999987e-92Initial program 96.9%
Taylor expanded in z around 0 96.9%
Taylor expanded in y around 0 48.4%
*-commutative48.4%
associate-*r*48.4%
neg-mul-148.4%
exp-prod43.6%
Simplified43.6%
Taylor expanded in a around 0 19.7%
neg-mul-119.7%
distribute-rgt-neg-in19.7%
Simplified19.7%
Taylor expanded in a around inf 20.4%
mul-1-neg20.4%
*-commutative20.4%
Simplified20.4%
if -2.19999999999999987e-92 < y < 2.69999999999999998e-6Initial program 97.9%
Taylor expanded in y around inf 66.2%
Taylor expanded in y around 0 40.2%
if 2.69999999999999998e-6 < y Initial program 99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in y around 0 33.3%
*-commutative33.3%
associate-*r*33.3%
neg-mul-133.3%
exp-prod30.4%
Simplified30.4%
Taylor expanded in a around 0 12.2%
neg-mul-112.2%
distribute-rgt-neg-in12.2%
Simplified12.2%
Taylor expanded in a around inf 22.6%
mul-1-neg22.6%
associate-*r*24.0%
*-commutative24.0%
distribute-rgt-neg-in24.0%
*-commutative24.0%
distribute-rgt-neg-in24.0%
Simplified24.0%
Final simplification28.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z 3.8e-27) (* x (- 1.0 (* a b))) (* a (* x (- b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 3.8e-27) {
tmp = x * (1.0 - (a * b));
} else {
tmp = a * (x * -b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 3.8d-27) then
tmp = x * (1.0d0 - (a * b))
else
tmp = a * (x * -b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 3.8e-27) {
tmp = x * (1.0 - (a * b));
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 3.8e-27: tmp = x * (1.0 - (a * b)) else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 3.8e-27) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(a * Float64(x * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= 3.8e-27) tmp = x * (1.0 - (a * b)); else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 3.8e-27], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.8 \cdot 10^{-27}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if z < 3.8e-27Initial program 97.7%
Taylor expanded in z around 0 97.7%
Taylor expanded in y around 0 57.9%
*-commutative57.9%
associate-*r*57.9%
neg-mul-157.9%
exp-prod51.9%
Simplified51.9%
Taylor expanded in a around 0 30.3%
neg-mul-130.3%
distribute-rgt-neg-in30.3%
Simplified30.3%
Taylor expanded in a around 0 27.8%
mul-1-neg27.8%
*-lft-identity27.8%
associate-*r*30.3%
distribute-lft-neg-in30.3%
mul-1-neg30.3%
distribute-rgt-in30.3%
mul-1-neg30.3%
unsub-neg30.3%
Simplified30.3%
if 3.8e-27 < z Initial program 100.0%
Taylor expanded in z around 0 100.0%
Taylor expanded in y around 0 34.1%
*-commutative34.1%
associate-*r*34.1%
neg-mul-134.1%
exp-prod25.1%
Simplified25.1%
Taylor expanded in a around 0 15.6%
neg-mul-115.6%
distribute-rgt-neg-in15.6%
Simplified15.6%
Taylor expanded in a around inf 43.3%
mul-1-neg43.3%
*-commutative43.3%
Simplified43.3%
Final simplification31.9%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 98.0%
Taylor expanded in y around inf 76.8%
Taylor expanded in y around 0 18.9%
Final simplification18.9%
herbie shell --seed 2024130
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B"
:precision binary64
(* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))