
(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 97.7%
fma-def98.1%
sub-neg98.1%
log1p-def99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.75e+64) (not (<= b 1.2e+82))) (* x (exp (* a (- b)))) (* x (exp (+ (* y (- (log z) t)) (* a (log1p (- z))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.75e+64) || !(b <= 1.2e+82)) {
tmp = x * exp((a * -b));
} else {
tmp = x * exp(((y * (log(z) - t)) + (a * log1p(-z))));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.75e+64) || !(b <= 1.2e+82)) {
tmp = x * Math.exp((a * -b));
} else {
tmp = x * Math.exp(((y * (Math.log(z) - t)) + (a * Math.log1p(-z))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.75e+64) or not (b <= 1.2e+82): tmp = x * math.exp((a * -b)) else: tmp = x * math.exp(((y * (math.log(z) - t)) + (a * math.log1p(-z)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.75e+64) || !(b <= 1.2e+82)) tmp = Float64(x * exp(Float64(a * Float64(-b)))); else tmp = Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * log1p(Float64(-z)))))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.75e+64], N[Not[LessEqual[b, 1.2e+82]], $MachinePrecision]], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[Log[1 + (-z)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.75 \cdot 10^{+64} \lor \neg \left(b \leq 1.2 \cdot 10^{+82}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \mathsf{log1p}\left(-z\right)}\\
\end{array}
\end{array}
if b < -1.7499999999999999e64 or 1.19999999999999999e82 < b Initial program 98.0%
Taylor expanded in b around inf 85.4%
mul-1-neg85.4%
distribute-rgt-neg-out85.4%
Simplified85.4%
if -1.7499999999999999e64 < b < 1.19999999999999999e82Initial program 97.4%
Taylor expanded in b around 0 86.8%
sub-neg86.8%
neg-mul-186.8%
log1p-def90.5%
neg-mul-190.5%
Simplified90.5%
Final simplification88.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 97.7%
Final simplification97.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -8e-72) (not (<= y 3.4e+15))) (* 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 ((y <= -8e-72) || !(y <= 3.4e+15)) {
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 ((y <= -8e-72) || !(y <= 3.4e+15)) {
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 (y <= -8e-72) or not (y <= 3.4e+15): 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 ((y <= -8e-72) || !(y <= 3.4e+15)) 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[Or[LessEqual[y, -8e-72], N[Not[LessEqual[y, 3.4e+15]], $MachinePrecision]], 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}\;y \leq -8 \cdot 10^{-72} \lor \neg \left(y \leq 3.4 \cdot 10^{+15}\right):\\
\;\;\;\;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 y < -7.9999999999999997e-72 or 3.4e15 < y Initial program 97.3%
Taylor expanded in y around inf 84.7%
if -7.9999999999999997e-72 < y < 3.4e15Initial program 98.2%
Taylor expanded in y around 0 83.4%
sub-neg83.4%
sub-neg83.4%
neg-mul-183.4%
log1p-def85.1%
neg-mul-185.1%
sub-neg85.1%
Simplified85.1%
Final simplification84.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.55e-71) (not (<= y 3.1e+22))) (* 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 <= -2.55e-71) || !(y <= 3.1e+22)) {
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 <= (-2.55d-71)) .or. (.not. (y <= 3.1d+22))) 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 <= -2.55e-71) || !(y <= 3.1e+22)) {
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 <= -2.55e-71) or not (y <= 3.1e+22): 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 <= -2.55e-71) || !(y <= 3.1e+22)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(Float64(Float64(-a) * Float64(z + b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.55e-71) || ~((y <= 3.1e+22))) 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, -2.55e-71], N[Not[LessEqual[y, 3.1e+22]], $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 -2.55 \cdot 10^{-71} \lor \neg \left(y \leq 3.1 \cdot 10^{+22}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\
\end{array}
\end{array}
if y < -2.5500000000000001e-71 or 3.1000000000000002e22 < y Initial program 97.3%
Taylor expanded in y around inf 84.7%
if -2.5500000000000001e-71 < y < 3.1000000000000002e22Initial program 98.2%
Taylor expanded in y around 0 83.4%
sub-neg83.4%
sub-neg83.4%
neg-mul-183.4%
log1p-def85.1%
neg-mul-185.1%
sub-neg85.1%
Simplified85.1%
Taylor expanded in z around 0 85.1%
+-commutative85.1%
associate-*r*85.1%
associate-*r*85.1%
distribute-lft-out85.1%
neg-mul-185.1%
Simplified85.1%
Final simplification84.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* (- a) (+ z b))))) (t_2 (* x (exp (* y (- t))))))
(if (<= t -6.5e+114)
t_2
(if (<= t 8.5e-230)
t_1
(if (<= t 2.8e-60) (* x (pow z y)) (if (<= t 2.5e+128) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((-a * (z + b)));
double t_2 = x * exp((y * -t));
double tmp;
if (t <= -6.5e+114) {
tmp = t_2;
} else if (t <= 8.5e-230) {
tmp = t_1;
} else if (t <= 2.8e-60) {
tmp = x * pow(z, y);
} else if (t <= 2.5e+128) {
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) :: tmp
t_1 = x * exp((-a * (z + b)))
t_2 = x * exp((y * -t))
if (t <= (-6.5d+114)) then
tmp = t_2
else if (t <= 8.5d-230) then
tmp = t_1
else if (t <= 2.8d-60) then
tmp = x * (z ** y)
else if (t <= 2.5d+128) 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 * (z + b)));
double t_2 = x * Math.exp((y * -t));
double tmp;
if (t <= -6.5e+114) {
tmp = t_2;
} else if (t <= 8.5e-230) {
tmp = t_1;
} else if (t <= 2.8e-60) {
tmp = x * Math.pow(z, y);
} else if (t <= 2.5e+128) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((-a * (z + b))) t_2 = x * math.exp((y * -t)) tmp = 0 if t <= -6.5e+114: tmp = t_2 elif t <= 8.5e-230: tmp = t_1 elif t <= 2.8e-60: tmp = x * math.pow(z, y) elif t <= 2.5e+128: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(Float64(-a) * Float64(z + b)))) t_2 = Float64(x * exp(Float64(y * Float64(-t)))) tmp = 0.0 if (t <= -6.5e+114) tmp = t_2; elseif (t <= 8.5e-230) tmp = t_1; elseif (t <= 2.8e-60) tmp = Float64(x * (z ^ y)); elseif (t <= 2.5e+128) 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 * (z + b))); t_2 = x * exp((y * -t)); tmp = 0.0; if (t <= -6.5e+114) tmp = t_2; elseif (t <= 8.5e-230) tmp = t_1; elseif (t <= 2.8e-60) tmp = x * (z ^ y); elseif (t <= 2.5e+128) 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) * N[(z + b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.5e+114], t$95$2, If[LessEqual[t, 8.5e-230], t$95$1, If[LessEqual[t, 2.8e-60], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e+128], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\
t_2 := x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{if}\;t \leq -6.5 \cdot 10^{+114}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-230}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-60}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{+128}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -6.5000000000000001e114 or 2.5e128 < t Initial program 98.8%
Taylor expanded in t around inf 88.5%
mul-1-neg88.5%
*-commutative88.5%
Simplified88.5%
if -6.5000000000000001e114 < t < 8.4999999999999998e-230 or 2.8000000000000002e-60 < t < 2.5e128Initial program 96.7%
Taylor expanded in y around 0 73.9%
sub-neg73.9%
sub-neg73.9%
neg-mul-173.9%
log1p-def75.8%
neg-mul-175.8%
sub-neg75.8%
Simplified75.8%
Taylor expanded in z around 0 75.8%
+-commutative75.8%
associate-*r*75.8%
associate-*r*75.8%
distribute-lft-out75.8%
neg-mul-175.8%
Simplified75.8%
if 8.4999999999999998e-230 < t < 2.8000000000000002e-60Initial program 99.9%
Taylor expanded in y around inf 84.3%
Taylor expanded in t around 0 84.3%
Final simplification80.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* a (- b))))) (t_2 (* x (exp (* y (- t))))))
(if (<= t -9.2e+117)
t_2
(if (<= t 9.5e-231)
t_1
(if (<= t 9.5e-61) (* x (pow z y)) (if (<= t 2.25e+128) 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 tmp;
if (t <= -9.2e+117) {
tmp = t_2;
} else if (t <= 9.5e-231) {
tmp = t_1;
} else if (t <= 9.5e-61) {
tmp = x * pow(z, y);
} else if (t <= 2.25e+128) {
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) :: tmp
t_1 = x * exp((a * -b))
t_2 = x * exp((y * -t))
if (t <= (-9.2d+117)) then
tmp = t_2
else if (t <= 9.5d-231) then
tmp = t_1
else if (t <= 9.5d-61) then
tmp = x * (z ** y)
else if (t <= 2.25d+128) 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 tmp;
if (t <= -9.2e+117) {
tmp = t_2;
} else if (t <= 9.5e-231) {
tmp = t_1;
} else if (t <= 9.5e-61) {
tmp = x * Math.pow(z, y);
} else if (t <= 2.25e+128) {
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)) tmp = 0 if t <= -9.2e+117: tmp = t_2 elif t <= 9.5e-231: tmp = t_1 elif t <= 9.5e-61: tmp = x * math.pow(z, y) elif t <= 2.25e+128: 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)))) tmp = 0.0 if (t <= -9.2e+117) tmp = t_2; elseif (t <= 9.5e-231) tmp = t_1; elseif (t <= 9.5e-61) tmp = Float64(x * (z ^ y)); elseif (t <= 2.25e+128) 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)); tmp = 0.0; if (t <= -9.2e+117) tmp = t_2; elseif (t <= 9.5e-231) tmp = t_1; elseif (t <= 9.5e-61) tmp = x * (z ^ y); elseif (t <= 2.25e+128) 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]}, If[LessEqual[t, -9.2e+117], t$95$2, If[LessEqual[t, 9.5e-231], t$95$1, If[LessEqual[t, 9.5e-61], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.25e+128], 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)}\\
\mathbf{if}\;t \leq -9.2 \cdot 10^{+117}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-231}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-61}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{+128}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -9.19999999999999951e117 or 2.2500000000000001e128 < t Initial program 98.8%
Taylor expanded in t around inf 88.5%
mul-1-neg88.5%
*-commutative88.5%
Simplified88.5%
if -9.19999999999999951e117 < t < 9.4999999999999995e-231 or 9.49999999999999986e-61 < t < 2.2500000000000001e128Initial program 96.7%
Taylor expanded in b around inf 72.6%
mul-1-neg72.6%
distribute-rgt-neg-out72.6%
Simplified72.6%
if 9.4999999999999995e-231 < t < 9.49999999999999986e-61Initial program 99.9%
Taylor expanded in y around inf 84.3%
Taylor expanded in t around 0 84.3%
Final simplification78.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.9e-13) (not (<= t 5e-9))) (* 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 <= -2.9e-13) || !(t <= 5e-9)) {
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 <= (-2.9d-13)) .or. (.not. (t <= 5d-9))) 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 <= -2.9e-13) || !(t <= 5e-9)) {
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 <= -2.9e-13) or not (t <= 5e-9): 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 <= -2.9e-13) || !(t <= 5e-9)) 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 <= -2.9e-13) || ~((t <= 5e-9))) 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, -2.9e-13], N[Not[LessEqual[t, 5e-9]], $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 -2.9 \cdot 10^{-13} \lor \neg \left(t \leq 5 \cdot 10^{-9}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -2.8999999999999998e-13 or 5.0000000000000001e-9 < t Initial program 97.3%
Taylor expanded in t around inf 77.1%
mul-1-neg77.1%
*-commutative77.1%
Simplified77.1%
if -2.8999999999999998e-13 < t < 5.0000000000000001e-9Initial program 98.2%
Taylor expanded in y around inf 61.9%
Taylor expanded in t around 0 61.9%
Final simplification70.5%
(FPCore (x y z t a b) :precision binary64 (if (<= t -8e+116) (* x (* a (- b))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -8e+116) {
tmp = x * (a * -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 <= (-8d+116)) then
tmp = x * (a * -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 <= -8e+116) {
tmp = x * (a * -b);
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -8e+116: tmp = x * (a * -b) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -8e+116) tmp = Float64(x * Float64(a * Float64(-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 <= -8e+116) tmp = x * (a * -b); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -8e+116], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{+116}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -8.00000000000000012e116Initial program 100.0%
Taylor expanded in b around inf 31.9%
mul-1-neg31.9%
distribute-rgt-neg-out31.9%
Simplified31.9%
Taylor expanded in a around 0 14.3%
mul-1-neg14.3%
unsub-neg14.3%
Simplified14.3%
Taylor expanded in a around inf 22.9%
mul-1-neg22.9%
associate-*r*25.0%
*-commutative25.0%
distribute-lft-neg-in25.0%
Simplified25.0%
if -8.00000000000000012e116 < t Initial program 97.2%
Taylor expanded in y around inf 65.8%
Taylor expanded in t around 0 56.7%
Final simplification51.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -0.00055) (not (<= y 1.9e-119))) (* a (* x (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -0.00055) || !(y <= 1.9e-119)) {
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 <= (-0.00055d0)) .or. (.not. (y <= 1.9d-119))) 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 <= -0.00055) || !(y <= 1.9e-119)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -0.00055) or not (y <= 1.9e-119): tmp = a * (x * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -0.00055) || !(y <= 1.9e-119)) 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 <= -0.00055) || ~((y <= 1.9e-119))) tmp = a * (x * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -0.00055], N[Not[LessEqual[y, 1.9e-119]], $MachinePrecision]], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00055 \lor \neg \left(y \leq 1.9 \cdot 10^{-119}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -5.50000000000000033e-4 or 1.89999999999999987e-119 < y Initial program 97.4%
Taylor expanded in b around inf 44.8%
mul-1-neg44.8%
distribute-rgt-neg-out44.8%
Simplified44.8%
Taylor expanded in a around 0 12.7%
mul-1-neg12.7%
unsub-neg12.7%
Simplified12.7%
Taylor expanded in a around inf 24.1%
mul-1-neg24.1%
*-commutative24.1%
distribute-rgt-neg-in24.1%
distribute-rgt-neg-in24.1%
Simplified24.1%
if -5.50000000000000033e-4 < y < 1.89999999999999987e-119Initial program 98.0%
Taylor expanded in b around inf 78.9%
mul-1-neg78.9%
distribute-rgt-neg-out78.9%
Simplified78.9%
Taylor expanded in a around 0 31.7%
Final simplification27.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y -8.9e-48) (* x (* z (- a))) (if (<= y 1.9e-119) x (* a (* x (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -8.9e-48) {
tmp = x * (z * -a);
} else if (y <= 1.9e-119) {
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 <= (-8.9d-48)) then
tmp = x * (z * -a)
else if (y <= 1.9d-119) 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 <= -8.9e-48) {
tmp = x * (z * -a);
} else if (y <= 1.9e-119) {
tmp = x;
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -8.9e-48: tmp = x * (z * -a) elif y <= 1.9e-119: tmp = x else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -8.9e-48) tmp = Float64(x * Float64(z * Float64(-a))); elseif (y <= 1.9e-119) tmp = x; 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 (y <= -8.9e-48) tmp = x * (z * -a); elseif (y <= 1.9e-119) tmp = x; else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -8.9e-48], N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e-119], x, N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.9 \cdot 10^{-48}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-119}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -8.90000000000000014e-48Initial program 97.5%
Taylor expanded in b around 0 85.6%
sub-neg85.6%
neg-mul-185.6%
log1p-def86.8%
neg-mul-186.8%
Simplified86.8%
Taylor expanded in y around 0 6.1%
Taylor expanded in z around 0 4.4%
mul-1-neg4.4%
unsub-neg4.4%
*-commutative4.4%
associate-*l*4.4%
*-commutative4.4%
Simplified4.4%
Taylor expanded in a around inf 13.1%
mul-1-neg13.1%
*-commutative13.1%
associate-*r*15.4%
distribute-rgt-neg-out15.4%
*-commutative15.4%
distribute-rgt-neg-in15.4%
Simplified15.4%
if -8.90000000000000014e-48 < y < 1.89999999999999987e-119Initial program 97.8%
Taylor expanded in b around inf 83.7%
mul-1-neg83.7%
distribute-rgt-neg-out83.7%
Simplified83.7%
Taylor expanded in a around 0 35.1%
if 1.89999999999999987e-119 < y Initial program 97.7%
Taylor expanded in b around inf 48.4%
mul-1-neg48.4%
distribute-rgt-neg-out48.4%
Simplified48.4%
Taylor expanded in a around 0 17.8%
mul-1-neg17.8%
unsub-neg17.8%
Simplified17.8%
Taylor expanded in a around inf 31.1%
mul-1-neg31.1%
*-commutative31.1%
distribute-rgt-neg-in31.1%
distribute-rgt-neg-in31.1%
Simplified31.1%
Final simplification27.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.35e-47) (* x (* z (- a))) (if (<= y 1.9e-119) x (* x (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.35e-47) {
tmp = x * (z * -a);
} else if (y <= 1.9e-119) {
tmp = x;
} else {
tmp = x * (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.35d-47)) then
tmp = x * (z * -a)
else if (y <= 1.9d-119) then
tmp = x
else
tmp = x * (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.35e-47) {
tmp = x * (z * -a);
} else if (y <= 1.9e-119) {
tmp = x;
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.35e-47: tmp = x * (z * -a) elif y <= 1.9e-119: tmp = x else: tmp = x * (a * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.35e-47) tmp = Float64(x * Float64(z * Float64(-a))); elseif (y <= 1.9e-119) tmp = x; else tmp = Float64(x * Float64(a * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.35e-47) tmp = x * (z * -a); elseif (y <= 1.9e-119) tmp = x; else tmp = x * (a * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.35e-47], N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e-119], x, N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{-47}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-119}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -1.3499999999999999e-47Initial program 97.5%
Taylor expanded in b around 0 85.6%
sub-neg85.6%
neg-mul-185.6%
log1p-def86.8%
neg-mul-186.8%
Simplified86.8%
Taylor expanded in y around 0 6.1%
Taylor expanded in z around 0 4.4%
mul-1-neg4.4%
unsub-neg4.4%
*-commutative4.4%
associate-*l*4.4%
*-commutative4.4%
Simplified4.4%
Taylor expanded in a around inf 13.1%
mul-1-neg13.1%
*-commutative13.1%
associate-*r*15.4%
distribute-rgt-neg-out15.4%
*-commutative15.4%
distribute-rgt-neg-in15.4%
Simplified15.4%
if -1.3499999999999999e-47 < y < 1.89999999999999987e-119Initial program 97.8%
Taylor expanded in b around inf 83.7%
mul-1-neg83.7%
distribute-rgt-neg-out83.7%
Simplified83.7%
Taylor expanded in a around 0 35.1%
if 1.89999999999999987e-119 < y Initial program 97.7%
Taylor expanded in b around inf 48.4%
mul-1-neg48.4%
distribute-rgt-neg-out48.4%
Simplified48.4%
Taylor expanded in a around 0 17.8%
mul-1-neg17.8%
unsub-neg17.8%
Simplified17.8%
Taylor expanded in a around inf 31.1%
mul-1-neg31.1%
associate-*r*31.2%
*-commutative31.2%
distribute-lft-neg-in31.2%
Simplified31.2%
Final simplification27.6%
(FPCore (x y z t a b) :precision binary64 (if (<= x 2.8e-45) (* a (* z (- x))) (* x (- 1.0 (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 2.8e-45) {
tmp = a * (z * -x);
} 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 (x <= 2.8d-45) then
tmp = a * (z * -x)
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 (x <= 2.8e-45) {
tmp = a * (z * -x);
} else {
tmp = x * (1.0 - (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 2.8e-45: tmp = a * (z * -x) else: tmp = x * (1.0 - (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 2.8e-45) tmp = Float64(a * Float64(z * Float64(-x))); 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 (x <= 2.8e-45) tmp = a * (z * -x); else tmp = x * (1.0 - (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 2.8e-45], N[(a * N[(z * (-x)), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.8 \cdot 10^{-45}:\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\end{array}
\end{array}
if x < 2.8000000000000001e-45Initial program 98.5%
Taylor expanded in b around 0 70.3%
sub-neg70.3%
neg-mul-170.3%
log1p-def75.2%
neg-mul-175.2%
Simplified75.2%
Taylor expanded in y around 0 15.9%
Taylor expanded in z around 0 13.2%
mul-1-neg13.2%
unsub-neg13.2%
*-commutative13.2%
associate-*l*13.2%
*-commutative13.2%
Simplified13.2%
Taylor expanded in a around inf 21.2%
if 2.8000000000000001e-45 < x Initial program 95.0%
Taylor expanded in b around inf 53.4%
mul-1-neg53.4%
distribute-rgt-neg-out53.4%
Simplified53.4%
Taylor expanded in a around 0 34.1%
mul-1-neg34.1%
unsub-neg34.1%
Simplified34.1%
Final simplification24.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x 3.8e-45) (* a (* z (- x))) (- x (* a (* x b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 3.8e-45) {
tmp = a * (z * -x);
} else {
tmp = x - (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 (x <= 3.8d-45) then
tmp = a * (z * -x)
else
tmp = x - (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 (x <= 3.8e-45) {
tmp = a * (z * -x);
} else {
tmp = x - (a * (x * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 3.8e-45: tmp = a * (z * -x) else: tmp = x - (a * (x * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 3.8e-45) tmp = Float64(a * Float64(z * Float64(-x))); else tmp = Float64(x - Float64(a * Float64(x * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 3.8e-45) tmp = a * (z * -x); else tmp = x - (a * (x * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 3.8e-45], N[(a * N[(z * (-x)), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.8 \cdot 10^{-45}:\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \left(x \cdot b\right)\\
\end{array}
\end{array}
if x < 3.79999999999999997e-45Initial program 98.5%
Taylor expanded in b around 0 70.3%
sub-neg70.3%
neg-mul-170.3%
log1p-def75.2%
neg-mul-175.2%
Simplified75.2%
Taylor expanded in y around 0 15.9%
Taylor expanded in z around 0 13.2%
mul-1-neg13.2%
unsub-neg13.2%
*-commutative13.2%
associate-*l*13.2%
*-commutative13.2%
Simplified13.2%
Taylor expanded in a around inf 21.2%
if 3.79999999999999997e-45 < x Initial program 95.0%
Taylor expanded in b around inf 53.4%
mul-1-neg53.4%
distribute-rgt-neg-out53.4%
Simplified53.4%
Taylor expanded in a around 0 32.5%
mul-1-neg32.5%
unsub-neg32.5%
*-commutative32.5%
Simplified32.5%
Final simplification23.8%
(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 97.7%
Taylor expanded in b around inf 58.4%
mul-1-neg58.4%
distribute-rgt-neg-out58.4%
Simplified58.4%
Taylor expanded in a around 0 15.7%
Final simplification15.7%
herbie shell --seed 2023334
(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))))))