
(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 14 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.1%
fma-def96.5%
sub-neg96.5%
log1p-def99.5%
Simplified99.5%
Final simplification99.5%
(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}
Initial program 96.1%
Final simplification96.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -8.6e-51) (not (<= a 6.2e-254))) (* x (exp (- (* a (- b)) (* y t)))) (* x (exp (* y (- (log z) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -8.6e-51) || !(a <= 6.2e-254)) {
tmp = x * exp(((a * -b) - (y * t)));
} else {
tmp = x * exp((y * (log(z) - 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 <= (-8.6d-51)) .or. (.not. (a <= 6.2d-254))) then
tmp = x * exp(((a * -b) - (y * t)))
else
tmp = x * exp((y * (log(z) - 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 <= -8.6e-51) || !(a <= 6.2e-254)) {
tmp = x * Math.exp(((a * -b) - (y * t)));
} else {
tmp = x * Math.exp((y * (Math.log(z) - t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -8.6e-51) or not (a <= 6.2e-254): tmp = x * math.exp(((a * -b) - (y * t))) else: tmp = x * math.exp((y * (math.log(z) - t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -8.6e-51) || !(a <= 6.2e-254)) tmp = Float64(x * exp(Float64(Float64(a * Float64(-b)) - Float64(y * t)))); else tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -8.6e-51) || ~((a <= 6.2e-254))) tmp = x * exp(((a * -b) - (y * t))); else tmp = x * exp((y * (log(z) - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -8.6e-51], N[Not[LessEqual[a, 6.2e-254]], $MachinePrecision]], N[(x * N[Exp[N[(N[(a * (-b)), $MachinePrecision] - N[(y * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.6 \cdot 10^{-51} \lor \neg \left(a \leq 6.2 \cdot 10^{-254}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right) - y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\end{array}
\end{array}
if a < -8.5999999999999995e-51 or 6.19999999999999976e-254 < a Initial program 94.9%
Taylor expanded in z around 0 94.4%
Taylor expanded in t around inf 88.4%
neg-mul-188.4%
Simplified88.4%
if -8.5999999999999995e-51 < a < 6.19999999999999976e-254Initial program 99.8%
Taylor expanded in y around inf 99.0%
Final simplification91.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3e+159) (not (<= y 7.8e+126))) (* x (pow (/ z (exp t)) y)) (* x (exp (- (* a (- b)) (* y t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3e+159) || !(y <= 7.8e+126)) {
tmp = x * pow((z / exp(t)), y);
} else {
tmp = x * exp(((a * -b) - (y * 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 ((y <= (-3d+159)) .or. (.not. (y <= 7.8d+126))) then
tmp = x * ((z / exp(t)) ** y)
else
tmp = x * exp(((a * -b) - (y * 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 ((y <= -3e+159) || !(y <= 7.8e+126)) {
tmp = x * Math.pow((z / Math.exp(t)), y);
} else {
tmp = x * Math.exp(((a * -b) - (y * t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3e+159) or not (y <= 7.8e+126): tmp = x * math.pow((z / math.exp(t)), y) else: tmp = x * math.exp(((a * -b) - (y * t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3e+159) || !(y <= 7.8e+126)) tmp = Float64(x * (Float64(z / exp(t)) ^ y)); else tmp = Float64(x * exp(Float64(Float64(a * Float64(-b)) - Float64(y * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -3e+159) || ~((y <= 7.8e+126))) tmp = x * ((z / exp(t)) ^ y); else tmp = x * exp(((a * -b) - (y * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3e+159], N[Not[LessEqual[y, 7.8e+126]], $MachinePrecision]], N[(x * N[Power[N[(z / N[Exp[t], $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(N[(a * (-b)), $MachinePrecision] - N[(y * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+159} \lor \neg \left(y \leq 7.8 \cdot 10^{+126}\right):\\
\;\;\;\;x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right) - y \cdot t}\\
\end{array}
\end{array}
if y < -3.0000000000000002e159 or 7.79999999999999986e126 < y Initial program 97.3%
Taylor expanded in y around inf 88.2%
pow-exp88.2%
expm1-log1p-u88.2%
expm1-udef88.2%
pow-exp88.2%
*-commutative88.2%
exp-prod88.2%
exp-diff88.2%
add-exp-log88.2%
Applied egg-rr88.2%
expm1-def88.2%
expm1-log1p88.2%
Simplified88.2%
if -3.0000000000000002e159 < y < 7.79999999999999986e126Initial program 95.6%
Taylor expanded in z around 0 95.0%
Taylor expanded in t around inf 91.9%
neg-mul-191.9%
Simplified91.9%
Final simplification90.8%
(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.1%
Taylor expanded in z around 0 95.7%
Final simplification95.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.18e-113) (not (<= t -5.6e-270))) (* x (exp (- (* a (- b)) (* y t)))) (* x (pow (- z (* z t)) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.18e-113) || !(t <= -5.6e-270)) {
tmp = x * exp(((a * -b) - (y * t)));
} else {
tmp = x * pow((z - (z * 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 ((t <= (-1.18d-113)) .or. (.not. (t <= (-5.6d-270)))) then
tmp = x * exp(((a * -b) - (y * t)))
else
tmp = x * ((z - (z * 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 ((t <= -1.18e-113) || !(t <= -5.6e-270)) {
tmp = x * Math.exp(((a * -b) - (y * t)));
} else {
tmp = x * Math.pow((z - (z * t)), y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.18e-113) or not (t <= -5.6e-270): tmp = x * math.exp(((a * -b) - (y * t))) else: tmp = x * math.pow((z - (z * t)), y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.18e-113) || !(t <= -5.6e-270)) tmp = Float64(x * exp(Float64(Float64(a * Float64(-b)) - Float64(y * t)))); else tmp = Float64(x * (Float64(z - Float64(z * t)) ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.18e-113) || ~((t <= -5.6e-270))) tmp = x * exp(((a * -b) - (y * t))); else tmp = x * ((z - (z * t)) ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.18e-113], N[Not[LessEqual[t, -5.6e-270]], $MachinePrecision]], N[(x * N[Exp[N[(N[(a * (-b)), $MachinePrecision] - N[(y * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[N[(z - N[(z * t), $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.18 \cdot 10^{-113} \lor \neg \left(t \leq -5.6 \cdot 10^{-270}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right) - y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {\left(z - z \cdot t\right)}^{y}\\
\end{array}
\end{array}
if t < -1.18e-113 or -5.5999999999999999e-270 < t Initial program 96.5%
Taylor expanded in z around 0 96.1%
Taylor expanded in t around inf 89.9%
neg-mul-189.9%
Simplified89.9%
if -1.18e-113 < t < -5.5999999999999999e-270Initial program 91.6%
Taylor expanded in y around inf 75.1%
pow-exp75.0%
expm1-log1p-u75.1%
expm1-udef75.1%
pow-exp75.1%
*-commutative75.1%
exp-prod75.1%
exp-diff75.1%
add-exp-log75.1%
Applied egg-rr75.1%
expm1-def75.1%
expm1-log1p75.4%
Simplified75.4%
Taylor expanded in t around 0 75.4%
mul-1-neg75.4%
unsub-neg75.4%
*-commutative75.4%
Simplified75.4%
Final simplification88.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -12500000.0) (not (<= t 2.3e-130))) (* x (exp (* y (- t)))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -12500000.0) || !(t <= 2.3e-130)) {
tmp = x * exp((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 <= (-12500000.0d0)) .or. (.not. (t <= 2.3d-130))) then
tmp = x * exp((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 <= -12500000.0) || !(t <= 2.3e-130)) {
tmp = x * Math.exp((y * -t));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -12500000.0) or not (t <= 2.3e-130): tmp = x * math.exp((y * -t)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -12500000.0) || !(t <= 2.3e-130)) tmp = Float64(x * exp(Float64(y * Float64(-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 <= -12500000.0) || ~((t <= 2.3e-130))) tmp = x * exp((y * -t)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -12500000.0], N[Not[LessEqual[t, 2.3e-130]], $MachinePrecision]], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -12500000 \lor \neg \left(t \leq 2.3 \cdot 10^{-130}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -1.25e7 or 2.3000000000000001e-130 < t Initial program 95.5%
Taylor expanded in t around inf 67.7%
mul-1-neg67.7%
*-commutative67.7%
Simplified67.7%
if -1.25e7 < t < 2.3000000000000001e-130Initial program 97.0%
Taylor expanded in y around inf 61.6%
Taylor expanded in t around 0 62.5%
Final simplification65.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.7e-5) (not (<= a 9.6e+67))) (* x (exp (* a (- b)))) (* x (exp (* y (- t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.7e-5) || !(a <= 9.6e+67)) {
tmp = x * exp((a * -b));
} else {
tmp = x * exp((y * -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 <= (-1.7d-5)) .or. (.not. (a <= 9.6d+67))) then
tmp = x * exp((a * -b))
else
tmp = x * exp((y * -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 <= -1.7e-5) || !(a <= 9.6e+67)) {
tmp = x * Math.exp((a * -b));
} else {
tmp = x * Math.exp((y * -t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.7e-5) or not (a <= 9.6e+67): tmp = x * math.exp((a * -b)) else: tmp = x * math.exp((y * -t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.7e-5) || !(a <= 9.6e+67)) tmp = Float64(x * exp(Float64(a * Float64(-b)))); else tmp = Float64(x * exp(Float64(y * Float64(-t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.7e-5) || ~((a <= 9.6e+67))) tmp = x * exp((a * -b)); else tmp = x * exp((y * -t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.7e-5], N[Not[LessEqual[a, 9.6e+67]], $MachinePrecision]], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.7 \cdot 10^{-5} \lor \neg \left(a \leq 9.6 \cdot 10^{+67}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\end{array}
\end{array}
if a < -1.7e-5 or 9.60000000000000007e67 < a Initial program 92.3%
Taylor expanded in b around inf 76.5%
mul-1-neg76.5%
distribute-rgt-neg-out76.5%
Simplified76.5%
if -1.7e-5 < a < 9.60000000000000007e67Initial program 99.8%
Taylor expanded in t around inf 76.5%
mul-1-neg76.5%
*-commutative76.5%
Simplified76.5%
Final simplification76.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.04e-33) (not (<= y 2.8e-22))) (* x (pow z y)) (* x (- 1.0 (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.04e-33) || !(y <= 2.8e-22)) {
tmp = x * pow(z, y);
} else {
tmp = x * (1.0 - (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 <= (-1.04d-33)) .or. (.not. (y <= 2.8d-22))) then
tmp = x * (z ** y)
else
tmp = x * (1.0d0 - (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 <= -1.04e-33) || !(y <= 2.8e-22)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * (1.0 - (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.04e-33) or not (y <= 2.8e-22): tmp = x * math.pow(z, y) else: tmp = x * (1.0 - (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.04e-33) || !(y <= 2.8e-22)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * Float64(1.0 - Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.04e-33) || ~((y <= 2.8e-22))) tmp = x * (z ^ y); else tmp = x * (1.0 - (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.04e-33], N[Not[LessEqual[y, 2.8e-22]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.04 \cdot 10^{-33} \lor \neg \left(y \leq 2.8 \cdot 10^{-22}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\end{array}
\end{array}
if y < -1.04e-33 or 2.79999999999999995e-22 < y Initial program 96.0%
Taylor expanded in y around inf 81.7%
Taylor expanded in t around 0 62.9%
if -1.04e-33 < y < 2.79999999999999995e-22Initial program 96.1%
Taylor expanded in z around 0 95.3%
Taylor expanded in y around 0 81.3%
*-commutative81.3%
associate-*r*81.3%
exp-prod71.9%
mul-1-neg71.9%
Simplified71.9%
Taylor expanded in a around 0 42.0%
+-commutative42.0%
mul-1-neg42.0%
Simplified42.0%
Final simplification52.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (- 1.0 (* a b)))))
(if (<= b -2.85e+81)
t_1
(if (<= b -6.6e-46)
(* t (* x (- y)))
(if (<= b 3.6e+76) (* x (- 1.0 (* y t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (1.0 - (a * b));
double tmp;
if (b <= -2.85e+81) {
tmp = t_1;
} else if (b <= -6.6e-46) {
tmp = t * (x * -y);
} else if (b <= 3.6e+76) {
tmp = x * (1.0 - (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 * (1.0d0 - (a * b))
if (b <= (-2.85d+81)) then
tmp = t_1
else if (b <= (-6.6d-46)) then
tmp = t * (x * -y)
else if (b <= 3.6d+76) then
tmp = x * (1.0d0 - (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 * (1.0 - (a * b));
double tmp;
if (b <= -2.85e+81) {
tmp = t_1;
} else if (b <= -6.6e-46) {
tmp = t * (x * -y);
} else if (b <= 3.6e+76) {
tmp = x * (1.0 - (y * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * (1.0 - (a * b)) tmp = 0 if b <= -2.85e+81: tmp = t_1 elif b <= -6.6e-46: tmp = t * (x * -y) elif b <= 3.6e+76: tmp = x * (1.0 - (y * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(1.0 - Float64(a * b))) tmp = 0.0 if (b <= -2.85e+81) tmp = t_1; elseif (b <= -6.6e-46) tmp = Float64(t * Float64(x * Float64(-y))); elseif (b <= 3.6e+76) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (1.0 - (a * b)); tmp = 0.0; if (b <= -2.85e+81) tmp = t_1; elseif (b <= -6.6e-46) tmp = t * (x * -y); elseif (b <= 3.6e+76) tmp = x * (1.0 - (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[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.85e+81], t$95$1, If[LessEqual[b, -6.6e-46], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.6e+76], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - a \cdot b\right)\\
\mathbf{if}\;b \leq -2.85 \cdot 10^{+81}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -6.6 \cdot 10^{-46}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{elif}\;b \leq 3.6 \cdot 10^{+76}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -2.85000000000000017e81 or 3.6000000000000003e76 < b Initial program 97.7%
Taylor expanded in z around 0 97.7%
Taylor expanded in y around 0 80.2%
*-commutative80.2%
associate-*r*80.2%
exp-prod69.0%
mul-1-neg69.0%
Simplified69.0%
Taylor expanded in a around 0 34.9%
+-commutative34.9%
mul-1-neg34.9%
Simplified34.9%
if -2.85000000000000017e81 < b < -6.60000000000000027e-46Initial program 100.0%
Taylor expanded in t around inf 47.1%
mul-1-neg47.1%
*-commutative47.1%
Simplified47.1%
Taylor expanded in y around 0 19.0%
neg-mul-119.0%
unsub-neg19.0%
*-commutative19.0%
Simplified19.0%
Taylor expanded in y around inf 41.5%
mul-1-neg41.5%
distribute-rgt-neg-in41.5%
*-commutative41.5%
Simplified41.5%
if -6.60000000000000027e-46 < b < 3.6000000000000003e76Initial program 94.4%
Taylor expanded in t around inf 65.2%
mul-1-neg65.2%
*-commutative65.2%
Simplified65.2%
Taylor expanded in y around 0 35.4%
neg-mul-135.4%
unsub-neg35.4%
*-commutative35.4%
Simplified35.4%
Final simplification35.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.35e+99) (not (<= a 9e+82))) (* t (* x (- y))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.35e+99) || !(a <= 9e+82)) {
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 ((a <= (-2.35d+99)) .or. (.not. (a <= 9d+82))) 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 ((a <= -2.35e+99) || !(a <= 9e+82)) {
tmp = t * (x * -y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.35e+99) or not (a <= 9e+82): tmp = t * (x * -y) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.35e+99) || !(a <= 9e+82)) tmp = Float64(t * Float64(x * Float64(-y))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -2.35e+99) || ~((a <= 9e+82))) tmp = t * (x * -y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.35e+99], N[Not[LessEqual[a, 9e+82]], $MachinePrecision]], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.35 \cdot 10^{+99} \lor \neg \left(a \leq 9 \cdot 10^{+82}\right):\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.34999999999999991e99 or 8.9999999999999993e82 < a Initial program 91.7%
Taylor expanded in t around inf 29.4%
mul-1-neg29.4%
*-commutative29.4%
Simplified29.4%
Taylor expanded in y around 0 14.8%
neg-mul-114.8%
unsub-neg14.8%
*-commutative14.8%
Simplified14.8%
Taylor expanded in y around inf 21.2%
mul-1-neg21.2%
distribute-rgt-neg-in21.2%
*-commutative21.2%
Simplified21.2%
if -2.34999999999999991e99 < a < 8.9999999999999993e82Initial program 99.2%
Taylor expanded in t around inf 70.4%
mul-1-neg70.4%
*-commutative70.4%
Simplified70.4%
Taylor expanded in y around 0 27.6%
Final simplification24.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7e-21) (not (<= y 2.9e+92))) (* y (* x (- t))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7e-21) || !(y <= 2.9e+92)) {
tmp = y * (x * -t);
} 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 <= (-7d-21)) .or. (.not. (y <= 2.9d+92))) then
tmp = y * (x * -t)
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 <= -7e-21) || !(y <= 2.9e+92)) {
tmp = y * (x * -t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -7e-21) or not (y <= 2.9e+92): tmp = y * (x * -t) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -7e-21) || !(y <= 2.9e+92)) tmp = Float64(y * Float64(x * Float64(-t))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -7e-21) || ~((y <= 2.9e+92))) tmp = y * (x * -t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -7e-21], N[Not[LessEqual[y, 2.9e+92]], $MachinePrecision]], N[(y * N[(x * (-t)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-21} \lor \neg \left(y \leq 2.9 \cdot 10^{+92}\right):\\
\;\;\;\;y \cdot \left(x \cdot \left(-t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -7.0000000000000007e-21 or 2.9000000000000001e92 < y Initial program 97.2%
Taylor expanded in t around inf 59.5%
mul-1-neg59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in y around 0 23.3%
neg-mul-123.3%
unsub-neg23.3%
*-commutative23.3%
Simplified23.3%
Taylor expanded in y around inf 18.1%
mul-1-neg18.1%
associate-*r*24.1%
*-commutative24.1%
distribute-rgt-neg-in24.1%
distribute-rgt-neg-in24.1%
Simplified24.1%
if -7.0000000000000007e-21 < y < 2.9000000000000001e92Initial program 95.2%
Taylor expanded in t around inf 48.6%
mul-1-neg48.6%
*-commutative48.6%
Simplified48.6%
Taylor expanded in y around 0 29.3%
Final simplification27.0%
(FPCore (x y z t a b) :precision binary64 (if (<= a 8.3e+74) (* x (- 1.0 (* y t))) (* y (* x (- t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= 8.3e+74) {
tmp = x * (1.0 - (y * t));
} 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 <= 8.3d+74) then
tmp = x * (1.0d0 - (y * t))
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 <= 8.3e+74) {
tmp = x * (1.0 - (y * t));
} else {
tmp = y * (x * -t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= 8.3e+74: tmp = x * (1.0 - (y * t)) else: tmp = y * (x * -t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= 8.3e+74) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(y * Float64(x * Float64(-t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= 8.3e+74) tmp = x * (1.0 - (y * t)); else tmp = y * (x * -t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, 8.3e+74], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x * (-t)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 8.3 \cdot 10^{+74}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \left(-t\right)\right)\\
\end{array}
\end{array}
if a < 8.2999999999999998e74Initial program 97.4%
Taylor expanded in t around inf 60.0%
mul-1-neg60.0%
*-commutative60.0%
Simplified60.0%
Taylor expanded in y around 0 30.9%
neg-mul-130.9%
unsub-neg30.9%
*-commutative30.9%
Simplified30.9%
if 8.2999999999999998e74 < a Initial program 91.2%
Taylor expanded in t around inf 29.1%
mul-1-neg29.1%
*-commutative29.1%
Simplified29.1%
Taylor expanded in y around 0 11.8%
neg-mul-111.8%
unsub-neg11.8%
*-commutative11.8%
Simplified11.8%
Taylor expanded in y around inf 20.5%
mul-1-neg20.5%
associate-*r*25.5%
*-commutative25.5%
distribute-rgt-neg-in25.5%
distribute-rgt-neg-in25.5%
Simplified25.5%
Final simplification29.7%
(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.1%
Taylor expanded in t around inf 53.3%
mul-1-neg53.3%
*-commutative53.3%
Simplified53.3%
Taylor expanded in y around 0 18.4%
Final simplification18.4%
herbie shell --seed 2024024
(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))))))