
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
(FPCore (x y z t a b) :precision binary64 (* x (exp (fma y (- (log z) t) (* a (- (log1p (- z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(y, (log(z) - t), (a * (log1p(-z) - b))));
}
function code(x, y, z, t, a, b) return Float64(x * exp(fma(y, Float64(log(z) - t), Float64(a * Float64(log1p(Float64(-z)) - b))))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}
\end{array}
Initial program 97.3%
fma-define97.7%
sub-neg97.7%
log1p-define99.9%
Simplified99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (pow (exp a) b))))
(if (<= a -5.5e+33)
t_1
(if (<= a -6.2e-221)
(* x (pow z y))
(if (<= a 1.05e+29) (* x (exp (* t (- y)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / pow(exp(a), b);
double tmp;
if (a <= -5.5e+33) {
tmp = t_1;
} else if (a <= -6.2e-221) {
tmp = x * pow(z, y);
} else if (a <= 1.05e+29) {
tmp = x * exp((t * -y));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (exp(a) ** b)
if (a <= (-5.5d+33)) then
tmp = t_1
else if (a <= (-6.2d-221)) then
tmp = x * (z ** y)
else if (a <= 1.05d+29) then
tmp = x * exp((t * -y))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / Math.pow(Math.exp(a), b);
double tmp;
if (a <= -5.5e+33) {
tmp = t_1;
} else if (a <= -6.2e-221) {
tmp = x * Math.pow(z, y);
} else if (a <= 1.05e+29) {
tmp = x * Math.exp((t * -y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / math.pow(math.exp(a), b) tmp = 0 if a <= -5.5e+33: tmp = t_1 elif a <= -6.2e-221: tmp = x * math.pow(z, y) elif a <= 1.05e+29: tmp = x * math.exp((t * -y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / (exp(a) ^ b)) tmp = 0.0 if (a <= -5.5e+33) tmp = t_1; elseif (a <= -6.2e-221) tmp = Float64(x * (z ^ y)); elseif (a <= 1.05e+29) tmp = Float64(x * exp(Float64(t * Float64(-y)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (exp(a) ^ b); tmp = 0.0; if (a <= -5.5e+33) tmp = t_1; elseif (a <= -6.2e-221) tmp = x * (z ^ y); elseif (a <= 1.05e+29) tmp = x * exp((t * -y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[Power[N[Exp[a], $MachinePrecision], b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.5e+33], t$95$1, If[LessEqual[a, -6.2e-221], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.05e+29], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{{\left(e^{a}\right)}^{b}}\\
\mathbf{if}\;a \leq -5.5 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -6.2 \cdot 10^{-221}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{+29}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.5000000000000006e33 or 1.0500000000000001e29 < a Initial program 94.4%
Taylor expanded in z around 0 94.4%
Taylor expanded in y around 0 78.9%
*-commutative78.9%
mul-1-neg78.9%
Simplified78.9%
Taylor expanded in a around inf 78.9%
exp-neg78.9%
*-commutative78.9%
exp-prod58.2%
associate-*r/58.2%
*-rgt-identity58.2%
exp-prod78.9%
*-commutative78.9%
exp-prod84.4%
Simplified84.4%
if -5.5000000000000006e33 < a < -6.1999999999999998e-221Initial program 99.8%
Taylor expanded in y around inf 87.3%
Taylor expanded in t around 0 76.2%
if -6.1999999999999998e-221 < a < 1.0500000000000001e29Initial program 99.9%
Taylor expanded in t around inf 79.9%
mul-1-neg79.9%
distribute-lft-neg-out79.9%
*-commutative79.9%
Simplified79.9%
Final simplification81.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -8.2e+33) (not (<= a 3.6e+28))) (* 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 ((a <= -8.2e+33) || !(a <= 3.6e+28)) {
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 ((a <= -8.2e+33) || !(a <= 3.6e+28)) {
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 (a <= -8.2e+33) or not (a <= 3.6e+28): 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 ((a <= -8.2e+33) || !(a <= 3.6e+28)) 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[Or[LessEqual[a, -8.2e+33], N[Not[LessEqual[a, 3.6e+28]], $MachinePrecision]], 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}\;a \leq -8.2 \cdot 10^{+33} \lor \neg \left(a \leq 3.6 \cdot 10^{+28}\right):\\
\;\;\;\;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 a < -8.1999999999999999e33 or 3.5999999999999999e28 < a Initial program 94.4%
Taylor expanded in y around 0 78.9%
sub-neg78.9%
log1p-define85.3%
Simplified85.3%
if -8.1999999999999999e33 < a < 3.5999999999999999e28Initial program 99.8%
Taylor expanded in y around inf 91.8%
Final simplification88.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.1e+35) (not (<= a 1.1e+27))) (/ x (pow (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 ((a <= -2.1e+35) || !(a <= 1.1e+27)) {
tmp = x / pow(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 ((a <= (-2.1d+35)) .or. (.not. (a <= 1.1d+27))) 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 ((a <= -2.1e+35) || !(a <= 1.1e+27)) {
tmp = x / Math.pow(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 (a <= -2.1e+35) or not (a <= 1.1e+27): tmp = x / math.pow(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 ((a <= -2.1e+35) || !(a <= 1.1e+27)) tmp = Float64(x / (exp(a) ^ b)); else tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -2.1e+35) || ~((a <= 1.1e+27))) 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[a, -2.1e+35], N[Not[LessEqual[a, 1.1e+27]], $MachinePrecision]], N[(x / N[Power[N[Exp[a], $MachinePrecision], b], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.1 \cdot 10^{+35} \lor \neg \left(a \leq 1.1 \cdot 10^{+27}\right):\\
\;\;\;\;\frac{x}{{\left(e^{a}\right)}^{b}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\end{array}
\end{array}
if a < -2.0999999999999999e35 or 1.0999999999999999e27 < a Initial program 94.4%
Taylor expanded in z around 0 94.4%
Taylor expanded in y around 0 78.9%
*-commutative78.9%
mul-1-neg78.9%
Simplified78.9%
Taylor expanded in a around inf 78.9%
exp-neg78.9%
*-commutative78.9%
exp-prod58.2%
associate-*r/58.2%
*-rgt-identity58.2%
exp-prod78.9%
*-commutative78.9%
exp-prod84.4%
Simplified84.4%
if -2.0999999999999999e35 < a < 1.0999999999999999e27Initial program 99.8%
Taylor expanded in y around inf 91.8%
Final simplification88.3%
(FPCore (x y z t a b) :precision binary64 (if (<= t -47000.0) (* x (exp (* t (- y)))) (* x (exp (- (* y (log z)) (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -47000.0) {
tmp = x * exp((t * -y));
} else {
tmp = x * exp(((y * log(z)) - (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 (t <= (-47000.0d0)) then
tmp = x * exp((t * -y))
else
tmp = x * exp(((y * log(z)) - (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 (t <= -47000.0) {
tmp = x * Math.exp((t * -y));
} else {
tmp = x * Math.exp(((y * Math.log(z)) - (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -47000.0: tmp = x * math.exp((t * -y)) else: tmp = x * math.exp(((y * math.log(z)) - (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -47000.0) tmp = Float64(x * exp(Float64(t * Float64(-y)))); else tmp = Float64(x * exp(Float64(Float64(y * log(z)) - Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -47000.0) tmp = x * exp((t * -y)); else tmp = x * exp(((y * log(z)) - (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -47000.0], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] - N[(a * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -47000:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \log z - a \cdot b}\\
\end{array}
\end{array}
if t < -47000Initial program 98.4%
Taylor expanded in t around inf 75.7%
mul-1-neg75.7%
distribute-lft-neg-out75.7%
*-commutative75.7%
Simplified75.7%
if -47000 < t Initial program 96.9%
Taylor expanded in z around 0 96.9%
Taylor expanded in t around 0 93.8%
add-log-exp85.7%
*-commutative85.7%
exp-to-pow85.7%
Applied egg-rr85.7%
Taylor expanded in a around 0 85.7%
mul-1-neg85.7%
unsub-neg85.7%
exp-to-pow85.7%
*-commutative85.7%
rem-log-exp93.8%
Simplified93.8%
Final simplification89.5%
(FPCore (x y z t a b) :precision binary64 (* x (exp (- (* y (- (log z) t)) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) - (a * 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 * 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 * b)));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) - (a * b)))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) - Float64(a * b)))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) - (a * 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 * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot b}
\end{array}
Initial program 97.3%
Taylor expanded in z around 0 97.3%
Final simplification97.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* a (- b))))))
(if (<= a -1.4e+34)
t_1
(if (<= a -2.5e-222)
(* x (pow z y))
(if (<= a 2.8e+23) (* x (exp (* t (- y)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((a * -b));
double tmp;
if (a <= -1.4e+34) {
tmp = t_1;
} else if (a <= -2.5e-222) {
tmp = x * pow(z, y);
} else if (a <= 2.8e+23) {
tmp = x * exp((t * -y));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x * exp((a * -b))
if (a <= (-1.4d+34)) then
tmp = t_1
else if (a <= (-2.5d-222)) then
tmp = x * (z ** y)
else if (a <= 2.8d+23) then
tmp = x * exp((t * -y))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.exp((a * -b));
double tmp;
if (a <= -1.4e+34) {
tmp = t_1;
} else if (a <= -2.5e-222) {
tmp = x * Math.pow(z, y);
} else if (a <= 2.8e+23) {
tmp = x * Math.exp((t * -y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((a * -b)) tmp = 0 if a <= -1.4e+34: tmp = t_1 elif a <= -2.5e-222: tmp = x * math.pow(z, y) elif a <= 2.8e+23: tmp = x * math.exp((t * -y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(a * Float64(-b)))) tmp = 0.0 if (a <= -1.4e+34) tmp = t_1; elseif (a <= -2.5e-222) tmp = Float64(x * (z ^ y)); elseif (a <= 2.8e+23) tmp = Float64(x * exp(Float64(t * Float64(-y)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp((a * -b)); tmp = 0.0; if (a <= -1.4e+34) tmp = t_1; elseif (a <= -2.5e-222) tmp = x * (z ^ y); elseif (a <= 2.8e+23) tmp = x * exp((t * -y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.4e+34], t$95$1, If[LessEqual[a, -2.5e-222], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.8e+23], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{if}\;a \leq -1.4 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.5 \cdot 10^{-222}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{+23}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.40000000000000004e34 or 2.8e23 < a Initial program 94.4%
Taylor expanded in b around inf 78.9%
associate-*r*78.9%
mul-1-neg78.9%
Simplified78.9%
if -1.40000000000000004e34 < a < -2.50000000000000004e-222Initial program 99.8%
Taylor expanded in y around inf 87.3%
Taylor expanded in t around 0 76.2%
if -2.50000000000000004e-222 < a < 2.8e23Initial program 99.9%
Taylor expanded in t around inf 79.9%
mul-1-neg79.9%
distribute-lft-neg-out79.9%
*-commutative79.9%
Simplified79.9%
Final simplification78.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -880.0) (not (<= t 9.6e-55))) (* x (exp (* t (- y)))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -880.0) || !(t <= 9.6e-55)) {
tmp = x * exp((t * -y));
} else {
tmp = x * pow(z, y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-880.0d0)) .or. (.not. (t <= 9.6d-55))) then
tmp = x * exp((t * -y))
else
tmp = x * (z ** y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -880.0) || !(t <= 9.6e-55)) {
tmp = x * Math.exp((t * -y));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -880.0) or not (t <= 9.6e-55): tmp = x * math.exp((t * -y)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -880.0) || !(t <= 9.6e-55)) tmp = Float64(x * exp(Float64(t * Float64(-y)))); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -880.0) || ~((t <= 9.6e-55))) tmp = x * exp((t * -y)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -880.0], N[Not[LessEqual[t, 9.6e-55]], $MachinePrecision]], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -880 \lor \neg \left(t \leq 9.6 \cdot 10^{-55}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -880 or 9.59999999999999966e-55 < t Initial program 98.6%
Taylor expanded in t around inf 79.6%
mul-1-neg79.6%
distribute-lft-neg-out79.6%
*-commutative79.6%
Simplified79.6%
if -880 < t < 9.59999999999999966e-55Initial program 95.6%
Taylor expanded in y around inf 65.6%
Taylor expanded in t around 0 65.7%
Final simplification73.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.5e-128) (not (<= y 4.8e+27))) (* 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 <= -2.5e-128) || !(y <= 4.8e+27)) {
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 <= (-2.5d-128)) .or. (.not. (y <= 4.8d+27))) 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 <= -2.5e-128) || !(y <= 4.8e+27)) {
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 <= -2.5e-128) or not (y <= 4.8e+27): 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 <= -2.5e-128) || !(y <= 4.8e+27)) 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 <= -2.5e-128) || ~((y <= 4.8e+27))) 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, -2.5e-128], N[Not[LessEqual[y, 4.8e+27]], $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 -2.5 \cdot 10^{-128} \lor \neg \left(y \leq 4.8 \cdot 10^{+27}\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 < -2.5000000000000001e-128 or 4.79999999999999995e27 < y Initial program 98.8%
Taylor expanded in y around inf 83.5%
Taylor expanded in t around 0 66.3%
if -2.5000000000000001e-128 < y < 4.79999999999999995e27Initial program 94.8%
Taylor expanded in z around 0 94.8%
Taylor expanded in y around 0 84.3%
*-commutative84.3%
mul-1-neg84.3%
Simplified84.3%
Taylor expanded in b around 0 58.8%
+-commutative58.8%
mul-1-neg58.8%
unsub-neg58.8%
*-commutative58.8%
*-commutative58.8%
Simplified58.8%
Taylor expanded in a around 0 59.1%
Final simplification63.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -4.9e+35) (not (<= a 7.2e-20))) (+ x (* b (* a (- (* 0.5 (* a (* x b))) x)))) (- x (* t (* x y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4.9e+35) || !(a <= 7.2e-20)) {
tmp = x + (b * (a * ((0.5 * (a * (x * b))) - x)));
} else {
tmp = x - (t * (x * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-4.9d+35)) .or. (.not. (a <= 7.2d-20))) then
tmp = x + (b * (a * ((0.5d0 * (a * (x * b))) - x)))
else
tmp = x - (t * (x * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4.9e+35) || !(a <= 7.2e-20)) {
tmp = x + (b * (a * ((0.5 * (a * (x * b))) - x)));
} else {
tmp = x - (t * (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -4.9e+35) or not (a <= 7.2e-20): tmp = x + (b * (a * ((0.5 * (a * (x * b))) - x))) else: tmp = x - (t * (x * y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -4.9e+35) || !(a <= 7.2e-20)) tmp = Float64(x + Float64(b * Float64(a * Float64(Float64(0.5 * Float64(a * Float64(x * b))) - x)))); else tmp = Float64(x - Float64(t * Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -4.9e+35) || ~((a <= 7.2e-20))) tmp = x + (b * (a * ((0.5 * (a * (x * b))) - x))); else tmp = x - (t * (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -4.9e+35], N[Not[LessEqual[a, 7.2e-20]], $MachinePrecision]], 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[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.9 \cdot 10^{+35} \lor \neg \left(a \leq 7.2 \cdot 10^{-20}\right):\\
\;\;\;\;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 - t \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if a < -4.90000000000000025e35 or 7.19999999999999948e-20 < a Initial program 94.7%
Taylor expanded in z around 0 94.7%
Taylor expanded in y around 0 76.5%
*-commutative76.5%
mul-1-neg76.5%
Simplified76.5%
Taylor expanded in b around 0 40.9%
+-commutative40.9%
mul-1-neg40.9%
unsub-neg40.9%
*-commutative40.9%
*-commutative40.9%
Simplified40.9%
Taylor expanded in a around 0 41.3%
if -4.90000000000000025e35 < a < 7.19999999999999948e-20Initial program 99.8%
Taylor expanded in y around inf 91.2%
Taylor expanded in y around 0 49.1%
associate-*r*47.7%
Simplified47.7%
Taylor expanded in t around inf 45.9%
Final simplification43.6%
(FPCore (x y z t a b) :precision binary64 (if (<= a -6.4e+35) (* b (- (/ x b) (* x a))) (if (<= a 4.2e-19) (- x (* t (* x y))) (* x (- 1.0 (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -6.4e+35) {
tmp = b * ((x / b) - (x * a));
} else if (a <= 4.2e-19) {
tmp = x - (t * (x * y));
} else {
tmp = x * (1.0 - (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 (a <= (-6.4d+35)) then
tmp = b * ((x / b) - (x * a))
else if (a <= 4.2d-19) then
tmp = x - (t * (x * y))
else
tmp = x * (1.0d0 - (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 (a <= -6.4e+35) {
tmp = b * ((x / b) - (x * a));
} else if (a <= 4.2e-19) {
tmp = x - (t * (x * y));
} else {
tmp = x * (1.0 - (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -6.4e+35: tmp = b * ((x / b) - (x * a)) elif a <= 4.2e-19: tmp = x - (t * (x * y)) else: tmp = x * (1.0 - (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -6.4e+35) tmp = Float64(b * Float64(Float64(x / b) - Float64(x * a))); elseif (a <= 4.2e-19) tmp = Float64(x - Float64(t * Float64(x * y))); else tmp = Float64(x * Float64(1.0 - Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -6.4e+35) tmp = b * ((x / b) - (x * a)); elseif (a <= 4.2e-19) tmp = x - (t * (x * y)); else tmp = x * (1.0 - (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -6.4e+35], N[(b * N[(N[(x / b), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.2e-19], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.4 \cdot 10^{+35}:\\
\;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{-19}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\end{array}
\end{array}
if a < -6.39999999999999965e35Initial program 90.3%
Taylor expanded in z around 0 90.3%
Taylor expanded in y around 0 75.7%
*-commutative75.7%
mul-1-neg75.7%
Simplified75.7%
Taylor expanded in a around 0 22.4%
neg-mul-122.4%
unsub-neg22.4%
Simplified22.4%
Taylor expanded in b around inf 23.9%
if -6.39999999999999965e35 < a < 4.1999999999999998e-19Initial program 99.8%
Taylor expanded in y around inf 91.2%
Taylor expanded in y around 0 49.1%
associate-*r*47.7%
Simplified47.7%
Taylor expanded in t around inf 45.9%
if 4.1999999999999998e-19 < a Initial program 98.6%
Taylor expanded in z around 0 98.6%
Taylor expanded in y around 0 77.1%
*-commutative77.1%
mul-1-neg77.1%
Simplified77.1%
Taylor expanded in a around 0 28.5%
neg-mul-128.5%
unsub-neg28.5%
Simplified28.5%
Final simplification36.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.6e+162) (- x (* t (* x y))) (if (<= y 1.02e+105) (* x (- 1.0 (* a b))) (* a (* x (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.6e+162) {
tmp = x - (t * (x * y));
} else if (y <= 1.02e+105) {
tmp = x * (1.0 - (a * b));
} else {
tmp = a * (x * -b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.6d+162)) then
tmp = x - (t * (x * y))
else if (y <= 1.02d+105) then
tmp = x * (1.0d0 - (a * b))
else
tmp = a * (x * -b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.6e+162) {
tmp = x - (t * (x * y));
} else if (y <= 1.02e+105) {
tmp = x * (1.0 - (a * b));
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.6e+162: tmp = x - (t * (x * y)) elif y <= 1.02e+105: tmp = x * (1.0 - (a * b)) else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.6e+162) tmp = Float64(x - Float64(t * Float64(x * y))); elseif (y <= 1.02e+105) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(a * Float64(x * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.6e+162) tmp = x - (t * (x * y)); elseif (y <= 1.02e+105) tmp = x * (1.0 - (a * b)); else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.6e+162], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.02e+105], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+162}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{+105}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -1.6000000000000001e162Initial program 100.0%
Taylor expanded in y around inf 86.4%
Taylor expanded in y around 0 43.3%
associate-*r*33.6%
Simplified33.6%
Taylor expanded in t around inf 22.8%
if -1.6000000000000001e162 < y < 1.02e105Initial program 96.6%
Taylor expanded in z around 0 96.6%
Taylor expanded in y around 0 71.7%
*-commutative71.7%
mul-1-neg71.7%
Simplified71.7%
Taylor expanded in a around 0 40.0%
neg-mul-140.0%
unsub-neg40.0%
Simplified40.0%
if 1.02e105 < y Initial program 98.1%
Taylor expanded in z around 0 98.1%
Taylor expanded in y around 0 43.5%
*-commutative43.5%
mul-1-neg43.5%
Simplified43.5%
Taylor expanded in a around 0 14.2%
neg-mul-114.2%
unsub-neg14.2%
Simplified14.2%
Taylor expanded in a around inf 30.4%
associate-*r*30.4%
neg-mul-130.4%
Simplified30.4%
Final simplification36.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4.9e-23) (not (<= y 3.95e-16))) (* a (* x (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4.9e-23) || !(y <= 3.95e-16)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-4.9d-23)) .or. (.not. (y <= 3.95d-16))) then
tmp = a * (x * -b)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4.9e-23) || !(y <= 3.95e-16)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -4.9e-23) or not (y <= 3.95e-16): tmp = a * (x * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -4.9e-23) || !(y <= 3.95e-16)) tmp = Float64(a * Float64(x * Float64(-b))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -4.9e-23) || ~((y <= 3.95e-16))) tmp = a * (x * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -4.9e-23], N[Not[LessEqual[y, 3.95e-16]], $MachinePrecision]], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.9 \cdot 10^{-23} \lor \neg \left(y \leq 3.95 \cdot 10^{-16}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.8999999999999998e-23 or 3.9500000000000001e-16 < y Initial program 98.7%
Taylor expanded in z around 0 98.7%
Taylor expanded in y around 0 45.3%
*-commutative45.3%
mul-1-neg45.3%
Simplified45.3%
Taylor expanded in a around 0 15.7%
neg-mul-115.7%
unsub-neg15.7%
Simplified15.7%
Taylor expanded in a around inf 19.3%
associate-*r*19.3%
neg-mul-119.3%
Simplified19.3%
if -4.8999999999999998e-23 < y < 3.9500000000000001e-16Initial program 95.2%
Taylor expanded in y around inf 59.2%
Taylor expanded in y around 0 44.8%
Final simplification29.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.02e+105) (* x (- 1.0 (* a b))) (* a (* x (- b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.02e+105) {
tmp = x * (1.0 - (a * b));
} else {
tmp = a * (x * -b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 1.02d+105) then
tmp = x * (1.0d0 - (a * b))
else
tmp = a * (x * -b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.02e+105) {
tmp = x * (1.0 - (a * b));
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.02e+105: tmp = x * (1.0 - (a * b)) else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.02e+105) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(a * Float64(x * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1.02e+105) tmp = x * (1.0 - (a * b)); else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.02e+105], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.02 \cdot 10^{+105}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < 1.02e105Initial program 97.0%
Taylor expanded in z around 0 97.0%
Taylor expanded in y around 0 66.6%
*-commutative66.6%
mul-1-neg66.6%
Simplified66.6%
Taylor expanded in a around 0 35.1%
neg-mul-135.1%
unsub-neg35.1%
Simplified35.1%
if 1.02e105 < y Initial program 98.1%
Taylor expanded in z around 0 98.1%
Taylor expanded in y around 0 43.5%
*-commutative43.5%
mul-1-neg43.5%
Simplified43.5%
Taylor expanded in a around 0 14.2%
neg-mul-114.2%
unsub-neg14.2%
Simplified14.2%
Taylor expanded in a around inf 30.4%
associate-*r*30.4%
neg-mul-130.4%
Simplified30.4%
Final simplification34.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 97.3%
Taylor expanded in y around inf 73.2%
Taylor expanded in y around 0 20.6%
herbie shell --seed 2024102
(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))))))