
(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 16 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.2%
fma-define95.6%
sub-neg95.6%
log1p-define99.2%
Simplified99.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.25e+30) (not (<= t 3.45e+205))) (* x (exp (* t (- y)))) (* x (exp (- (* y (log z)) (* a (+ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.25e+30) || !(t <= 3.45e+205)) {
tmp = x * exp((t * -y));
} else {
tmp = x * exp(((y * log(z)) - (a * (z + b))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-2.25d+30)) .or. (.not. (t <= 3.45d+205))) then
tmp = x * exp((t * -y))
else
tmp = x * exp(((y * log(z)) - (a * (z + b))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.25e+30) || !(t <= 3.45e+205)) {
tmp = x * Math.exp((t * -y));
} else {
tmp = x * Math.exp(((y * Math.log(z)) - (a * (z + b))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.25e+30) or not (t <= 3.45e+205): tmp = x * math.exp((t * -y)) else: tmp = x * math.exp(((y * math.log(z)) - (a * (z + b)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.25e+30) || !(t <= 3.45e+205)) tmp = Float64(x * exp(Float64(t * Float64(-y)))); else tmp = Float64(x * exp(Float64(Float64(y * log(z)) - Float64(a * Float64(z + b))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -2.25e+30) || ~((t <= 3.45e+205))) tmp = x * exp((t * -y)); else tmp = x * exp(((y * log(z)) - (a * (z + b)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.25e+30], N[Not[LessEqual[t, 3.45e+205]], $MachinePrecision]], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.25 \cdot 10^{+30} \lor \neg \left(t \leq 3.45 \cdot 10^{+205}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \log z - a \cdot \left(z + b\right)}\\
\end{array}
\end{array}
if t < -2.24999999999999997e30 or 3.4499999999999999e205 < t Initial program 98.6%
Taylor expanded in t around inf 86.1%
mul-1-neg86.1%
distribute-lft-neg-out86.1%
*-commutative86.1%
Simplified86.1%
if -2.24999999999999997e30 < t < 3.4499999999999999e205Initial program 94.0%
Taylor expanded in z around 0 98.9%
mul-1-neg98.9%
Simplified98.9%
Taylor expanded in t around 0 98.1%
+-commutative98.1%
mul-1-neg98.1%
unsub-neg98.1%
Simplified98.1%
Final simplification94.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5.8e-42) (not (<= y 1.6e+19))) (* x (pow (/ z (exp t)) y)) (* x (exp (* a (- (log1p (- z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5.8e-42) || !(y <= 1.6e+19)) {
tmp = x * pow((z / exp(t)), y);
} else {
tmp = x * exp((a * (log1p(-z) - b)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5.8e-42) || !(y <= 1.6e+19)) {
tmp = x * Math.pow((z / Math.exp(t)), y);
} else {
tmp = x * Math.exp((a * (Math.log1p(-z) - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -5.8e-42) or not (y <= 1.6e+19): tmp = x * math.pow((z / math.exp(t)), y) else: tmp = x * math.exp((a * (math.log1p(-z) - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -5.8e-42) || !(y <= 1.6e+19)) tmp = Float64(x * (Float64(z / exp(t)) ^ y)); else tmp = Float64(x * exp(Float64(a * Float64(log1p(Float64(-z)) - b)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5.8e-42], N[Not[LessEqual[y, 1.6e+19]], $MachinePrecision]], N[(x * N[Power[N[(z / N[Exp[t], $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{-42} \lor \neg \left(y \leq 1.6 \cdot 10^{+19}\right):\\
\;\;\;\;x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}\\
\end{array}
\end{array}
if y < -5.8000000000000006e-42 or 1.6e19 < y Initial program 97.8%
Taylor expanded in a around 0 90.6%
*-commutative90.6%
exp-prod90.6%
exp-diff90.6%
rem-exp-log90.6%
Simplified90.6%
if -5.8000000000000006e-42 < y < 1.6e19Initial program 92.4%
Taylor expanded in y around 0 81.7%
sub-neg81.7%
log1p-define89.1%
Simplified89.1%
Final simplification89.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1e-46) (not (<= y 4.7e-54))) (* x (pow (/ z (exp t)) y)) (* x (pow E (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1e-46) || !(y <= 4.7e-54)) {
tmp = x * pow((z / exp(t)), y);
} else {
tmp = x * pow(((double) M_E), (a * -b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1e-46) || !(y <= 4.7e-54)) {
tmp = x * Math.pow((z / Math.exp(t)), y);
} else {
tmp = x * Math.pow(Math.E, (a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1e-46) or not (y <= 4.7e-54): tmp = x * math.pow((z / math.exp(t)), y) else: tmp = x * math.pow(math.e, (a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1e-46) || !(y <= 4.7e-54)) tmp = Float64(x * (Float64(z / exp(t)) ^ y)); else tmp = Float64(x * (exp(1) ^ Float64(a * Float64(-b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1e-46) || ~((y <= 4.7e-54))) tmp = x * ((z / exp(t)) ^ y); else tmp = x * (2.71828182845904523536 ^ (a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1e-46], N[Not[LessEqual[y, 4.7e-54]], $MachinePrecision]], N[(x * N[Power[N[(z / N[Exp[t], $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[E, N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-46} \lor \neg \left(y \leq 4.7 \cdot 10^{-54}\right):\\
\;\;\;\;x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {e}^{\left(a \cdot \left(-b\right)\right)}\\
\end{array}
\end{array}
if y < -1.00000000000000002e-46 or 4.7e-54 < y Initial program 96.0%
Taylor expanded in a around 0 87.8%
*-commutative87.8%
exp-prod87.8%
exp-diff87.8%
rem-exp-log87.8%
Simplified87.8%
if -1.00000000000000002e-46 < y < 4.7e-54Initial program 94.0%
Taylor expanded in y around 0 86.0%
sub-neg86.0%
log1p-define91.9%
Simplified91.9%
*-un-lft-identity91.9%
exp-prod91.9%
add-sqr-sqrt0.0%
sqrt-unprod83.0%
sqr-neg83.0%
sqrt-unprod83.0%
add-sqr-sqrt83.0%
Applied egg-rr83.0%
exp-1-e83.0%
Simplified83.0%
Taylor expanded in z around 0 83.0%
+-commutative83.0%
mul-1-neg83.0%
distribute-rgt-neg-out83.0%
distribute-lft-out83.0%
Simplified83.0%
Taylor expanded in z around 0 85.0%
associate-*r*85.0%
neg-mul-185.0%
Simplified85.0%
Final simplification86.7%
(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 95.2%
Taylor expanded in z around 0 98.8%
mul-1-neg98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -9.5e+14) (not (<= y 1.6e+19))) (* x (pow z y)) (* x (pow E (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -9.5e+14) || !(y <= 1.6e+19)) {
tmp = x * pow(z, y);
} else {
tmp = x * pow(((double) M_E), (a * -b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -9.5e+14) || !(y <= 1.6e+19)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * Math.pow(Math.E, (a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -9.5e+14) or not (y <= 1.6e+19): tmp = x * math.pow(z, y) else: tmp = x * math.pow(math.e, (a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -9.5e+14) || !(y <= 1.6e+19)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * (exp(1) ^ Float64(a * Float64(-b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -9.5e+14) || ~((y <= 1.6e+19))) tmp = x * (z ^ y); else tmp = x * (2.71828182845904523536 ^ (a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -9.5e+14], N[Not[LessEqual[y, 1.6e+19]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[E, N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+14} \lor \neg \left(y \leq 1.6 \cdot 10^{+19}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {e}^{\left(a \cdot \left(-b\right)\right)}\\
\end{array}
\end{array}
if y < -9.5e14 or 1.6e19 < y Initial program 97.6%
Taylor expanded in a around 0 92.0%
*-commutative92.0%
exp-prod92.0%
exp-diff92.0%
rem-exp-log92.0%
Simplified92.0%
Taylor expanded in t around 0 74.4%
if -9.5e14 < y < 1.6e19Initial program 93.1%
Taylor expanded in y around 0 78.7%
sub-neg78.7%
log1p-define85.4%
Simplified85.4%
*-un-lft-identity85.4%
exp-prod85.4%
add-sqr-sqrt0.0%
sqrt-unprod76.5%
sqr-neg76.5%
sqrt-unprod76.5%
add-sqr-sqrt76.5%
Applied egg-rr76.5%
exp-1-e76.5%
Simplified76.5%
Taylor expanded in z around 0 76.5%
+-commutative76.5%
mul-1-neg76.5%
distribute-rgt-neg-out76.5%
distribute-lft-out76.5%
Simplified76.5%
Taylor expanded in z around 0 78.0%
associate-*r*78.0%
neg-mul-178.0%
Simplified78.0%
Final simplification76.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -8.2e+14) (not (<= y 2.8e+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 <= -8.2e+14) || !(y <= 2.8e+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 <= (-8.2d+14)) .or. (.not. (y <= 2.8d+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 <= -8.2e+14) || !(y <= 2.8e+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 <= -8.2e+14) or not (y <= 2.8e+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 <= -8.2e+14) || !(y <= 2.8e+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 <= -8.2e+14) || ~((y <= 2.8e+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, -8.2e+14], N[Not[LessEqual[y, 2.8e+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 -8.2 \cdot 10^{+14} \lor \neg \left(y \leq 2.8 \cdot 10^{+19}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -8.2e14 or 2.8e19 < y Initial program 97.6%
Taylor expanded in a around 0 92.0%
*-commutative92.0%
exp-prod92.0%
exp-diff92.0%
rem-exp-log92.0%
Simplified92.0%
Taylor expanded in t around 0 74.4%
if -8.2e14 < y < 2.8e19Initial program 93.1%
Taylor expanded in b around inf 78.0%
mul-1-neg78.0%
distribute-rgt-neg-out78.0%
Simplified78.0%
Final simplification76.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.6e-53) (not (<= y 8.3e-47))) (* x (pow z y)) (* x (+ 1.0 (* a (- z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.6e-53) || !(y <= 8.3e-47)) {
tmp = x * pow(z, y);
} else {
tmp = x * (1.0 + (a * (z - b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.6d-53)) .or. (.not. (y <= 8.3d-47))) then
tmp = x * (z ** y)
else
tmp = x * (1.0d0 + (a * (z - b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.6e-53) || !(y <= 8.3e-47)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * (1.0 + (a * (z - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.6e-53) or not (y <= 8.3e-47): tmp = x * math.pow(z, y) else: tmp = x * (1.0 + (a * (z - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.6e-53) || !(y <= 8.3e-47)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * Float64(1.0 + Float64(a * Float64(z - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.6e-53) || ~((y <= 8.3e-47))) tmp = x * (z ^ y); else tmp = x * (1.0 + (a * (z - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.6e-53], N[Not[LessEqual[y, 8.3e-47]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 + N[(a * N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{-53} \lor \neg \left(y \leq 8.3 \cdot 10^{-47}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + a \cdot \left(z - b\right)\right)\\
\end{array}
\end{array}
if y < -2.59999999999999996e-53 or 8.2999999999999997e-47 < y Initial program 95.4%
Taylor expanded in a around 0 86.7%
*-commutative86.7%
exp-prod86.1%
exp-diff86.1%
rem-exp-log86.1%
Simplified86.1%
Taylor expanded in t around 0 66.5%
if -2.59999999999999996e-53 < y < 8.2999999999999997e-47Initial program 95.0%
Taylor expanded in y around 0 85.9%
sub-neg85.9%
log1p-define90.9%
Simplified90.9%
*-un-lft-identity90.9%
exp-prod90.9%
add-sqr-sqrt0.0%
sqrt-unprod83.0%
sqr-neg83.0%
sqrt-unprod83.0%
add-sqr-sqrt83.0%
Applied egg-rr83.0%
exp-1-e83.0%
Simplified83.0%
Taylor expanded in z around 0 83.0%
+-commutative83.0%
mul-1-neg83.0%
distribute-rgt-neg-out83.0%
distribute-lft-out83.0%
Simplified83.0%
Taylor expanded in a around 0 48.3%
sub-neg48.3%
mul-1-neg48.3%
log-E48.3%
mul-1-neg48.3%
sub-neg48.3%
Simplified48.3%
Final simplification59.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y -7e-64) (* a (- (/ x a) (* x z))) (if (<= y 7.4e+22) (* x (+ 1.0 (* a (- z b)))) (* x (* z (- a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7e-64) {
tmp = a * ((x / a) - (x * z));
} else if (y <= 7.4e+22) {
tmp = x * (1.0 + (a * (z - b)));
} else {
tmp = x * (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 <= (-7d-64)) then
tmp = a * ((x / a) - (x * z))
else if (y <= 7.4d+22) then
tmp = x * (1.0d0 + (a * (z - b)))
else
tmp = x * (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 <= -7e-64) {
tmp = a * ((x / a) - (x * z));
} else if (y <= 7.4e+22) {
tmp = x * (1.0 + (a * (z - b)));
} else {
tmp = x * (z * -a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -7e-64: tmp = a * ((x / a) - (x * z)) elif y <= 7.4e+22: tmp = x * (1.0 + (a * (z - b))) else: tmp = x * (z * -a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -7e-64) tmp = Float64(a * Float64(Float64(x / a) - Float64(x * z))); elseif (y <= 7.4e+22) tmp = Float64(x * Float64(1.0 + Float64(a * Float64(z - b)))); else tmp = Float64(x * Float64(z * Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -7e-64) tmp = a * ((x / a) - (x * z)); elseif (y <= 7.4e+22) tmp = x * (1.0 + (a * (z - b))); else tmp = x * (z * -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -7e-64], N[(a * N[(N[(x / a), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.4e+22], N[(x * N[(1.0 + N[(a * N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-64}:\\
\;\;\;\;a \cdot \left(\frac{x}{a} - x \cdot z\right)\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{+22}:\\
\;\;\;\;x \cdot \left(1 + a \cdot \left(z - b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\end{array}
\end{array}
if y < -7.0000000000000006e-64Initial program 94.2%
Taylor expanded in z around 0 96.5%
mul-1-neg96.5%
Simplified96.5%
Taylor expanded in z around inf 21.6%
associate-*r*21.6%
mul-1-neg21.6%
Simplified21.6%
Taylor expanded in a around 0 10.3%
mul-1-neg10.3%
unsub-neg10.3%
*-commutative10.3%
Simplified10.3%
Taylor expanded in a around inf 20.2%
neg-mul-120.2%
+-commutative20.2%
sub-neg20.2%
Simplified20.2%
if -7.0000000000000006e-64 < y < 7.3999999999999996e22Initial program 93.7%
Taylor expanded in y around 0 82.7%
sub-neg82.7%
log1p-define88.7%
Simplified88.7%
*-un-lft-identity88.7%
exp-prod88.7%
add-sqr-sqrt0.0%
sqrt-unprod80.1%
sqr-neg80.1%
sqrt-unprod80.1%
add-sqr-sqrt80.1%
Applied egg-rr80.1%
exp-1-e80.1%
Simplified80.1%
Taylor expanded in z around 0 80.1%
+-commutative80.1%
mul-1-neg80.1%
distribute-rgt-neg-out80.1%
distribute-lft-out80.1%
Simplified80.1%
Taylor expanded in a around 0 47.4%
sub-neg47.4%
mul-1-neg47.4%
log-E47.4%
mul-1-neg47.4%
sub-neg47.4%
Simplified47.4%
if 7.3999999999999996e22 < y Initial program 100.0%
Taylor expanded in z around 0 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 16.0%
associate-*r*16.0%
mul-1-neg16.0%
Simplified16.0%
Taylor expanded in a around 0 3.9%
mul-1-neg3.9%
unsub-neg3.9%
*-commutative3.9%
Simplified3.9%
Taylor expanded in z around inf 32.3%
mul-1-neg32.3%
*-commutative32.3%
distribute-rgt-neg-in32.3%
associate-*r*33.2%
*-commutative33.2%
distribute-lft-neg-in33.2%
distribute-rgt-neg-in33.2%
Simplified33.2%
Final simplification35.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y -7.2e-237) (* z (- (/ x z) (* x a))) (if (<= y 5e-8) (- x (* z (* x a))) (* a (* z (- x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7.2e-237) {
tmp = z * ((x / z) - (x * a));
} else if (y <= 5e-8) {
tmp = x - (z * (x * a));
} else {
tmp = a * (z * -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 <= (-7.2d-237)) then
tmp = z * ((x / z) - (x * a))
else if (y <= 5d-8) then
tmp = x - (z * (x * a))
else
tmp = a * (z * -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 <= -7.2e-237) {
tmp = z * ((x / z) - (x * a));
} else if (y <= 5e-8) {
tmp = x - (z * (x * a));
} else {
tmp = a * (z * -x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -7.2e-237: tmp = z * ((x / z) - (x * a)) elif y <= 5e-8: tmp = x - (z * (x * a)) else: tmp = a * (z * -x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -7.2e-237) tmp = Float64(z * Float64(Float64(x / z) - Float64(x * a))); elseif (y <= 5e-8) tmp = Float64(x - Float64(z * Float64(x * a))); else tmp = Float64(a * Float64(z * Float64(-x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -7.2e-237) tmp = z * ((x / z) - (x * a)); elseif (y <= 5e-8) tmp = x - (z * (x * a)); else tmp = a * (z * -x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -7.2e-237], N[(z * N[(N[(x / z), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e-8], N[(x - N[(z * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(z * (-x)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{-237}:\\
\;\;\;\;z \cdot \left(\frac{x}{z} - x \cdot a\right)\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-8}:\\
\;\;\;\;x - z \cdot \left(x \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\
\end{array}
\end{array}
if y < -7.19999999999999993e-237Initial program 95.0%
Taylor expanded in z around 0 97.5%
mul-1-neg97.5%
Simplified97.5%
Taylor expanded in z around inf 28.9%
associate-*r*28.9%
mul-1-neg28.9%
Simplified28.9%
Taylor expanded in a around 0 16.0%
mul-1-neg16.0%
unsub-neg16.0%
*-commutative16.0%
Simplified16.0%
Taylor expanded in z around inf 24.3%
+-commutative24.3%
mul-1-neg24.3%
sub-neg24.3%
*-commutative24.3%
Simplified24.3%
if -7.19999999999999993e-237 < y < 4.9999999999999998e-8Initial program 92.1%
Taylor expanded in z around 0 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 60.2%
associate-*r*60.2%
mul-1-neg60.2%
Simplified60.2%
Taylor expanded in a around 0 40.3%
mul-1-neg40.3%
unsub-neg40.3%
*-commutative40.3%
Simplified40.3%
distribute-rgt-out--40.3%
*-un-lft-identity40.3%
associate-*l*41.5%
Applied egg-rr41.5%
if 4.9999999999999998e-8 < y Initial program 100.0%
Taylor expanded in z around 0 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 17.3%
associate-*r*17.3%
mul-1-neg17.3%
Simplified17.3%
Taylor expanded in a around 0 4.0%
mul-1-neg4.0%
unsub-neg4.0%
*-commutative4.0%
Simplified4.0%
Taylor expanded in z around inf 33.0%
mul-1-neg33.0%
distribute-rgt-neg-out33.0%
distribute-rgt-neg-in33.0%
Simplified33.0%
Final simplification31.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y -9.2e-26) (* a (- (/ x a) (* x z))) (if (<= y 4.8e-8) (- x (* z (* x a))) (* a (* z (- x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -9.2e-26) {
tmp = a * ((x / a) - (x * z));
} else if (y <= 4.8e-8) {
tmp = x - (z * (x * a));
} else {
tmp = a * (z * -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 <= (-9.2d-26)) then
tmp = a * ((x / a) - (x * z))
else if (y <= 4.8d-8) then
tmp = x - (z * (x * a))
else
tmp = a * (z * -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 <= -9.2e-26) {
tmp = a * ((x / a) - (x * z));
} else if (y <= 4.8e-8) {
tmp = x - (z * (x * a));
} else {
tmp = a * (z * -x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -9.2e-26: tmp = a * ((x / a) - (x * z)) elif y <= 4.8e-8: tmp = x - (z * (x * a)) else: tmp = a * (z * -x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -9.2e-26) tmp = Float64(a * Float64(Float64(x / a) - Float64(x * z))); elseif (y <= 4.8e-8) tmp = Float64(x - Float64(z * Float64(x * a))); else tmp = Float64(a * Float64(z * Float64(-x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -9.2e-26) tmp = a * ((x / a) - (x * z)); elseif (y <= 4.8e-8) tmp = x - (z * (x * a)); else tmp = a * (z * -x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -9.2e-26], N[(a * N[(N[(x / a), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e-8], N[(x - N[(z * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(z * (-x)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{-26}:\\
\;\;\;\;a \cdot \left(\frac{x}{a} - x \cdot z\right)\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-8}:\\
\;\;\;\;x - z \cdot \left(x \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\
\end{array}
\end{array}
if y < -9.20000000000000035e-26Initial program 96.2%
Taylor expanded in z around 0 96.2%
mul-1-neg96.2%
Simplified96.2%
Taylor expanded in z around inf 16.0%
associate-*r*16.0%
mul-1-neg16.0%
Simplified16.0%
Taylor expanded in a around 0 6.1%
mul-1-neg6.1%
unsub-neg6.1%
*-commutative6.1%
Simplified6.1%
Taylor expanded in a around inf 17.0%
neg-mul-117.0%
+-commutative17.0%
sub-neg17.0%
Simplified17.0%
if -9.20000000000000035e-26 < y < 4.79999999999999997e-8Initial program 92.4%
Taylor expanded in z around 0 99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 57.3%
associate-*r*57.3%
mul-1-neg57.3%
Simplified57.3%
Taylor expanded in a around 0 38.0%
mul-1-neg38.0%
unsub-neg38.0%
*-commutative38.0%
Simplified38.0%
distribute-rgt-out--38.0%
*-un-lft-identity38.0%
associate-*l*39.5%
Applied egg-rr39.5%
if 4.79999999999999997e-8 < y Initial program 100.0%
Taylor expanded in z around 0 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 17.3%
associate-*r*17.3%
mul-1-neg17.3%
Simplified17.3%
Taylor expanded in a around 0 4.0%
mul-1-neg4.0%
unsub-neg4.0%
*-commutative4.0%
Simplified4.0%
Taylor expanded in z around inf 33.0%
mul-1-neg33.0%
distribute-rgt-neg-out33.0%
distribute-rgt-neg-in33.0%
Simplified33.0%
Final simplification31.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -9.6e-24) (not (<= y 2.8e-7))) (* a (* z (- x))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -9.6e-24) || !(y <= 2.8e-7)) {
tmp = a * (z * -x);
} 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 <= (-9.6d-24)) .or. (.not. (y <= 2.8d-7))) then
tmp = a * (z * -x)
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 <= -9.6e-24) || !(y <= 2.8e-7)) {
tmp = a * (z * -x);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -9.6e-24) or not (y <= 2.8e-7): tmp = a * (z * -x) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -9.6e-24) || !(y <= 2.8e-7)) tmp = Float64(a * Float64(z * Float64(-x))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -9.6e-24) || ~((y <= 2.8e-7))) tmp = a * (z * -x); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -9.6e-24], N[Not[LessEqual[y, 2.8e-7]], $MachinePrecision]], N[(a * N[(z * (-x)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.6 \cdot 10^{-24} \lor \neg \left(y \leq 2.8 \cdot 10^{-7}\right):\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -9.5999999999999993e-24 or 2.80000000000000019e-7 < y Initial program 97.8%
Taylor expanded in z around 0 97.8%
mul-1-neg97.8%
Simplified97.8%
Taylor expanded in z around inf 16.6%
associate-*r*16.6%
mul-1-neg16.6%
Simplified16.6%
Taylor expanded in a around 0 5.2%
mul-1-neg5.2%
unsub-neg5.2%
*-commutative5.2%
Simplified5.2%
Taylor expanded in z around inf 19.7%
mul-1-neg19.7%
distribute-rgt-neg-out19.7%
distribute-rgt-neg-in19.7%
Simplified19.7%
if -9.5999999999999993e-24 < y < 2.80000000000000019e-7Initial program 92.5%
Taylor expanded in y around 0 80.5%
sub-neg80.5%
log1p-define87.7%
Simplified87.7%
Taylor expanded in a around 0 35.6%
Final simplification27.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.85e-6) (- x (* z (* x a))) (* a (* z (- x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.85e-6) {
tmp = x - (z * (x * a));
} else {
tmp = a * (z * -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.85d-6) then
tmp = x - (z * (x * a))
else
tmp = a * (z * -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.85e-6) {
tmp = x - (z * (x * a));
} else {
tmp = a * (z * -x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.85e-6: tmp = x - (z * (x * a)) else: tmp = a * (z * -x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.85e-6) tmp = Float64(x - Float64(z * Float64(x * a))); else tmp = Float64(a * Float64(z * Float64(-x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1.85e-6) tmp = x - (z * (x * a)); else tmp = a * (z * -x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.85e-6], N[(x - N[(z * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(z * (-x)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.85 \cdot 10^{-6}:\\
\;\;\;\;x - z \cdot \left(x \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\
\end{array}
\end{array}
if y < 1.8500000000000001e-6Initial program 93.9%
Taylor expanded in z around 0 98.5%
mul-1-neg98.5%
Simplified98.5%
Taylor expanded in z around inf 41.1%
associate-*r*41.1%
mul-1-neg41.1%
Simplified41.1%
Taylor expanded in a around 0 25.5%
mul-1-neg25.5%
unsub-neg25.5%
*-commutative25.5%
Simplified25.5%
distribute-rgt-out--25.5%
*-un-lft-identity25.5%
associate-*l*26.8%
Applied egg-rr26.8%
if 1.8500000000000001e-6 < y Initial program 100.0%
Taylor expanded in z around 0 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 17.3%
associate-*r*17.3%
mul-1-neg17.3%
Simplified17.3%
Taylor expanded in a around 0 4.0%
mul-1-neg4.0%
unsub-neg4.0%
*-commutative4.0%
Simplified4.0%
Taylor expanded in z around inf 33.0%
mul-1-neg33.0%
distribute-rgt-neg-out33.0%
distribute-rgt-neg-in33.0%
Simplified33.0%
Final simplification28.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y 5.5e-8) (- x (* a (* x z))) (* a (* z (- x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 5.5e-8) {
tmp = x - (a * (x * z));
} else {
tmp = a * (z * -x);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 5.5d-8) then
tmp = x - (a * (x * z))
else
tmp = a * (z * -x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 5.5e-8) {
tmp = x - (a * (x * z));
} else {
tmp = a * (z * -x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 5.5e-8: tmp = x - (a * (x * z)) else: tmp = a * (z * -x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 5.5e-8) tmp = Float64(x - Float64(a * Float64(x * z))); else tmp = Float64(a * Float64(z * Float64(-x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 5.5e-8) tmp = x - (a * (x * z)); else tmp = a * (z * -x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 5.5e-8], N[(x - N[(a * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(z * (-x)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.5 \cdot 10^{-8}:\\
\;\;\;\;x - a \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\
\end{array}
\end{array}
if y < 5.5000000000000003e-8Initial program 93.9%
Taylor expanded in z around 0 98.5%
mul-1-neg98.5%
Simplified98.5%
Taylor expanded in z around inf 41.1%
associate-*r*41.1%
mul-1-neg41.1%
Simplified41.1%
Taylor expanded in a around 0 25.5%
mul-1-neg25.5%
unsub-neg25.5%
*-commutative25.5%
Simplified25.5%
if 5.5000000000000003e-8 < y Initial program 100.0%
Taylor expanded in z around 0 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 17.3%
associate-*r*17.3%
mul-1-neg17.3%
Simplified17.3%
Taylor expanded in a around 0 4.0%
mul-1-neg4.0%
unsub-neg4.0%
*-commutative4.0%
Simplified4.0%
Taylor expanded in z around inf 33.0%
mul-1-neg33.0%
distribute-rgt-neg-out33.0%
distribute-rgt-neg-in33.0%
Simplified33.0%
Final simplification27.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.55e-7) (* x (- 1.0 (* z a))) (* a (* z (- x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.55e-7) {
tmp = x * (1.0 - (z * a));
} else {
tmp = a * (z * -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.55d-7) then
tmp = x * (1.0d0 - (z * a))
else
tmp = a * (z * -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.55e-7) {
tmp = x * (1.0 - (z * a));
} else {
tmp = a * (z * -x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.55e-7: tmp = x * (1.0 - (z * a)) else: tmp = a * (z * -x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.55e-7) tmp = Float64(x * Float64(1.0 - Float64(z * a))); else tmp = Float64(a * Float64(z * Float64(-x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1.55e-7) tmp = x * (1.0 - (z * a)); else tmp = a * (z * -x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.55e-7], N[(x * N[(1.0 - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(z * (-x)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.55 \cdot 10^{-7}:\\
\;\;\;\;x \cdot \left(1 - z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\
\end{array}
\end{array}
if y < 1.55e-7Initial program 93.9%
Taylor expanded in z around 0 98.5%
mul-1-neg98.5%
Simplified98.5%
Taylor expanded in z around inf 41.1%
associate-*r*41.1%
mul-1-neg41.1%
Simplified41.1%
Taylor expanded in a around 0 25.5%
mul-1-neg25.5%
unsub-neg25.5%
*-commutative25.5%
Simplified25.5%
if 1.55e-7 < y Initial program 100.0%
Taylor expanded in z around 0 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 17.3%
associate-*r*17.3%
mul-1-neg17.3%
Simplified17.3%
Taylor expanded in a around 0 4.0%
mul-1-neg4.0%
unsub-neg4.0%
*-commutative4.0%
Simplified4.0%
Taylor expanded in z around inf 33.0%
mul-1-neg33.0%
distribute-rgt-neg-out33.0%
distribute-rgt-neg-in33.0%
Simplified33.0%
Final simplification27.2%
(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.2%
Taylor expanded in y around 0 56.4%
sub-neg56.4%
log1p-define60.6%
Simplified60.6%
Taylor expanded in a around 0 19.0%
herbie shell --seed 2024088
(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))))))