
(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 18 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 96.7%
fma-def97.4%
sub-neg97.4%
log1p-def99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a b) :precision binary64 (* x (exp (fma a (- (log1p (- z)) b) (* y (- (log z) t))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(a, (log1p(-z) - b), (y * (log(z) - t))));
}
function code(x, y, z, t, a, b) return Float64(x * exp(fma(a, Float64(log1p(Float64(-z)) - b), Float64(y * Float64(log(z) - t))))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision] + N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\mathsf{fma}\left(a, \mathsf{log1p}\left(-z\right) - b, y \cdot \left(\log z - t\right)\right)}
\end{array}
Initial program 96.7%
+-commutative96.7%
fma-def97.1%
sub-neg97.1%
log1p-def99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -850000000000.0) (not (<= y 1.85e-83))) (* x (exp (* y (- (log z) t)))) (* x (exp (* a (- (- z) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -850000000000.0) || !(y <= 1.85e-83)) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = x * exp((a * (-z - 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 <= (-850000000000.0d0)) .or. (.not. (y <= 1.85d-83))) then
tmp = x * exp((y * (log(z) - t)))
else
tmp = x * exp((a * (-z - 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 <= -850000000000.0) || !(y <= 1.85e-83)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((a * (-z - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -850000000000.0) or not (y <= 1.85e-83): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((a * (-z - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -850000000000.0) || !(y <= 1.85e-83)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -850000000000.0) || ~((y <= 1.85e-83))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp((a * (-z - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -850000000000.0], N[Not[LessEqual[y, 1.85e-83]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -850000000000 \lor \neg \left(y \leq 1.85 \cdot 10^{-83}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\end{array}
\end{array}
if y < -8.5e11 or 1.84999999999999997e-83 < y Initial program 97.8%
Taylor expanded in y around inf 88.1%
if -8.5e11 < y < 1.84999999999999997e-83Initial program 95.3%
Taylor expanded in y around 0 84.9%
sub-neg84.9%
neg-mul-184.9%
log1p-def90.4%
neg-mul-190.4%
Simplified90.4%
Taylor expanded in z around 0 90.4%
neg-mul-190.4%
+-commutative90.4%
neg-mul-190.4%
unsub-neg90.4%
Simplified90.4%
Final simplification89.1%
(FPCore (x y z t a b) :precision binary64 (if (<= t -6.5e+56) (* x (exp (* y (- t)))) (* 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 <= -6.5e+56) {
tmp = x * exp((y * -t));
} 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 <= (-6.5d+56)) then
tmp = x * exp((y * -t))
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 <= -6.5e+56) {
tmp = x * Math.exp((y * -t));
} 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 <= -6.5e+56: tmp = x * math.exp((y * -t)) 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 <= -6.5e+56) tmp = Float64(x * exp(Float64(y * Float64(-t)))); 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 <= -6.5e+56) tmp = x * exp((y * -t)); else tmp = x * exp(((y * log(z)) - (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -6.5e+56], N[(x * N[Exp[N[(y * (-t)), $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 -6.5 \cdot 10^{+56}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \log z - a \cdot b}\\
\end{array}
\end{array}
if t < -6.5000000000000001e56Initial program 98.3%
Taylor expanded in t around inf 85.2%
mul-1-neg85.2%
distribute-rgt-neg-out85.2%
Simplified85.2%
if -6.5000000000000001e56 < t Initial program 96.2%
+-commutative96.2%
fma-def96.2%
sub-neg96.2%
log1p-def99.0%
Simplified99.0%
Taylor expanded in z around 0 96.2%
Taylor expanded in t around 0 91.3%
mul-1-neg91.3%
unsub-neg91.3%
Simplified91.3%
Final simplification89.9%
(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 96.7%
+-commutative96.7%
fma-def97.1%
sub-neg97.1%
log1p-def99.2%
Simplified99.2%
Taylor expanded in z around 0 96.7%
Final simplification96.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* a (- b)))))
(t_2 (* x (exp (* y (- t)))))
(t_3 (* x (pow z y))))
(if (<= t -4.5e+108)
t_2
(if (<= t -2.1e-106)
t_1
(if (<= t 5.2e-280)
t_3
(if (<= t 1.56e-237)
t_1
(if (<= t 1.14e-85) t_3 (if (<= t 1.04e+30) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((a * -b));
double t_2 = x * exp((y * -t));
double t_3 = x * pow(z, y);
double tmp;
if (t <= -4.5e+108) {
tmp = t_2;
} else if (t <= -2.1e-106) {
tmp = t_1;
} else if (t <= 5.2e-280) {
tmp = t_3;
} else if (t <= 1.56e-237) {
tmp = t_1;
} else if (t <= 1.14e-85) {
tmp = t_3;
} else if (t <= 1.04e+30) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x * exp((a * -b))
t_2 = x * exp((y * -t))
t_3 = x * (z ** y)
if (t <= (-4.5d+108)) then
tmp = t_2
else if (t <= (-2.1d-106)) then
tmp = t_1
else if (t <= 5.2d-280) then
tmp = t_3
else if (t <= 1.56d-237) then
tmp = t_1
else if (t <= 1.14d-85) then
tmp = t_3
else if (t <= 1.04d+30) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.exp((a * -b));
double t_2 = x * Math.exp((y * -t));
double t_3 = x * Math.pow(z, y);
double tmp;
if (t <= -4.5e+108) {
tmp = t_2;
} else if (t <= -2.1e-106) {
tmp = t_1;
} else if (t <= 5.2e-280) {
tmp = t_3;
} else if (t <= 1.56e-237) {
tmp = t_1;
} else if (t <= 1.14e-85) {
tmp = t_3;
} else if (t <= 1.04e+30) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((a * -b)) t_2 = x * math.exp((y * -t)) t_3 = x * math.pow(z, y) tmp = 0 if t <= -4.5e+108: tmp = t_2 elif t <= -2.1e-106: tmp = t_1 elif t <= 5.2e-280: tmp = t_3 elif t <= 1.56e-237: tmp = t_1 elif t <= 1.14e-85: tmp = t_3 elif t <= 1.04e+30: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(a * Float64(-b)))) t_2 = Float64(x * exp(Float64(y * Float64(-t)))) t_3 = Float64(x * (z ^ y)) tmp = 0.0 if (t <= -4.5e+108) tmp = t_2; elseif (t <= -2.1e-106) tmp = t_1; elseif (t <= 5.2e-280) tmp = t_3; elseif (t <= 1.56e-237) tmp = t_1; elseif (t <= 1.14e-85) tmp = t_3; elseif (t <= 1.04e+30) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp((a * -b)); t_2 = x * exp((y * -t)); t_3 = x * (z ^ y); tmp = 0.0; if (t <= -4.5e+108) tmp = t_2; elseif (t <= -2.1e-106) tmp = t_1; elseif (t <= 5.2e-280) tmp = t_3; elseif (t <= 1.56e-237) tmp = t_1; elseif (t <= 1.14e-85) tmp = t_3; elseif (t <= 1.04e+30) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.5e+108], t$95$2, If[LessEqual[t, -2.1e-106], t$95$1, If[LessEqual[t, 5.2e-280], t$95$3, If[LessEqual[t, 1.56e-237], t$95$1, If[LessEqual[t, 1.14e-85], t$95$3, If[LessEqual[t, 1.04e+30], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{a \cdot \left(-b\right)}\\
t_2 := x \cdot e^{y \cdot \left(-t\right)}\\
t_3 := x \cdot {z}^{y}\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{+108}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -2.1 \cdot 10^{-106}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{-280}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 1.56 \cdot 10^{-237}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.14 \cdot 10^{-85}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 1.04 \cdot 10^{+30}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -4.5e108 or 1.04e30 < t Initial program 96.2%
Taylor expanded in t around inf 80.4%
mul-1-neg80.4%
distribute-rgt-neg-out80.4%
Simplified80.4%
if -4.5e108 < t < -2.10000000000000003e-106 or 5.2e-280 < t < 1.5599999999999999e-237 or 1.1400000000000001e-85 < t < 1.04e30Initial program 98.8%
Taylor expanded in b around inf 82.5%
associate-*r*82.5%
*-commutative82.5%
neg-mul-182.5%
Simplified82.5%
if -2.10000000000000003e-106 < t < 5.2e-280 or 1.5599999999999999e-237 < t < 1.1400000000000001e-85Initial program 94.5%
Taylor expanded in y around inf 75.3%
Taylor expanded in t around 0 75.3%
Final simplification79.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))))
(if (<= y -1.15e+49)
t_1
(if (<= y 3.9e-80)
(* x (exp (* a (- (- z) b))))
(if (or (<= y 6.6e+52) (and (not (<= y 8e+126)) (<= y 2.6e+210)))
(* x (exp (* y (- t))))
t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * pow(z, y);
double tmp;
if (y <= -1.15e+49) {
tmp = t_1;
} else if (y <= 3.9e-80) {
tmp = x * exp((a * (-z - b)));
} else if ((y <= 6.6e+52) || (!(y <= 8e+126) && (y <= 2.6e+210))) {
tmp = x * exp((y * -t));
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = x * (z ** y)
if (y <= (-1.15d+49)) then
tmp = t_1
else if (y <= 3.9d-80) then
tmp = x * exp((a * (-z - b)))
else if ((y <= 6.6d+52) .or. (.not. (y <= 8d+126)) .and. (y <= 2.6d+210)) then
tmp = x * exp((y * -t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.pow(z, y);
double tmp;
if (y <= -1.15e+49) {
tmp = t_1;
} else if (y <= 3.9e-80) {
tmp = x * Math.exp((a * (-z - b)));
} else if ((y <= 6.6e+52) || (!(y <= 8e+126) && (y <= 2.6e+210))) {
tmp = x * Math.exp((y * -t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.pow(z, y) tmp = 0 if y <= -1.15e+49: tmp = t_1 elif y <= 3.9e-80: tmp = x * math.exp((a * (-z - b))) elif (y <= 6.6e+52) or (not (y <= 8e+126) and (y <= 2.6e+210)): tmp = x * math.exp((y * -t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * (z ^ y)) tmp = 0.0 if (y <= -1.15e+49) tmp = t_1; elseif (y <= 3.9e-80) tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b)))); elseif ((y <= 6.6e+52) || (!(y <= 8e+126) && (y <= 2.6e+210))) tmp = Float64(x * exp(Float64(y * Float64(-t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (z ^ y); tmp = 0.0; if (y <= -1.15e+49) tmp = t_1; elseif (y <= 3.9e-80) tmp = x * exp((a * (-z - b))); elseif ((y <= 6.6e+52) || (~((y <= 8e+126)) && (y <= 2.6e+210))) tmp = x * exp((y * -t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.15e+49], t$95$1, If[LessEqual[y, 3.9e-80], N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 6.6e+52], And[N[Not[LessEqual[y, 8e+126]], $MachinePrecision], LessEqual[y, 2.6e+210]]], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -1.15 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-80}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{+52} \lor \neg \left(y \leq 8 \cdot 10^{+126}\right) \land y \leq 2.6 \cdot 10^{+210}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.15000000000000001e49 or 6.6e52 < y < 7.9999999999999994e126 or 2.5999999999999999e210 < y Initial program 97.7%
Taylor expanded in y around inf 90.9%
Taylor expanded in t around 0 70.6%
if -1.15000000000000001e49 < y < 3.8999999999999998e-80Initial program 95.5%
Taylor expanded in y around 0 83.5%
sub-neg83.5%
neg-mul-183.5%
log1p-def88.6%
neg-mul-188.6%
Simplified88.6%
Taylor expanded in z around 0 88.6%
neg-mul-188.6%
+-commutative88.6%
neg-mul-188.6%
unsub-neg88.6%
Simplified88.6%
if 3.8999999999999998e-80 < y < 6.6e52 or 7.9999999999999994e126 < y < 2.5999999999999999e210Initial program 97.7%
Taylor expanded in t around inf 76.2%
mul-1-neg76.2%
distribute-rgt-neg-out76.2%
Simplified76.2%
Final simplification80.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.9e+49) (not (<= y 205000.0))) (* 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 <= -3.9e+49) || !(y <= 205000.0)) {
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 <= (-3.9d+49)) .or. (.not. (y <= 205000.0d0))) 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 <= -3.9e+49) || !(y <= 205000.0)) {
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 <= -3.9e+49) or not (y <= 205000.0): 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 <= -3.9e+49) || !(y <= 205000.0)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(a * Float64(-b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -3.9e+49) || ~((y <= 205000.0))) 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, -3.9e+49], N[Not[LessEqual[y, 205000.0]], $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 -3.9 \cdot 10^{+49} \lor \neg \left(y \leq 205000\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -3.9000000000000001e49 or 205000 < y Initial program 97.4%
Taylor expanded in y around inf 89.1%
Taylor expanded in t around 0 65.5%
if -3.9000000000000001e49 < y < 205000Initial program 96.0%
Taylor expanded in b around inf 81.2%
associate-*r*81.2%
*-commutative81.2%
neg-mul-181.2%
Simplified81.2%
Final simplification74.0%
(FPCore (x y z t a b) :precision binary64 (if (<= t -6e+49) (* x (- 1.0 (* y t))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -6e+49) {
tmp = x * (1.0 - (y * t));
} 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 <= (-6d+49)) then
tmp = x * (1.0d0 - (y * t))
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 <= -6e+49) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -6e+49: tmp = x * (1.0 - (y * t)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -6e+49) tmp = Float64(x * Float64(1.0 - Float64(y * t))); 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 <= -6e+49) tmp = x * (1.0 - (y * t)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -6e+49], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{+49}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -6.0000000000000005e49Initial program 98.3%
Taylor expanded in t around inf 84.0%
mul-1-neg84.0%
distribute-rgt-neg-out84.0%
Simplified84.0%
Taylor expanded in y around 0 27.3%
+-commutative27.3%
mul-1-neg27.3%
unsub-neg27.3%
Simplified27.3%
Taylor expanded in x around 0 35.6%
if -6.0000000000000005e49 < t Initial program 96.2%
Taylor expanded in y around inf 66.7%
Taylor expanded in t around 0 61.8%
Final simplification55.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- a) (* x b))))
(if (<= a -1.7e+37)
t_1
(if (<= a 5.5e-76) x (if (<= a 1.08e+174) (* t (- (* x y))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -a * (x * b);
double tmp;
if (a <= -1.7e+37) {
tmp = t_1;
} else if (a <= 5.5e-76) {
tmp = x;
} else if (a <= 1.08e+174) {
tmp = t * -(x * y);
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = -a * (x * b)
if (a <= (-1.7d+37)) then
tmp = t_1
else if (a <= 5.5d-76) then
tmp = x
else if (a <= 1.08d+174) then
tmp = t * -(x * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -a * (x * b);
double tmp;
if (a <= -1.7e+37) {
tmp = t_1;
} else if (a <= 5.5e-76) {
tmp = x;
} else if (a <= 1.08e+174) {
tmp = t * -(x * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -a * (x * b) tmp = 0 if a <= -1.7e+37: tmp = t_1 elif a <= 5.5e-76: tmp = x elif a <= 1.08e+174: tmp = t * -(x * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-a) * Float64(x * b)) tmp = 0.0 if (a <= -1.7e+37) tmp = t_1; elseif (a <= 5.5e-76) tmp = x; elseif (a <= 1.08e+174) tmp = Float64(t * Float64(-Float64(x * y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -a * (x * b); tmp = 0.0; if (a <= -1.7e+37) tmp = t_1; elseif (a <= 5.5e-76) tmp = x; elseif (a <= 1.08e+174) tmp = t * -(x * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-a) * N[(x * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.7e+37], t$95$1, If[LessEqual[a, 5.5e-76], x, If[LessEqual[a, 1.08e+174], N[(t * (-N[(x * y), $MachinePrecision])), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-a\right) \cdot \left(x \cdot b\right)\\
\mathbf{if}\;a \leq -1.7 \cdot 10^{+37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{-76}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.08 \cdot 10^{+174}:\\
\;\;\;\;t \cdot \left(-x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -1.70000000000000003e37 or 1.08e174 < a Initial program 92.1%
Taylor expanded in b around inf 70.3%
associate-*r*70.3%
*-commutative70.3%
neg-mul-170.3%
Simplified70.3%
Taylor expanded in b around 0 30.2%
mul-1-neg30.2%
unsub-neg30.2%
Simplified30.2%
Taylor expanded in a around inf 27.5%
associate-*r*27.5%
neg-mul-127.5%
Simplified27.5%
if -1.70000000000000003e37 < a < 5.50000000000000014e-76Initial program 99.4%
Taylor expanded in b around inf 53.3%
associate-*r*53.3%
*-commutative53.3%
neg-mul-153.3%
Simplified53.3%
Taylor expanded in b around 0 35.9%
if 5.50000000000000014e-76 < a < 1.08e174Initial program 96.8%
Taylor expanded in t around inf 53.7%
mul-1-neg53.7%
distribute-rgt-neg-out53.7%
Simplified53.7%
Taylor expanded in y around 0 16.2%
+-commutative16.2%
mul-1-neg16.2%
unsub-neg16.2%
Simplified16.2%
Taylor expanded in y around inf 26.2%
neg-mul-126.2%
distribute-rgt-neg-in26.2%
Simplified26.2%
Taylor expanded in y around 0 26.2%
mul-1-neg26.2%
associate-*r*29.8%
*-commutative29.8%
associate-*r*28.4%
distribute-rgt-neg-in28.4%
distribute-rgt-neg-in28.4%
Simplified28.4%
Final simplification31.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -2.45e+35)
(* (* a b) (- x))
(if (<= a 1.08e-75)
x
(if (<= a 1.22e+174) (* t (- (* x y))) (* (- a) (* x b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.45e+35) {
tmp = (a * b) * -x;
} else if (a <= 1.08e-75) {
tmp = x;
} else if (a <= 1.22e+174) {
tmp = 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 (a <= (-2.45d+35)) then
tmp = (a * b) * -x
else if (a <= 1.08d-75) then
tmp = x
else if (a <= 1.22d+174) then
tmp = 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 (a <= -2.45e+35) {
tmp = (a * b) * -x;
} else if (a <= 1.08e-75) {
tmp = x;
} else if (a <= 1.22e+174) {
tmp = t * -(x * y);
} else {
tmp = -a * (x * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.45e+35: tmp = (a * b) * -x elif a <= 1.08e-75: tmp = x elif a <= 1.22e+174: tmp = t * -(x * y) else: tmp = -a * (x * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.45e+35) tmp = Float64(Float64(a * b) * Float64(-x)); elseif (a <= 1.08e-75) tmp = x; elseif (a <= 1.22e+174) tmp = Float64(t * Float64(-Float64(x * y))); else tmp = Float64(Float64(-a) * Float64(x * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -2.45e+35) tmp = (a * b) * -x; elseif (a <= 1.08e-75) tmp = x; elseif (a <= 1.22e+174) tmp = t * -(x * y); else tmp = -a * (x * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.45e+35], N[(N[(a * b), $MachinePrecision] * (-x)), $MachinePrecision], If[LessEqual[a, 1.08e-75], x, If[LessEqual[a, 1.22e+174], N[(t * (-N[(x * y), $MachinePrecision])), $MachinePrecision], N[((-a) * N[(x * b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.45 \cdot 10^{+35}:\\
\;\;\;\;\left(a \cdot b\right) \cdot \left(-x\right)\\
\mathbf{elif}\;a \leq 1.08 \cdot 10^{-75}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.22 \cdot 10^{+174}:\\
\;\;\;\;t \cdot \left(-x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\
\end{array}
\end{array}
if a < -2.45000000000000013e35Initial program 90.4%
Taylor expanded in b around inf 62.4%
associate-*r*62.4%
*-commutative62.4%
neg-mul-162.4%
Simplified62.4%
Taylor expanded in b around 0 24.2%
mul-1-neg24.2%
unsub-neg24.2%
Simplified24.2%
Taylor expanded in a around inf 19.2%
associate-*r*19.2%
neg-mul-119.2%
Simplified19.2%
Taylor expanded in a around 0 19.2%
mul-1-neg19.2%
associate-*r*28.4%
distribute-rgt-neg-in28.4%
Simplified28.4%
if -2.45000000000000013e35 < a < 1.08e-75Initial program 99.4%
Taylor expanded in b around inf 53.3%
associate-*r*53.3%
*-commutative53.3%
neg-mul-153.3%
Simplified53.3%
Taylor expanded in b around 0 35.9%
if 1.08e-75 < a < 1.21999999999999996e174Initial program 96.8%
Taylor expanded in t around inf 53.7%
mul-1-neg53.7%
distribute-rgt-neg-out53.7%
Simplified53.7%
Taylor expanded in y around 0 16.2%
+-commutative16.2%
mul-1-neg16.2%
unsub-neg16.2%
Simplified16.2%
Taylor expanded in y around inf 26.2%
neg-mul-126.2%
distribute-rgt-neg-in26.2%
Simplified26.2%
Taylor expanded in y around 0 26.2%
mul-1-neg26.2%
associate-*r*29.8%
*-commutative29.8%
associate-*r*28.4%
distribute-rgt-neg-in28.4%
distribute-rgt-neg-in28.4%
Simplified28.4%
if 1.21999999999999996e174 < a Initial program 94.2%
Taylor expanded in b around inf 79.9%
associate-*r*79.9%
*-commutative79.9%
neg-mul-179.9%
Simplified79.9%
Taylor expanded in b around 0 37.5%
mul-1-neg37.5%
unsub-neg37.5%
Simplified37.5%
Taylor expanded in a around inf 37.5%
associate-*r*37.5%
neg-mul-137.5%
Simplified37.5%
Final simplification33.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2e+56) (* t (- (* x y))) (if (<= y 2.9e-6) (* x (- 1.0 (* a b))) (* (* a b) (- x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2e+56) {
tmp = t * -(x * y);
} else if (y <= 2.9e-6) {
tmp = x * (1.0 - (a * b));
} 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 <= (-2d+56)) then
tmp = t * -(x * y)
else if (y <= 2.9d-6) then
tmp = x * (1.0d0 - (a * b))
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 <= -2e+56) {
tmp = t * -(x * y);
} else if (y <= 2.9e-6) {
tmp = x * (1.0 - (a * b));
} else {
tmp = (a * b) * -x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2e+56: tmp = t * -(x * y) elif y <= 2.9e-6: tmp = x * (1.0 - (a * b)) else: tmp = (a * b) * -x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2e+56) tmp = Float64(t * Float64(-Float64(x * y))); elseif (y <= 2.9e-6) tmp = Float64(x * Float64(1.0 - Float64(a * b))); 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 <= -2e+56) tmp = t * -(x * y); elseif (y <= 2.9e-6) tmp = x * (1.0 - (a * b)); else tmp = (a * b) * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2e+56], N[(t * (-N[(x * y), $MachinePrecision])), $MachinePrecision], If[LessEqual[y, 2.9e-6], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] * (-x)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+56}:\\
\;\;\;\;t \cdot \left(-x \cdot y\right)\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot b\right) \cdot \left(-x\right)\\
\end{array}
\end{array}
if y < -2.00000000000000018e56Initial program 98.2%
Taylor expanded in t around inf 61.3%
mul-1-neg61.3%
distribute-rgt-neg-out61.3%
Simplified61.3%
Taylor expanded in y around 0 13.7%
+-commutative13.7%
mul-1-neg13.7%
unsub-neg13.7%
Simplified13.7%
Taylor expanded in y around inf 16.9%
neg-mul-116.9%
distribute-rgt-neg-in16.9%
Simplified16.9%
Taylor expanded in y around 0 16.9%
mul-1-neg16.9%
associate-*r*18.5%
*-commutative18.5%
associate-*r*22.1%
distribute-rgt-neg-in22.1%
distribute-rgt-neg-in22.1%
Simplified22.1%
if -2.00000000000000018e56 < y < 2.9000000000000002e-6Initial program 96.0%
Taylor expanded in b around inf 80.7%
associate-*r*80.7%
*-commutative80.7%
neg-mul-180.7%
Simplified80.7%
Taylor expanded in b around 0 44.9%
mul-1-neg44.9%
unsub-neg44.9%
Simplified44.9%
if 2.9000000000000002e-6 < y Initial program 96.7%
Taylor expanded in b around inf 36.4%
associate-*r*36.4%
*-commutative36.4%
neg-mul-136.4%
Simplified36.4%
Taylor expanded in b around 0 15.7%
mul-1-neg15.7%
unsub-neg15.7%
Simplified15.7%
Taylor expanded in a around inf 23.8%
associate-*r*23.8%
neg-mul-123.8%
Simplified23.8%
Taylor expanded in a around 0 23.8%
mul-1-neg23.8%
associate-*r*31.5%
distribute-rgt-neg-in31.5%
Simplified31.5%
Final simplification36.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -640000000000.0) (not (<= y 1.3e+14))) (* t (- (* x y))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -640000000000.0) || !(y <= 1.3e+14)) {
tmp = t * -(x * y);
} 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 <= (-640000000000.0d0)) .or. (.not. (y <= 1.3d+14))) then
tmp = t * -(x * y)
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 <= -640000000000.0) || !(y <= 1.3e+14)) {
tmp = t * -(x * y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -640000000000.0) or not (y <= 1.3e+14): tmp = t * -(x * y) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -640000000000.0) || !(y <= 1.3e+14)) tmp = Float64(t * Float64(-Float64(x * y))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -640000000000.0) || ~((y <= 1.3e+14))) tmp = t * -(x * y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -640000000000.0], N[Not[LessEqual[y, 1.3e+14]], $MachinePrecision]], N[(t * (-N[(x * y), $MachinePrecision])), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -640000000000 \lor \neg \left(y \leq 1.3 \cdot 10^{+14}\right):\\
\;\;\;\;t \cdot \left(-x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -6.4e11 or 1.3e14 < y Initial program 97.5%
Taylor expanded in t around inf 56.0%
mul-1-neg56.0%
distribute-rgt-neg-out56.0%
Simplified56.0%
Taylor expanded in y around 0 13.7%
+-commutative13.7%
mul-1-neg13.7%
unsub-neg13.7%
Simplified13.7%
Taylor expanded in y around inf 20.5%
neg-mul-120.5%
distribute-rgt-neg-in20.5%
Simplified20.5%
Taylor expanded in y around 0 20.5%
mul-1-neg20.5%
associate-*r*23.8%
*-commutative23.8%
associate-*r*21.5%
distribute-rgt-neg-in21.5%
distribute-rgt-neg-in21.5%
Simplified21.5%
if -6.4e11 < y < 1.3e14Initial program 95.9%
Taylor expanded in b around inf 79.9%
associate-*r*79.9%
*-commutative79.9%
neg-mul-179.9%
Simplified79.9%
Taylor expanded in b around 0 35.5%
Final simplification28.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y -560000000000.0) (* t (- (* x y))) (if (<= y 135000000.0) x (* (* x t) (- y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -560000000000.0) {
tmp = t * -(x * y);
} else if (y <= 135000000.0) {
tmp = x;
} else {
tmp = (x * t) * -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 (y <= (-560000000000.0d0)) then
tmp = t * -(x * y)
else if (y <= 135000000.0d0) then
tmp = x
else
tmp = (x * t) * -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 (y <= -560000000000.0) {
tmp = t * -(x * y);
} else if (y <= 135000000.0) {
tmp = x;
} else {
tmp = (x * t) * -y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -560000000000.0: tmp = t * -(x * y) elif y <= 135000000.0: tmp = x else: tmp = (x * t) * -y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -560000000000.0) tmp = Float64(t * Float64(-Float64(x * y))); elseif (y <= 135000000.0) tmp = x; else tmp = Float64(Float64(x * t) * Float64(-y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -560000000000.0) tmp = t * -(x * y); elseif (y <= 135000000.0) tmp = x; else tmp = (x * t) * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -560000000000.0], N[(t * (-N[(x * y), $MachinePrecision])), $MachinePrecision], If[LessEqual[y, 135000000.0], x, N[(N[(x * t), $MachinePrecision] * (-y)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -560000000000:\\
\;\;\;\;t \cdot \left(-x \cdot y\right)\\
\mathbf{elif}\;y \leq 135000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot t\right) \cdot \left(-y\right)\\
\end{array}
\end{array}
if y < -5.6e11Initial program 98.5%
Taylor expanded in t around inf 57.5%
mul-1-neg57.5%
distribute-rgt-neg-out57.5%
Simplified57.5%
Taylor expanded in y around 0 12.0%
+-commutative12.0%
mul-1-neg12.0%
unsub-neg12.0%
Simplified12.0%
Taylor expanded in y around inf 15.9%
neg-mul-115.9%
distribute-rgt-neg-in15.9%
Simplified15.9%
Taylor expanded in y around 0 15.9%
mul-1-neg15.9%
associate-*r*17.3%
*-commutative17.3%
associate-*r*20.2%
distribute-rgt-neg-in20.2%
distribute-rgt-neg-in20.2%
Simplified20.2%
if -5.6e11 < y < 1.35e8Initial program 95.8%
Taylor expanded in b around inf 81.0%
associate-*r*81.0%
*-commutative81.0%
neg-mul-181.0%
Simplified81.0%
Taylor expanded in b around 0 36.0%
if 1.35e8 < y Initial program 96.5%
Taylor expanded in t around inf 54.0%
mul-1-neg54.0%
distribute-rgt-neg-out54.0%
Simplified54.0%
Taylor expanded in y around 0 15.3%
+-commutative15.3%
mul-1-neg15.3%
unsub-neg15.3%
Simplified15.3%
Taylor expanded in y around inf 25.2%
neg-mul-125.2%
distribute-rgt-neg-in25.2%
Simplified25.2%
Final simplification29.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4.7e+14) (not (<= y 4e+42))) (* b (* x a)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4.7e+14) || !(y <= 4e+42)) {
tmp = b * (x * a);
} 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 <= (-4.7d+14)) .or. (.not. (y <= 4d+42))) then
tmp = b * (x * a)
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 <= -4.7e+14) || !(y <= 4e+42)) {
tmp = b * (x * a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -4.7e+14) or not (y <= 4e+42): tmp = b * (x * a) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -4.7e+14) || !(y <= 4e+42)) tmp = Float64(b * Float64(x * a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -4.7e+14) || ~((y <= 4e+42))) tmp = b * (x * a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -4.7e+14], N[Not[LessEqual[y, 4e+42]], $MachinePrecision]], N[(b * N[(x * a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.7 \cdot 10^{+14} \lor \neg \left(y \leq 4 \cdot 10^{+42}\right):\\
\;\;\;\;b \cdot \left(x \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.7e14 or 4.00000000000000018e42 < y Initial program 97.4%
Taylor expanded in b around inf 35.4%
associate-*r*35.4%
*-commutative35.4%
neg-mul-135.4%
Simplified35.4%
Taylor expanded in b around 0 11.7%
mul-1-neg11.7%
unsub-neg11.7%
Simplified11.7%
Taylor expanded in a around inf 18.1%
associate-*r*18.1%
neg-mul-118.1%
Simplified18.1%
expm1-log1p-u14.0%
expm1-udef28.7%
add-sqr-sqrt9.9%
sqrt-unprod27.6%
sqr-neg27.6%
sqrt-unprod16.1%
add-sqr-sqrt25.3%
associate-*r*25.3%
Applied egg-rr25.3%
expm1-def14.7%
expm1-log1p16.0%
associate-*r*12.7%
*-commutative12.7%
associate-*l*16.8%
Simplified16.8%
if -4.7e14 < y < 4.00000000000000018e42Initial program 96.1%
Taylor expanded in b around inf 79.3%
associate-*r*79.3%
*-commutative79.3%
neg-mul-179.3%
Simplified79.3%
Taylor expanded in b around 0 34.2%
Final simplification26.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y 5.1e+42) x (* a (* x b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 5.1e+42) {
tmp = x;
} 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 (y <= 5.1d+42) then
tmp = x
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 (y <= 5.1e+42) {
tmp = x;
} else {
tmp = a * (x * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 5.1e+42: tmp = x else: tmp = a * (x * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 5.1e+42) tmp = x; else tmp = Float64(a * Float64(x * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 5.1e+42) tmp = x; else tmp = a * (x * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 5.1e+42], x, N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.1 \cdot 10^{+42}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot b\right)\\
\end{array}
\end{array}
if y < 5.0999999999999999e42Initial program 96.8%
Taylor expanded in b around inf 65.3%
associate-*r*65.3%
*-commutative65.3%
neg-mul-165.3%
Simplified65.3%
Taylor expanded in b around 0 24.8%
if 5.0999999999999999e42 < y Initial program 96.0%
Taylor expanded in b around inf 36.1%
associate-*r*36.1%
*-commutative36.1%
neg-mul-136.1%
Simplified36.1%
Taylor expanded in b around 0 12.7%
mul-1-neg12.7%
unsub-neg12.7%
Simplified12.7%
Taylor expanded in a around inf 22.5%
associate-*r*22.5%
neg-mul-122.5%
Simplified22.5%
expm1-log1p-u19.9%
expm1-udef36.8%
add-sqr-sqrt12.3%
sqrt-unprod34.4%
sqr-neg34.4%
sqrt-unprod20.4%
add-sqr-sqrt32.7%
associate-*r*32.8%
Applied egg-rr32.8%
expm1-def21.4%
expm1-log1p23.8%
associate-*r*18.1%
Simplified18.1%
Final simplification23.5%
(FPCore (x y z t a b) :precision binary64 (if (<= a 2.1e-26) x (* y (* x t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= 2.1e-26) {
tmp = x;
} else {
tmp = y * (x * t);
}
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 <= 2.1d-26) then
tmp = x
else
tmp = y * (x * t)
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 <= 2.1e-26) {
tmp = x;
} else {
tmp = y * (x * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= 2.1e-26: tmp = x else: tmp = y * (x * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= 2.1e-26) tmp = x; else tmp = Float64(y * Float64(x * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= 2.1e-26) tmp = x; else tmp = y * (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, 2.1e-26], x, N[(y * N[(x * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.1 \cdot 10^{-26}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot t\right)\\
\end{array}
\end{array}
if a < 2.10000000000000008e-26Initial program 97.4%
Taylor expanded in b around inf 55.1%
associate-*r*55.1%
*-commutative55.1%
neg-mul-155.1%
Simplified55.1%
Taylor expanded in b around 0 27.0%
if 2.10000000000000008e-26 < a Initial program 95.0%
Taylor expanded in t around inf 39.1%
mul-1-neg39.1%
distribute-rgt-neg-out39.1%
Simplified39.1%
expm1-log1p-u28.5%
expm1-udef41.8%
*-commutative41.8%
exp-prod40.4%
add-sqr-sqrt24.7%
sqrt-unprod45.6%
sqr-neg45.6%
sqrt-unprod20.9%
add-sqr-sqrt32.9%
Applied egg-rr32.9%
expm1-def19.6%
expm1-log1p23.8%
exp-prod21.4%
Simplified21.4%
Taylor expanded in t around 0 9.0%
Taylor expanded in y around inf 19.9%
*-commutative19.9%
Simplified19.9%
Final simplification24.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 96.7%
Taylor expanded in b around inf 59.6%
associate-*r*59.6%
*-commutative59.6%
neg-mul-159.6%
Simplified59.6%
Taylor expanded in b around 0 20.7%
Final simplification20.7%
herbie shell --seed 2023240
(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))))))