
(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 17 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 94.6%
fma-define94.6%
sub-neg94.6%
log1p-define99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a b) :precision binary64 (if (<= a -6.2e+194) (* x (exp (* a (- (- z) b)))) (* 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) {
double tmp;
if (a <= -6.2e+194) {
tmp = x * exp((a * (-z - b)));
} else {
tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - 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 (a <= (-6.2d+194)) then
tmp = x * exp((a * (-z - b)))
else
tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - 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 (a <= -6.2e+194) {
tmp = x * Math.exp((a * (-z - b)));
} else {
tmp = x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -6.2e+194: tmp = x * math.exp((a * (-z - b))) else: tmp = x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -6.2e+194) tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b)))); else tmp = Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -6.2e+194) tmp = x * exp((a * (-z - b))); else tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -6.2e+194], N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.2 \cdot 10^{+194}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\\
\end{array}
\end{array}
if a < -6.1999999999999999e194Initial program 76.5%
Taylor expanded in y around 0 70.3%
sub-neg70.3%
log1p-define93.6%
Simplified93.6%
Taylor expanded in z around 0 93.6%
+-commutative93.6%
associate-*r*93.6%
associate-*r*93.6%
distribute-lft-out93.6%
mul-1-neg93.6%
Simplified93.6%
if -6.1999999999999999e194 < a Initial program 97.1%
Final simplification96.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -35000000.0) (not (<= y 5.4e-7))) (* x (pow (/ z (exp t)) y)) (* x (exp (* a (- (- z) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -35000000.0) || !(y <= 5.4e-7)) {
tmp = x * pow((z / exp(t)), y);
} 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 <= (-35000000.0d0)) .or. (.not. (y <= 5.4d-7))) then
tmp = x * ((z / exp(t)) ** y)
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 <= -35000000.0) || !(y <= 5.4e-7)) {
tmp = x * Math.pow((z / Math.exp(t)), y);
} else {
tmp = x * Math.exp((a * (-z - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -35000000.0) or not (y <= 5.4e-7): tmp = x * math.pow((z / math.exp(t)), y) else: tmp = x * math.exp((a * (-z - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -35000000.0) || !(y <= 5.4e-7)) tmp = Float64(x * (Float64(z / exp(t)) ^ y)); 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 <= -35000000.0) || ~((y <= 5.4e-7))) tmp = x * ((z / exp(t)) ^ y); else tmp = x * exp((a * (-z - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -35000000.0], N[Not[LessEqual[y, 5.4e-7]], $MachinePrecision]], N[(x * N[Power[N[(z / N[Exp[t], $MachinePrecision]), $MachinePrecision], y], $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 -35000000 \lor \neg \left(y \leq 5.4 \cdot 10^{-7}\right):\\
\;\;\;\;x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\end{array}
\end{array}
if y < -3.5e7 or 5.40000000000000018e-7 < y Initial program 96.9%
Taylor expanded in a around 0 90.7%
*-commutative90.7%
exp-prod90.7%
exp-diff90.7%
rem-exp-log90.7%
Simplified90.7%
if -3.5e7 < y < 5.40000000000000018e-7Initial program 92.4%
Taylor expanded in y around 0 80.8%
sub-neg80.8%
log1p-define88.4%
Simplified88.4%
Taylor expanded in z around 0 88.4%
+-commutative88.4%
associate-*r*88.4%
associate-*r*88.4%
distribute-lft-out88.4%
mul-1-neg88.4%
Simplified88.4%
Final simplification89.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))))
(if (<= y -2.1e+146)
t_1
(if (<= y -1e+31)
(* x (exp (* t (- y))))
(if (or (<= y -10000000.0) (not (<= y 8e+24)))
t_1
(* x (exp (* a (- (- z) b)))))))))
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 <= -2.1e+146) {
tmp = t_1;
} else if (y <= -1e+31) {
tmp = x * exp((t * -y));
} else if ((y <= -10000000.0) || !(y <= 8e+24)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * (z ** y)
if (y <= (-2.1d+146)) then
tmp = t_1
else if (y <= (-1d+31)) then
tmp = x * exp((t * -y))
else if ((y <= (-10000000.0d0)) .or. (.not. (y <= 8d+24))) then
tmp = t_1
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 t_1 = x * Math.pow(z, y);
double tmp;
if (y <= -2.1e+146) {
tmp = t_1;
} else if (y <= -1e+31) {
tmp = x * Math.exp((t * -y));
} else if ((y <= -10000000.0) || !(y <= 8e+24)) {
tmp = t_1;
} else {
tmp = x * Math.exp((a * (-z - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.pow(z, y) tmp = 0 if y <= -2.1e+146: tmp = t_1 elif y <= -1e+31: tmp = x * math.exp((t * -y)) elif (y <= -10000000.0) or not (y <= 8e+24): tmp = t_1 else: tmp = x * math.exp((a * (-z - b))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * (z ^ y)) tmp = 0.0 if (y <= -2.1e+146) tmp = t_1; elseif (y <= -1e+31) tmp = Float64(x * exp(Float64(t * Float64(-y)))); elseif ((y <= -10000000.0) || !(y <= 8e+24)) tmp = t_1; 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) t_1 = x * (z ^ y); tmp = 0.0; if (y <= -2.1e+146) tmp = t_1; elseif (y <= -1e+31) tmp = x * exp((t * -y)); elseif ((y <= -10000000.0) || ~((y <= 8e+24))) tmp = t_1; else tmp = x * exp((a * (-z - b))); 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, -2.1e+146], t$95$1, If[LessEqual[y, -1e+31], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -10000000.0], N[Not[LessEqual[y, 8e+24]], $MachinePrecision]], t$95$1, N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1 \cdot 10^{+31}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{elif}\;y \leq -10000000 \lor \neg \left(y \leq 8 \cdot 10^{+24}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\end{array}
\end{array}
if y < -2.1000000000000001e146 or -9.9999999999999996e30 < y < -1e7 or 7.9999999999999999e24 < y Initial program 97.8%
Taylor expanded in a around 0 94.7%
*-commutative94.7%
exp-prod94.7%
exp-diff94.7%
rem-exp-log94.7%
Simplified94.7%
Taylor expanded in t around 0 78.6%
if -2.1000000000000001e146 < y < -9.9999999999999996e30Initial program 96.5%
Taylor expanded in t around inf 72.3%
mul-1-neg72.3%
distribute-lft-neg-out72.3%
*-commutative72.3%
Simplified72.3%
if -1e7 < y < 7.9999999999999999e24Initial program 92.0%
Taylor expanded in y around 0 78.4%
sub-neg78.4%
log1p-define86.4%
Simplified86.4%
Taylor expanded in z around 0 86.4%
+-commutative86.4%
associate-*r*86.4%
associate-*r*86.4%
distribute-lft-out86.4%
mul-1-neg86.4%
Simplified86.4%
Final simplification82.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))))
(if (<= y -2.75e+146)
t_1
(if (<= y -1.8e+31)
(* x (exp (* t (- y))))
(if (or (<= y -6400000.0) (not (<= y 1.2e-5)))
t_1
(* x (exp (* a (- b)))))))))
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 <= -2.75e+146) {
tmp = t_1;
} else if (y <= -1.8e+31) {
tmp = x * exp((t * -y));
} else if ((y <= -6400000.0) || !(y <= 1.2e-5)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * (z ** y)
if (y <= (-2.75d+146)) then
tmp = t_1
else if (y <= (-1.8d+31)) then
tmp = x * exp((t * -y))
else if ((y <= (-6400000.0d0)) .or. (.not. (y <= 1.2d-5))) then
tmp = t_1
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 t_1 = x * Math.pow(z, y);
double tmp;
if (y <= -2.75e+146) {
tmp = t_1;
} else if (y <= -1.8e+31) {
tmp = x * Math.exp((t * -y));
} else if ((y <= -6400000.0) || !(y <= 1.2e-5)) {
tmp = t_1;
} else {
tmp = x * Math.exp((a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.pow(z, y) tmp = 0 if y <= -2.75e+146: tmp = t_1 elif y <= -1.8e+31: tmp = x * math.exp((t * -y)) elif (y <= -6400000.0) or not (y <= 1.2e-5): tmp = t_1 else: tmp = x * math.exp((a * -b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * (z ^ y)) tmp = 0.0 if (y <= -2.75e+146) tmp = t_1; elseif (y <= -1.8e+31) tmp = Float64(x * exp(Float64(t * Float64(-y)))); elseif ((y <= -6400000.0) || !(y <= 1.2e-5)) tmp = t_1; else tmp = Float64(x * exp(Float64(a * Float64(-b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (z ^ y); tmp = 0.0; if (y <= -2.75e+146) tmp = t_1; elseif (y <= -1.8e+31) tmp = x * exp((t * -y)); elseif ((y <= -6400000.0) || ~((y <= 1.2e-5))) tmp = t_1; else tmp = x * exp((a * -b)); 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, -2.75e+146], t$95$1, If[LessEqual[y, -1.8e+31], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -6400000.0], N[Not[LessEqual[y, 1.2e-5]], $MachinePrecision]], t$95$1, N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -2.75 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{+31}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{elif}\;y \leq -6400000 \lor \neg \left(y \leq 1.2 \cdot 10^{-5}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -2.7500000000000002e146 or -1.79999999999999998e31 < y < -6.4e6 or 1.2e-5 < y Initial program 97.0%
Taylor expanded in a around 0 93.0%
*-commutative93.0%
exp-prod93.0%
exp-diff93.0%
rem-exp-log93.0%
Simplified93.0%
Taylor expanded in t around 0 76.1%
if -2.7500000000000002e146 < y < -1.79999999999999998e31Initial program 96.5%
Taylor expanded in t around inf 72.3%
mul-1-neg72.3%
distribute-lft-neg-out72.3%
*-commutative72.3%
Simplified72.3%
if -6.4e6 < y < 1.2e-5Initial program 92.4%
Taylor expanded in b around inf 80.1%
mul-1-neg80.1%
distribute-rgt-neg-out80.1%
Simplified80.1%
Final simplification77.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6500000.0) (not (<= y 1.2e-5))) (* 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 <= -6500000.0) || !(y <= 1.2e-5)) {
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 <= (-6500000.0d0)) .or. (.not. (y <= 1.2d-5))) 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 <= -6500000.0) || !(y <= 1.2e-5)) {
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 <= -6500000.0) or not (y <= 1.2e-5): 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 <= -6500000.0) || !(y <= 1.2e-5)) 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 <= -6500000.0) || ~((y <= 1.2e-5))) 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, -6500000.0], N[Not[LessEqual[y, 1.2e-5]], $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 -6500000 \lor \neg \left(y \leq 1.2 \cdot 10^{-5}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -6.5e6 or 1.2e-5 < y Initial program 96.9%
Taylor expanded in a around 0 90.7%
*-commutative90.7%
exp-prod90.7%
exp-diff90.7%
rem-exp-log90.7%
Simplified90.7%
Taylor expanded in t around 0 71.3%
if -6.5e6 < y < 1.2e-5Initial program 92.4%
Taylor expanded in b around inf 80.1%
mul-1-neg80.1%
distribute-rgt-neg-out80.1%
Simplified80.1%
Final simplification75.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -9200.0) (not (<= y 1.15e-20))) (* x (pow z y)) (- x (* (+ z b) (* x a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -9200.0) || !(y <= 1.15e-20)) {
tmp = x * pow(z, y);
} else {
tmp = x - ((z + b) * (x * a));
}
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 <= (-9200.0d0)) .or. (.not. (y <= 1.15d-20))) then
tmp = x * (z ** y)
else
tmp = x - ((z + b) * (x * a))
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 <= -9200.0) || !(y <= 1.15e-20)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x - ((z + b) * (x * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -9200.0) or not (y <= 1.15e-20): tmp = x * math.pow(z, y) else: tmp = x - ((z + b) * (x * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -9200.0) || !(y <= 1.15e-20)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x - Float64(Float64(z + b) * Float64(x * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -9200.0) || ~((y <= 1.15e-20))) tmp = x * (z ^ y); else tmp = x - ((z + b) * (x * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -9200.0], N[Not[LessEqual[y, 1.15e-20]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z + b), $MachinePrecision] * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9200 \lor \neg \left(y \leq 1.15 \cdot 10^{-20}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x - \left(z + b\right) \cdot \left(x \cdot a\right)\\
\end{array}
\end{array}
if y < -9200 or 1.15e-20 < y Initial program 97.0%
Taylor expanded in a around 0 88.7%
*-commutative88.7%
exp-prod88.7%
exp-diff88.7%
rem-exp-log88.7%
Simplified88.7%
Taylor expanded in t around 0 70.7%
if -9200 < y < 1.15e-20Initial program 92.1%
Taylor expanded in y around 0 80.5%
sub-neg80.5%
log1p-define88.3%
Simplified88.3%
Taylor expanded in z around 0 88.3%
+-commutative88.3%
associate-*r*88.3%
associate-*r*88.3%
distribute-lft-out88.3%
mul-1-neg88.3%
Simplified88.3%
Taylor expanded in a around 0 42.4%
mul-1-neg42.4%
unsub-neg42.4%
associate-*r*45.3%
*-commutative45.3%
Simplified45.3%
Final simplification58.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.05e+213)
(- x (* t (* x y)))
(if (<= y -1.4e-229)
(* a (- (/ x a) (* x b)))
(if (<= y 1.8e-267)
(* b (/ x b))
(if (<= y 350.0) (- x (* b (* x a))) (* b (* a (- x))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.05e+213) {
tmp = x - (t * (x * y));
} else if (y <= -1.4e-229) {
tmp = a * ((x / a) - (x * b));
} else if (y <= 1.8e-267) {
tmp = b * (x / b);
} else if (y <= 350.0) {
tmp = x - (b * (x * a));
} else {
tmp = b * (a * -x);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-2.05d+213)) then
tmp = x - (t * (x * y))
else if (y <= (-1.4d-229)) then
tmp = a * ((x / a) - (x * b))
else if (y <= 1.8d-267) then
tmp = b * (x / b)
else if (y <= 350.0d0) then
tmp = x - (b * (x * a))
else
tmp = b * (a * -x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.05e+213) {
tmp = x - (t * (x * y));
} else if (y <= -1.4e-229) {
tmp = a * ((x / a) - (x * b));
} else if (y <= 1.8e-267) {
tmp = b * (x / b);
} else if (y <= 350.0) {
tmp = x - (b * (x * a));
} else {
tmp = b * (a * -x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.05e+213: tmp = x - (t * (x * y)) elif y <= -1.4e-229: tmp = a * ((x / a) - (x * b)) elif y <= 1.8e-267: tmp = b * (x / b) elif y <= 350.0: tmp = x - (b * (x * a)) else: tmp = b * (a * -x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.05e+213) tmp = Float64(x - Float64(t * Float64(x * y))); elseif (y <= -1.4e-229) tmp = Float64(a * Float64(Float64(x / a) - Float64(x * b))); elseif (y <= 1.8e-267) tmp = Float64(b * Float64(x / b)); elseif (y <= 350.0) tmp = Float64(x - Float64(b * Float64(x * a))); else tmp = Float64(b * Float64(a * Float64(-x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.05e+213) tmp = x - (t * (x * y)); elseif (y <= -1.4e-229) tmp = a * ((x / a) - (x * b)); elseif (y <= 1.8e-267) tmp = b * (x / b); elseif (y <= 350.0) tmp = x - (b * (x * a)); else tmp = b * (a * -x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.05e+213], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.4e-229], N[(a * N[(N[(x / a), $MachinePrecision] - N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e-267], N[(b * N[(x / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 350.0], N[(x - N[(b * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(a * (-x)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{+213}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-229}:\\
\;\;\;\;a \cdot \left(\frac{x}{a} - x \cdot b\right)\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-267}:\\
\;\;\;\;b \cdot \frac{x}{b}\\
\mathbf{elif}\;y \leq 350:\\
\;\;\;\;x - b \cdot \left(x \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot \left(-x\right)\right)\\
\end{array}
\end{array}
if y < -2.0499999999999999e213Initial program 95.0%
Taylor expanded in t around inf 80.3%
mul-1-neg80.3%
distribute-lft-neg-out80.3%
*-commutative80.3%
Simplified80.3%
Taylor expanded in y around 0 46.1%
mul-1-neg46.1%
Simplified46.1%
if -2.0499999999999999e213 < y < -1.39999999999999995e-229Initial program 94.8%
Taylor expanded in b around inf 61.4%
mul-1-neg61.4%
distribute-rgt-neg-out61.4%
Simplified61.4%
Taylor expanded in a around 0 24.9%
mul-1-neg24.9%
unsub-neg24.9%
associate-*r*24.9%
*-commutative24.9%
associate-*l*26.9%
Simplified26.9%
Taylor expanded in a around inf 32.1%
if -1.39999999999999995e-229 < y < 1.8000000000000001e-267Initial program 84.2%
Taylor expanded in b around inf 79.9%
mul-1-neg79.9%
distribute-rgt-neg-out79.9%
Simplified79.9%
Taylor expanded in a around 0 31.1%
mul-1-neg31.1%
unsub-neg31.1%
associate-*r*35.4%
*-commutative35.4%
associate-*l*35.4%
Simplified35.4%
Taylor expanded in b around inf 43.8%
Taylor expanded in b around 0 52.4%
if 1.8000000000000001e-267 < y < 350Initial program 95.9%
Taylor expanded in b around inf 76.1%
mul-1-neg76.1%
distribute-rgt-neg-out76.1%
Simplified76.1%
Taylor expanded in a around 0 42.4%
mul-1-neg42.4%
unsub-neg42.4%
associate-*r*43.8%
*-commutative43.8%
associate-*l*46.8%
Simplified46.8%
if 350 < y Initial program 96.7%
Taylor expanded in b around inf 27.5%
mul-1-neg27.5%
distribute-rgt-neg-out27.5%
Simplified27.5%
Taylor expanded in a around 0 11.3%
mul-1-neg11.3%
unsub-neg11.3%
associate-*r*12.9%
*-commutative12.9%
associate-*l*12.9%
Simplified12.9%
Taylor expanded in b around inf 19.0%
Taylor expanded in b around inf 30.9%
associate-*r*30.9%
mul-1-neg30.9%
Simplified30.9%
Final simplification38.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -5.4e+214)
(- x (* t (* x y)))
(if (<= y -2.3e-42)
(* b (* a (- (/ x (* a b)) x)))
(if (<= y 1.35e+48) (- x (* (+ z b) (* x a))) (* b (* a (- x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5.4e+214) {
tmp = x - (t * (x * y));
} else if (y <= -2.3e-42) {
tmp = b * (a * ((x / (a * b)) - x));
} else if (y <= 1.35e+48) {
tmp = x - ((z + b) * (x * a));
} else {
tmp = b * (a * -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 <= (-5.4d+214)) then
tmp = x - (t * (x * y))
else if (y <= (-2.3d-42)) then
tmp = b * (a * ((x / (a * b)) - x))
else if (y <= 1.35d+48) then
tmp = x - ((z + b) * (x * a))
else
tmp = b * (a * -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 <= -5.4e+214) {
tmp = x - (t * (x * y));
} else if (y <= -2.3e-42) {
tmp = b * (a * ((x / (a * b)) - x));
} else if (y <= 1.35e+48) {
tmp = x - ((z + b) * (x * a));
} else {
tmp = b * (a * -x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -5.4e+214: tmp = x - (t * (x * y)) elif y <= -2.3e-42: tmp = b * (a * ((x / (a * b)) - x)) elif y <= 1.35e+48: tmp = x - ((z + b) * (x * a)) else: tmp = b * (a * -x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -5.4e+214) tmp = Float64(x - Float64(t * Float64(x * y))); elseif (y <= -2.3e-42) tmp = Float64(b * Float64(a * Float64(Float64(x / Float64(a * b)) - x))); elseif (y <= 1.35e+48) tmp = Float64(x - Float64(Float64(z + b) * Float64(x * a))); else tmp = Float64(b * Float64(a * Float64(-x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -5.4e+214) tmp = x - (t * (x * y)); elseif (y <= -2.3e-42) tmp = b * (a * ((x / (a * b)) - x)); elseif (y <= 1.35e+48) tmp = x - ((z + b) * (x * a)); else tmp = b * (a * -x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -5.4e+214], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.3e-42], N[(b * N[(a * N[(N[(x / N[(a * b), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+48], N[(x - N[(N[(z + b), $MachinePrecision] * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(a * (-x)), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.4 \cdot 10^{+214}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;y \leq -2.3 \cdot 10^{-42}:\\
\;\;\;\;b \cdot \left(a \cdot \left(\frac{x}{a \cdot b} - x\right)\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+48}:\\
\;\;\;\;x - \left(z + b\right) \cdot \left(x \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot \left(-x\right)\right)\\
\end{array}
\end{array}
if y < -5.40000000000000018e214Initial program 95.0%
Taylor expanded in t around inf 80.3%
mul-1-neg80.3%
distribute-lft-neg-out80.3%
*-commutative80.3%
Simplified80.3%
Taylor expanded in y around 0 46.1%
mul-1-neg46.1%
Simplified46.1%
if -5.40000000000000018e214 < y < -2.30000000000000004e-42Initial program 98.2%
Taylor expanded in b around inf 48.1%
mul-1-neg48.1%
distribute-rgt-neg-out48.1%
Simplified48.1%
Taylor expanded in a around 0 17.0%
mul-1-neg17.0%
unsub-neg17.0%
associate-*r*16.9%
*-commutative16.9%
associate-*l*17.0%
Simplified17.0%
Taylor expanded in b around inf 25.3%
Taylor expanded in a around inf 34.0%
if -2.30000000000000004e-42 < y < 1.35000000000000002e48Initial program 90.8%
Taylor expanded in y around 0 76.4%
sub-neg76.4%
log1p-define85.6%
Simplified85.6%
Taylor expanded in z around 0 85.6%
+-commutative85.6%
associate-*r*85.6%
associate-*r*85.6%
distribute-lft-out85.6%
mul-1-neg85.6%
Simplified85.6%
Taylor expanded in a around 0 39.9%
mul-1-neg39.9%
unsub-neg39.9%
associate-*r*42.8%
*-commutative42.8%
Simplified42.8%
if 1.35000000000000002e48 < y Initial program 100.0%
Taylor expanded in b around inf 27.5%
mul-1-neg27.5%
distribute-rgt-neg-out27.5%
Simplified27.5%
Taylor expanded in a around 0 10.8%
mul-1-neg10.8%
unsub-neg10.8%
associate-*r*12.6%
*-commutative12.6%
associate-*l*12.6%
Simplified12.6%
Taylor expanded in b around inf 17.9%
Taylor expanded in b around inf 33.4%
associate-*r*33.4%
mul-1-neg33.4%
Simplified33.4%
Final simplification39.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -4e+166)
(* t (* x (- y)))
(if (<= y -1.4e+23)
(* b (/ x b))
(if (<= y 350.0) (* x (- 1.0 (* a b))) (* b (* a (- x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4e+166) {
tmp = t * (x * -y);
} else if (y <= -1.4e+23) {
tmp = b * (x / b);
} else if (y <= 350.0) {
tmp = x * (1.0 - (a * b));
} else {
tmp = b * (a * -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 <= (-4d+166)) then
tmp = t * (x * -y)
else if (y <= (-1.4d+23)) then
tmp = b * (x / b)
else if (y <= 350.0d0) then
tmp = x * (1.0d0 - (a * b))
else
tmp = b * (a * -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 <= -4e+166) {
tmp = t * (x * -y);
} else if (y <= -1.4e+23) {
tmp = b * (x / b);
} else if (y <= 350.0) {
tmp = x * (1.0 - (a * b));
} else {
tmp = b * (a * -x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -4e+166: tmp = t * (x * -y) elif y <= -1.4e+23: tmp = b * (x / b) elif y <= 350.0: tmp = x * (1.0 - (a * b)) else: tmp = b * (a * -x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4e+166) tmp = Float64(t * Float64(x * Float64(-y))); elseif (y <= -1.4e+23) tmp = Float64(b * Float64(x / b)); elseif (y <= 350.0) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(b * Float64(a * Float64(-x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -4e+166) tmp = t * (x * -y); elseif (y <= -1.4e+23) tmp = b * (x / b); elseif (y <= 350.0) tmp = x * (1.0 - (a * b)); else tmp = b * (a * -x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4e+166], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.4e+23], N[(b * N[(x / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 350.0], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(a * (-x)), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+166}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{+23}:\\
\;\;\;\;b \cdot \frac{x}{b}\\
\mathbf{elif}\;y \leq 350:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot \left(-x\right)\right)\\
\end{array}
\end{array}
if y < -3.99999999999999976e166Initial program 96.0%
Taylor expanded in t around inf 72.5%
mul-1-neg72.5%
distribute-lft-neg-out72.5%
*-commutative72.5%
Simplified72.5%
Taylor expanded in y around 0 41.1%
mul-1-neg41.1%
Simplified41.1%
Taylor expanded in t around inf 41.1%
*-commutative41.1%
associate-*r*33.5%
associate-*l*33.5%
*-commutative33.5%
mul-1-neg33.5%
distribute-rgt-neg-in33.5%
Simplified33.5%
Taylor expanded in x around 0 41.1%
mul-1-neg41.1%
distribute-rgt-neg-in41.1%
Simplified41.1%
if -3.99999999999999976e166 < y < -1.4e23Initial program 97.3%
Taylor expanded in b around inf 39.9%
mul-1-neg39.9%
distribute-rgt-neg-out39.9%
Simplified39.9%
Taylor expanded in a around 0 5.9%
mul-1-neg5.9%
unsub-neg5.9%
associate-*r*5.8%
*-commutative5.8%
associate-*l*5.8%
Simplified5.8%
Taylor expanded in b around inf 21.1%
Taylor expanded in b around 0 24.0%
if -1.4e23 < y < 350Initial program 92.6%
Taylor expanded in b around inf 77.4%
mul-1-neg77.4%
distribute-rgt-neg-out77.4%
Simplified77.4%
Taylor expanded in a around 0 40.3%
mul-1-neg40.3%
unsub-neg40.3%
Simplified40.3%
if 350 < y Initial program 96.7%
Taylor expanded in b around inf 27.5%
mul-1-neg27.5%
distribute-rgt-neg-out27.5%
Simplified27.5%
Taylor expanded in a around 0 11.3%
mul-1-neg11.3%
unsub-neg11.3%
associate-*r*12.9%
*-commutative12.9%
associate-*l*12.9%
Simplified12.9%
Taylor expanded in b around inf 19.0%
Taylor expanded in b around inf 30.9%
associate-*r*30.9%
mul-1-neg30.9%
Simplified30.9%
Final simplification35.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.85e+165)
(* t (* x (- y)))
(if (<= y -2.7e+21)
(* b (/ x b))
(if (<= y 350.0) (- x (* b (* x a))) (* b (* a (- x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.85e+165) {
tmp = t * (x * -y);
} else if (y <= -2.7e+21) {
tmp = b * (x / b);
} else if (y <= 350.0) {
tmp = x - (b * (x * a));
} else {
tmp = b * (a * -x);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-2.85d+165)) then
tmp = t * (x * -y)
else if (y <= (-2.7d+21)) then
tmp = b * (x / b)
else if (y <= 350.0d0) then
tmp = x - (b * (x * a))
else
tmp = b * (a * -x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.85e+165) {
tmp = t * (x * -y);
} else if (y <= -2.7e+21) {
tmp = b * (x / b);
} else if (y <= 350.0) {
tmp = x - (b * (x * a));
} else {
tmp = b * (a * -x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.85e+165: tmp = t * (x * -y) elif y <= -2.7e+21: tmp = b * (x / b) elif y <= 350.0: tmp = x - (b * (x * a)) else: tmp = b * (a * -x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.85e+165) tmp = Float64(t * Float64(x * Float64(-y))); elseif (y <= -2.7e+21) tmp = Float64(b * Float64(x / b)); elseif (y <= 350.0) tmp = Float64(x - Float64(b * Float64(x * a))); else tmp = Float64(b * Float64(a * Float64(-x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.85e+165) tmp = t * (x * -y); elseif (y <= -2.7e+21) tmp = b * (x / b); elseif (y <= 350.0) tmp = x - (b * (x * a)); else tmp = b * (a * -x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.85e+165], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.7e+21], N[(b * N[(x / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 350.0], N[(x - N[(b * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(a * (-x)), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.85 \cdot 10^{+165}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq -2.7 \cdot 10^{+21}:\\
\;\;\;\;b \cdot \frac{x}{b}\\
\mathbf{elif}\;y \leq 350:\\
\;\;\;\;x - b \cdot \left(x \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot \left(-x\right)\right)\\
\end{array}
\end{array}
if y < -2.85000000000000013e165Initial program 96.0%
Taylor expanded in t around inf 72.5%
mul-1-neg72.5%
distribute-lft-neg-out72.5%
*-commutative72.5%
Simplified72.5%
Taylor expanded in y around 0 41.1%
mul-1-neg41.1%
Simplified41.1%
Taylor expanded in t around inf 41.1%
*-commutative41.1%
associate-*r*33.5%
associate-*l*33.5%
*-commutative33.5%
mul-1-neg33.5%
distribute-rgt-neg-in33.5%
Simplified33.5%
Taylor expanded in x around 0 41.1%
mul-1-neg41.1%
distribute-rgt-neg-in41.1%
Simplified41.1%
if -2.85000000000000013e165 < y < -2.7e21Initial program 97.3%
Taylor expanded in b around inf 39.9%
mul-1-neg39.9%
distribute-rgt-neg-out39.9%
Simplified39.9%
Taylor expanded in a around 0 5.9%
mul-1-neg5.9%
unsub-neg5.9%
associate-*r*5.8%
*-commutative5.8%
associate-*l*5.8%
Simplified5.8%
Taylor expanded in b around inf 21.1%
Taylor expanded in b around 0 24.0%
if -2.7e21 < y < 350Initial program 92.6%
Taylor expanded in b around inf 77.4%
mul-1-neg77.4%
distribute-rgt-neg-out77.4%
Simplified77.4%
Taylor expanded in a around 0 38.9%
mul-1-neg38.9%
unsub-neg38.9%
associate-*r*40.3%
*-commutative40.3%
associate-*l*43.1%
Simplified43.1%
if 350 < y Initial program 96.7%
Taylor expanded in b around inf 27.5%
mul-1-neg27.5%
distribute-rgt-neg-out27.5%
Simplified27.5%
Taylor expanded in a around 0 11.3%
mul-1-neg11.3%
unsub-neg11.3%
associate-*r*12.9%
*-commutative12.9%
associate-*l*12.9%
Simplified12.9%
Taylor expanded in b around inf 19.0%
Taylor expanded in b around inf 30.9%
associate-*r*30.9%
mul-1-neg30.9%
Simplified30.9%
Final simplification37.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y -3e+213) (- x (* t (* x y))) (if (<= y 1.35e+48) (* b (- (/ x b) (* x a))) (* b (* a (- x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3e+213) {
tmp = x - (t * (x * y));
} else if (y <= 1.35e+48) {
tmp = b * ((x / b) - (x * a));
} else {
tmp = b * (a * -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 <= (-3d+213)) then
tmp = x - (t * (x * y))
else if (y <= 1.35d+48) then
tmp = b * ((x / b) - (x * a))
else
tmp = b * (a * -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 <= -3e+213) {
tmp = x - (t * (x * y));
} else if (y <= 1.35e+48) {
tmp = b * ((x / b) - (x * a));
} else {
tmp = b * (a * -x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3e+213: tmp = x - (t * (x * y)) elif y <= 1.35e+48: tmp = b * ((x / b) - (x * a)) else: tmp = b * (a * -x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3e+213) tmp = Float64(x - Float64(t * Float64(x * y))); elseif (y <= 1.35e+48) tmp = Float64(b * Float64(Float64(x / b) - Float64(x * a))); else tmp = Float64(b * Float64(a * Float64(-x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -3e+213) tmp = x - (t * (x * y)); elseif (y <= 1.35e+48) tmp = b * ((x / b) - (x * a)); else tmp = b * (a * -x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3e+213], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+48], N[(b * N[(N[(x / b), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(a * (-x)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+213}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+48}:\\
\;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot \left(-x\right)\right)\\
\end{array}
\end{array}
if y < -3.0000000000000001e213Initial program 95.0%
Taylor expanded in t around inf 80.3%
mul-1-neg80.3%
distribute-lft-neg-out80.3%
*-commutative80.3%
Simplified80.3%
Taylor expanded in y around 0 46.1%
mul-1-neg46.1%
Simplified46.1%
if -3.0000000000000001e213 < y < 1.35000000000000002e48Initial program 93.0%
Taylor expanded in b around inf 67.2%
mul-1-neg67.2%
distribute-rgt-neg-out67.2%
Simplified67.2%
Taylor expanded in a around 0 31.3%
mul-1-neg31.3%
unsub-neg31.3%
associate-*r*32.3%
*-commutative32.3%
associate-*l*34.3%
Simplified34.3%
Taylor expanded in b around inf 36.9%
if 1.35000000000000002e48 < y Initial program 100.0%
Taylor expanded in b around inf 27.5%
mul-1-neg27.5%
distribute-rgt-neg-out27.5%
Simplified27.5%
Taylor expanded in a around 0 10.8%
mul-1-neg10.8%
unsub-neg10.8%
associate-*r*12.6%
*-commutative12.6%
associate-*l*12.6%
Simplified12.6%
Taylor expanded in b around inf 17.9%
Taylor expanded in b around inf 33.4%
associate-*r*33.4%
mul-1-neg33.4%
Simplified33.4%
Final simplification36.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y -3.9e+22) (- x (* x (* y t))) (if (<= y 46000.0) (- x (* b (* x a))) (* b (* a (- x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.9e+22) {
tmp = x - (x * (y * t));
} else if (y <= 46000.0) {
tmp = x - (b * (x * a));
} else {
tmp = b * (a * -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 <= (-3.9d+22)) then
tmp = x - (x * (y * t))
else if (y <= 46000.0d0) then
tmp = x - (b * (x * a))
else
tmp = b * (a * -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 <= -3.9e+22) {
tmp = x - (x * (y * t));
} else if (y <= 46000.0) {
tmp = x - (b * (x * a));
} else {
tmp = b * (a * -x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.9e+22: tmp = x - (x * (y * t)) elif y <= 46000.0: tmp = x - (b * (x * a)) else: tmp = b * (a * -x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.9e+22) tmp = Float64(x - Float64(x * Float64(y * t))); elseif (y <= 46000.0) tmp = Float64(x - Float64(b * Float64(x * a))); else tmp = Float64(b * Float64(a * Float64(-x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -3.9e+22) tmp = x - (x * (y * t)); elseif (y <= 46000.0) tmp = x - (b * (x * a)); else tmp = b * (a * -x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.9e+22], N[(x - N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 46000.0], N[(x - N[(b * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(a * (-x)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.9 \cdot 10^{+22}:\\
\;\;\;\;x - x \cdot \left(y \cdot t\right)\\
\mathbf{elif}\;y \leq 46000:\\
\;\;\;\;x - b \cdot \left(x \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot \left(-x\right)\right)\\
\end{array}
\end{array}
if y < -3.90000000000000021e22Initial program 96.8%
Taylor expanded in t around inf 68.6%
mul-1-neg68.6%
distribute-lft-neg-out68.6%
*-commutative68.6%
Simplified68.6%
Taylor expanded in y around 0 24.3%
mul-1-neg24.3%
unsub-neg24.3%
*-commutative24.3%
associate-*l*24.5%
*-commutative24.5%
Simplified24.5%
if -3.90000000000000021e22 < y < 46000Initial program 92.6%
Taylor expanded in b around inf 77.4%
mul-1-neg77.4%
distribute-rgt-neg-out77.4%
Simplified77.4%
Taylor expanded in a around 0 38.9%
mul-1-neg38.9%
unsub-neg38.9%
associate-*r*40.3%
*-commutative40.3%
associate-*l*43.1%
Simplified43.1%
if 46000 < y Initial program 96.7%
Taylor expanded in b around inf 27.5%
mul-1-neg27.5%
distribute-rgt-neg-out27.5%
Simplified27.5%
Taylor expanded in a around 0 11.3%
mul-1-neg11.3%
unsub-neg11.3%
associate-*r*12.9%
*-commutative12.9%
associate-*l*12.9%
Simplified12.9%
Taylor expanded in b around inf 19.0%
Taylor expanded in b around inf 30.9%
associate-*r*30.9%
mul-1-neg30.9%
Simplified30.9%
Final simplification35.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y -4.8e+168) (* t (* x (- y))) (if (<= y 1.35e+48) (* b (/ x b)) (* b (* a (- x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.8e+168) {
tmp = t * (x * -y);
} else if (y <= 1.35e+48) {
tmp = b * (x / b);
} else {
tmp = b * (a * -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.8d+168)) then
tmp = t * (x * -y)
else if (y <= 1.35d+48) then
tmp = b * (x / b)
else
tmp = b * (a * -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.8e+168) {
tmp = t * (x * -y);
} else if (y <= 1.35e+48) {
tmp = b * (x / b);
} else {
tmp = b * (a * -x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -4.8e+168: tmp = t * (x * -y) elif y <= 1.35e+48: tmp = b * (x / b) else: tmp = b * (a * -x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.8e+168) tmp = Float64(t * Float64(x * Float64(-y))); elseif (y <= 1.35e+48) tmp = Float64(b * Float64(x / b)); else tmp = Float64(b * Float64(a * Float64(-x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -4.8e+168) tmp = t * (x * -y); elseif (y <= 1.35e+48) tmp = b * (x / b); else tmp = b * (a * -x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.8e+168], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+48], N[(b * N[(x / b), $MachinePrecision]), $MachinePrecision], N[(b * N[(a * (-x)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+168}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+48}:\\
\;\;\;\;b \cdot \frac{x}{b}\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot \left(-x\right)\right)\\
\end{array}
\end{array}
if y < -4.80000000000000019e168Initial program 96.0%
Taylor expanded in t around inf 72.5%
mul-1-neg72.5%
distribute-lft-neg-out72.5%
*-commutative72.5%
Simplified72.5%
Taylor expanded in y around 0 41.1%
mul-1-neg41.1%
Simplified41.1%
Taylor expanded in t around inf 41.1%
*-commutative41.1%
associate-*r*33.5%
associate-*l*33.5%
*-commutative33.5%
mul-1-neg33.5%
distribute-rgt-neg-in33.5%
Simplified33.5%
Taylor expanded in x around 0 41.1%
mul-1-neg41.1%
distribute-rgt-neg-in41.1%
Simplified41.1%
if -4.80000000000000019e168 < y < 1.35000000000000002e48Initial program 92.8%
Taylor expanded in b around inf 67.4%
mul-1-neg67.4%
distribute-rgt-neg-out67.4%
Simplified67.4%
Taylor expanded in a around 0 31.0%
mul-1-neg31.0%
unsub-neg31.0%
associate-*r*32.0%
*-commutative32.0%
associate-*l*34.1%
Simplified34.1%
Taylor expanded in b around inf 36.8%
Taylor expanded in b around 0 31.9%
if 1.35000000000000002e48 < y Initial program 100.0%
Taylor expanded in b around inf 27.5%
mul-1-neg27.5%
distribute-rgt-neg-out27.5%
Simplified27.5%
Taylor expanded in a around 0 10.8%
mul-1-neg10.8%
unsub-neg10.8%
associate-*r*12.6%
*-commutative12.6%
associate-*l*12.6%
Simplified12.6%
Taylor expanded in b around inf 17.9%
Taylor expanded in b around inf 33.4%
associate-*r*33.4%
mul-1-neg33.4%
Simplified33.4%
Final simplification33.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.8e+51) (* b (/ x b)) (* b (* a (- x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.8e+51) {
tmp = b * (x / b);
} else {
tmp = b * (a * -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 <= 1.8d+51) then
tmp = b * (x / b)
else
tmp = b * (a * -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 <= 1.8e+51) {
tmp = b * (x / b);
} else {
tmp = b * (a * -x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.8e+51: tmp = b * (x / b) else: tmp = b * (a * -x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.8e+51) tmp = Float64(b * Float64(x / b)); else tmp = Float64(b * Float64(a * Float64(-x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1.8e+51) tmp = b * (x / b); else tmp = b * (a * -x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.8e+51], N[(b * N[(x / b), $MachinePrecision]), $MachinePrecision], N[(b * N[(a * (-x)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.8 \cdot 10^{+51}:\\
\;\;\;\;b \cdot \frac{x}{b}\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot \left(-x\right)\right)\\
\end{array}
\end{array}
if y < 1.80000000000000005e51Initial program 93.2%
Taylor expanded in b around inf 62.4%
mul-1-neg62.4%
distribute-rgt-neg-out62.4%
Simplified62.4%
Taylor expanded in a around 0 28.5%
mul-1-neg28.5%
unsub-neg28.5%
associate-*r*29.4%
*-commutative29.4%
associate-*l*31.2%
Simplified31.2%
Taylor expanded in b around inf 34.0%
Taylor expanded in b around 0 28.9%
if 1.80000000000000005e51 < y Initial program 100.0%
Taylor expanded in b around inf 27.5%
mul-1-neg27.5%
distribute-rgt-neg-out27.5%
Simplified27.5%
Taylor expanded in a around 0 10.8%
mul-1-neg10.8%
unsub-neg10.8%
associate-*r*12.6%
*-commutative12.6%
associate-*l*12.6%
Simplified12.6%
Taylor expanded in b around inf 17.9%
Taylor expanded in b around inf 33.4%
associate-*r*33.4%
mul-1-neg33.4%
Simplified33.4%
Final simplification29.8%
(FPCore (x y z t a b) :precision binary64 (* b (/ x b)))
double code(double x, double y, double z, double t, double a, double b) {
return b * (x / 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 = b * (x / b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return b * (x / b);
}
def code(x, y, z, t, a, b): return b * (x / b)
function code(x, y, z, t, a, b) return Float64(b * Float64(x / b)) end
function tmp = code(x, y, z, t, a, b) tmp = b * (x / b); end
code[x_, y_, z_, t_, a_, b_] := N[(b * N[(x / b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot \frac{x}{b}
\end{array}
Initial program 94.6%
Taylor expanded in b around inf 55.3%
mul-1-neg55.3%
distribute-rgt-neg-out55.3%
Simplified55.3%
Taylor expanded in a around 0 24.9%
mul-1-neg24.9%
unsub-neg24.9%
associate-*r*26.0%
*-commutative26.0%
associate-*l*27.4%
Simplified27.4%
Taylor expanded in b around inf 30.7%
Taylor expanded in b around 0 25.9%
Final simplification25.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 94.6%
Taylor expanded in b around inf 55.3%
mul-1-neg55.3%
distribute-rgt-neg-out55.3%
Simplified55.3%
Taylor expanded in a around 0 16.5%
Final simplification16.5%
herbie shell --seed 2024059
(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))))))