
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
(FPCore (x y z t a b) :precision binary64 (* x (exp (fma a (- (log1p (- z)) b) (* y (- (log z) t))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(a, (log1p(-z) - b), (y * (log(z) - t))));
}
function code(x, y, z, t, a, b) return Float64(x * exp(fma(a, Float64(log1p(Float64(-z)) - b), Float64(y * Float64(log(z) - t))))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision] + N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\mathsf{fma}\left(a, \mathsf{log1p}\left(-z\right) - b, y \cdot \left(\log z - t\right)\right)}
\end{array}
Initial program 95.4%
+-commutative95.4%
fma-def96.2%
sub-neg96.2%
log1p-def99.2%
Simplified99.2%
Final simplification99.2%
(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 95.4%
Final simplification95.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -48000000000000.0) (not (<= y 8.4e-35))) (* 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 <= -48000000000000.0) || !(y <= 8.4e-35)) {
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 <= (-48000000000000.0d0)) .or. (.not. (y <= 8.4d-35))) 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 <= -48000000000000.0) || !(y <= 8.4e-35)) {
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 <= -48000000000000.0) or not (y <= 8.4e-35): 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 <= -48000000000000.0) || !(y <= 8.4e-35)) 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 <= -48000000000000.0) || ~((y <= 8.4e-35))) 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, -48000000000000.0], N[Not[LessEqual[y, 8.4e-35]], $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 -48000000000000 \lor \neg \left(y \leq 8.4 \cdot 10^{-35}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{-a \cdot \left(z + b\right)}\\
\end{array}
\end{array}
if y < -4.8e13 or 8.3999999999999999e-35 < y Initial program 96.2%
Taylor expanded in y around inf 91.7%
if -4.8e13 < y < 8.3999999999999999e-35Initial program 94.7%
Taylor expanded in y around 0 81.9%
sub-neg81.9%
neg-mul-181.9%
log1p-def87.2%
neg-mul-187.2%
sub-neg87.2%
sub-neg87.2%
Simplified87.2%
Taylor expanded in z around 0 87.2%
associate-*r*87.2%
associate-*r*87.2%
distribute-lft-out87.2%
neg-mul-187.2%
Simplified87.2%
Final simplification89.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* t (- y))))) (t_2 (* x (pow z y))))
(if (<= y -1.55e+171)
t_2
(if (<= y -7.5e+87)
t_1
(if (<= y -66000000000000.0)
t_2
(if (<= y 5.2e-33)
(* x (exp (* a (- b))))
(if (or (<= y 5.5e+191) (not (<= y 2e+248))) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((t * -y));
double t_2 = x * pow(z, y);
double tmp;
if (y <= -1.55e+171) {
tmp = t_2;
} else if (y <= -7.5e+87) {
tmp = t_1;
} else if (y <= -66000000000000.0) {
tmp = t_2;
} else if (y <= 5.2e-33) {
tmp = x * exp((a * -b));
} else if ((y <= 5.5e+191) || !(y <= 2e+248)) {
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((t * -y))
t_2 = x * (z ** y)
if (y <= (-1.55d+171)) then
tmp = t_2
else if (y <= (-7.5d+87)) then
tmp = t_1
else if (y <= (-66000000000000.0d0)) then
tmp = t_2
else if (y <= 5.2d-33) then
tmp = x * exp((a * -b))
else if ((y <= 5.5d+191) .or. (.not. (y <= 2d+248))) 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((t * -y));
double t_2 = x * Math.pow(z, y);
double tmp;
if (y <= -1.55e+171) {
tmp = t_2;
} else if (y <= -7.5e+87) {
tmp = t_1;
} else if (y <= -66000000000000.0) {
tmp = t_2;
} else if (y <= 5.2e-33) {
tmp = x * Math.exp((a * -b));
} else if ((y <= 5.5e+191) || !(y <= 2e+248)) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((t * -y)) t_2 = x * math.pow(z, y) tmp = 0 if y <= -1.55e+171: tmp = t_2 elif y <= -7.5e+87: tmp = t_1 elif y <= -66000000000000.0: tmp = t_2 elif y <= 5.2e-33: tmp = x * math.exp((a * -b)) elif (y <= 5.5e+191) or not (y <= 2e+248): tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(t * Float64(-y)))) t_2 = Float64(x * (z ^ y)) tmp = 0.0 if (y <= -1.55e+171) tmp = t_2; elseif (y <= -7.5e+87) tmp = t_1; elseif (y <= -66000000000000.0) tmp = t_2; elseif (y <= 5.2e-33) tmp = Float64(x * exp(Float64(a * Float64(-b)))); elseif ((y <= 5.5e+191) || !(y <= 2e+248)) 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((t * -y)); t_2 = x * (z ^ y); tmp = 0.0; if (y <= -1.55e+171) tmp = t_2; elseif (y <= -7.5e+87) tmp = t_1; elseif (y <= -66000000000000.0) tmp = t_2; elseif (y <= 5.2e-33) tmp = x * exp((a * -b)); elseif ((y <= 5.5e+191) || ~((y <= 2e+248))) 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[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.55e+171], t$95$2, If[LessEqual[y, -7.5e+87], t$95$1, If[LessEqual[y, -66000000000000.0], t$95$2, If[LessEqual[y, 5.2e-33], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 5.5e+191], N[Not[LessEqual[y, 2e+248]], $MachinePrecision]], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{t \cdot \left(-y\right)}\\
t_2 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -1.55 \cdot 10^{+171}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -7.5 \cdot 10^{+87}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -66000000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-33}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+191} \lor \neg \left(y \leq 2 \cdot 10^{+248}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.5499999999999999e171 or -7.50000000000000014e87 < y < -6.6e13 or 5.5000000000000002e191 < y < 2.00000000000000009e248Initial program 98.0%
Taylor expanded in y around inf 88.4%
Taylor expanded in t around 0 78.8%
if -1.5499999999999999e171 < y < -7.50000000000000014e87 or 5.19999999999999988e-33 < y < 5.5000000000000002e191 or 2.00000000000000009e248 < y Initial program 95.0%
Taylor expanded in t around inf 79.4%
mul-1-neg79.4%
distribute-rgt-neg-in79.4%
Simplified79.4%
if -6.6e13 < y < 5.19999999999999988e-33Initial program 94.7%
Taylor expanded in b around inf 81.9%
associate-*r*81.9%
*-commutative81.9%
neg-mul-181.9%
Simplified81.9%
Final simplification80.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))))
(if (<= y -9e+14)
t_1
(if (<= y 3800.0)
(* x (exp (* a (- b))))
(if (or (<= y 7.6e+125) (not (<= y 5e+194)))
t_1
(* (* x (* y y)) (* t (* t 0.5))))))))
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 <= -9e+14) {
tmp = t_1;
} else if (y <= 3800.0) {
tmp = x * exp((a * -b));
} else if ((y <= 7.6e+125) || !(y <= 5e+194)) {
tmp = t_1;
} else {
tmp = (x * (y * y)) * (t * (t * 0.5));
}
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 <= (-9d+14)) then
tmp = t_1
else if (y <= 3800.0d0) then
tmp = x * exp((a * -b))
else if ((y <= 7.6d+125) .or. (.not. (y <= 5d+194))) then
tmp = t_1
else
tmp = (x * (y * y)) * (t * (t * 0.5d0))
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 <= -9e+14) {
tmp = t_1;
} else if (y <= 3800.0) {
tmp = x * Math.exp((a * -b));
} else if ((y <= 7.6e+125) || !(y <= 5e+194)) {
tmp = t_1;
} else {
tmp = (x * (y * y)) * (t * (t * 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.pow(z, y) tmp = 0 if y <= -9e+14: tmp = t_1 elif y <= 3800.0: tmp = x * math.exp((a * -b)) elif (y <= 7.6e+125) or not (y <= 5e+194): tmp = t_1 else: tmp = (x * (y * y)) * (t * (t * 0.5)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * (z ^ y)) tmp = 0.0 if (y <= -9e+14) tmp = t_1; elseif (y <= 3800.0) tmp = Float64(x * exp(Float64(a * Float64(-b)))); elseif ((y <= 7.6e+125) || !(y <= 5e+194)) tmp = t_1; else tmp = Float64(Float64(x * Float64(y * y)) * Float64(t * Float64(t * 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (z ^ y); tmp = 0.0; if (y <= -9e+14) tmp = t_1; elseif (y <= 3800.0) tmp = x * exp((a * -b)); elseif ((y <= 7.6e+125) || ~((y <= 5e+194))) tmp = t_1; else tmp = (x * (y * y)) * (t * (t * 0.5)); 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, -9e+14], t$95$1, If[LessEqual[y, 3800.0], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 7.6e+125], N[Not[LessEqual[y, 5e+194]], $MachinePrecision]], t$95$1, N[(N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(t * N[(t * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -9 \cdot 10^{+14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3800:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{+125} \lor \neg \left(y \leq 5 \cdot 10^{+194}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(t \cdot \left(t \cdot 0.5\right)\right)\\
\end{array}
\end{array}
if y < -9e14 or 3800 < y < 7.60000000000000003e125 or 4.99999999999999989e194 < y Initial program 96.5%
Taylor expanded in y around inf 92.2%
Taylor expanded in t around 0 66.0%
if -9e14 < y < 3800Initial program 94.9%
Taylor expanded in b around inf 80.4%
associate-*r*80.4%
*-commutative80.4%
neg-mul-180.4%
Simplified80.4%
if 7.60000000000000003e125 < y < 4.99999999999999989e194Initial program 92.3%
Taylor expanded in t around inf 84.9%
mul-1-neg84.9%
distribute-rgt-neg-in84.9%
Simplified84.9%
Taylor expanded in t around 0 77.2%
associate-+r+77.2%
mul-1-neg77.2%
unsub-neg77.2%
*-commutative77.2%
associate-*r*77.2%
unpow277.2%
unpow277.2%
Simplified77.2%
Taylor expanded in y around inf 77.2%
unpow277.2%
associate-*r*77.2%
*-commutative77.2%
unpow277.2%
associate-*r*77.2%
*-commutative77.2%
Simplified77.2%
Final simplification73.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.2e+42) (not (<= t 2.5e+45))) (* x (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 ((t <= -1.2e+42) || !(t <= 2.5e+45)) {
tmp = x * 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 ((t <= (-1.2d+42)) .or. (.not. (t <= 2.5d+45))) then
tmp = x * 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 ((t <= -1.2e+42) || !(t <= 2.5e+45)) {
tmp = x * 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 (t <= -1.2e+42) or not (t <= 2.5e+45): tmp = x * 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 ((t <= -1.2e+42) || !(t <= 2.5e+45)) tmp = Float64(x * exp(Float64(t * Float64(-y)))); 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 ((t <= -1.2e+42) || ~((t <= 2.5e+45))) tmp = x * 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[t, -1.2e+42], N[Not[LessEqual[t, 2.5e+45]], $MachinePrecision]], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[(-N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+42} \lor \neg \left(t \leq 2.5 \cdot 10^{+45}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{-a \cdot \left(z + b\right)}\\
\end{array}
\end{array}
if t < -1.1999999999999999e42 or 2.5e45 < t Initial program 94.9%
Taylor expanded in t around inf 81.8%
mul-1-neg81.8%
distribute-rgt-neg-in81.8%
Simplified81.8%
if -1.1999999999999999e42 < t < 2.5e45Initial program 95.9%
Taylor expanded in y around 0 67.5%
sub-neg67.5%
neg-mul-167.5%
log1p-def72.8%
neg-mul-172.8%
sub-neg72.8%
sub-neg72.8%
Simplified72.8%
Taylor expanded in z around 0 72.8%
associate-*r*72.8%
associate-*r*72.8%
distribute-lft-out72.8%
neg-mul-172.8%
Simplified72.8%
Final simplification76.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -550.0) (* x (+ (- 1.0 (* y t)) (* (* y y) (* 0.5 (* t t))))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -550.0) {
tmp = x * ((1.0 - (y * t)) + ((y * y) * (0.5 * (t * 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 <= (-550.0d0)) then
tmp = x * ((1.0d0 - (y * t)) + ((y * y) * (0.5d0 * (t * 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 <= -550.0) {
tmp = x * ((1.0 - (y * t)) + ((y * y) * (0.5 * (t * t))));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -550.0: tmp = x * ((1.0 - (y * t)) + ((y * y) * (0.5 * (t * t)))) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -550.0) tmp = Float64(x * Float64(Float64(1.0 - Float64(y * t)) + Float64(Float64(y * y) * Float64(0.5 * Float64(t * 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 <= -550.0) tmp = x * ((1.0 - (y * t)) + ((y * y) * (0.5 * (t * t)))); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -550.0], N[(x * N[(N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision] + N[(N[(y * y), $MachinePrecision] * N[(0.5 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -550:\\
\;\;\;\;x \cdot \left(\left(1 - y \cdot t\right) + \left(y \cdot y\right) \cdot \left(0.5 \cdot \left(t \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -550Initial program 94.9%
Taylor expanded in t around inf 78.6%
mul-1-neg78.6%
distribute-rgt-neg-in78.6%
Simplified78.6%
Taylor expanded in t around 0 49.2%
associate-+r+49.2%
mul-1-neg49.2%
unsub-neg49.2%
*-commutative49.2%
associate-*r*49.2%
unpow249.2%
unpow249.2%
Simplified49.2%
if -550 < t Initial program 95.7%
Taylor expanded in y around inf 65.8%
Taylor expanded in t around 0 60.2%
Final simplification56.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.1e-100) (not (<= y 2.4e-36))) (* (* x (* y y)) (* t (* t 0.5))) (* x (+ (- 1.0 (* a b)) (* 0.5 (* (* a b) (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.1e-100) || !(y <= 2.4e-36)) {
tmp = (x * (y * y)) * (t * (t * 0.5));
} else {
tmp = x * ((1.0 - (a * b)) + (0.5 * ((a * b) * (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.1d-100)) .or. (.not. (y <= 2.4d-36))) then
tmp = (x * (y * y)) * (t * (t * 0.5d0))
else
tmp = x * ((1.0d0 - (a * b)) + (0.5d0 * ((a * b) * (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.1e-100) || !(y <= 2.4e-36)) {
tmp = (x * (y * y)) * (t * (t * 0.5));
} else {
tmp = x * ((1.0 - (a * b)) + (0.5 * ((a * b) * (a * b))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.1e-100) or not (y <= 2.4e-36): tmp = (x * (y * y)) * (t * (t * 0.5)) else: tmp = x * ((1.0 - (a * b)) + (0.5 * ((a * b) * (a * b)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.1e-100) || !(y <= 2.4e-36)) tmp = Float64(Float64(x * Float64(y * y)) * Float64(t * Float64(t * 0.5))); else tmp = Float64(x * Float64(Float64(1.0 - Float64(a * b)) + Float64(0.5 * Float64(Float64(a * b) * Float64(a * b))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.1e-100) || ~((y <= 2.4e-36))) tmp = (x * (y * y)) * (t * (t * 0.5)); else tmp = x * ((1.0 - (a * b)) + (0.5 * ((a * b) * (a * b)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.1e-100], N[Not[LessEqual[y, 2.4e-36]], $MachinePrecision]], N[(N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(t * N[(t * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[(a * b), $MachinePrecision] * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-100} \lor \neg \left(y \leq 2.4 \cdot 10^{-36}\right):\\
\;\;\;\;\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(t \cdot \left(t \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\left(1 - a \cdot b\right) + 0.5 \cdot \left(\left(a \cdot b\right) \cdot \left(a \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if y < -1.09999999999999995e-100 or 2.4e-36 < y Initial program 96.3%
Taylor expanded in t around inf 58.9%
mul-1-neg58.9%
distribute-rgt-neg-in58.9%
Simplified58.9%
Taylor expanded in t around 0 34.7%
associate-+r+34.7%
mul-1-neg34.7%
unsub-neg34.7%
*-commutative34.7%
associate-*r*34.7%
unpow234.7%
unpow234.7%
Simplified34.7%
Taylor expanded in y around inf 39.5%
unpow239.5%
associate-*r*39.5%
*-commutative39.5%
unpow239.5%
associate-*r*39.5%
*-commutative39.5%
Simplified39.5%
if -1.09999999999999995e-100 < y < 2.4e-36Initial program 94.0%
Taylor expanded in b around inf 84.0%
associate-*r*84.0%
*-commutative84.0%
neg-mul-184.0%
Simplified84.0%
Taylor expanded in b around 0 50.3%
associate-+r+50.3%
mul-1-neg50.3%
unsub-neg50.3%
unpow250.3%
unpow250.3%
unswap-sqr52.3%
Simplified52.3%
Final simplification44.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.7e-112) (not (<= y 1.5e-36))) (* (* x (* y y)) (* t (* t 0.5))) (* x (- 1.0 (* a (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.7e-112) || !(y <= 1.5e-36)) {
tmp = (x * (y * y)) * (t * (t * 0.5));
} else {
tmp = x * (1.0 - (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.7d-112)) .or. (.not. (y <= 1.5d-36))) then
tmp = (x * (y * y)) * (t * (t * 0.5d0))
else
tmp = x * (1.0d0 - (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.7e-112) || !(y <= 1.5e-36)) {
tmp = (x * (y * y)) * (t * (t * 0.5));
} else {
tmp = x * (1.0 - (a * (z + b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.7e-112) or not (y <= 1.5e-36): tmp = (x * (y * y)) * (t * (t * 0.5)) else: tmp = x * (1.0 - (a * (z + b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.7e-112) || !(y <= 1.5e-36)) tmp = Float64(Float64(x * Float64(y * y)) * Float64(t * Float64(t * 0.5))); else tmp = Float64(x * Float64(1.0 - 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.7e-112) || ~((y <= 1.5e-36))) tmp = (x * (y * y)) * (t * (t * 0.5)); else tmp = x * (1.0 - (a * (z + b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.7e-112], N[Not[LessEqual[y, 1.5e-36]], $MachinePrecision]], N[(N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(t * N[(t * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{-112} \lor \neg \left(y \leq 1.5 \cdot 10^{-36}\right):\\
\;\;\;\;\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(t \cdot \left(t \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\
\end{array}
\end{array}
if y < -2.7000000000000001e-112 or 1.5000000000000001e-36 < y Initial program 96.3%
Taylor expanded in t around inf 58.9%
mul-1-neg58.9%
distribute-rgt-neg-in58.9%
Simplified58.9%
Taylor expanded in t around 0 34.7%
associate-+r+34.7%
mul-1-neg34.7%
unsub-neg34.7%
*-commutative34.7%
associate-*r*34.7%
unpow234.7%
unpow234.7%
Simplified34.7%
Taylor expanded in y around inf 39.5%
unpow239.5%
associate-*r*39.5%
*-commutative39.5%
unpow239.5%
associate-*r*39.5%
*-commutative39.5%
Simplified39.5%
if -2.7000000000000001e-112 < y < 1.5000000000000001e-36Initial program 94.0%
Taylor expanded in y around 0 84.0%
sub-neg84.0%
neg-mul-184.0%
log1p-def90.0%
neg-mul-190.0%
sub-neg90.0%
sub-neg90.0%
Simplified90.0%
Taylor expanded in z around 0 90.0%
associate-*r*90.0%
associate-*r*90.0%
distribute-lft-out90.0%
neg-mul-190.0%
Simplified90.0%
Taylor expanded in a around 0 49.2%
neg-mul-149.2%
unsub-neg49.2%
Simplified49.2%
Final simplification43.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.65e+72) (not (<= t 11000000000000.0))) (* x (- 1.0 (* y t))) (* x (- 1.0 (* a (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.65e+72) || !(t <= 11000000000000.0)) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * (1.0 - (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 ((t <= (-1.65d+72)) .or. (.not. (t <= 11000000000000.0d0))) then
tmp = x * (1.0d0 - (y * t))
else
tmp = x * (1.0d0 - (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 ((t <= -1.65e+72) || !(t <= 11000000000000.0)) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * (1.0 - (a * (z + b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.65e+72) or not (t <= 11000000000000.0): tmp = x * (1.0 - (y * t)) else: tmp = x * (1.0 - (a * (z + b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.65e+72) || !(t <= 11000000000000.0)) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(x * Float64(1.0 - Float64(a * Float64(z + b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.65e+72) || ~((t <= 11000000000000.0))) tmp = x * (1.0 - (y * t)); else tmp = x * (1.0 - (a * (z + b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.65e+72], N[Not[LessEqual[t, 11000000000000.0]], $MachinePrecision]], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{+72} \lor \neg \left(t \leq 11000000000000\right):\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\
\end{array}
\end{array}
if t < -1.65e72 or 1.1e13 < t Initial program 94.9%
Taylor expanded in t around inf 81.1%
mul-1-neg81.1%
distribute-rgt-neg-in81.1%
Simplified81.1%
Taylor expanded in t around 0 38.0%
mul-1-neg38.0%
unsub-neg38.0%
*-commutative38.0%
Simplified38.0%
if -1.65e72 < t < 1.1e13Initial program 95.9%
Taylor expanded in y around 0 66.6%
sub-neg66.6%
neg-mul-166.6%
log1p-def71.9%
neg-mul-171.9%
sub-neg71.9%
sub-neg71.9%
Simplified71.9%
Taylor expanded in z around 0 71.9%
associate-*r*71.9%
associate-*r*71.9%
distribute-lft-out71.9%
neg-mul-171.9%
Simplified71.9%
Taylor expanded in a around 0 35.0%
neg-mul-135.0%
unsub-neg35.0%
Simplified35.0%
Final simplification36.4%
(FPCore (x y z t a b) :precision binary64 (if (<= b -6.8e+114) (* a (* x (- b))) (if (or (<= b -6.2e-106) (not (<= b 1.75e-19))) (* a (* x (- z))) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -6.8e+114) {
tmp = a * (x * -b);
} else if ((b <= -6.2e-106) || !(b <= 1.75e-19)) {
tmp = a * (x * -z);
} 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 (b <= (-6.8d+114)) then
tmp = a * (x * -b)
else if ((b <= (-6.2d-106)) .or. (.not. (b <= 1.75d-19))) then
tmp = a * (x * -z)
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 (b <= -6.8e+114) {
tmp = a * (x * -b);
} else if ((b <= -6.2e-106) || !(b <= 1.75e-19)) {
tmp = a * (x * -z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -6.8e+114: tmp = a * (x * -b) elif (b <= -6.2e-106) or not (b <= 1.75e-19): tmp = a * (x * -z) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -6.8e+114) tmp = Float64(a * Float64(x * Float64(-b))); elseif ((b <= -6.2e-106) || !(b <= 1.75e-19)) tmp = Float64(a * Float64(x * Float64(-z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -6.8e+114) tmp = a * (x * -b); elseif ((b <= -6.2e-106) || ~((b <= 1.75e-19))) tmp = a * (x * -z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -6.8e+114], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[b, -6.2e-106], N[Not[LessEqual[b, 1.75e-19]], $MachinePrecision]], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.8 \cdot 10^{+114}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{elif}\;b \leq -6.2 \cdot 10^{-106} \lor \neg \left(b \leq 1.75 \cdot 10^{-19}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if b < -6.8000000000000001e114Initial program 97.3%
Taylor expanded in b around inf 79.2%
associate-*r*79.2%
*-commutative79.2%
neg-mul-179.2%
Simplified79.2%
Taylor expanded in b around 0 34.5%
mul-1-neg34.5%
unsub-neg34.5%
Simplified34.5%
Taylor expanded in a around inf 29.0%
mul-1-neg29.0%
distribute-rgt-neg-in29.0%
Simplified29.0%
if -6.8000000000000001e114 < b < -6.19999999999999971e-106 or 1.75000000000000008e-19 < b Initial program 97.1%
Taylor expanded in y around 0 61.0%
sub-neg61.0%
neg-mul-161.0%
log1p-def61.0%
neg-mul-161.0%
sub-neg61.0%
sub-neg61.0%
Simplified61.0%
Taylor expanded in z around 0 61.0%
associate-*r*61.0%
associate-*r*61.0%
distribute-lft-out61.0%
neg-mul-161.0%
Simplified61.0%
Taylor expanded in a around 0 16.1%
mul-1-neg16.1%
unsub-neg16.1%
*-commutative16.1%
Simplified16.1%
Taylor expanded in z around inf 26.6%
associate-*r*26.6%
neg-mul-126.6%
Simplified26.6%
if -6.19999999999999971e-106 < b < 1.75000000000000008e-19Initial program 93.1%
Taylor expanded in y around inf 81.1%
Taylor expanded in y around 0 26.2%
Final simplification26.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -1.55e-42) (not (<= x 9.8e-80))) (* x (- 1.0 (* a b))) (* a (* x (- z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -1.55e-42) || !(x <= 9.8e-80)) {
tmp = x * (1.0 - (a * b));
} else {
tmp = a * (x * -z);
}
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 <= (-1.55d-42)) .or. (.not. (x <= 9.8d-80))) then
tmp = x * (1.0d0 - (a * b))
else
tmp = a * (x * -z)
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 <= -1.55e-42) || !(x <= 9.8e-80)) {
tmp = x * (1.0 - (a * b));
} else {
tmp = a * (x * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -1.55e-42) or not (x <= 9.8e-80): tmp = x * (1.0 - (a * b)) else: tmp = a * (x * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -1.55e-42) || !(x <= 9.8e-80)) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(a * Float64(x * Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x <= -1.55e-42) || ~((x <= 9.8e-80))) tmp = x * (1.0 - (a * b)); else tmp = a * (x * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -1.55e-42], N[Not[LessEqual[x, 9.8e-80]], $MachinePrecision]], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{-42} \lor \neg \left(x \leq 9.8 \cdot 10^{-80}\right):\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if x < -1.5500000000000001e-42 or 9.79999999999999981e-80 < x Initial program 95.4%
Taylor expanded in b around inf 54.1%
associate-*r*54.1%
*-commutative54.1%
neg-mul-154.1%
Simplified54.1%
Taylor expanded in b around 0 27.8%
mul-1-neg27.8%
unsub-neg27.8%
Simplified27.8%
if -1.5500000000000001e-42 < x < 9.79999999999999981e-80Initial program 95.4%
Taylor expanded in y around 0 58.1%
sub-neg58.1%
neg-mul-158.1%
log1p-def63.4%
neg-mul-163.4%
sub-neg63.4%
sub-neg63.4%
Simplified63.4%
Taylor expanded in z around 0 63.4%
associate-*r*63.4%
associate-*r*63.4%
distribute-lft-out63.4%
neg-mul-163.4%
Simplified63.4%
Taylor expanded in a around 0 15.4%
mul-1-neg15.4%
unsub-neg15.4%
*-commutative15.4%
Simplified15.4%
Taylor expanded in z around inf 33.8%
associate-*r*33.8%
neg-mul-133.8%
Simplified33.8%
Final simplification30.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.3e+72) (not (<= t 1250000000000.0))) (* x (- 1.0 (* y t))) (* x (- 1.0 (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.3e+72) || !(t <= 1250000000000.0)) {
tmp = x * (1.0 - (y * t));
} 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 ((t <= (-1.3d+72)) .or. (.not. (t <= 1250000000000.0d0))) then
tmp = x * (1.0d0 - (y * t))
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 ((t <= -1.3e+72) || !(t <= 1250000000000.0)) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * (1.0 - (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.3e+72) or not (t <= 1250000000000.0): tmp = x * (1.0 - (y * t)) else: tmp = x * (1.0 - (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.3e+72) || !(t <= 1250000000000.0)) tmp = Float64(x * Float64(1.0 - Float64(y * t))); 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 ((t <= -1.3e+72) || ~((t <= 1250000000000.0))) tmp = x * (1.0 - (y * t)); else tmp = x * (1.0 - (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.3e+72], N[Not[LessEqual[t, 1250000000000.0]], $MachinePrecision]], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{+72} \lor \neg \left(t \leq 1250000000000\right):\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\end{array}
\end{array}
if t < -1.29999999999999991e72 or 1.25e12 < t Initial program 94.9%
Taylor expanded in t around inf 81.1%
mul-1-neg81.1%
distribute-rgt-neg-in81.1%
Simplified81.1%
Taylor expanded in t around 0 38.0%
mul-1-neg38.0%
unsub-neg38.0%
*-commutative38.0%
Simplified38.0%
if -1.29999999999999991e72 < t < 1.25e12Initial program 95.9%
Taylor expanded in b around inf 65.8%
associate-*r*65.8%
*-commutative65.8%
neg-mul-165.8%
Simplified65.8%
Taylor expanded in b around 0 33.7%
mul-1-neg33.7%
unsub-neg33.7%
Simplified33.7%
Final simplification35.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.5e+68) (not (<= t 5.1e-8))) (* x (- 1.0 (* y t))) (- x (* b (* x a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.5e+68) || !(t <= 5.1e-8)) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x - (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 ((t <= (-2.5d+68)) .or. (.not. (t <= 5.1d-8))) then
tmp = x * (1.0d0 - (y * t))
else
tmp = x - (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 ((t <= -2.5e+68) || !(t <= 5.1e-8)) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x - (b * (x * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.5e+68) or not (t <= 5.1e-8): tmp = x * (1.0 - (y * t)) else: tmp = x - (b * (x * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.5e+68) || !(t <= 5.1e-8)) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(x - Float64(b * Float64(x * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -2.5e+68) || ~((t <= 5.1e-8))) tmp = x * (1.0 - (y * t)); else tmp = x - (b * (x * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.5e+68], N[Not[LessEqual[t, 5.1e-8]], $MachinePrecision]], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(b * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+68} \lor \neg \left(t \leq 5.1 \cdot 10^{-8}\right):\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x - b \cdot \left(x \cdot a\right)\\
\end{array}
\end{array}
if t < -2.5000000000000002e68 or 5.10000000000000001e-8 < t Initial program 95.1%
Taylor expanded in t around inf 80.7%
mul-1-neg80.7%
distribute-rgt-neg-in80.7%
Simplified80.7%
Taylor expanded in t around 0 38.7%
mul-1-neg38.7%
unsub-neg38.7%
*-commutative38.7%
Simplified38.7%
if -2.5000000000000002e68 < t < 5.10000000000000001e-8Initial program 95.8%
Taylor expanded in y around 0 65.8%
sub-neg65.8%
neg-mul-165.8%
log1p-def71.3%
neg-mul-171.3%
sub-neg71.3%
sub-neg71.3%
Simplified71.3%
Taylor expanded in z around 0 71.3%
associate-*r*71.3%
associate-*r*71.3%
distribute-lft-out71.3%
neg-mul-171.3%
Simplified71.3%
Taylor expanded in a around 0 31.6%
mul-1-neg31.6%
unsub-neg31.6%
*-commutative31.6%
Simplified31.6%
Taylor expanded in b around inf 30.4%
*-commutative30.4%
associate-*r*33.0%
Simplified33.0%
Final simplification35.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.3e-82) (not (<= y 1.06e-70))) (* a (* x (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.3e-82) || !(y <= 1.06e-70)) {
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 <= (-3.3d-82)) .or. (.not. (y <= 1.06d-70))) 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 <= -3.3e-82) || !(y <= 1.06e-70)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.3e-82) or not (y <= 1.06e-70): tmp = a * (x * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.3e-82) || !(y <= 1.06e-70)) 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 <= -3.3e-82) || ~((y <= 1.06e-70))) tmp = a * (x * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.3e-82], N[Not[LessEqual[y, 1.06e-70]], $MachinePrecision]], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-82} \lor \neg \left(y \leq 1.06 \cdot 10^{-70}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.30000000000000022e-82 or 1.06e-70 < y Initial program 95.7%
Taylor expanded in b around inf 38.4%
associate-*r*38.4%
*-commutative38.4%
neg-mul-138.4%
Simplified38.4%
Taylor expanded in b around 0 13.3%
mul-1-neg13.3%
unsub-neg13.3%
Simplified13.3%
Taylor expanded in a around inf 17.1%
mul-1-neg17.1%
distribute-rgt-neg-in17.1%
Simplified17.1%
if -3.30000000000000022e-82 < y < 1.06e-70Initial program 95.0%
Taylor expanded in y around inf 48.2%
Taylor expanded in y around 0 35.0%
Final simplification23.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y -3.1e-83) (* a (* x (- z))) (if (<= y 1.35e-70) x (* b (* x (- a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.1e-83) {
tmp = a * (x * -z);
} else if (y <= 1.35e-70) {
tmp = x;
} else {
tmp = 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 <= (-3.1d-83)) then
tmp = a * (x * -z)
else if (y <= 1.35d-70) then
tmp = x
else
tmp = 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 <= -3.1e-83) {
tmp = a * (x * -z);
} else if (y <= 1.35e-70) {
tmp = x;
} else {
tmp = b * (x * -a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.1e-83: tmp = a * (x * -z) elif y <= 1.35e-70: tmp = x else: tmp = b * (x * -a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.1e-83) tmp = Float64(a * Float64(x * Float64(-z))); elseif (y <= 1.35e-70) tmp = x; else tmp = Float64(b * Float64(x * Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -3.1e-83) tmp = a * (x * -z); elseif (y <= 1.35e-70) tmp = x; else tmp = b * (x * -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.1e-83], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e-70], x, N[(b * N[(x * (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-83}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-70}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\
\end{array}
\end{array}
if y < -3.09999999999999992e-83Initial program 97.4%
Taylor expanded in y around 0 44.6%
sub-neg44.6%
neg-mul-144.6%
log1p-def46.9%
neg-mul-146.9%
sub-neg46.9%
sub-neg46.9%
Simplified46.9%
Taylor expanded in z around 0 46.9%
associate-*r*46.9%
associate-*r*46.9%
distribute-lft-out46.9%
neg-mul-146.9%
Simplified46.9%
Taylor expanded in a around 0 12.1%
mul-1-neg12.1%
unsub-neg12.1%
*-commutative12.1%
Simplified12.1%
Taylor expanded in z around inf 18.0%
associate-*r*18.0%
neg-mul-118.0%
Simplified18.0%
if -3.09999999999999992e-83 < y < 1.3500000000000001e-70Initial program 94.8%
Taylor expanded in y around inf 48.1%
Taylor expanded in y around 0 35.7%
if 1.3500000000000001e-70 < y Initial program 94.2%
Taylor expanded in b around inf 33.9%
associate-*r*33.9%
*-commutative33.9%
neg-mul-133.9%
Simplified33.9%
Taylor expanded in b around 0 13.5%
mul-1-neg13.5%
unsub-neg13.5%
Simplified13.5%
Taylor expanded in a around inf 19.0%
mul-1-neg19.0%
distribute-rgt-neg-in19.0%
Simplified19.0%
Taylor expanded in a around 0 19.0%
associate-*r*19.0%
neg-mul-119.0%
*-commutative19.0%
associate-*r*24.6%
Simplified24.6%
Final simplification26.3%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1e-98) (* t (* x y)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1e-98) {
tmp = t * (x * y);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-1d-98)) then
tmp = t * (x * y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1e-98) {
tmp = t * (x * y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1e-98: tmp = t * (x * y) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1e-98) tmp = Float64(t * Float64(x * y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -1e-98) tmp = t * (x * y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1e-98], N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{-98}:\\
\;\;\;\;t \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if b < -9.99999999999999939e-99Initial program 98.6%
Taylor expanded in t around inf 48.4%
mul-1-neg48.4%
distribute-rgt-neg-in48.4%
Simplified48.4%
expm1-log1p-u48.4%
expm1-udef48.4%
exp-prod51.8%
add-sqr-sqrt26.1%
sqrt-unprod29.5%
sqr-neg29.5%
sqrt-unprod9.4%
add-sqr-sqrt16.0%
Applied egg-rr16.0%
expm1-def16.0%
expm1-log1p16.0%
exp-prod23.2%
*-commutative23.2%
Simplified23.2%
Taylor expanded in y around 0 16.0%
Taylor expanded in t around inf 20.2%
if -9.99999999999999939e-99 < b Initial program 93.9%
Taylor expanded in y around inf 71.9%
Taylor expanded in y around 0 18.5%
Final simplification19.1%
(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 95.4%
Taylor expanded in y around inf 69.7%
Taylor expanded in y around 0 16.6%
Final simplification16.6%
herbie shell --seed 2023290
(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))))))