
(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.0%
fma-define97.4%
sub-neg97.4%
log1p-define100.0%
Simplified100.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5e-36) (not (<= y 1.12e-127))) (* x (exp (* y (- (log z) t)))) (* x (pow E (* a (- (- b) z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5e-36) || !(y <= 1.12e-127)) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = x * pow(((double) M_E), (a * (-b - z)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5e-36) || !(y <= 1.12e-127)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.pow(Math.E, (a * (-b - z)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -5e-36) or not (y <= 1.12e-127): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.pow(math.e, (a * (-b - z))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -5e-36) || !(y <= 1.12e-127)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * (exp(1) ^ Float64(a * Float64(Float64(-b) - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -5e-36) || ~((y <= 1.12e-127))) tmp = x * exp((y * (log(z) - t))); else tmp = x * (2.71828182845904523536 ^ (a * (-b - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5e-36], N[Not[LessEqual[y, 1.12e-127]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[E, N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-36} \lor \neg \left(y \leq 1.12 \cdot 10^{-127}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {e}^{\left(a \cdot \left(\left(-b\right) - z\right)\right)}\\
\end{array}
\end{array}
if y < -5.00000000000000004e-36 or 1.1199999999999999e-127 < y Initial program 98.7%
fma-define99.3%
sub-neg99.3%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 86.5%
if -5.00000000000000004e-36 < y < 1.1199999999999999e-127Initial program 94.5%
fma-define94.5%
sub-neg94.5%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 90.2%
*-un-lft-identity90.2%
exp-prod90.2%
sub-neg90.2%
log1p-define95.7%
Applied egg-rr95.7%
exp-1-e95.7%
Simplified95.7%
Taylor expanded in z around 0 95.7%
associate-*r*95.7%
associate-*r*95.7%
distribute-lft-out95.7%
mul-1-neg95.7%
Simplified95.7%
Final simplification90.2%
(FPCore (x y z t a b) :precision binary64 (* x (exp (- (* y (- (log z) t)) (* a (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) - (a * (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 * (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 * (z + b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) - (a * (z + b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) - Float64(a * Float64(z + b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) - (a * (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[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot \left(z + b\right)}
\end{array}
Initial program 97.0%
Taylor expanded in z around 0 99.6%
associate-*r*99.6%
associate-*r*99.6%
distribute-lft-out99.6%
mul-1-neg99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -8.3e-76) (not (<= a 7e-38))) (* x (exp (* a (- (- b) z)))) (* x (exp (* y (- t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -8.3e-76) || !(a <= 7e-38)) {
tmp = x * exp((a * (-b - z)));
} 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) :: tmp
if ((a <= (-8.3d-76)) .or. (.not. (a <= 7d-38))) then
tmp = x * exp((a * (-b - z)))
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 tmp;
if ((a <= -8.3e-76) || !(a <= 7e-38)) {
tmp = x * Math.exp((a * (-b - z)));
} else {
tmp = x * Math.exp((y * -t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -8.3e-76) or not (a <= 7e-38): tmp = x * math.exp((a * (-b - z))) else: tmp = x * math.exp((y * -t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -8.3e-76) || !(a <= 7e-38)) tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); else tmp = Float64(x * exp(Float64(y * Float64(-t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -8.3e-76) || ~((a <= 7e-38))) tmp = x * exp((a * (-b - z))); else tmp = x * exp((y * -t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -8.3e-76], N[Not[LessEqual[a, 7e-38]], $MachinePrecision]], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.3 \cdot 10^{-76} \lor \neg \left(a \leq 7 \cdot 10^{-38}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\end{array}
\end{array}
if a < -8.3000000000000002e-76 or 7.0000000000000003e-38 < a Initial program 94.8%
fma-define95.4%
sub-neg95.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 77.4%
Taylor expanded in z around 0 83.9%
associate-*r*99.3%
associate-*r*99.3%
distribute-lft-out99.3%
mul-1-neg99.3%
Simplified83.9%
if -8.3000000000000002e-76 < a < 7.0000000000000003e-38Initial program 100.0%
add-cube-cbrt100.0%
pow3100.0%
sub-neg100.0%
log1p-undefine100.0%
add-sqr-sqrt0.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod100.0%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 82.1%
associate-*r*82.1%
neg-mul-182.1%
Simplified82.1%
Final simplification83.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (- (- b) z))))
(if (<= a -5.4e-72)
(* x (pow E t_1))
(if (<= a 1.8e-35) (* x (exp (* y (- t)))) (* x (exp t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (-b - z);
double tmp;
if (a <= -5.4e-72) {
tmp = x * pow(((double) M_E), t_1);
} else if (a <= 1.8e-35) {
tmp = x * exp((y * -t));
} else {
tmp = x * exp(t_1);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (-b - z);
double tmp;
if (a <= -5.4e-72) {
tmp = x * Math.pow(Math.E, t_1);
} else if (a <= 1.8e-35) {
tmp = x * Math.exp((y * -t));
} else {
tmp = x * Math.exp(t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (-b - z) tmp = 0 if a <= -5.4e-72: tmp = x * math.pow(math.e, t_1) elif a <= 1.8e-35: tmp = x * math.exp((y * -t)) else: tmp = x * math.exp(t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(Float64(-b) - z)) tmp = 0.0 if (a <= -5.4e-72) tmp = Float64(x * (exp(1) ^ t_1)); elseif (a <= 1.8e-35) tmp = Float64(x * exp(Float64(y * Float64(-t)))); else tmp = Float64(x * exp(t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (-b - z); tmp = 0.0; if (a <= -5.4e-72) tmp = x * (2.71828182845904523536 ^ t_1); elseif (a <= 1.8e-35) tmp = x * exp((y * -t)); else tmp = x * exp(t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.4e-72], N[(x * N[Power[E, t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.8e-35], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[t$95$1], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(\left(-b\right) - z\right)\\
\mathbf{if}\;a \leq -5.4 \cdot 10^{-72}:\\
\;\;\;\;x \cdot {e}^{t\_1}\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{-35}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{t\_1}\\
\end{array}
\end{array}
if a < -5.4e-72Initial program 94.5%
fma-define94.5%
sub-neg94.5%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 74.0%
*-un-lft-identity74.0%
exp-prod74.0%
sub-neg74.0%
log1p-define84.8%
Applied egg-rr84.8%
exp-1-e84.8%
Simplified84.8%
Taylor expanded in z around 0 84.8%
associate-*r*84.8%
associate-*r*84.8%
distribute-lft-out84.8%
mul-1-neg84.8%
Simplified84.8%
if -5.4e-72 < a < 1.80000000000000009e-35Initial program 100.0%
add-cube-cbrt100.0%
pow3100.0%
sub-neg100.0%
log1p-undefine100.0%
add-sqr-sqrt0.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod100.0%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 82.1%
associate-*r*82.1%
neg-mul-182.1%
Simplified82.1%
if 1.80000000000000009e-35 < a Initial program 95.0%
fma-define96.2%
sub-neg96.2%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 80.5%
Taylor expanded in z around 0 83.0%
associate-*r*98.7%
associate-*r*98.7%
distribute-lft-out98.7%
mul-1-neg98.7%
Simplified83.0%
Final simplification83.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -6.6e-62) (not (<= a 2.1e-35))) (* x (exp (* a (- b)))) (* x (exp (* y (- t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6.6e-62) || !(a <= 2.1e-35)) {
tmp = x * exp((a * -b));
} 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) :: tmp
if ((a <= (-6.6d-62)) .or. (.not. (a <= 2.1d-35))) then
tmp = x * exp((a * -b))
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 tmp;
if ((a <= -6.6e-62) || !(a <= 2.1e-35)) {
tmp = x * Math.exp((a * -b));
} else {
tmp = x * Math.exp((y * -t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -6.6e-62) or not (a <= 2.1e-35): tmp = x * math.exp((a * -b)) else: tmp = x * math.exp((y * -t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -6.6e-62) || !(a <= 2.1e-35)) tmp = Float64(x * exp(Float64(a * Float64(-b)))); else tmp = Float64(x * exp(Float64(y * Float64(-t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -6.6e-62) || ~((a <= 2.1e-35))) tmp = x * exp((a * -b)); else tmp = x * exp((y * -t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -6.6e-62], N[Not[LessEqual[a, 2.1e-35]], $MachinePrecision]], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.6 \cdot 10^{-62} \lor \neg \left(a \leq 2.1 \cdot 10^{-35}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\end{array}
\end{array}
if a < -6.60000000000000009e-62 or 2.1e-35 < a Initial program 94.8%
fma-define95.4%
sub-neg95.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 77.4%
Taylor expanded in z around 0 76.8%
mul-1-neg76.8%
distribute-rgt-neg-out76.8%
Simplified76.8%
if -6.60000000000000009e-62 < a < 2.1e-35Initial program 100.0%
add-cube-cbrt100.0%
pow3100.0%
sub-neg100.0%
log1p-undefine100.0%
add-sqr-sqrt0.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod100.0%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 82.1%
associate-*r*82.1%
neg-mul-182.1%
Simplified82.1%
Final simplification79.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.14e+64) (not (<= y 2e+19))) (* 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.14e+64) || !(y <= 2e+19)) {
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.14d+64)) .or. (.not. (y <= 2d+19))) 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.14e+64) || !(y <= 2e+19)) {
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.14e+64) or not (y <= 2e+19): 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.14e+64) || !(y <= 2e+19)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(a * Float64(-b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.14e+64) || ~((y <= 2e+19))) tmp = x * (z ^ y); else tmp = x * exp((a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.14e+64], N[Not[LessEqual[y, 2e+19]], $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.14 \cdot 10^{+64} \lor \neg \left(y \leq 2 \cdot 10^{+19}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -1.14e64 or 2e19 < y Initial program 99.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 92.1%
Taylor expanded in t around 0 71.5%
if -1.14e64 < y < 2e19Initial program 95.7%
fma-define95.7%
sub-neg95.7%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 77.6%
Taylor expanded in z around 0 77.0%
mul-1-neg77.0%
distribute-rgt-neg-out77.0%
Simplified77.0%
Final simplification74.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.14e+64) (not (<= y 3e-7))) (* x (pow z y)) (* x (exp (* z (- a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.14e+64) || !(y <= 3e-7)) {
tmp = x * pow(z, y);
} else {
tmp = x * exp((z * -a));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.14d+64)) .or. (.not. (y <= 3d-7))) then
tmp = x * (z ** y)
else
tmp = x * exp((z * -a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.14e+64) || !(y <= 3e-7)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * Math.exp((z * -a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.14e+64) or not (y <= 3e-7): tmp = x * math.pow(z, y) else: tmp = x * math.exp((z * -a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.14e+64) || !(y <= 3e-7)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(z * Float64(-a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.14e+64) || ~((y <= 3e-7))) tmp = x * (z ^ y); else tmp = x * exp((z * -a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.14e+64], N[Not[LessEqual[y, 3e-7]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(z * (-a)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.14 \cdot 10^{+64} \lor \neg \left(y \leq 3 \cdot 10^{-7}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{z \cdot \left(-a\right)}\\
\end{array}
\end{array}
if y < -1.14e64 or 2.9999999999999999e-7 < y Initial program 99.1%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 91.6%
Taylor expanded in t around 0 69.4%
if -1.14e64 < y < 2.9999999999999999e-7Initial program 95.5%
fma-define95.5%
sub-neg95.5%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 78.4%
*-un-lft-identity78.4%
exp-prod78.4%
sub-neg78.4%
log1p-define82.9%
Applied egg-rr82.9%
exp-1-e82.9%
Simplified82.9%
Taylor expanded in z around 0 82.9%
associate-*r*82.9%
associate-*r*82.9%
distribute-lft-out82.9%
mul-1-neg82.9%
Simplified82.9%
Taylor expanded in b around 0 54.9%
exp-prod54.9%
log-E54.9%
associate-*r*54.9%
*-rgt-identity54.9%
exp-prod54.9%
mul-1-neg54.9%
Simplified54.9%
Final simplification60.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.3e+16) (* x (- 1.0 (* y t))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.3e+16) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * pow(z, y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-2.3d+16)) then
tmp = x * (1.0d0 - (y * t))
else
tmp = x * (z ** y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.3e+16) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.3e+16: tmp = x * (1.0 - (y * t)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.3e+16) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.3e+16) tmp = x * (1.0 - (y * t)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.3e+16], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{+16}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -2.3e16Initial program 98.5%
add-cube-cbrt98.5%
pow398.5%
sub-neg98.5%
log1p-undefine99.8%
add-sqr-sqrt0.0%
sqrt-unprod96.9%
sqr-neg96.9%
sqrt-unprod96.9%
add-sqr-sqrt96.9%
Applied egg-rr96.9%
Taylor expanded in t around inf 80.7%
associate-*r*80.7%
neg-mul-180.7%
Simplified80.7%
Taylor expanded in t around 0 31.6%
mul-1-neg31.6%
*-commutative31.6%
unsub-neg31.6%
Simplified31.6%
if -2.3e16 < t Initial program 96.5%
fma-define97.0%
sub-neg97.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 71.0%
Taylor expanded in t around 0 63.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.6e-30) (* b (- (/ x b) (* x a))) (if (<= y 72000000000.0) (* x (- 1.0 (* 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.6e-30) {
tmp = b * ((x / b) - (x * a));
} else if (y <= 72000000000.0) {
tmp = x * (1.0 - (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.6d-30)) then
tmp = b * ((x / b) - (x * a))
else if (y <= 72000000000.0d0) then
tmp = x * (1.0d0 - (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.6e-30) {
tmp = b * ((x / b) - (x * a));
} else if (y <= 72000000000.0) {
tmp = x * (1.0 - (a * (z + b)));
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.6e-30: tmp = b * ((x / b) - (x * a)) elif y <= 72000000000.0: tmp = x * (1.0 - (a * (z + b))) else: tmp = x * (a * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.6e-30) tmp = Float64(b * Float64(Float64(x / b) - Float64(x * a))); elseif (y <= 72000000000.0) tmp = Float64(x * Float64(1.0 - 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.6e-30) tmp = b * ((x / b) - (x * a)); elseif (y <= 72000000000.0) tmp = x * (1.0 - (a * (z + b))); else tmp = x * (a * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.6e-30], N[(b * N[(N[(x / b), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 72000000000.0], N[(x * N[(1.0 - 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.6 \cdot 10^{-30}:\\
\;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\
\mathbf{elif}\;y \leq 72000000000:\\
\;\;\;\;x \cdot \left(1 - 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.59999999999999987e-30Initial program 96.7%
fma-define98.4%
sub-neg98.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 39.8%
Taylor expanded in z around 0 39.8%
mul-1-neg39.8%
distribute-rgt-neg-out39.8%
Simplified39.8%
Taylor expanded in a around 0 15.9%
neg-mul-115.9%
unsub-neg15.9%
Simplified15.9%
Taylor expanded in b around inf 26.5%
+-commutative26.5%
mul-1-neg26.5%
sub-neg26.5%
*-commutative26.5%
Simplified26.5%
if -2.59999999999999987e-30 < y < 7.2e10Initial program 95.9%
fma-define95.9%
sub-neg95.9%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 79.8%
*-un-lft-identity79.8%
exp-prod79.8%
sub-neg79.8%
log1p-define83.9%
Applied egg-rr83.9%
exp-1-e83.9%
Simplified83.9%
Taylor expanded in z around 0 83.9%
associate-*r*83.9%
associate-*r*83.9%
distribute-lft-out83.9%
mul-1-neg83.9%
Simplified83.9%
Taylor expanded in a around 0 48.7%
mul-1-neg48.7%
unsub-neg48.7%
log-E48.7%
*-lft-identity48.7%
Simplified48.7%
if 7.2e10 < y Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 43.3%
Taylor expanded in z around 0 43.3%
mul-1-neg43.3%
distribute-rgt-neg-out43.3%
Simplified43.3%
Taylor expanded in a around 0 12.1%
neg-mul-112.1%
unsub-neg12.1%
Simplified12.1%
Taylor expanded in a around inf 28.1%
mul-1-neg28.1%
associate-*r*31.4%
*-commutative31.4%
distribute-rgt-neg-in31.4%
distribute-rgt-neg-in31.4%
Simplified31.4%
Final simplification39.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.6e-35) (* b (- (/ x b) (* x a))) (if (<= y 6800000000.0) (* 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.6e-35) {
tmp = b * ((x / b) - (x * a));
} else if (y <= 6800000000.0) {
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.6d-35)) then
tmp = b * ((x / b) - (x * a))
else if (y <= 6800000000.0d0) 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.6e-35) {
tmp = b * ((x / b) - (x * a));
} else if (y <= 6800000000.0) {
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.6e-35: tmp = b * ((x / b) - (x * a)) elif y <= 6800000000.0: 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.6e-35) tmp = Float64(b * Float64(Float64(x / b) - Float64(x * a))); elseif (y <= 6800000000.0) 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.6e-35) tmp = b * ((x / b) - (x * a)); elseif (y <= 6800000000.0) 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.6e-35], N[(b * N[(N[(x / b), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6800000000.0], 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.6 \cdot 10^{-35}:\\
\;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\
\mathbf{elif}\;y \leq 6800000000:\\
\;\;\;\;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.5999999999999999e-35Initial program 96.8%
fma-define98.4%
sub-neg98.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 39.2%
Taylor expanded in z around 0 39.2%
mul-1-neg39.2%
distribute-rgt-neg-out39.2%
Simplified39.2%
Taylor expanded in a around 0 15.7%
neg-mul-115.7%
unsub-neg15.7%
Simplified15.7%
Taylor expanded in b around inf 26.2%
+-commutative26.2%
mul-1-neg26.2%
sub-neg26.2%
*-commutative26.2%
Simplified26.2%
if -1.5999999999999999e-35 < y < 6.8e9Initial program 95.8%
fma-define95.8%
sub-neg95.8%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 80.3%
Taylor expanded in z around 0 79.6%
mul-1-neg79.6%
distribute-rgt-neg-out79.6%
Simplified79.6%
Taylor expanded in a around 0 48.3%
neg-mul-148.3%
unsub-neg48.3%
Simplified48.3%
if 6.8e9 < y Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 43.3%
Taylor expanded in z around 0 43.3%
mul-1-neg43.3%
distribute-rgt-neg-out43.3%
Simplified43.3%
Taylor expanded in a around 0 12.1%
neg-mul-112.1%
unsub-neg12.1%
Simplified12.1%
Taylor expanded in a around inf 28.1%
mul-1-neg28.1%
associate-*r*31.4%
*-commutative31.4%
distribute-rgt-neg-in31.4%
distribute-rgt-neg-in31.4%
Simplified31.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y -8.5e-36) (* a (* x (- b))) (if (<= y 8600000000.0) (* 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 <= -8.5e-36) {
tmp = a * (x * -b);
} else if (y <= 8600000000.0) {
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 <= (-8.5d-36)) then
tmp = a * (x * -b)
else if (y <= 8600000000.0d0) 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 <= -8.5e-36) {
tmp = a * (x * -b);
} else if (y <= 8600000000.0) {
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 <= -8.5e-36: tmp = a * (x * -b) elif y <= 8600000000.0: 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 <= -8.5e-36) tmp = Float64(a * Float64(x * Float64(-b))); elseif (y <= 8600000000.0) 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 <= -8.5e-36) tmp = a * (x * -b); elseif (y <= 8600000000.0) 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, -8.5e-36], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8600000000.0], 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 -8.5 \cdot 10^{-36}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq 8600000000:\\
\;\;\;\;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 < -8.5000000000000007e-36Initial program 96.9%
fma-define98.4%
sub-neg98.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 38.7%
Taylor expanded in z around 0 38.7%
mul-1-neg38.7%
distribute-rgt-neg-out38.7%
Simplified38.7%
Taylor expanded in a around 0 15.6%
neg-mul-115.6%
unsub-neg15.6%
Simplified15.6%
Taylor expanded in a around inf 24.2%
if -8.5000000000000007e-36 < y < 8.6e9Initial program 95.8%
fma-define95.8%
sub-neg95.8%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 80.8%
Taylor expanded in z around 0 80.1%
mul-1-neg80.1%
distribute-rgt-neg-out80.1%
Simplified80.1%
Taylor expanded in a around 0 48.6%
neg-mul-148.6%
unsub-neg48.6%
Simplified48.6%
if 8.6e9 < y Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 43.3%
Taylor expanded in z around 0 43.3%
mul-1-neg43.3%
distribute-rgt-neg-out43.3%
Simplified43.3%
Taylor expanded in a around 0 12.1%
neg-mul-112.1%
unsub-neg12.1%
Simplified12.1%
Taylor expanded in a around inf 28.1%
mul-1-neg28.1%
associate-*r*31.4%
*-commutative31.4%
distribute-rgt-neg-in31.4%
distribute-rgt-neg-in31.4%
Simplified31.4%
Final simplification38.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -8.5e-36) (not (<= y 1.15e+16))) (* x (* a (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -8.5e-36) || !(y <= 1.15e+16)) {
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 <= (-8.5d-36)) .or. (.not. (y <= 1.15d+16))) 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 <= -8.5e-36) || !(y <= 1.15e+16)) {
tmp = x * (a * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -8.5e-36) or not (y <= 1.15e+16): tmp = x * (a * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -8.5e-36) || !(y <= 1.15e+16)) 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 <= -8.5e-36) || ~((y <= 1.15e+16))) tmp = x * (a * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -8.5e-36], N[Not[LessEqual[y, 1.15e+16]], $MachinePrecision]], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{-36} \lor \neg \left(y \leq 1.15 \cdot 10^{+16}\right):\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -8.5000000000000007e-36 or 1.15e16 < y Initial program 98.3%
fma-define99.2%
sub-neg99.2%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 39.8%
Taylor expanded in z around 0 39.8%
mul-1-neg39.8%
distribute-rgt-neg-out39.8%
Simplified39.8%
Taylor expanded in a around 0 14.1%
neg-mul-114.1%
unsub-neg14.1%
Simplified14.1%
Taylor expanded in a around inf 26.4%
mul-1-neg26.4%
associate-*r*27.2%
*-commutative27.2%
distribute-rgt-neg-in27.2%
distribute-rgt-neg-in27.2%
Simplified27.2%
if -8.5000000000000007e-36 < y < 1.15e16Initial program 95.9%
fma-define95.9%
sub-neg95.9%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 81.1%
Taylor expanded in a around 0 42.0%
Final simplification35.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y -6e-36) (* a (* x (- b))) (if (<= y 1.15e+16) x (* x (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6e-36) {
tmp = a * (x * -b);
} else if (y <= 1.15e+16) {
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 <= (-6d-36)) then
tmp = a * (x * -b)
else if (y <= 1.15d+16) 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 <= -6e-36) {
tmp = a * (x * -b);
} else if (y <= 1.15e+16) {
tmp = x;
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -6e-36: tmp = a * (x * -b) elif y <= 1.15e+16: tmp = x else: tmp = x * (a * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -6e-36) tmp = Float64(a * Float64(x * Float64(-b))); elseif (y <= 1.15e+16) 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 <= -6e-36) tmp = a * (x * -b); elseif (y <= 1.15e+16) tmp = x; else tmp = x * (a * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -6e-36], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+16], x, N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{-36}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+16}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -6.0000000000000003e-36Initial program 96.9%
fma-define98.4%
sub-neg98.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 38.7%
Taylor expanded in z around 0 38.7%
mul-1-neg38.7%
distribute-rgt-neg-out38.7%
Simplified38.7%
Taylor expanded in a around 0 15.6%
neg-mul-115.6%
unsub-neg15.6%
Simplified15.6%
Taylor expanded in a around inf 24.2%
if -6.0000000000000003e-36 < y < 1.15e16Initial program 95.9%
fma-define95.9%
sub-neg95.9%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 81.1%
Taylor expanded in a around 0 42.0%
if 1.15e16 < y Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 41.2%
Taylor expanded in z around 0 41.2%
mul-1-neg41.2%
distribute-rgt-neg-out41.2%
Simplified41.2%
Taylor expanded in a around 0 12.4%
neg-mul-112.4%
unsub-neg12.4%
Simplified12.4%
Taylor expanded in a around inf 29.0%
mul-1-neg29.0%
associate-*r*32.4%
*-commutative32.4%
distribute-rgt-neg-in32.4%
distribute-rgt-neg-in32.4%
Simplified32.4%
Final simplification35.6%
(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.0%
fma-define97.4%
sub-neg97.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 62.3%
Taylor expanded in a around 0 24.7%
herbie shell --seed 2024144
(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))))))