
(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 19 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 95.6%
fma-define96.4%
sub-neg96.4%
log1p-define99.5%
Simplified99.5%
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
Initial program 95.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -0.0064)
(* x (pow (/ z (exp t)) y))
(if (<= y 2.7e-5)
(* x (exp (* a (- (log1p (- z)) b))))
(* x (/ (exp (+ (* y (- (log z) t)) 1.0)) E)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -0.0064) {
tmp = x * pow((z / exp(t)), y);
} else if (y <= 2.7e-5) {
tmp = x * exp((a * (log1p(-z) - b)));
} else {
tmp = x * (exp(((y * (log(z) - t)) + 1.0)) / ((double) M_E));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -0.0064) {
tmp = x * Math.pow((z / Math.exp(t)), y);
} else if (y <= 2.7e-5) {
tmp = x * Math.exp((a * (Math.log1p(-z) - b)));
} else {
tmp = x * (Math.exp(((y * (Math.log(z) - t)) + 1.0)) / Math.E);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -0.0064: tmp = x * math.pow((z / math.exp(t)), y) elif y <= 2.7e-5: tmp = x * math.exp((a * (math.log1p(-z) - b))) else: tmp = x * (math.exp(((y * (math.log(z) - t)) + 1.0)) / math.e) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -0.0064) tmp = Float64(x * (Float64(z / exp(t)) ^ y)); elseif (y <= 2.7e-5) tmp = Float64(x * exp(Float64(a * Float64(log1p(Float64(-z)) - b)))); else tmp = Float64(x * Float64(exp(Float64(Float64(y * Float64(log(z) - t)) + 1.0)) / exp(1))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -0.0064], N[(x * N[Power[N[(z / N[Exp[t], $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e-5], N[(x * N[Exp[N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision] / E), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.0064:\\
\;\;\;\;x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-5}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{e^{y \cdot \left(\log z - t\right) + 1}}{e}\\
\end{array}
\end{array}
if y < -0.00640000000000000031Initial program 95.2%
Taylor expanded in y around inf 89.1%
pow-exp89.1%
*-un-lft-identity89.1%
pow-exp89.1%
*-commutative89.1%
exp-prod89.1%
exp-diff89.1%
add-exp-log89.2%
Applied egg-rr89.2%
*-lft-identity89.2%
Simplified89.2%
if -0.00640000000000000031 < y < 2.6999999999999999e-5Initial program 95.4%
Taylor expanded in y around 0 80.1%
sub-neg80.1%
mul-1-neg80.1%
log1p-define86.9%
mul-1-neg86.9%
Simplified86.9%
if 2.6999999999999999e-5 < y Initial program 96.7%
Taylor expanded in y around inf 86.8%
expm1-log1p-u20.1%
expm1-define20.1%
exp-diff20.1%
log1p-undefine20.1%
rem-exp-log86.9%
exp-1-e86.9%
Applied egg-rr86.9%
Final simplification87.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -0.0038)
(* x (pow (/ z (exp t)) y))
(if (<= y 2.75e-5)
(* x (exp (* a (- (log1p (- 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 (y <= -0.0038) {
tmp = x * pow((z / exp(t)), y);
} else if (y <= 2.75e-5) {
tmp = x * exp((a * (log1p(-z) - b)));
} else {
tmp = x * exp((y * (log(z) - t)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -0.0038) {
tmp = x * Math.pow((z / Math.exp(t)), y);
} else if (y <= 2.75e-5) {
tmp = x * Math.exp((a * (Math.log1p(-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 y <= -0.0038: tmp = x * math.pow((z / math.exp(t)), y) elif y <= 2.75e-5: tmp = x * math.exp((a * (math.log1p(-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 (y <= -0.0038) tmp = Float64(x * (Float64(z / exp(t)) ^ y)); elseif (y <= 2.75e-5) tmp = Float64(x * exp(Float64(a * Float64(log1p(Float64(-z)) - b)))); else tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -0.0038], N[(x * N[Power[N[(z / N[Exp[t], $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.75e-5], N[(x * N[Exp[N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - 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}\;y \leq -0.0038:\\
\;\;\;\;x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\\
\mathbf{elif}\;y \leq 2.75 \cdot 10^{-5}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\end{array}
\end{array}
if y < -0.00379999999999999999Initial program 95.2%
Taylor expanded in y around inf 89.1%
pow-exp89.1%
*-un-lft-identity89.1%
pow-exp89.1%
*-commutative89.1%
exp-prod89.1%
exp-diff89.1%
add-exp-log89.2%
Applied egg-rr89.2%
*-lft-identity89.2%
Simplified89.2%
if -0.00379999999999999999 < y < 2.7500000000000001e-5Initial program 95.4%
Taylor expanded in y around 0 80.1%
sub-neg80.1%
mul-1-neg80.1%
log1p-define86.9%
mul-1-neg86.9%
Simplified86.9%
if 2.7500000000000001e-5 < y Initial program 96.7%
Taylor expanded in y around inf 86.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -9e-14) (not (<= b 2.8e+40))) (* x (exp (* a (- b)))) (* x (exp (* y (- (log z) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -9e-14) || !(b <= 2.8e+40)) {
tmp = x * exp((a * -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 ((b <= (-9d-14)) .or. (.not. (b <= 2.8d+40))) then
tmp = x * exp((a * -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 ((b <= -9e-14) || !(b <= 2.8e+40)) {
tmp = x * Math.exp((a * -b));
} else {
tmp = x * Math.exp((y * (Math.log(z) - t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -9e-14) or not (b <= 2.8e+40): tmp = x * math.exp((a * -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 ((b <= -9e-14) || !(b <= 2.8e+40)) tmp = Float64(x * exp(Float64(a * Float64(-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 ((b <= -9e-14) || ~((b <= 2.8e+40))) tmp = x * exp((a * -b)); else tmp = x * exp((y * (log(z) - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -9e-14], N[Not[LessEqual[b, 2.8e+40]], $MachinePrecision]], N[(x * N[Exp[N[(a * (-b)), $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}\;b \leq -9 \cdot 10^{-14} \lor \neg \left(b \leq 2.8 \cdot 10^{+40}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\end{array}
\end{array}
if b < -8.9999999999999995e-14 or 2.8000000000000001e40 < b Initial program 97.6%
Taylor expanded in b around inf 81.7%
mul-1-neg81.7%
distribute-rgt-neg-out81.7%
Simplified81.7%
if -8.9999999999999995e-14 < b < 2.8000000000000001e40Initial program 93.6%
Taylor expanded in y around inf 88.1%
Final simplification84.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5.4e-71) (not (<= y 2e-5))) (* x (pow (/ z (exp t)) y)) (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5.4e-71) || !(y <= 2e-5)) {
tmp = x * pow((z / exp(t)), 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 <= (-5.4d-71)) .or. (.not. (y <= 2d-5))) then
tmp = x * ((z / exp(t)) ** 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 <= -5.4e-71) || !(y <= 2e-5)) {
tmp = x * Math.pow((z / Math.exp(t)), y);
} else {
tmp = x * Math.exp((a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -5.4e-71) or not (y <= 2e-5): tmp = x * math.pow((z / math.exp(t)), y) else: tmp = x * math.exp((a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -5.4e-71) || !(y <= 2e-5)) tmp = Float64(x * (Float64(z / exp(t)) ^ 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 <= -5.4e-71) || ~((y <= 2e-5))) tmp = x * ((z / exp(t)) ^ y); else tmp = x * exp((a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5.4e-71], N[Not[LessEqual[y, 2e-5]], $MachinePrecision]], N[(x * N[Power[N[(z / N[Exp[t], $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.4 \cdot 10^{-71} \lor \neg \left(y \leq 2 \cdot 10^{-5}\right):\\
\;\;\;\;x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -5.4000000000000003e-71 or 2.00000000000000016e-5 < y Initial program 95.3%
Taylor expanded in y around inf 86.1%
pow-exp82.0%
*-un-lft-identity82.0%
pow-exp86.1%
*-commutative86.1%
exp-prod85.8%
exp-diff85.8%
add-exp-log85.9%
Applied egg-rr85.9%
*-lft-identity85.9%
Simplified85.9%
if -5.4000000000000003e-71 < y < 2.00000000000000016e-5Initial program 96.0%
Taylor expanded in b around inf 82.6%
mul-1-neg82.6%
distribute-rgt-neg-out82.6%
Simplified82.6%
Final simplification84.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -3e-13)
(* x (pow (exp y) (- t)))
(if (<= y 0.00045)
(* x (exp (* a (- b))))
(if (<= y 1.45e+186)
(* x (pow (/ z (+ t 1.0)) y))
(* x (exp (* y (- t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3e-13) {
tmp = x * pow(exp(y), -t);
} else if (y <= 0.00045) {
tmp = x * exp((a * -b));
} else if (y <= 1.45e+186) {
tmp = x * pow((z / (t + 1.0)), y);
} 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 (y <= (-3d-13)) then
tmp = x * (exp(y) ** -t)
else if (y <= 0.00045d0) then
tmp = x * exp((a * -b))
else if (y <= 1.45d+186) then
tmp = x * ((z / (t + 1.0d0)) ** y)
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 (y <= -3e-13) {
tmp = x * Math.pow(Math.exp(y), -t);
} else if (y <= 0.00045) {
tmp = x * Math.exp((a * -b));
} else if (y <= 1.45e+186) {
tmp = x * Math.pow((z / (t + 1.0)), y);
} else {
tmp = x * Math.exp((y * -t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3e-13: tmp = x * math.pow(math.exp(y), -t) elif y <= 0.00045: tmp = x * math.exp((a * -b)) elif y <= 1.45e+186: tmp = x * math.pow((z / (t + 1.0)), y) else: tmp = x * math.exp((y * -t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3e-13) tmp = Float64(x * (exp(y) ^ Float64(-t))); elseif (y <= 0.00045) tmp = Float64(x * exp(Float64(a * Float64(-b)))); elseif (y <= 1.45e+186) tmp = Float64(x * (Float64(z / Float64(t + 1.0)) ^ y)); 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 (y <= -3e-13) tmp = x * (exp(y) ^ -t); elseif (y <= 0.00045) tmp = x * exp((a * -b)); elseif (y <= 1.45e+186) tmp = x * ((z / (t + 1.0)) ^ y); else tmp = x * exp((y * -t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3e-13], N[(x * N[Power[N[Exp[y], $MachinePrecision], (-t)], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.00045], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+186], N[(x * N[Power[N[(z / N[(t + 1.0), $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-13}:\\
\;\;\;\;x \cdot {\left(e^{y}\right)}^{\left(-t\right)}\\
\mathbf{elif}\;y \leq 0.00045:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+186}:\\
\;\;\;\;x \cdot {\left(\frac{z}{t + 1}\right)}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\end{array}
\end{array}
if y < -2.99999999999999984e-13Initial program 94.0%
*-un-lft-identity94.0%
exp-prod94.0%
fma-define95.5%
sub-neg95.5%
sub-neg95.5%
sub-neg95.5%
log1p-undefine98.5%
add-sqr-sqrt0.0%
sqrt-unprod95.5%
sqr-neg95.5%
sqrt-unprod95.5%
add-sqr-sqrt95.5%
Applied egg-rr95.5%
Taylor expanded in t around inf 62.4%
associate-*r*62.4%
neg-mul-162.4%
Simplified62.4%
Taylor expanded in t around inf 62.4%
mul-1-neg62.4%
*-commutative62.4%
distribute-rgt-neg-in62.4%
exp-prod78.1%
Simplified78.1%
if -2.99999999999999984e-13 < y < 4.4999999999999999e-4Initial program 96.0%
Taylor expanded in b around inf 81.2%
mul-1-neg81.2%
distribute-rgt-neg-out81.2%
Simplified81.2%
if 4.4999999999999999e-4 < y < 1.45e186Initial program 95.2%
Taylor expanded in y around inf 85.9%
pow-exp85.8%
*-un-lft-identity85.8%
pow-exp85.9%
*-commutative85.9%
exp-prod85.9%
exp-diff85.9%
add-exp-log85.9%
Applied egg-rr85.9%
*-lft-identity85.9%
Simplified85.9%
Taylor expanded in t around 0 81.2%
if 1.45e186 < y Initial program 100.0%
Taylor expanded in t around inf 94.5%
mul-1-neg94.5%
distribute-lft-neg-out94.5%
*-commutative94.5%
Simplified94.5%
Final simplification81.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -5.2e+15)
(* x (pow z y))
(if (<= y 0.00033)
(* x (exp (* a (- b))))
(if (<= y 6.5e+187)
(* x (pow (/ z (+ t 1.0)) y))
(* x (exp (* y (- t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5.2e+15) {
tmp = x * pow(z, y);
} else if (y <= 0.00033) {
tmp = x * exp((a * -b));
} else if (y <= 6.5e+187) {
tmp = x * pow((z / (t + 1.0)), y);
} 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 (y <= (-5.2d+15)) then
tmp = x * (z ** y)
else if (y <= 0.00033d0) then
tmp = x * exp((a * -b))
else if (y <= 6.5d+187) then
tmp = x * ((z / (t + 1.0d0)) ** y)
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 (y <= -5.2e+15) {
tmp = x * Math.pow(z, y);
} else if (y <= 0.00033) {
tmp = x * Math.exp((a * -b));
} else if (y <= 6.5e+187) {
tmp = x * Math.pow((z / (t + 1.0)), y);
} else {
tmp = x * Math.exp((y * -t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -5.2e+15: tmp = x * math.pow(z, y) elif y <= 0.00033: tmp = x * math.exp((a * -b)) elif y <= 6.5e+187: tmp = x * math.pow((z / (t + 1.0)), y) else: tmp = x * math.exp((y * -t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -5.2e+15) tmp = Float64(x * (z ^ y)); elseif (y <= 0.00033) tmp = Float64(x * exp(Float64(a * Float64(-b)))); elseif (y <= 6.5e+187) tmp = Float64(x * (Float64(z / Float64(t + 1.0)) ^ y)); 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 (y <= -5.2e+15) tmp = x * (z ^ y); elseif (y <= 0.00033) tmp = x * exp((a * -b)); elseif (y <= 6.5e+187) tmp = x * ((z / (t + 1.0)) ^ y); else tmp = x * exp((y * -t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -5.2e+15], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.00033], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e+187], N[(x * N[Power[N[(z / N[(t + 1.0), $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{+15}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{elif}\;y \leq 0.00033:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+187}:\\
\;\;\;\;x \cdot {\left(\frac{z}{t + 1}\right)}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\end{array}
\end{array}
if y < -5.2e15Initial program 95.0%
Taylor expanded in y around inf 88.5%
Taylor expanded in t around 0 65.5%
if -5.2e15 < y < 3.3e-4Initial program 95.5%
Taylor expanded in b around inf 79.3%
mul-1-neg79.3%
distribute-rgt-neg-out79.3%
Simplified79.3%
if 3.3e-4 < y < 6.49999999999999969e187Initial program 95.2%
Taylor expanded in y around inf 85.9%
pow-exp85.8%
*-un-lft-identity85.8%
pow-exp85.9%
*-commutative85.9%
exp-prod85.9%
exp-diff85.9%
add-exp-log85.9%
Applied egg-rr85.9%
*-lft-identity85.9%
Simplified85.9%
Taylor expanded in t around 0 81.2%
if 6.49999999999999969e187 < y Initial program 100.0%
Taylor expanded in t around inf 94.5%
mul-1-neg94.5%
distribute-lft-neg-out94.5%
*-commutative94.5%
Simplified94.5%
Final simplification77.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))))
(if (<= y -2.55e+16)
t_1
(if (<= y 0.00045)
(* x (exp (* a (- b))))
(if (<= y 2.7e+185) 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 (y <= -2.55e+16) {
tmp = t_1;
} else if (y <= 0.00045) {
tmp = x * exp((a * -b));
} else if (y <= 2.7e+185) {
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 (y <= (-2.55d+16)) then
tmp = t_1
else if (y <= 0.00045d0) then
tmp = x * exp((a * -b))
else if (y <= 2.7d+185) 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 (y <= -2.55e+16) {
tmp = t_1;
} else if (y <= 0.00045) {
tmp = x * Math.exp((a * -b));
} else if (y <= 2.7e+185) {
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 y <= -2.55e+16: tmp = t_1 elif y <= 0.00045: tmp = x * math.exp((a * -b)) elif y <= 2.7e+185: 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 (y <= -2.55e+16) tmp = t_1; elseif (y <= 0.00045) tmp = Float64(x * exp(Float64(a * Float64(-b)))); elseif (y <= 2.7e+185) tmp = t_1; else tmp = Float64(x * exp(Float64(y * Float64(-t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (z ^ y); tmp = 0.0; if (y <= -2.55e+16) tmp = t_1; elseif (y <= 0.00045) tmp = x * exp((a * -b)); elseif (y <= 2.7e+185) 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[y, -2.55e+16], t$95$1, If[LessEqual[y, 0.00045], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e+185], 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}\;y \leq -2.55 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.00045:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+185}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\end{array}
\end{array}
if y < -2.55e16 or 4.4999999999999999e-4 < y < 2.70000000000000007e185Initial program 95.1%
Taylor expanded in y around inf 87.4%
Taylor expanded in t around 0 71.8%
if -2.55e16 < y < 4.4999999999999999e-4Initial program 95.5%
Taylor expanded in b around inf 79.3%
mul-1-neg79.3%
distribute-rgt-neg-out79.3%
Simplified79.3%
if 2.70000000000000007e185 < y Initial program 100.0%
Taylor expanded in t around inf 94.5%
mul-1-neg94.5%
distribute-lft-neg-out94.5%
*-commutative94.5%
Simplified94.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.25e-13) (not (<= b 1.22e-98))) (* x (exp (* a (- b)))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.25e-13) || !(b <= 1.22e-98)) {
tmp = x * exp((a * -b));
} 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 ((b <= (-1.25d-13)) .or. (.not. (b <= 1.22d-98))) then
tmp = x * exp((a * -b))
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 ((b <= -1.25e-13) || !(b <= 1.22e-98)) {
tmp = x * Math.exp((a * -b));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.25e-13) or not (b <= 1.22e-98): tmp = x * math.exp((a * -b)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.25e-13) || !(b <= 1.22e-98)) tmp = Float64(x * exp(Float64(a * Float64(-b)))); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -1.25e-13) || ~((b <= 1.22e-98))) tmp = x * exp((a * -b)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.25e-13], N[Not[LessEqual[b, 1.22e-98]], $MachinePrecision]], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.25 \cdot 10^{-13} \lor \neg \left(b \leq 1.22 \cdot 10^{-98}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if b < -1.24999999999999997e-13 or 1.2200000000000001e-98 < b Initial program 97.9%
Taylor expanded in b around inf 78.8%
mul-1-neg78.8%
distribute-rgt-neg-out78.8%
Simplified78.8%
if -1.24999999999999997e-13 < b < 1.2200000000000001e-98Initial program 92.6%
Taylor expanded in y around inf 90.1%
Taylor expanded in t around 0 69.5%
Final simplification74.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.7e-18) (not (<= y 1.65e-36))) (* x (pow z y)) (+ x (* b (* a (- (* 0.5 (* a (* x b))) x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.7e-18) || !(y <= 1.65e-36)) {
tmp = x * pow(z, y);
} else {
tmp = x + (b * (a * ((0.5 * (a * (x * b))) - 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.7d-18)) .or. (.not. (y <= 1.65d-36))) then
tmp = x * (z ** y)
else
tmp = x + (b * (a * ((0.5d0 * (a * (x * b))) - 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.7e-18) || !(y <= 1.65e-36)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x + (b * (a * ((0.5 * (a * (x * b))) - x)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.7e-18) or not (y <= 1.65e-36): tmp = x * math.pow(z, y) else: tmp = x + (b * (a * ((0.5 * (a * (x * b))) - x))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.7e-18) || !(y <= 1.65e-36)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x + Float64(b * Float64(a * Float64(Float64(0.5 * Float64(a * Float64(x * b))) - x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.7e-18) || ~((y <= 1.65e-36))) tmp = x * (z ^ y); else tmp = x + (b * (a * ((0.5 * (a * (x * b))) - x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.7e-18], N[Not[LessEqual[y, 1.65e-36]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x + N[(b * N[(a * N[(N[(0.5 * N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-18} \lor \neg \left(y \leq 1.65 \cdot 10^{-36}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x + b \cdot \left(a \cdot \left(0.5 \cdot \left(a \cdot \left(x \cdot b\right)\right) - x\right)\right)\\
\end{array}
\end{array}
if y < -1.70000000000000001e-18 or 1.64999999999999995e-36 < y Initial program 95.6%
Taylor expanded in y around inf 84.3%
Taylor expanded in t around 0 64.4%
if -1.70000000000000001e-18 < y < 1.64999999999999995e-36Initial program 95.7%
Taylor expanded in b around inf 81.0%
mul-1-neg81.0%
distribute-rgt-neg-out81.0%
Simplified81.0%
Taylor expanded in b around 0 51.2%
+-commutative51.2%
mul-1-neg51.2%
unsub-neg51.2%
associate-*r*54.5%
*-commutative54.5%
Simplified54.5%
Taylor expanded in a around 0 52.3%
*-commutative52.3%
Simplified52.3%
Final simplification58.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.6e-47)
(* b (- (/ x b) (* x a)))
(if (<= y 0.036)
(+ x (* b (* a (- (* 0.5 (* a (* x b))) x))))
(* x (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.6e-47) {
tmp = b * ((x / b) - (x * a));
} else if (y <= 0.036) {
tmp = x + (b * (a * ((0.5 * (a * (x * b))) - 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 <= (-2.6d-47)) then
tmp = b * ((x / b) - (x * a))
else if (y <= 0.036d0) then
tmp = x + (b * (a * ((0.5d0 * (a * (x * b))) - 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 <= -2.6e-47) {
tmp = b * ((x / b) - (x * a));
} else if (y <= 0.036) {
tmp = x + (b * (a * ((0.5 * (a * (x * b))) - x)));
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.6e-47: tmp = b * ((x / b) - (x * a)) elif y <= 0.036: tmp = x + (b * (a * ((0.5 * (a * (x * b))) - x))) else: tmp = x * (a * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.6e-47) tmp = Float64(b * Float64(Float64(x / b) - Float64(x * a))); elseif (y <= 0.036) tmp = Float64(x + Float64(b * Float64(a * Float64(Float64(0.5 * Float64(a * Float64(x * b))) - 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 <= -2.6e-47) tmp = b * ((x / b) - (x * a)); elseif (y <= 0.036) tmp = x + (b * (a * ((0.5 * (a * (x * b))) - x))); else tmp = x * (a * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.6e-47], N[(b * N[(N[(x / b), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.036], N[(x + N[(b * N[(a * N[(N[(0.5 * N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $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^{-47}:\\
\;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\
\mathbf{elif}\;y \leq 0.036:\\
\;\;\;\;x + b \cdot \left(a \cdot \left(0.5 \cdot \left(a \cdot \left(x \cdot b\right)\right) - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -2.6e-47Initial program 93.9%
Taylor expanded in b around inf 44.5%
mul-1-neg44.5%
distribute-rgt-neg-out44.5%
Simplified44.5%
Taylor expanded in a around 0 15.1%
neg-mul-115.1%
unsub-neg15.1%
Simplified15.1%
Taylor expanded in b around inf 24.9%
+-commutative24.9%
mul-1-neg24.9%
*-commutative24.9%
unsub-neg24.9%
Simplified24.9%
if -2.6e-47 < y < 0.0359999999999999973Initial program 96.3%
Taylor expanded in b around inf 80.6%
mul-1-neg80.6%
distribute-rgt-neg-out80.6%
Simplified80.6%
Taylor expanded in b around 0 49.0%
+-commutative49.0%
mul-1-neg49.0%
unsub-neg49.0%
associate-*r*51.5%
*-commutative51.5%
Simplified51.5%
Taylor expanded in a around 0 50.1%
*-commutative50.1%
Simplified50.1%
if 0.0359999999999999973 < y Initial program 96.6%
Taylor expanded in b around inf 37.7%
mul-1-neg37.7%
distribute-rgt-neg-out37.7%
Simplified37.7%
Taylor expanded in a around 0 12.8%
neg-mul-112.8%
unsub-neg12.8%
Simplified12.8%
Taylor expanded in a around inf 29.0%
mul-1-neg29.0%
*-commutative29.0%
*-commutative29.0%
distribute-rgt-neg-in29.0%
associate-*r*32.3%
Simplified32.3%
Final simplification38.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y -4e-201) (* b (- (/ x b) (* x a))) (if (<= y 0.0032) (- 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 <= -4e-201) {
tmp = b * ((x / b) - (x * a));
} else if (y <= 0.0032) {
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 <= (-4d-201)) then
tmp = b * ((x / b) - (x * a))
else if (y <= 0.0032d0) 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 <= -4e-201) {
tmp = b * ((x / b) - (x * a));
} else if (y <= 0.0032) {
tmp = x - (x * (a * b));
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -4e-201: tmp = b * ((x / b) - (x * a)) elif y <= 0.0032: 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 <= -4e-201) tmp = Float64(b * Float64(Float64(x / b) - Float64(x * a))); elseif (y <= 0.0032) 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 <= -4e-201) tmp = b * ((x / b) - (x * a)); elseif (y <= 0.0032) 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, -4e-201], N[(b * N[(N[(x / b), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.0032], 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 -4 \cdot 10^{-201}:\\
\;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\
\mathbf{elif}\;y \leq 0.0032:\\
\;\;\;\;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 < -3.99999999999999978e-201Initial program 94.6%
Taylor expanded in b around inf 52.5%
mul-1-neg52.5%
distribute-rgt-neg-out52.5%
Simplified52.5%
Taylor expanded in a around 0 21.0%
neg-mul-121.0%
unsub-neg21.0%
Simplified21.0%
Taylor expanded in b around inf 28.1%
+-commutative28.1%
mul-1-neg28.1%
*-commutative28.1%
unsub-neg28.1%
Simplified28.1%
if -3.99999999999999978e-201 < y < 0.00320000000000000015Initial program 96.1%
Taylor expanded in b around inf 82.9%
mul-1-neg82.9%
distribute-rgt-neg-out82.9%
Simplified82.9%
Taylor expanded in a around 0 48.3%
mul-1-neg48.3%
unsub-neg48.3%
associate-*r*50.2%
Simplified50.2%
if 0.00320000000000000015 < y Initial program 96.6%
Taylor expanded in b around inf 37.7%
mul-1-neg37.7%
distribute-rgt-neg-out37.7%
Simplified37.7%
Taylor expanded in a around 0 12.8%
neg-mul-112.8%
unsub-neg12.8%
Simplified12.8%
Taylor expanded in a around inf 29.0%
mul-1-neg29.0%
*-commutative29.0%
*-commutative29.0%
distribute-rgt-neg-in29.0%
associate-*r*32.3%
Simplified32.3%
Final simplification37.0%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.8e-11) (* a (- (/ x a) (* x b))) (if (<= y 0.102) (- 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 <= -1.8e-11) {
tmp = a * ((x / a) - (x * b));
} else if (y <= 0.102) {
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 <= (-1.8d-11)) then
tmp = a * ((x / a) - (x * b))
else if (y <= 0.102d0) 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 <= -1.8e-11) {
tmp = a * ((x / a) - (x * b));
} else if (y <= 0.102) {
tmp = x - (x * (a * b));
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.8e-11: tmp = a * ((x / a) - (x * b)) elif y <= 0.102: 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 <= -1.8e-11) tmp = Float64(a * Float64(Float64(x / a) - Float64(x * b))); elseif (y <= 0.102) 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 <= -1.8e-11) tmp = a * ((x / a) - (x * b)); elseif (y <= 0.102) 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, -1.8e-11], N[(a * N[(N[(x / a), $MachinePrecision] - N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.102], 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 -1.8 \cdot 10^{-11}:\\
\;\;\;\;a \cdot \left(\frac{x}{a} - x \cdot b\right)\\
\mathbf{elif}\;y \leq 0.102:\\
\;\;\;\;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 < -1.79999999999999992e-11Initial program 94.0%
Taylor expanded in b around inf 39.4%
mul-1-neg39.4%
distribute-rgt-neg-out39.4%
Simplified39.4%
Taylor expanded in a around 0 8.9%
neg-mul-18.9%
unsub-neg8.9%
Simplified8.9%
Taylor expanded in a around inf 17.3%
+-commutative17.3%
mul-1-neg17.3%
*-commutative17.3%
unsub-neg17.3%
Simplified17.3%
if -1.79999999999999992e-11 < y < 0.101999999999999993Initial program 96.0%
Taylor expanded in b around inf 80.8%
mul-1-neg80.8%
distribute-rgt-neg-out80.8%
Simplified80.8%
Taylor expanded in a around 0 45.1%
mul-1-neg45.1%
unsub-neg45.1%
associate-*r*47.9%
Simplified47.9%
if 0.101999999999999993 < y Initial program 96.6%
Taylor expanded in b around inf 37.7%
mul-1-neg37.7%
distribute-rgt-neg-out37.7%
Simplified37.7%
Taylor expanded in a around 0 12.8%
neg-mul-112.8%
unsub-neg12.8%
Simplified12.8%
Taylor expanded in a around inf 29.0%
mul-1-neg29.0%
*-commutative29.0%
*-commutative29.0%
distribute-rgt-neg-in29.0%
associate-*r*32.3%
Simplified32.3%
Final simplification36.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.12e+58) (not (<= b 5.5e-167))) (* x (* a (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.12e+58) || !(b <= 5.5e-167)) {
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 ((b <= (-1.12d+58)) .or. (.not. (b <= 5.5d-167))) 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 ((b <= -1.12e+58) || !(b <= 5.5e-167)) {
tmp = x * (a * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.12e+58) or not (b <= 5.5e-167): tmp = x * (a * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.12e+58) || !(b <= 5.5e-167)) 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 ((b <= -1.12e+58) || ~((b <= 5.5e-167))) tmp = x * (a * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.12e+58], N[Not[LessEqual[b, 5.5e-167]], $MachinePrecision]], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.12 \cdot 10^{+58} \lor \neg \left(b \leq 5.5 \cdot 10^{-167}\right):\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if b < -1.12e58 or 5.5000000000000003e-167 < b Initial program 97.8%
Taylor expanded in b around inf 72.5%
mul-1-neg72.5%
distribute-rgt-neg-out72.5%
Simplified72.5%
Taylor expanded in a around 0 28.3%
neg-mul-128.3%
unsub-neg28.3%
Simplified28.3%
Taylor expanded in a around inf 24.7%
mul-1-neg24.7%
*-commutative24.7%
*-commutative24.7%
distribute-rgt-neg-in24.7%
associate-*r*26.8%
Simplified26.8%
if -1.12e58 < b < 5.5000000000000003e-167Initial program 93.2%
Taylor expanded in b around inf 45.7%
mul-1-neg45.7%
distribute-rgt-neg-out45.7%
Simplified45.7%
Taylor expanded in a around 0 30.9%
Final simplification28.7%
(FPCore (x y z t a b) :precision binary64 (if (<= b -3.2e+153) (* a (* x (- b))) (if (<= b 3.15e-167) x (* x (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.2e+153) {
tmp = a * (x * -b);
} else if (b <= 3.15e-167) {
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 (b <= (-3.2d+153)) then
tmp = a * (x * -b)
else if (b <= 3.15d-167) 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 (b <= -3.2e+153) {
tmp = a * (x * -b);
} else if (b <= 3.15e-167) {
tmp = x;
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -3.2e+153: tmp = a * (x * -b) elif b <= 3.15e-167: tmp = x else: tmp = x * (a * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3.2e+153) tmp = Float64(a * Float64(x * Float64(-b))); elseif (b <= 3.15e-167) 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 (b <= -3.2e+153) tmp = a * (x * -b); elseif (b <= 3.15e-167) tmp = x; else tmp = x * (a * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3.2e+153], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.15e-167], x, N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.2 \cdot 10^{+153}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{elif}\;b \leq 3.15 \cdot 10^{-167}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if b < -3.2000000000000001e153Initial program 96.7%
Taylor expanded in b around inf 74.2%
mul-1-neg74.2%
distribute-rgt-neg-out74.2%
Simplified74.2%
Taylor expanded in a around 0 32.2%
neg-mul-132.2%
unsub-neg32.2%
Simplified32.2%
Taylor expanded in a around inf 35.1%
if -3.2000000000000001e153 < b < 3.1500000000000001e-167Initial program 94.1%
Taylor expanded in b around inf 50.7%
mul-1-neg50.7%
distribute-rgt-neg-out50.7%
Simplified50.7%
Taylor expanded in a around 0 28.0%
if 3.1500000000000001e-167 < b Initial program 97.7%
Taylor expanded in b around inf 69.6%
mul-1-neg69.6%
distribute-rgt-neg-out69.6%
Simplified69.6%
Taylor expanded in a around 0 29.0%
neg-mul-129.0%
unsub-neg29.0%
Simplified29.0%
Taylor expanded in a around inf 24.6%
mul-1-neg24.6%
*-commutative24.6%
*-commutative24.6%
distribute-rgt-neg-in24.6%
associate-*r*28.9%
Simplified28.9%
Final simplification29.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y 0.0005) (- 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 <= 0.0005) {
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 <= 0.0005d0) 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 <= 0.0005) {
tmp = x - (x * (a * b));
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 0.0005: 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 <= 0.0005) 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 <= 0.0005) 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, 0.0005], 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 0.0005:\\
\;\;\;\;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 < 5.0000000000000001e-4Initial program 95.3%
Taylor expanded in b around inf 66.7%
mul-1-neg66.7%
distribute-rgt-neg-out66.7%
Simplified66.7%
Taylor expanded in a around 0 33.2%
mul-1-neg33.2%
unsub-neg33.2%
associate-*r*34.6%
Simplified34.6%
if 5.0000000000000001e-4 < y Initial program 96.6%
Taylor expanded in b around inf 37.7%
mul-1-neg37.7%
distribute-rgt-neg-out37.7%
Simplified37.7%
Taylor expanded in a around 0 12.8%
neg-mul-112.8%
unsub-neg12.8%
Simplified12.8%
Taylor expanded in a around inf 29.0%
mul-1-neg29.0%
*-commutative29.0%
*-commutative29.0%
distribute-rgt-neg-in29.0%
associate-*r*32.3%
Simplified32.3%
Final simplification34.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y 0.023) (* 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 <= 0.023) {
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 <= 0.023d0) 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 <= 0.023) {
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 <= 0.023: 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 <= 0.023) 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 <= 0.023) 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, 0.023], 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 0.023:\\
\;\;\;\;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 < 0.023Initial program 95.3%
Taylor expanded in b around inf 66.7%
mul-1-neg66.7%
distribute-rgt-neg-out66.7%
Simplified66.7%
Taylor expanded in a around 0 34.6%
neg-mul-134.6%
unsub-neg34.6%
Simplified34.6%
if 0.023 < y Initial program 96.6%
Taylor expanded in b around inf 37.7%
mul-1-neg37.7%
distribute-rgt-neg-out37.7%
Simplified37.7%
Taylor expanded in a around 0 12.8%
neg-mul-112.8%
unsub-neg12.8%
Simplified12.8%
Taylor expanded in a around inf 29.0%
mul-1-neg29.0%
*-commutative29.0%
*-commutative29.0%
distribute-rgt-neg-in29.0%
associate-*r*32.3%
Simplified32.3%
Final simplification34.1%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 95.6%
Taylor expanded in b around inf 60.0%
mul-1-neg60.0%
distribute-rgt-neg-out60.0%
Simplified60.0%
Taylor expanded in a around 0 19.2%
herbie shell --seed 2024137
(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))))))