
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
(FPCore (x y z t a b) :precision binary64 (* x (exp (fma y (- (log z) t) (* a (- (log1p (- z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(y, (log(z) - t), (a * (log1p(-z) - b))));
}
function code(x, y, z, t, a, b) return Float64(x * exp(fma(y, Float64(log(z) - t), Float64(a * Float64(log1p(Float64(-z)) - b))))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}
\end{array}
Initial program 97.5%
fma-def98.7%
sub-neg98.7%
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 97.5%
Final simplification97.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7.9e-25) (not (<= y 3.7))) (* 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 <= -7.9e-25) || !(y <= 3.7)) {
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 <= (-7.9d-25)) .or. (.not. (y <= 3.7d0))) 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 <= -7.9e-25) || !(y <= 3.7)) {
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 <= -7.9e-25) or not (y <= 3.7): 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 <= -7.9e-25) || !(y <= 3.7)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(Float64(a * Float64(-Float64(z + b))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -7.9e-25) || ~((y <= 3.7))) 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, -7.9e-25], N[Not[LessEqual[y, 3.7]], $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 -7.9 \cdot 10^{-25} \lor \neg \left(y \leq 3.7\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-\left(z + b\right)\right)}\\
\end{array}
\end{array}
if y < -7.8999999999999997e-25 or 3.7000000000000002 < y Initial program 95.5%
Taylor expanded in y around inf 91.8%
if -7.8999999999999997e-25 < y < 3.7000000000000002Initial program 99.7%
Taylor expanded in y around 0 87.2%
sub-neg87.2%
neg-mul-187.2%
log1p-def88.2%
neg-mul-188.2%
Simplified88.2%
Taylor expanded in z around 0 88.2%
+-commutative88.2%
associate-*r*88.2%
associate-*r*88.2%
distribute-lft-out88.2%
neg-mul-188.2%
Simplified88.2%
Final simplification90.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))) (t_2 (/ x (exp (* y t)))))
(if (<= y -1e+254)
t_2
(if (<= y -15500000000000.0)
t_1
(if (<= y -2.5e-24)
t_2
(if (<= y 270.0) (* x (exp (* a (- (+ z b))))) t_1))))))
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 (y <= -1e+254) {
tmp = t_2;
} else if (y <= -15500000000000.0) {
tmp = t_1;
} else if (y <= -2.5e-24) {
tmp = t_2;
} else if (y <= 270.0) {
tmp = x * exp((a * -(z + b)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * (z ** y)
t_2 = x / exp((y * t))
if (y <= (-1d+254)) then
tmp = t_2
else if (y <= (-15500000000000.0d0)) then
tmp = t_1
else if (y <= (-2.5d-24)) then
tmp = t_2
else if (y <= 270.0d0) then
tmp = x * exp((a * -(z + b)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.pow(z, y);
double t_2 = x / Math.exp((y * t));
double tmp;
if (y <= -1e+254) {
tmp = t_2;
} else if (y <= -15500000000000.0) {
tmp = t_1;
} else if (y <= -2.5e-24) {
tmp = t_2;
} else if (y <= 270.0) {
tmp = x * Math.exp((a * -(z + b)));
} else {
tmp = t_1;
}
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 y <= -1e+254: tmp = t_2 elif y <= -15500000000000.0: tmp = t_1 elif y <= -2.5e-24: tmp = t_2 elif y <= 270.0: tmp = x * math.exp((a * -(z + b))) else: tmp = t_1 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 (y <= -1e+254) tmp = t_2; elseif (y <= -15500000000000.0) tmp = t_1; elseif (y <= -2.5e-24) tmp = t_2; elseif (y <= 270.0) tmp = Float64(x * exp(Float64(a * Float64(-Float64(z + b))))); else tmp = t_1; 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 (y <= -1e+254) tmp = t_2; elseif (y <= -15500000000000.0) tmp = t_1; elseif (y <= -2.5e-24) tmp = t_2; elseif (y <= 270.0) tmp = x * exp((a * -(z + b))); else tmp = t_1; 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[y, -1e+254], t$95$2, If[LessEqual[y, -15500000000000.0], t$95$1, If[LessEqual[y, -2.5e-24], t$95$2, If[LessEqual[y, 270.0], N[(x * N[Exp[N[(a * (-N[(z + b), $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
t_2 := \frac{x}{e^{y \cdot t}}\\
\mathbf{if}\;y \leq -1 \cdot 10^{+254}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -15500000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-24}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 270:\\
\;\;\;\;x \cdot e^{a \cdot \left(-\left(z + b\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -9.9999999999999994e253 or -1.55e13 < y < -2.4999999999999999e-24Initial program 99.9%
fma-def99.9%
sub-neg99.9%
log1p-def99.9%
Simplified99.9%
add-exp-log58.6%
*-commutative58.6%
log-prod45.0%
add-log-exp45.0%
add-sqr-sqrt0.0%
sqrt-unprod45.0%
sqr-neg45.0%
sqrt-unprod45.0%
add-sqr-sqrt45.0%
Applied egg-rr45.0%
Taylor expanded in t around inf 43.8%
associate-*r*43.8%
neg-mul-143.8%
Simplified43.8%
Taylor expanded in t around inf 43.8%
mul-1-neg43.8%
sub-neg43.8%
exp-diff43.8%
rem-exp-log89.5%
Simplified89.5%
if -9.9999999999999994e253 < y < -1.55e13 or 270 < y Initial program 94.6%
Taylor expanded in y around inf 90.2%
Taylor expanded in t around 0 69.0%
if -2.4999999999999999e-24 < y < 270Initial program 99.7%
Taylor expanded in y around 0 87.2%
sub-neg87.2%
neg-mul-187.2%
log1p-def88.2%
neg-mul-188.2%
Simplified88.2%
Taylor expanded in z around 0 88.2%
+-commutative88.2%
associate-*r*88.2%
associate-*r*88.2%
distribute-lft-out88.2%
neg-mul-188.2%
Simplified88.2%
Final simplification80.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))) (t_2 (/ x (exp (* y t)))))
(if (<= y -4.1e+250)
t_2
(if (<= y -5800000000000.0)
t_1
(if (<= y -2.05e-24) t_2 (if (<= y 4.0) (/ x (exp (* a b))) t_1))))))
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 (y <= -4.1e+250) {
tmp = t_2;
} else if (y <= -5800000000000.0) {
tmp = t_1;
} else if (y <= -2.05e-24) {
tmp = t_2;
} else if (y <= 4.0) {
tmp = x / exp((a * b));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * (z ** y)
t_2 = x / exp((y * t))
if (y <= (-4.1d+250)) then
tmp = t_2
else if (y <= (-5800000000000.0d0)) then
tmp = t_1
else if (y <= (-2.05d-24)) then
tmp = t_2
else if (y <= 4.0d0) then
tmp = x / exp((a * b))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.pow(z, y);
double t_2 = x / Math.exp((y * t));
double tmp;
if (y <= -4.1e+250) {
tmp = t_2;
} else if (y <= -5800000000000.0) {
tmp = t_1;
} else if (y <= -2.05e-24) {
tmp = t_2;
} else if (y <= 4.0) {
tmp = x / Math.exp((a * b));
} else {
tmp = t_1;
}
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 y <= -4.1e+250: tmp = t_2 elif y <= -5800000000000.0: tmp = t_1 elif y <= -2.05e-24: tmp = t_2 elif y <= 4.0: tmp = x / math.exp((a * b)) else: tmp = t_1 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 (y <= -4.1e+250) tmp = t_2; elseif (y <= -5800000000000.0) tmp = t_1; elseif (y <= -2.05e-24) tmp = t_2; elseif (y <= 4.0) tmp = Float64(x / exp(Float64(a * b))); else tmp = t_1; 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 (y <= -4.1e+250) tmp = t_2; elseif (y <= -5800000000000.0) tmp = t_1; elseif (y <= -2.05e-24) tmp = t_2; elseif (y <= 4.0) tmp = x / exp((a * b)); else tmp = t_1; 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[y, -4.1e+250], t$95$2, If[LessEqual[y, -5800000000000.0], t$95$1, If[LessEqual[y, -2.05e-24], t$95$2, If[LessEqual[y, 4.0], N[(x / N[Exp[N[(a * b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
t_2 := \frac{x}{e^{y \cdot t}}\\
\mathbf{if}\;y \leq -4.1 \cdot 10^{+250}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -5800000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.05 \cdot 10^{-24}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 4:\\
\;\;\;\;\frac{x}{e^{a \cdot b}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -4.09999999999999999e250 or -5.8e12 < y < -2.05000000000000007e-24Initial program 99.9%
fma-def99.9%
sub-neg99.9%
log1p-def99.9%
Simplified99.9%
add-exp-log58.6%
*-commutative58.6%
log-prod45.0%
add-log-exp45.0%
add-sqr-sqrt0.0%
sqrt-unprod45.0%
sqr-neg45.0%
sqrt-unprod45.0%
add-sqr-sqrt45.0%
Applied egg-rr45.0%
Taylor expanded in t around inf 43.8%
associate-*r*43.8%
neg-mul-143.8%
Simplified43.8%
Taylor expanded in t around inf 43.8%
mul-1-neg43.8%
sub-neg43.8%
exp-diff43.8%
rem-exp-log89.5%
Simplified89.5%
if -4.09999999999999999e250 < y < -5.8e12 or 4 < y Initial program 94.6%
Taylor expanded in y around inf 90.2%
Taylor expanded in t around 0 69.0%
if -2.05000000000000007e-24 < y < 4Initial program 99.7%
Taylor expanded in y around 0 87.2%
sub-neg87.2%
neg-mul-187.2%
log1p-def88.2%
neg-mul-188.2%
Simplified88.2%
Taylor expanded in z around 0 87.2%
rem-exp-log39.2%
exp-sum39.2%
mul-1-neg39.2%
sub-neg39.2%
exp-diff39.2%
rem-exp-log87.2%
Simplified87.2%
Final simplification79.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (exp (* a (- b)))))
(if (<= b -2.5e+39)
t_1
(if (<= b -1.55e-61)
(- x (* t (* x y)))
(if (or (<= b -3.2e-114) (not (<= b 1.5e-160)))
t_1
(- x (* x (* y t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp((a * -b));
double tmp;
if (b <= -2.5e+39) {
tmp = t_1;
} else if (b <= -1.55e-61) {
tmp = x - (t * (x * y));
} else if ((b <= -3.2e-114) || !(b <= 1.5e-160)) {
tmp = t_1;
} else {
tmp = x - (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) :: t_1
real(8) :: tmp
t_1 = exp((a * -b))
if (b <= (-2.5d+39)) then
tmp = t_1
else if (b <= (-1.55d-61)) then
tmp = x - (t * (x * y))
else if ((b <= (-3.2d-114)) .or. (.not. (b <= 1.5d-160))) then
tmp = t_1
else
tmp = x - (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 t_1 = Math.exp((a * -b));
double tmp;
if (b <= -2.5e+39) {
tmp = t_1;
} else if (b <= -1.55e-61) {
tmp = x - (t * (x * y));
} else if ((b <= -3.2e-114) || !(b <= 1.5e-160)) {
tmp = t_1;
} else {
tmp = x - (x * (y * t));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp((a * -b)) tmp = 0 if b <= -2.5e+39: tmp = t_1 elif b <= -1.55e-61: tmp = x - (t * (x * y)) elif (b <= -3.2e-114) or not (b <= 1.5e-160): tmp = t_1 else: tmp = x - (x * (y * t)) return tmp
function code(x, y, z, t, a, b) t_1 = exp(Float64(a * Float64(-b))) tmp = 0.0 if (b <= -2.5e+39) tmp = t_1; elseif (b <= -1.55e-61) tmp = Float64(x - Float64(t * Float64(x * y))); elseif ((b <= -3.2e-114) || !(b <= 1.5e-160)) tmp = t_1; else tmp = Float64(x - Float64(x * Float64(y * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp((a * -b)); tmp = 0.0; if (b <= -2.5e+39) tmp = t_1; elseif (b <= -1.55e-61) tmp = x - (t * (x * y)); elseif ((b <= -3.2e-114) || ~((b <= 1.5e-160))) tmp = t_1; else tmp = x - (x * (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, -2.5e+39], t$95$1, If[LessEqual[b, -1.55e-61], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[b, -3.2e-114], N[Not[LessEqual[b, 1.5e-160]], $MachinePrecision]], t$95$1, N[(x - N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{a \cdot \left(-b\right)}\\
\mathbf{if}\;b \leq -2.5 \cdot 10^{+39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -1.55 \cdot 10^{-61}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;b \leq -3.2 \cdot 10^{-114} \lor \neg \left(b \leq 1.5 \cdot 10^{-160}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \left(y \cdot t\right)\\
\end{array}
\end{array}
if b < -2.50000000000000008e39 or -1.54999999999999997e-61 < b < -3.2000000000000002e-114 or 1.49999999999999998e-160 < b Initial program 96.8%
fma-def98.7%
sub-neg98.7%
log1p-def98.7%
Simplified98.7%
add-exp-log69.8%
*-commutative69.8%
log-prod52.6%
add-log-exp52.6%
add-sqr-sqrt0.0%
sqrt-unprod50.8%
sqr-neg50.8%
sqrt-unprod50.8%
add-sqr-sqrt50.8%
Applied egg-rr50.8%
Taylor expanded in b around inf 37.0%
mul-1-neg37.0%
distribute-rgt-neg-in37.0%
Simplified37.0%
Taylor expanded in a around inf 43.1%
mul-1-neg43.1%
*-commutative43.1%
distribute-rgt-neg-in43.1%
Simplified43.1%
if -2.50000000000000008e39 < b < -1.54999999999999997e-61Initial program 98.8%
fma-def98.8%
sub-neg98.8%
log1p-def99.9%
Simplified99.9%
add-exp-log65.5%
*-commutative65.5%
log-prod61.0%
add-log-exp61.0%
add-sqr-sqrt0.0%
sqrt-unprod61.0%
sqr-neg61.0%
sqrt-unprod61.0%
add-sqr-sqrt61.0%
Applied egg-rr61.0%
Taylor expanded in t around inf 38.8%
associate-*r*38.8%
neg-mul-138.8%
Simplified38.8%
Taylor expanded in t around 0 53.3%
mul-1-neg53.3%
unsub-neg53.3%
Simplified53.3%
if -3.2000000000000002e-114 < b < 1.49999999999999998e-160Initial program 98.6%
Taylor expanded in y around inf 93.2%
Taylor expanded in y around 0 51.6%
*-commutative51.6%
Simplified51.6%
Taylor expanded in t around inf 48.9%
neg-mul-148.9%
Simplified48.9%
Final simplification45.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (exp (* y (- t)))))
(if (<= y -8.6e-25)
t_1
(if (<= y -3.7e-190)
(exp (* a (- b)))
(if (<= y 2.9e-248)
(/ x (+ 1.0 (* a b)))
(if (<= y 1900000000.0) (* x (- 1.0 (* a b))) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp((y * -t));
double tmp;
if (y <= -8.6e-25) {
tmp = t_1;
} else if (y <= -3.7e-190) {
tmp = exp((a * -b));
} else if (y <= 2.9e-248) {
tmp = x / (1.0 + (a * b));
} else if (y <= 1900000000.0) {
tmp = x * (1.0 - (a * b));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = exp((y * -t))
if (y <= (-8.6d-25)) then
tmp = t_1
else if (y <= (-3.7d-190)) then
tmp = exp((a * -b))
else if (y <= 2.9d-248) then
tmp = x / (1.0d0 + (a * b))
else if (y <= 1900000000.0d0) then
tmp = x * (1.0d0 - (a * b))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = Math.exp((y * -t));
double tmp;
if (y <= -8.6e-25) {
tmp = t_1;
} else if (y <= -3.7e-190) {
tmp = Math.exp((a * -b));
} else if (y <= 2.9e-248) {
tmp = x / (1.0 + (a * b));
} else if (y <= 1900000000.0) {
tmp = x * (1.0 - (a * b));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp((y * -t)) tmp = 0 if y <= -8.6e-25: tmp = t_1 elif y <= -3.7e-190: tmp = math.exp((a * -b)) elif y <= 2.9e-248: tmp = x / (1.0 + (a * b)) elif y <= 1900000000.0: tmp = x * (1.0 - (a * b)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = exp(Float64(y * Float64(-t))) tmp = 0.0 if (y <= -8.6e-25) tmp = t_1; elseif (y <= -3.7e-190) tmp = exp(Float64(a * Float64(-b))); elseif (y <= 2.9e-248) tmp = Float64(x / Float64(1.0 + Float64(a * b))); elseif (y <= 1900000000.0) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp((y * -t)); tmp = 0.0; if (y <= -8.6e-25) tmp = t_1; elseif (y <= -3.7e-190) tmp = exp((a * -b)); elseif (y <= 2.9e-248) tmp = x / (1.0 + (a * b)); elseif (y <= 1900000000.0) tmp = x * (1.0 - (a * b)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, -8.6e-25], t$95$1, If[LessEqual[y, -3.7e-190], N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision], If[LessEqual[y, 2.9e-248], N[(x / N[(1.0 + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1900000000.0], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{y \cdot \left(-t\right)}\\
\mathbf{if}\;y \leq -8.6 \cdot 10^{-25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.7 \cdot 10^{-190}:\\
\;\;\;\;e^{a \cdot \left(-b\right)}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-248}:\\
\;\;\;\;\frac{x}{1 + a \cdot b}\\
\mathbf{elif}\;y \leq 1900000000:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -8.59999999999999953e-25 or 1.9e9 < y Initial program 95.4%
fma-def97.7%
sub-neg97.7%
log1p-def98.5%
Simplified98.5%
add-exp-log72.5%
*-commutative72.5%
log-prod57.2%
add-log-exp57.2%
add-sqr-sqrt0.0%
sqrt-unprod54.9%
sqr-neg54.9%
sqrt-unprod54.9%
add-sqr-sqrt54.9%
Applied egg-rr54.9%
Taylor expanded in t around inf 33.5%
associate-*r*33.5%
neg-mul-133.5%
Simplified33.5%
Taylor expanded in t around inf 43.0%
mul-1-neg43.0%
distribute-rgt-neg-in43.0%
Simplified43.0%
if -8.59999999999999953e-25 < y < -3.7000000000000002e-190Initial program 98.9%
fma-def98.9%
sub-neg98.9%
log1p-def99.9%
Simplified99.9%
add-exp-log65.4%
*-commutative65.4%
log-prod39.5%
add-log-exp39.5%
add-sqr-sqrt0.0%
sqrt-unprod39.5%
sqr-neg39.5%
sqrt-unprod39.5%
add-sqr-sqrt39.5%
Applied egg-rr39.5%
Taylor expanded in b around inf 36.0%
mul-1-neg36.0%
distribute-rgt-neg-in36.0%
Simplified36.0%
Taylor expanded in a around inf 42.3%
mul-1-neg42.3%
*-commutative42.3%
distribute-rgt-neg-in42.3%
Simplified42.3%
if -3.7000000000000002e-190 < y < 2.9000000000000001e-248Initial program 100.0%
Taylor expanded in y around 0 88.6%
sub-neg88.6%
neg-mul-188.6%
log1p-def91.4%
neg-mul-191.4%
Simplified91.4%
Taylor expanded in z around 0 88.6%
rem-exp-log48.3%
exp-sum48.3%
mul-1-neg48.3%
sub-neg48.3%
exp-diff48.3%
rem-exp-log88.6%
Simplified88.6%
Taylor expanded in a around 0 62.6%
if 2.9000000000000001e-248 < y < 1.9e9Initial program 99.8%
Taylor expanded in b around inf 83.4%
mul-1-neg83.4%
distribute-rgt-neg-out83.4%
Simplified83.4%
Taylor expanded in a around 0 54.9%
mul-1-neg54.9%
unsub-neg54.9%
Simplified54.9%
Final simplification48.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.25e+253)
(exp (* y (- t)))
(if (or (<= y -1.46e-16) (not (<= y 7.5)))
(* x (pow z y))
(/ x (exp (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.25e+253) {
tmp = exp((y * -t));
} else if ((y <= -1.46e-16) || !(y <= 7.5)) {
tmp = x * pow(z, y);
} else {
tmp = x / exp((a * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.25d+253)) then
tmp = exp((y * -t))
else if ((y <= (-1.46d-16)) .or. (.not. (y <= 7.5d0))) then
tmp = x * (z ** y)
else
tmp = x / exp((a * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.25e+253) {
tmp = Math.exp((y * -t));
} else if ((y <= -1.46e-16) || !(y <= 7.5)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x / Math.exp((a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.25e+253: tmp = math.exp((y * -t)) elif (y <= -1.46e-16) or not (y <= 7.5): tmp = x * math.pow(z, y) else: tmp = x / math.exp((a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.25e+253) tmp = exp(Float64(y * Float64(-t))); elseif ((y <= -1.46e-16) || !(y <= 7.5)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x / exp(Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.25e+253) tmp = exp((y * -t)); elseif ((y <= -1.46e-16) || ~((y <= 7.5))) tmp = x * (z ^ y); else tmp = x / exp((a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.25e+253], N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[y, -1.46e-16], N[Not[LessEqual[y, 7.5]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x / N[Exp[N[(a * b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+253}:\\
\;\;\;\;e^{y \cdot \left(-t\right)}\\
\mathbf{elif}\;y \leq -1.46 \cdot 10^{-16} \lor \neg \left(y \leq 7.5\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{e^{a \cdot b}}\\
\end{array}
\end{array}
if y < -1.2499999999999999e253Initial program 100.0%
fma-def100.0%
sub-neg100.0%
log1p-def100.0%
Simplified100.0%
add-exp-log66.7%
*-commutative66.7%
log-prod50.0%
add-log-exp50.0%
add-sqr-sqrt0.0%
sqrt-unprod50.0%
sqr-neg50.0%
sqrt-unprod50.0%
add-sqr-sqrt50.0%
Applied egg-rr50.0%
Taylor expanded in t around inf 50.0%
associate-*r*50.0%
neg-mul-150.0%
Simplified50.0%
Taylor expanded in t around inf 66.9%
mul-1-neg66.9%
distribute-rgt-neg-in66.9%
Simplified66.9%
if -1.2499999999999999e253 < y < -1.4600000000000001e-16 or 7.5 < y Initial program 94.9%
Taylor expanded in y around inf 90.7%
Taylor expanded in t around 0 67.2%
if -1.4600000000000001e-16 < y < 7.5Initial program 99.7%
Taylor expanded in y around 0 86.1%
sub-neg86.1%
neg-mul-186.1%
log1p-def87.0%
neg-mul-187.0%
Simplified87.0%
Taylor expanded in z around 0 86.1%
rem-exp-log38.7%
exp-sum38.7%
mul-1-neg38.7%
sub-neg38.7%
exp-diff38.7%
rem-exp-log86.1%
Simplified86.1%
Final simplification76.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -85000000.0) (not (<= t 7.6e+185))) (exp (* y (- t))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -85000000.0) || !(t <= 7.6e+185)) {
tmp = exp((y * -t));
} else {
tmp = x * pow(z, y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-85000000.0d0)) .or. (.not. (t <= 7.6d+185))) then
tmp = exp((y * -t))
else
tmp = x * (z ** y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -85000000.0) || !(t <= 7.6e+185)) {
tmp = Math.exp((y * -t));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -85000000.0) or not (t <= 7.6e+185): tmp = math.exp((y * -t)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -85000000.0) || !(t <= 7.6e+185)) tmp = exp(Float64(y * Float64(-t))); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -85000000.0) || ~((t <= 7.6e+185))) tmp = exp((y * -t)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -85000000.0], N[Not[LessEqual[t, 7.6e+185]], $MachinePrecision]], N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -85000000 \lor \neg \left(t \leq 7.6 \cdot 10^{+185}\right):\\
\;\;\;\;e^{y \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -8.5e7 or 7.5999999999999996e185 < t Initial program 95.6%
fma-def97.8%
sub-neg97.8%
log1p-def97.8%
Simplified97.8%
add-exp-log72.9%
*-commutative72.9%
log-prod55.1%
add-log-exp55.1%
add-sqr-sqrt0.0%
sqrt-unprod55.1%
sqr-neg55.1%
sqrt-unprod55.1%
add-sqr-sqrt55.1%
Applied egg-rr55.1%
Taylor expanded in t around inf 47.5%
associate-*r*47.5%
neg-mul-147.5%
Simplified47.5%
Taylor expanded in t around inf 61.7%
mul-1-neg61.7%
distribute-rgt-neg-in61.7%
Simplified61.7%
if -8.5e7 < t < 7.5999999999999996e185Initial program 98.6%
Taylor expanded in y around inf 71.1%
Taylor expanded in t around 0 67.7%
Final simplification65.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.05e+45) (- x (* t (* x y))) (if (<= y 6.5e-5) (* x (- 1.0 (* a b))) (* x (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.05e+45) {
tmp = x - (t * (x * y));
} else if (y <= 6.5e-5) {
tmp = x * (1.0 - (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 <= (-1.05d+45)) then
tmp = x - (t * (x * y))
else if (y <= 6.5d-5) then
tmp = x * (1.0d0 - (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 <= -1.05e+45) {
tmp = x - (t * (x * y));
} else if (y <= 6.5e-5) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.05e+45: tmp = x - (t * (x * y)) elif y <= 6.5e-5: tmp = x * (1.0 - (a * b)) else: tmp = x * (a * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.05e+45) tmp = Float64(x - Float64(t * Float64(x * y))); elseif (y <= 6.5e-5) tmp = Float64(x * Float64(1.0 - 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 <= -1.05e+45) tmp = x - (t * (x * y)); elseif (y <= 6.5e-5) tmp = x * (1.0 - (a * b)); else tmp = x * (a * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.05e+45], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e-5], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+45}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-5}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -1.04999999999999997e45Initial program 98.1%
fma-def98.1%
sub-neg98.1%
log1p-def98.1%
Simplified98.1%
add-exp-log57.7%
*-commutative57.7%
log-prod46.2%
add-log-exp46.2%
add-sqr-sqrt0.0%
sqrt-unprod44.3%
sqr-neg44.3%
sqrt-unprod44.3%
add-sqr-sqrt44.3%
Applied egg-rr44.3%
Taylor expanded in t around inf 33.1%
associate-*r*33.1%
neg-mul-133.1%
Simplified33.1%
Taylor expanded in t around 0 19.1%
mul-1-neg19.1%
unsub-neg19.1%
Simplified19.1%
if -1.04999999999999997e45 < y < 6.49999999999999943e-5Initial program 99.0%
Taylor expanded in b around inf 80.0%
mul-1-neg80.0%
distribute-rgt-neg-out80.0%
Simplified80.0%
Taylor expanded in a around 0 46.0%
mul-1-neg46.0%
unsub-neg46.0%
Simplified46.0%
if 6.49999999999999943e-5 < y Initial program 93.8%
Taylor expanded in b around inf 39.1%
mul-1-neg39.1%
distribute-rgt-neg-out39.1%
Simplified39.1%
Taylor expanded in a around 0 16.6%
mul-1-neg16.6%
unsub-neg16.6%
Simplified16.6%
Taylor expanded in a around inf 29.9%
mul-1-neg29.9%
associate-*r*33.6%
distribute-rgt-neg-in33.6%
Simplified33.6%
Final simplification37.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y 2.3e-246) (/ x (+ 1.0 (* a b))) (if (<= y 0.052) (* x (- 1.0 (* a b))) (* x (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.3e-246) {
tmp = x / (1.0 + (a * b));
} else if (y <= 0.052) {
tmp = x * (1.0 - (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 <= 2.3d-246) then
tmp = x / (1.0d0 + (a * b))
else if (y <= 0.052d0) then
tmp = x * (1.0d0 - (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 <= 2.3e-246) {
tmp = x / (1.0 + (a * b));
} else if (y <= 0.052) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 2.3e-246: tmp = x / (1.0 + (a * b)) elif y <= 0.052: tmp = x * (1.0 - (a * b)) else: tmp = x * (a * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 2.3e-246) tmp = Float64(x / Float64(1.0 + Float64(a * b))); elseif (y <= 0.052) tmp = Float64(x * Float64(1.0 - 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 <= 2.3e-246) tmp = x / (1.0 + (a * b)); elseif (y <= 0.052) tmp = x * (1.0 - (a * b)); else tmp = x * (a * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 2.3e-246], N[(x / N[(1.0 + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.052], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3 \cdot 10^{-246}:\\
\;\;\;\;\frac{x}{1 + a \cdot b}\\
\mathbf{elif}\;y \leq 0.052:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < 2.2999999999999998e-246Initial program 98.2%
Taylor expanded in y around 0 60.1%
sub-neg60.1%
neg-mul-160.1%
log1p-def61.7%
neg-mul-161.7%
Simplified61.7%
Taylor expanded in z around 0 60.1%
rem-exp-log29.6%
exp-sum29.6%
mul-1-neg29.6%
sub-neg29.6%
exp-diff29.6%
rem-exp-log60.1%
Simplified60.1%
Taylor expanded in a around 0 31.9%
if 2.2999999999999998e-246 < y < 0.0519999999999999976Initial program 99.8%
Taylor expanded in b around inf 85.7%
mul-1-neg85.7%
distribute-rgt-neg-out85.7%
Simplified85.7%
Taylor expanded in a around 0 55.8%
mul-1-neg55.8%
unsub-neg55.8%
Simplified55.8%
if 0.0519999999999999976 < y Initial program 93.8%
Taylor expanded in b around inf 39.1%
mul-1-neg39.1%
distribute-rgt-neg-out39.1%
Simplified39.1%
Taylor expanded in a around 0 16.6%
mul-1-neg16.6%
unsub-neg16.6%
Simplified16.6%
Taylor expanded in a around inf 29.9%
mul-1-neg29.9%
associate-*r*33.6%
distribute-rgt-neg-in33.6%
Simplified33.6%
Final simplification38.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -61000000000000.0) (not (<= y 0.00011))) (* b (* x (- a))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -61000000000000.0) || !(y <= 0.00011)) {
tmp = b * (x * -a);
} 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 <= (-61000000000000.0d0)) .or. (.not. (y <= 0.00011d0))) then
tmp = b * (x * -a)
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 <= -61000000000000.0) || !(y <= 0.00011)) {
tmp = b * (x * -a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -61000000000000.0) or not (y <= 0.00011): tmp = b * (x * -a) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -61000000000000.0) || !(y <= 0.00011)) tmp = Float64(b * Float64(x * Float64(-a))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -61000000000000.0) || ~((y <= 0.00011))) tmp = b * (x * -a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -61000000000000.0], N[Not[LessEqual[y, 0.00011]], $MachinePrecision]], N[(b * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -61000000000000 \lor \neg \left(y \leq 0.00011\right):\\
\;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -6.1e13 or 1.10000000000000004e-4 < y Initial program 95.1%
Taylor expanded in b around inf 38.0%
mul-1-neg38.0%
distribute-rgt-neg-out38.0%
Simplified38.0%
Taylor expanded in a around 0 12.7%
mul-1-neg12.7%
unsub-neg12.7%
Simplified12.7%
Taylor expanded in a around inf 20.0%
mul-1-neg20.0%
associate-*r*22.8%
*-commutative22.8%
associate-*r*22.7%
Simplified22.7%
if -6.1e13 < y < 1.10000000000000004e-4Initial program 99.7%
Taylor expanded in b around inf 82.0%
mul-1-neg82.0%
distribute-rgt-neg-out82.0%
Simplified82.0%
Taylor expanded in a around 0 39.2%
Final simplification31.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y -61000000000000.0) (* b (* x (- a))) (if (<= y 1.75e-15) x (* x (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -61000000000000.0) {
tmp = b * (x * -a);
} else if (y <= 1.75e-15) {
tmp = x;
} else {
tmp = x * (a * -b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-61000000000000.0d0)) then
tmp = b * (x * -a)
else if (y <= 1.75d-15) then
tmp = x
else
tmp = x * (a * -b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -61000000000000.0) {
tmp = b * (x * -a);
} else if (y <= 1.75e-15) {
tmp = x;
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -61000000000000.0: tmp = b * (x * -a) elif y <= 1.75e-15: tmp = x else: tmp = x * (a * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -61000000000000.0) tmp = Float64(b * Float64(x * Float64(-a))); elseif (y <= 1.75e-15) tmp = x; else tmp = Float64(x * Float64(a * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -61000000000000.0) tmp = b * (x * -a); elseif (y <= 1.75e-15) tmp = x; else tmp = x * (a * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -61000000000000.0], N[(b * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e-15], x, N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -61000000000000:\\
\;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{-15}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -6.1e13Initial program 96.6%
Taylor expanded in b around inf 36.8%
mul-1-neg36.8%
distribute-rgt-neg-out36.8%
Simplified36.8%
Taylor expanded in a around 0 8.3%
mul-1-neg8.3%
unsub-neg8.3%
Simplified8.3%
Taylor expanded in a around inf 9.0%
mul-1-neg9.0%
associate-*r*10.7%
*-commutative10.7%
associate-*r*12.2%
Simplified12.2%
if -6.1e13 < y < 1.75e-15Initial program 99.7%
Taylor expanded in b around inf 82.0%
mul-1-neg82.0%
distribute-rgt-neg-out82.0%
Simplified82.0%
Taylor expanded in a around 0 39.2%
if 1.75e-15 < y Initial program 93.8%
Taylor expanded in b around inf 39.1%
mul-1-neg39.1%
distribute-rgt-neg-out39.1%
Simplified39.1%
Taylor expanded in a around 0 16.6%
mul-1-neg16.6%
unsub-neg16.6%
Simplified16.6%
Taylor expanded in a around inf 29.9%
mul-1-neg29.9%
associate-*r*33.6%
distribute-rgt-neg-in33.6%
Simplified33.6%
Final simplification31.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y 9e-5) (* x (- 1.0 (* a b))) (* x (* a (- b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 9e-5) {
tmp = x * (1.0 - (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 <= 9d-5) then
tmp = x * (1.0d0 - (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 <= 9e-5) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 9e-5: tmp = x * (1.0 - (a * b)) else: tmp = x * (a * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 9e-5) tmp = Float64(x * Float64(1.0 - 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 <= 9e-5) tmp = x * (1.0 - (a * b)); else tmp = x * (a * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 9e-5], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9 \cdot 10^{-5}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < 9.00000000000000057e-5Initial program 98.7%
Taylor expanded in b around inf 68.3%
mul-1-neg68.3%
distribute-rgt-neg-out68.3%
Simplified68.3%
Taylor expanded in a around 0 35.9%
mul-1-neg35.9%
unsub-neg35.9%
Simplified35.9%
if 9.00000000000000057e-5 < y Initial program 93.8%
Taylor expanded in b around inf 39.1%
mul-1-neg39.1%
distribute-rgt-neg-out39.1%
Simplified39.1%
Taylor expanded in a around 0 16.6%
mul-1-neg16.6%
unsub-neg16.6%
Simplified16.6%
Taylor expanded in a around inf 29.9%
mul-1-neg29.9%
associate-*r*33.6%
distribute-rgt-neg-in33.6%
Simplified33.6%
Final simplification35.3%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 97.5%
Taylor expanded in b around inf 60.9%
mul-1-neg60.9%
distribute-rgt-neg-out60.9%
Simplified60.9%
Taylor expanded in a around 0 22.1%
Final simplification22.1%
herbie shell --seed 2024021
(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))))))