
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
(FPCore (x y z t a b) :precision binary64 (* x (exp (fma y (- (log z) t) (* a (- (log1p (- z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(y, (log(z) - t), (a * (log1p(-z) - b))));
}
function code(x, y, z, t, a, b) return Float64(x * exp(fma(y, Float64(log(z) - t), Float64(a * Float64(log1p(Float64(-z)) - b))))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}
\end{array}
Initial program 96.2%
fma-def96.6%
sub-neg96.6%
log1p-def100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
Initial program 96.2%
Final simplification96.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2e+70) (not (<= a 2.7e+17))) (* x (exp (* a (- (+ z b))))) (* x (exp (* y (- (log z) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2e+70) || !(a <= 2.7e+17)) {
tmp = x * exp((a * -(z + b)));
} else {
tmp = x * exp((y * (log(z) - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-2d+70)) .or. (.not. (a <= 2.7d+17))) then
tmp = x * exp((a * -(z + b)))
else
tmp = x * exp((y * (log(z) - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2e+70) || !(a <= 2.7e+17)) {
tmp = x * Math.exp((a * -(z + b)));
} else {
tmp = x * Math.exp((y * (Math.log(z) - t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2e+70) or not (a <= 2.7e+17): tmp = x * math.exp((a * -(z + b))) else: tmp = x * math.exp((y * (math.log(z) - t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2e+70) || !(a <= 2.7e+17)) tmp = Float64(x * exp(Float64(a * Float64(-Float64(z + b))))); else tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -2e+70) || ~((a <= 2.7e+17))) tmp = x * exp((a * -(z + b))); else tmp = x * exp((y * (log(z) - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2e+70], N[Not[LessEqual[a, 2.7e+17]], $MachinePrecision]], N[(x * N[Exp[N[(a * (-N[(z + b), $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{+70} \lor \neg \left(a \leq 2.7 \cdot 10^{+17}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-\left(z + b\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\end{array}
\end{array}
if a < -2.00000000000000015e70 or 2.7e17 < a Initial program 92.0%
Taylor expanded in y around 0 78.7%
sub-neg78.7%
sub-neg78.7%
neg-mul-178.7%
log1p-def89.0%
neg-mul-189.0%
sub-neg89.0%
Simplified89.0%
Taylor expanded in z around 0 89.0%
associate-*r*89.0%
associate-*r*89.0%
distribute-lft-out89.0%
neg-mul-189.0%
Simplified89.0%
if -2.00000000000000015e70 < a < 2.7e17Initial program 100.0%
Taylor expanded in y around inf 90.2%
Final simplification89.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* a (- b))))))
(if (<= a -5.4e+192)
t_1
(if (<= a -2.9e+179)
(* x (exp (* a (- z))))
(if (or (<= a -4.8e+17) (not (<= a 1.05e-32)))
t_1
(* x (exp (* t (- y)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((a * -b));
double tmp;
if (a <= -5.4e+192) {
tmp = t_1;
} else if (a <= -2.9e+179) {
tmp = x * exp((a * -z));
} else if ((a <= -4.8e+17) || !(a <= 1.05e-32)) {
tmp = t_1;
} else {
tmp = x * exp((t * -y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x * exp((a * -b))
if (a <= (-5.4d+192)) then
tmp = t_1
else if (a <= (-2.9d+179)) then
tmp = x * exp((a * -z))
else if ((a <= (-4.8d+17)) .or. (.not. (a <= 1.05d-32))) then
tmp = t_1
else
tmp = x * exp((t * -y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.exp((a * -b));
double tmp;
if (a <= -5.4e+192) {
tmp = t_1;
} else if (a <= -2.9e+179) {
tmp = x * Math.exp((a * -z));
} else if ((a <= -4.8e+17) || !(a <= 1.05e-32)) {
tmp = t_1;
} else {
tmp = x * Math.exp((t * -y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((a * -b)) tmp = 0 if a <= -5.4e+192: tmp = t_1 elif a <= -2.9e+179: tmp = x * math.exp((a * -z)) elif (a <= -4.8e+17) or not (a <= 1.05e-32): tmp = t_1 else: tmp = x * math.exp((t * -y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(a * Float64(-b)))) tmp = 0.0 if (a <= -5.4e+192) tmp = t_1; elseif (a <= -2.9e+179) tmp = Float64(x * exp(Float64(a * Float64(-z)))); elseif ((a <= -4.8e+17) || !(a <= 1.05e-32)) tmp = t_1; else tmp = Float64(x * exp(Float64(t * Float64(-y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp((a * -b)); tmp = 0.0; if (a <= -5.4e+192) tmp = t_1; elseif (a <= -2.9e+179) tmp = x * exp((a * -z)); elseif ((a <= -4.8e+17) || ~((a <= 1.05e-32))) tmp = t_1; else tmp = x * exp((t * -y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.4e+192], t$95$1, If[LessEqual[a, -2.9e+179], N[(x * N[Exp[N[(a * (-z)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -4.8e+17], N[Not[LessEqual[a, 1.05e-32]], $MachinePrecision]], t$95$1, N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{if}\;a \leq -5.4 \cdot 10^{+192}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -2.9 \cdot 10^{+179}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-z\right)}\\
\mathbf{elif}\;a \leq -4.8 \cdot 10^{+17} \lor \neg \left(a \leq 1.05 \cdot 10^{-32}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\end{array}
\end{array}
if a < -5.39999999999999979e192 or -2.90000000000000019e179 < a < -4.8e17 or 1.05e-32 < a Initial program 95.0%
Taylor expanded in b around inf 80.4%
mul-1-neg80.4%
distribute-rgt-neg-out80.4%
Simplified80.4%
if -5.39999999999999979e192 < a < -2.90000000000000019e179Initial program 51.6%
Taylor expanded in y around 0 18.9%
sub-neg18.9%
sub-neg18.9%
neg-mul-118.9%
log1p-def100.0%
neg-mul-1100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in b around 0 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
if -4.8e17 < a < 1.05e-32Initial program 100.0%
Taylor expanded in t around inf 76.2%
mul-1-neg76.2%
*-commutative76.2%
Simplified76.2%
Final simplification79.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))) (t_2 (/ x (exp (* y t)))))
(if (<= t -2.35e+32)
t_2
(if (<= t -4.6e-260)
t_1
(if (<= t 5.6e-271)
(- x (* x (* a (+ z b))))
(if (<= t 4e+99) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * pow(z, y);
double t_2 = x / exp((y * t));
double tmp;
if (t <= -2.35e+32) {
tmp = t_2;
} else if (t <= -4.6e-260) {
tmp = t_1;
} else if (t <= 5.6e-271) {
tmp = x - (x * (a * (z + b)));
} else if (t <= 4e+99) {
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 * (z ** y)
t_2 = x / exp((y * t))
if (t <= (-2.35d+32)) then
tmp = t_2
else if (t <= (-4.6d-260)) then
tmp = t_1
else if (t <= 5.6d-271) then
tmp = x - (x * (a * (z + b)))
else if (t <= 4d+99) 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.pow(z, y);
double t_2 = x / Math.exp((y * t));
double tmp;
if (t <= -2.35e+32) {
tmp = t_2;
} else if (t <= -4.6e-260) {
tmp = t_1;
} else if (t <= 5.6e-271) {
tmp = x - (x * (a * (z + b)));
} else if (t <= 4e+99) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.pow(z, y) t_2 = x / math.exp((y * t)) tmp = 0 if t <= -2.35e+32: tmp = t_2 elif t <= -4.6e-260: tmp = t_1 elif t <= 5.6e-271: tmp = x - (x * (a * (z + b))) elif t <= 4e+99: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * (z ^ y)) t_2 = Float64(x / exp(Float64(y * t))) tmp = 0.0 if (t <= -2.35e+32) tmp = t_2; elseif (t <= -4.6e-260) tmp = t_1; elseif (t <= 5.6e-271) tmp = Float64(x - Float64(x * Float64(a * Float64(z + b)))); elseif (t <= 4e+99) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (z ^ y); t_2 = x / exp((y * t)); tmp = 0.0; if (t <= -2.35e+32) tmp = t_2; elseif (t <= -4.6e-260) tmp = t_1; elseif (t <= 5.6e-271) tmp = x - (x * (a * (z + b))); elseif (t <= 4e+99) 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[Power[z, y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[Exp[N[(y * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.35e+32], t$95$2, If[LessEqual[t, -4.6e-260], t$95$1, If[LessEqual[t, 5.6e-271], N[(x - N[(x * N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e+99], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
t_2 := \frac{x}{e^{y \cdot t}}\\
\mathbf{if}\;t \leq -2.35 \cdot 10^{+32}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -4.6 \cdot 10^{-260}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{-271}:\\
\;\;\;\;x - x \cdot \left(a \cdot \left(z + b\right)\right)\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+99}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -2.35000000000000012e32 or 3.9999999999999999e99 < t Initial program 98.8%
Taylor expanded in t around inf 80.1%
mul-1-neg80.1%
*-commutative80.1%
Simplified80.1%
Taylor expanded in x around 0 80.1%
exp-neg80.1%
*-commutative80.1%
exp-prod59.3%
associate-*r/59.3%
*-rgt-identity59.3%
exp-prod80.1%
Simplified80.1%
if -2.35000000000000012e32 < t < -4.6e-260 or 5.5999999999999995e-271 < t < 3.9999999999999999e99Initial program 95.1%
Taylor expanded in y around inf 62.7%
Taylor expanded in t around 0 62.7%
if -4.6e-260 < t < 5.5999999999999995e-271Initial program 89.3%
Taylor expanded in y around 0 89.3%
sub-neg89.3%
sub-neg89.3%
neg-mul-189.3%
log1p-def100.0%
neg-mul-1100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in a around 0 57.1%
mul-1-neg57.1%
unsub-neg57.1%
*-commutative57.1%
associate-*l*62.3%
*-commutative62.3%
Simplified62.3%
Final simplification69.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))))
(if (<= t -2.35e+32)
(* x (exp (* t (- y))))
(if (<= t -4.6e-260)
t_1
(if (<= t 5.6e-271)
(- x (* x (* a (+ z b))))
(if (<= t 5e+88) t_1 (/ x (exp (* y t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * pow(z, y);
double tmp;
if (t <= -2.35e+32) {
tmp = x * exp((t * -y));
} else if (t <= -4.6e-260) {
tmp = t_1;
} else if (t <= 5.6e-271) {
tmp = x - (x * (a * (z + b)));
} else if (t <= 5e+88) {
tmp = t_1;
} else {
tmp = x / exp((y * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x * (z ** y)
if (t <= (-2.35d+32)) then
tmp = x * exp((t * -y))
else if (t <= (-4.6d-260)) then
tmp = t_1
else if (t <= 5.6d-271) then
tmp = x - (x * (a * (z + b)))
else if (t <= 5d+88) then
tmp = t_1
else
tmp = x / exp((y * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.pow(z, y);
double tmp;
if (t <= -2.35e+32) {
tmp = x * Math.exp((t * -y));
} else if (t <= -4.6e-260) {
tmp = t_1;
} else if (t <= 5.6e-271) {
tmp = x - (x * (a * (z + b)));
} else if (t <= 5e+88) {
tmp = t_1;
} else {
tmp = x / Math.exp((y * t));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.pow(z, y) tmp = 0 if t <= -2.35e+32: tmp = x * math.exp((t * -y)) elif t <= -4.6e-260: tmp = t_1 elif t <= 5.6e-271: tmp = x - (x * (a * (z + b))) elif t <= 5e+88: tmp = t_1 else: tmp = x / math.exp((y * t)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * (z ^ y)) tmp = 0.0 if (t <= -2.35e+32) tmp = Float64(x * exp(Float64(t * Float64(-y)))); elseif (t <= -4.6e-260) tmp = t_1; elseif (t <= 5.6e-271) tmp = Float64(x - Float64(x * Float64(a * Float64(z + b)))); elseif (t <= 5e+88) tmp = t_1; else tmp = Float64(x / exp(Float64(y * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (z ^ y); tmp = 0.0; if (t <= -2.35e+32) tmp = x * exp((t * -y)); elseif (t <= -4.6e-260) tmp = t_1; elseif (t <= 5.6e-271) tmp = x - (x * (a * (z + b))); elseif (t <= 5e+88) tmp = t_1; else tmp = x / exp((y * t)); 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[t, -2.35e+32], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.6e-260], t$95$1, If[LessEqual[t, 5.6e-271], N[(x - N[(x * N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e+88], t$95$1, N[(x / N[Exp[N[(y * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;t \leq -2.35 \cdot 10^{+32}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{elif}\;t \leq -4.6 \cdot 10^{-260}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{-271}:\\
\;\;\;\;x - x \cdot \left(a \cdot \left(z + b\right)\right)\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+88}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{e^{y \cdot t}}\\
\end{array}
\end{array}
if t < -2.35000000000000012e32Initial program 99.7%
Taylor expanded in t around inf 74.0%
mul-1-neg74.0%
*-commutative74.0%
Simplified74.0%
if -2.35000000000000012e32 < t < -4.6e-260 or 5.5999999999999995e-271 < t < 4.99999999999999997e88Initial program 95.1%
Taylor expanded in y around inf 62.7%
Taylor expanded in t around 0 62.7%
if -4.6e-260 < t < 5.5999999999999995e-271Initial program 89.3%
Taylor expanded in y around 0 89.3%
sub-neg89.3%
sub-neg89.3%
neg-mul-189.3%
log1p-def100.0%
neg-mul-1100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in a around 0 57.1%
mul-1-neg57.1%
unsub-neg57.1%
*-commutative57.1%
associate-*l*62.3%
*-commutative62.3%
Simplified62.3%
if 4.99999999999999997e88 < t Initial program 97.8%
Taylor expanded in t around inf 87.0%
mul-1-neg87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in x around 0 87.0%
exp-neg87.0%
*-commutative87.0%
exp-prod60.7%
associate-*r/60.7%
*-rgt-identity60.7%
exp-prod87.0%
Simplified87.0%
Final simplification69.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -8.5e+28) (not (<= a 5.7e-36))) (* x (exp (* a (- (+ z b))))) (* x (exp (* t (- y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -8.5e+28) || !(a <= 5.7e-36)) {
tmp = x * exp((a * -(z + b)));
} else {
tmp = x * exp((t * -y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-8.5d+28)) .or. (.not. (a <= 5.7d-36))) then
tmp = x * exp((a * -(z + b)))
else
tmp = x * exp((t * -y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -8.5e+28) || !(a <= 5.7e-36)) {
tmp = x * Math.exp((a * -(z + b)));
} else {
tmp = x * Math.exp((t * -y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -8.5e+28) or not (a <= 5.7e-36): tmp = x * math.exp((a * -(z + b))) else: tmp = x * math.exp((t * -y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -8.5e+28) || !(a <= 5.7e-36)) tmp = Float64(x * exp(Float64(a * Float64(-Float64(z + b))))); else tmp = Float64(x * exp(Float64(t * Float64(-y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -8.5e+28) || ~((a <= 5.7e-36))) tmp = x * exp((a * -(z + b))); else tmp = x * exp((t * -y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -8.5e+28], N[Not[LessEqual[a, 5.7e-36]], $MachinePrecision]], N[(x * N[Exp[N[(a * (-N[(z + b), $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{+28} \lor \neg \left(a \leq 5.7 \cdot 10^{-36}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-\left(z + b\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\end{array}
\end{array}
if a < -8.49999999999999954e28 or 5.6999999999999999e-36 < a Initial program 93.0%
Taylor expanded in y around 0 77.9%
sub-neg77.9%
sub-neg77.9%
neg-mul-177.9%
log1p-def86.9%
neg-mul-186.9%
sub-neg86.9%
Simplified86.9%
Taylor expanded in z around 0 86.9%
associate-*r*86.9%
associate-*r*86.9%
distribute-lft-out86.9%
neg-mul-186.9%
Simplified86.9%
if -8.49999999999999954e28 < a < 5.6999999999999999e-36Initial program 100.0%
Taylor expanded in t around inf 76.2%
mul-1-neg76.2%
*-commutative76.2%
Simplified76.2%
Final simplification82.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -9.2e+17) (not (<= a 1.56e-31))) (* x (exp (* a (- b)))) (* x (exp (* t (- y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -9.2e+17) || !(a <= 1.56e-31)) {
tmp = x * exp((a * -b));
} else {
tmp = x * exp((t * -y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-9.2d+17)) .or. (.not. (a <= 1.56d-31))) then
tmp = x * exp((a * -b))
else
tmp = x * exp((t * -y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -9.2e+17) || !(a <= 1.56e-31)) {
tmp = x * Math.exp((a * -b));
} else {
tmp = x * Math.exp((t * -y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -9.2e+17) or not (a <= 1.56e-31): tmp = x * math.exp((a * -b)) else: tmp = x * math.exp((t * -y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -9.2e+17) || !(a <= 1.56e-31)) tmp = Float64(x * exp(Float64(a * Float64(-b)))); else tmp = Float64(x * exp(Float64(t * Float64(-y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -9.2e+17) || ~((a <= 1.56e-31))) tmp = x * exp((a * -b)); else tmp = x * exp((t * -y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -9.2e+17], N[Not[LessEqual[a, 1.56e-31]], $MachinePrecision]], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.2 \cdot 10^{+17} \lor \neg \left(a \leq 1.56 \cdot 10^{-31}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\end{array}
\end{array}
if a < -9.2e17 or 1.5600000000000001e-31 < a Initial program 93.2%
Taylor expanded in b around inf 77.9%
mul-1-neg77.9%
distribute-rgt-neg-out77.9%
Simplified77.9%
if -9.2e17 < a < 1.5600000000000001e-31Initial program 100.0%
Taylor expanded in t around inf 76.2%
mul-1-neg76.2%
*-commutative76.2%
Simplified76.2%
Final simplification77.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.85e-161) (not (<= y 1.8e+20))) (* x (pow z y)) (- x (* x (* a (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.85e-161) || !(y <= 1.8e+20)) {
tmp = x * pow(z, y);
} else {
tmp = x - (x * (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.85d-161)) .or. (.not. (y <= 1.8d+20))) then
tmp = x * (z ** y)
else
tmp = x - (x * (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.85e-161) || !(y <= 1.8e+20)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x - (x * (a * (z + b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.85e-161) or not (y <= 1.8e+20): tmp = x * math.pow(z, y) else: tmp = x - (x * (a * (z + b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.85e-161) || !(y <= 1.8e+20)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x - Float64(x * 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.85e-161) || ~((y <= 1.8e+20))) tmp = x * (z ^ y); else tmp = x - (x * (a * (z + b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.85e-161], N[Not[LessEqual[y, 1.8e+20]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x - N[(x * N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.85 \cdot 10^{-161} \lor \neg \left(y \leq 1.8 \cdot 10^{+20}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \left(a \cdot \left(z + b\right)\right)\\
\end{array}
\end{array}
if y < -2.85000000000000011e-161 or 1.8e20 < y Initial program 98.6%
Taylor expanded in y around inf 78.6%
Taylor expanded in t around 0 63.9%
if -2.85000000000000011e-161 < y < 1.8e20Initial program 92.9%
Taylor expanded in y around 0 78.2%
sub-neg78.2%
sub-neg78.2%
neg-mul-178.2%
log1p-def85.2%
neg-mul-185.2%
sub-neg85.2%
Simplified85.2%
Taylor expanded in z around 0 85.2%
associate-*r*85.2%
associate-*r*85.2%
distribute-lft-out85.2%
neg-mul-185.2%
Simplified85.2%
Taylor expanded in a around 0 47.5%
mul-1-neg47.5%
unsub-neg47.5%
*-commutative47.5%
associate-*l*50.2%
*-commutative50.2%
Simplified50.2%
Final simplification58.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.2e-13) (not (<= y 1e+19))) (* x (* a (- b))) (- x (* a (* x b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.2e-13) || !(y <= 1e+19)) {
tmp = x * (a * -b);
} else {
tmp = x - (a * (x * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-6.2d-13)) .or. (.not. (y <= 1d+19))) then
tmp = x * (a * -b)
else
tmp = x - (a * (x * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.2e-13) || !(y <= 1e+19)) {
tmp = x * (a * -b);
} else {
tmp = x - (a * (x * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.2e-13) or not (y <= 1e+19): tmp = x * (a * -b) else: tmp = x - (a * (x * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.2e-13) || !(y <= 1e+19)) tmp = Float64(x * Float64(a * Float64(-b))); else tmp = Float64(x - Float64(a * Float64(x * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6.2e-13) || ~((y <= 1e+19))) tmp = x * (a * -b); else tmp = x - (a * (x * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.2e-13], N[Not[LessEqual[y, 1e+19]], $MachinePrecision]], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{-13} \lor \neg \left(y \leq 10^{+19}\right):\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \left(x \cdot b\right)\\
\end{array}
\end{array}
if y < -6.1999999999999998e-13 or 1e19 < y Initial program 99.2%
Taylor expanded in b around inf 43.4%
mul-1-neg43.4%
distribute-rgt-neg-out43.4%
Simplified43.4%
Taylor expanded in a around 0 10.3%
mul-1-neg10.3%
unsub-neg10.3%
Simplified10.3%
Taylor expanded in a around inf 17.5%
mul-1-neg17.5%
associate-*r*23.8%
distribute-rgt-neg-in23.8%
Simplified23.8%
if -6.1999999999999998e-13 < y < 1e19Initial program 93.4%
Taylor expanded in b around inf 78.3%
mul-1-neg78.3%
distribute-rgt-neg-out78.3%
Simplified78.3%
Taylor expanded in a around 0 41.1%
mul-1-neg41.1%
unsub-neg41.1%
Simplified41.1%
Final simplification32.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y 2.25e+19) (- x (* x (* a (+ z b)))) (* x (* a (- b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.25e+19) {
tmp = x - (x * (a * (z + b)));
} else {
tmp = x * (a * -b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 2.25d+19) then
tmp = x - (x * (a * (z + b)))
else
tmp = x * (a * -b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.25e+19) {
tmp = x - (x * (a * (z + b)));
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 2.25e+19: tmp = x - (x * (a * (z + b))) else: tmp = x * (a * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 2.25e+19) tmp = Float64(x - Float64(x * Float64(a * Float64(z + b)))); else tmp = Float64(x * Float64(a * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 2.25e+19) tmp = x - (x * (a * (z + b))); else tmp = x * (a * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 2.25e+19], N[(x - N[(x * N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.25 \cdot 10^{+19}:\\
\;\;\;\;x - x \cdot \left(a \cdot \left(z + b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < 2.25e19Initial program 95.6%
Taylor expanded in y around 0 65.9%
sub-neg65.9%
sub-neg65.9%
neg-mul-165.9%
log1p-def70.8%
neg-mul-170.8%
sub-neg70.8%
Simplified70.8%
Taylor expanded in z around 0 70.8%
associate-*r*70.8%
associate-*r*70.8%
distribute-lft-out70.8%
neg-mul-170.8%
Simplified70.8%
Taylor expanded in a around 0 31.7%
mul-1-neg31.7%
unsub-neg31.7%
*-commutative31.7%
associate-*l*35.1%
*-commutative35.1%
Simplified35.1%
if 2.25e19 < y Initial program 98.3%
Taylor expanded in b around inf 46.5%
mul-1-neg46.5%
distribute-rgt-neg-out46.5%
Simplified46.5%
Taylor expanded in a around 0 9.8%
mul-1-neg9.8%
unsub-neg9.8%
Simplified9.8%
Taylor expanded in a around inf 21.6%
mul-1-neg21.6%
associate-*r*26.4%
distribute-rgt-neg-in26.4%
Simplified26.4%
Final simplification33.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.42e-8) (not (<= y 2.5e-137))) (* (- a) (* x b)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.42e-8) || !(y <= 2.5e-137)) {
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 <= (-1.42d-8)) .or. (.not. (y <= 2.5d-137))) 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 <= -1.42e-8) || !(y <= 2.5e-137)) {
tmp = -a * (x * b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.42e-8) or not (y <= 2.5e-137): tmp = -a * (x * b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.42e-8) || !(y <= 2.5e-137)) tmp = Float64(Float64(-a) * Float64(x * b)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.42e-8) || ~((y <= 2.5e-137))) tmp = -a * (x * b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.42e-8], N[Not[LessEqual[y, 2.5e-137]], $MachinePrecision]], N[((-a) * N[(x * b), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.42 \cdot 10^{-8} \lor \neg \left(y \leq 2.5 \cdot 10^{-137}\right):\\
\;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.41999999999999998e-8 or 2.5e-137 < y Initial program 98.1%
Taylor expanded in b around inf 48.5%
mul-1-neg48.5%
distribute-rgt-neg-out48.5%
Simplified48.5%
Taylor expanded in a around 0 14.9%
mul-1-neg14.9%
unsub-neg14.9%
Simplified14.9%
expm1-log1p-u9.1%
expm1-udef9.1%
associate-*r*10.9%
*-commutative10.9%
Applied egg-rr10.9%
expm1-def10.9%
expm1-log1p18.5%
Simplified18.5%
Taylor expanded in a around inf 19.3%
mul-1-neg19.3%
*-commutative19.3%
Simplified19.3%
if -1.41999999999999998e-8 < y < 2.5e-137Initial program 93.0%
Taylor expanded in t around inf 49.1%
mul-1-neg49.1%
*-commutative49.1%
Simplified49.1%
Taylor expanded in y around 0 37.8%
Final simplification26.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5.5e-14) (not (<= y 2.5e-137))) (* x (* a (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5.5e-14) || !(y <= 2.5e-137)) {
tmp = x * (a * -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 <= (-5.5d-14)) .or. (.not. (y <= 2.5d-137))) then
tmp = x * (a * -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 <= -5.5e-14) || !(y <= 2.5e-137)) {
tmp = x * (a * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -5.5e-14) or not (y <= 2.5e-137): tmp = x * (a * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -5.5e-14) || !(y <= 2.5e-137)) tmp = Float64(x * Float64(a * Float64(-b))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -5.5e-14) || ~((y <= 2.5e-137))) tmp = x * (a * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5.5e-14], N[Not[LessEqual[y, 2.5e-137]], $MachinePrecision]], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{-14} \lor \neg \left(y \leq 2.5 \cdot 10^{-137}\right):\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -5.49999999999999991e-14 or 2.5e-137 < y Initial program 98.1%
Taylor expanded in b around inf 48.5%
mul-1-neg48.5%
distribute-rgt-neg-out48.5%
Simplified48.5%
Taylor expanded in a around 0 14.9%
mul-1-neg14.9%
unsub-neg14.9%
Simplified14.9%
Taylor expanded in a around inf 19.3%
mul-1-neg19.3%
associate-*r*24.9%
distribute-rgt-neg-in24.9%
Simplified24.9%
if -5.49999999999999991e-14 < y < 2.5e-137Initial program 93.0%
Taylor expanded in t around inf 49.1%
mul-1-neg49.1%
*-commutative49.1%
Simplified49.1%
Taylor expanded in y around 0 37.8%
Final simplification29.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y -6.4e-89) (* t (* x (- y))) (if (<= y 2.4e-137) x (* (- a) (* x b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6.4e-89) {
tmp = t * (x * -y);
} else if (y <= 2.4e-137) {
tmp = x;
} else {
tmp = -a * (x * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-6.4d-89)) then
tmp = t * (x * -y)
else if (y <= 2.4d-137) then
tmp = x
else
tmp = -a * (x * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6.4e-89) {
tmp = t * (x * -y);
} else if (y <= 2.4e-137) {
tmp = x;
} else {
tmp = -a * (x * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -6.4e-89: tmp = t * (x * -y) elif y <= 2.4e-137: tmp = x else: tmp = -a * (x * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -6.4e-89) tmp = Float64(t * Float64(x * Float64(-y))); elseif (y <= 2.4e-137) tmp = x; else tmp = Float64(Float64(-a) * Float64(x * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -6.4e-89) tmp = t * (x * -y); elseif (y <= 2.4e-137) tmp = x; else tmp = -a * (x * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -6.4e-89], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e-137], x, N[((-a) * N[(x * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.4 \cdot 10^{-89}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-137}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\
\end{array}
\end{array}
if y < -6.39999999999999997e-89Initial program 98.8%
Taylor expanded in t around inf 56.8%
mul-1-neg56.8%
*-commutative56.8%
Simplified56.8%
Taylor expanded in y around 0 18.2%
mul-1-neg18.2%
unsub-neg18.2%
associate-*r*13.9%
*-commutative13.9%
Simplified13.9%
Taylor expanded in y around inf 19.0%
mul-1-neg19.0%
*-commutative19.0%
associate-*r*18.1%
distribute-rgt-neg-in18.1%
*-commutative18.1%
distribute-rgt-neg-in18.1%
Simplified18.1%
Taylor expanded in x around 0 19.0%
mul-1-neg19.0%
Simplified19.0%
if -6.39999999999999997e-89 < y < 2.4e-137Initial program 92.8%
Taylor expanded in t around inf 52.2%
mul-1-neg52.2%
*-commutative52.2%
Simplified52.2%
Taylor expanded in y around 0 42.2%
if 2.4e-137 < y Initial program 96.9%
Taylor expanded in b around inf 54.1%
mul-1-neg54.1%
distribute-rgt-neg-out54.1%
Simplified54.1%
Taylor expanded in a around 0 17.7%
mul-1-neg17.7%
unsub-neg17.7%
Simplified17.7%
expm1-log1p-u11.7%
expm1-udef11.7%
associate-*r*13.6%
*-commutative13.6%
Applied egg-rr13.6%
expm1-def13.6%
expm1-log1p19.8%
Simplified19.8%
Taylor expanded in a around inf 23.2%
mul-1-neg23.2%
*-commutative23.2%
Simplified23.2%
Final simplification27.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1e+19) (- x (* x (* a b))) (* x (* a (- b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1e+19) {
tmp = x - (x * (a * b));
} else {
tmp = x * (a * -b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 1d+19) then
tmp = x - (x * (a * b))
else
tmp = x * (a * -b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1e+19) {
tmp = x - (x * (a * b));
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1e+19: tmp = x - (x * (a * b)) else: tmp = x * (a * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1e+19) tmp = Float64(x - Float64(x * Float64(a * b))); else tmp = Float64(x * Float64(a * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1e+19) tmp = x - (x * (a * b)); else tmp = x * (a * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1e+19], N[(x - N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{+19}:\\
\;\;\;\;x - x \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < 1e19Initial program 95.6%
Taylor expanded in b around inf 65.9%
mul-1-neg65.9%
distribute-rgt-neg-out65.9%
Simplified65.9%
Taylor expanded in a around 0 31.2%
mul-1-neg31.2%
unsub-neg31.2%
Simplified31.2%
expm1-log1p-u25.5%
expm1-udef25.4%
associate-*r*26.8%
*-commutative26.8%
Applied egg-rr26.8%
expm1-def26.9%
expm1-log1p34.5%
Simplified34.5%
if 1e19 < y Initial program 98.3%
Taylor expanded in b around inf 46.5%
mul-1-neg46.5%
distribute-rgt-neg-out46.5%
Simplified46.5%
Taylor expanded in a around 0 9.8%
mul-1-neg9.8%
unsub-neg9.8%
Simplified9.8%
Taylor expanded in a around inf 21.6%
mul-1-neg21.6%
associate-*r*26.4%
distribute-rgt-neg-in26.4%
Simplified26.4%
Final simplification32.7%
(FPCore (x y z t a b) :precision binary64 (if (<= a 2.85e+145) x (* t (* x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= 2.85e+145) {
tmp = x;
} else {
tmp = t * (x * 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 (a <= 2.85d+145) then
tmp = x
else
tmp = t * (x * 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 (a <= 2.85e+145) {
tmp = x;
} else {
tmp = t * (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= 2.85e+145: tmp = x else: tmp = t * (x * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= 2.85e+145) tmp = x; else tmp = Float64(t * Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= 2.85e+145) tmp = x; else tmp = t * (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, 2.85e+145], x, N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.85 \cdot 10^{+145}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if a < 2.85e145Initial program 96.3%
Taylor expanded in t around inf 59.5%
mul-1-neg59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in y around 0 20.7%
if 2.85e145 < a Initial program 95.4%
Taylor expanded in t around inf 26.0%
mul-1-neg26.0%
*-commutative26.0%
Simplified26.0%
Taylor expanded in y around 0 3.8%
mul-1-neg3.8%
unsub-neg3.8%
associate-*r*3.7%
*-commutative3.7%
Simplified3.7%
Taylor expanded in y around inf 19.6%
mul-1-neg19.6%
*-commutative19.6%
associate-*r*24.5%
distribute-rgt-neg-in24.5%
*-commutative24.5%
distribute-rgt-neg-in24.5%
Simplified24.5%
expm1-log1p-u21.4%
expm1-udef31.9%
associate-*r*31.8%
*-commutative31.8%
add-sqr-sqrt18.5%
sqrt-unprod41.5%
sqr-neg41.5%
sqrt-unprod13.3%
add-sqr-sqrt31.6%
Applied egg-rr31.6%
expm1-def16.4%
expm1-log1p19.3%
*-commutative19.3%
*-commutative19.3%
associate-*r*19.2%
Simplified19.2%
Final simplification20.5%
(FPCore (x y z t a b) :precision binary64 (if (<= a 2.8e+145) x (* x (* y t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= 2.8e+145) {
tmp = x;
} else {
tmp = x * (y * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= 2.8d+145) then
tmp = x
else
tmp = x * (y * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= 2.8e+145) {
tmp = x;
} else {
tmp = x * (y * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= 2.8e+145: tmp = x else: tmp = x * (y * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= 2.8e+145) tmp = x; else tmp = Float64(x * Float64(y * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= 2.8e+145) tmp = x; else tmp = x * (y * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, 2.8e+145], x, N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.8 \cdot 10^{+145}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot t\right)\\
\end{array}
\end{array}
if a < 2.7999999999999999e145Initial program 96.3%
Taylor expanded in t around inf 59.5%
mul-1-neg59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in y around 0 20.7%
if 2.7999999999999999e145 < a Initial program 95.4%
Taylor expanded in t around inf 26.0%
mul-1-neg26.0%
*-commutative26.0%
Simplified26.0%
Taylor expanded in y around 0 3.8%
mul-1-neg3.8%
unsub-neg3.8%
associate-*r*3.7%
*-commutative3.7%
Simplified3.7%
Taylor expanded in y around inf 19.6%
mul-1-neg19.6%
*-commutative19.6%
associate-*r*24.5%
distribute-rgt-neg-in24.5%
*-commutative24.5%
distribute-rgt-neg-in24.5%
Simplified24.5%
expm1-log1p-u21.4%
expm1-udef31.9%
associate-*r*31.8%
*-commutative31.8%
add-sqr-sqrt18.5%
sqrt-unprod41.5%
sqr-neg41.5%
sqrt-unprod13.3%
add-sqr-sqrt31.6%
Applied egg-rr31.6%
expm1-def16.4%
expm1-log1p19.3%
*-commutative19.3%
associate-*l*21.6%
Simplified21.6%
Final simplification20.8%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 96.2%
Taylor expanded in t around inf 54.4%
mul-1-neg54.4%
*-commutative54.4%
Simplified54.4%
Taylor expanded in y around 0 18.1%
Final simplification18.1%
herbie shell --seed 2023333
(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))))))