
(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 96.0%
fma-define96.8%
sub-neg96.8%
log1p-define99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* t (- y))))))
(if (<= t -8.8e+248)
t_1
(if (<= t -7.5e+223)
(* x (exp (* a (- (+ z b)))))
(if (<= t -640.0)
t_1
(if (<= t 3.8e+87)
(* x (exp (- (* y (log z)) (* a b))))
(* x (exp (* y (- (log z) t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((t * -y));
double tmp;
if (t <= -8.8e+248) {
tmp = t_1;
} else if (t <= -7.5e+223) {
tmp = x * exp((a * -(z + b)));
} else if (t <= -640.0) {
tmp = t_1;
} else if (t <= 3.8e+87) {
tmp = x * exp(((y * log(z)) - (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) :: t_1
real(8) :: tmp
t_1 = x * exp((t * -y))
if (t <= (-8.8d+248)) then
tmp = t_1
else if (t <= (-7.5d+223)) then
tmp = x * exp((a * -(z + b)))
else if (t <= (-640.0d0)) then
tmp = t_1
else if (t <= 3.8d+87) then
tmp = x * exp(((y * log(z)) - (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 t_1 = x * Math.exp((t * -y));
double tmp;
if (t <= -8.8e+248) {
tmp = t_1;
} else if (t <= -7.5e+223) {
tmp = x * Math.exp((a * -(z + b)));
} else if (t <= -640.0) {
tmp = t_1;
} else if (t <= 3.8e+87) {
tmp = x * Math.exp(((y * Math.log(z)) - (a * b)));
} else {
tmp = x * Math.exp((y * (Math.log(z) - t)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((t * -y)) tmp = 0 if t <= -8.8e+248: tmp = t_1 elif t <= -7.5e+223: tmp = x * math.exp((a * -(z + b))) elif t <= -640.0: tmp = t_1 elif t <= 3.8e+87: tmp = x * math.exp(((y * math.log(z)) - (a * b))) else: tmp = x * math.exp((y * (math.log(z) - t))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(t * Float64(-y)))) tmp = 0.0 if (t <= -8.8e+248) tmp = t_1; elseif (t <= -7.5e+223) tmp = Float64(x * exp(Float64(a * Float64(-Float64(z + b))))); elseif (t <= -640.0) tmp = t_1; elseif (t <= 3.8e+87) tmp = Float64(x * exp(Float64(Float64(y * log(z)) - Float64(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) t_1 = x * exp((t * -y)); tmp = 0.0; if (t <= -8.8e+248) tmp = t_1; elseif (t <= -7.5e+223) tmp = x * exp((a * -(z + b))); elseif (t <= -640.0) tmp = t_1; elseif (t <= 3.8e+87) tmp = x * exp(((y * log(z)) - (a * b))); else tmp = x * exp((y * (log(z) - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8.8e+248], t$95$1, If[LessEqual[t, -7.5e+223], N[(x * N[Exp[N[(a * (-N[(z + b), $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -640.0], t$95$1, If[LessEqual[t, 3.8e+87], N[(x * N[Exp[N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] - N[(a * 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}
t_1 := x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{if}\;t \leq -8.8 \cdot 10^{+248}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -7.5 \cdot 10^{+223}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-\left(z + b\right)\right)}\\
\mathbf{elif}\;t \leq -640:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+87}:\\
\;\;\;\;x \cdot e^{y \cdot \log z - a \cdot b}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\end{array}
\end{array}
if t < -8.7999999999999997e248 or -7.5000000000000003e223 < t < -640Initial program 96.3%
Taylor expanded in t around inf 89.1%
mul-1-neg89.1%
distribute-lft-neg-out89.1%
*-commutative89.1%
Simplified89.1%
if -8.7999999999999997e248 < t < -7.5000000000000003e223Initial program 100.0%
Taylor expanded in y around 0 78.2%
sub-neg78.2%
mul-1-neg78.2%
log1p-define90.1%
mul-1-neg90.1%
Simplified90.1%
Taylor expanded in z around 0 90.1%
mul-1-neg90.1%
unsub-neg90.1%
mul-1-neg90.1%
Simplified90.1%
if -640 < t < 3.80000000000000011e87Initial program 96.2%
Taylor expanded in z around 0 96.2%
Taylor expanded in t around 0 96.1%
+-commutative96.1%
mul-1-neg96.1%
unsub-neg96.1%
Simplified96.1%
if 3.80000000000000011e87 < t Initial program 94.5%
Taylor expanded in y around inf 92.9%
Final simplification93.7%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= a -3.25e+162)
(and (not (<= a 1.35e+55))
(or (<= a 3.25e+97) (not (<= a 3.6e+138)))))
(* x (exp (* a (- (+ 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 <= -3.25e+162) || (!(a <= 1.35e+55) && ((a <= 3.25e+97) || !(a <= 3.6e+138)))) {
tmp = x * exp((a * -(z + 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 <= (-3.25d+162)) .or. (.not. (a <= 1.35d+55)) .and. (a <= 3.25d+97) .or. (.not. (a <= 3.6d+138))) then
tmp = x * exp((a * -(z + 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 <= -3.25e+162) || (!(a <= 1.35e+55) && ((a <= 3.25e+97) || !(a <= 3.6e+138)))) {
tmp = x * Math.exp((a * -(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 <= -3.25e+162) or (not (a <= 1.35e+55) and ((a <= 3.25e+97) or not (a <= 3.6e+138))): tmp = x * math.exp((a * -(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 <= -3.25e+162) || (!(a <= 1.35e+55) && ((a <= 3.25e+97) || !(a <= 3.6e+138)))) tmp = Float64(x * exp(Float64(a * Float64(-Float64(z + 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 <= -3.25e+162) || (~((a <= 1.35e+55)) && ((a <= 3.25e+97) || ~((a <= 3.6e+138))))) tmp = x * exp((a * -(z + 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, -3.25e+162], And[N[Not[LessEqual[a, 1.35e+55]], $MachinePrecision], Or[LessEqual[a, 3.25e+97], N[Not[LessEqual[a, 3.6e+138]], $MachinePrecision]]]], N[(x * N[Exp[N[(a * (-N[(z + 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 -3.25 \cdot 10^{+162} \lor \neg \left(a \leq 1.35 \cdot 10^{+55}\right) \land \left(a \leq 3.25 \cdot 10^{+97} \lor \neg \left(a \leq 3.6 \cdot 10^{+138}\right)\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-\left(z + b\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\end{array}
\end{array}
if a < -3.2500000000000002e162 or 1.34999999999999988e55 < a < 3.25e97 or 3.6000000000000001e138 < a Initial program 86.8%
Taylor expanded in y around 0 76.7%
sub-neg76.7%
mul-1-neg76.7%
log1p-define89.8%
mul-1-neg89.8%
Simplified89.8%
Taylor expanded in z around 0 89.8%
mul-1-neg89.8%
unsub-neg89.8%
mul-1-neg89.8%
Simplified89.8%
if -3.2500000000000002e162 < a < 1.34999999999999988e55 or 3.25e97 < a < 3.6000000000000001e138Initial program 99.2%
Taylor expanded in y around inf 90.9%
Final simplification90.6%
(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 96.0%
Taylor expanded in z around 0 96.0%
Final simplification96.0%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= a -3.8e+42)
(and (not (<= a 5.2e+28))
(or (<= a 1.45e+100) (not (<= a 1.5e+139)))))
(* x (exp (* a (- (+ z b)))))
(* x (exp (* t (- y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.8e+42) || (!(a <= 5.2e+28) && ((a <= 1.45e+100) || !(a <= 1.5e+139)))) {
tmp = x * exp((a * -(z + b)));
} else {
tmp = x * exp((t * -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 <= (-3.8d+42)) .or. (.not. (a <= 5.2d+28)) .and. (a <= 1.45d+100) .or. (.not. (a <= 1.5d+139))) then
tmp = x * exp((a * -(z + b)))
else
tmp = x * exp((t * -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 <= -3.8e+42) || (!(a <= 5.2e+28) && ((a <= 1.45e+100) || !(a <= 1.5e+139)))) {
tmp = x * Math.exp((a * -(z + b)));
} else {
tmp = x * Math.exp((t * -y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -3.8e+42) or (not (a <= 5.2e+28) and ((a <= 1.45e+100) or not (a <= 1.5e+139))): tmp = x * math.exp((a * -(z + b))) else: tmp = x * math.exp((t * -y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.8e+42) || (!(a <= 5.2e+28) && ((a <= 1.45e+100) || !(a <= 1.5e+139)))) tmp = Float64(x * exp(Float64(a * Float64(-Float64(z + b))))); else tmp = Float64(x * exp(Float64(t * Float64(-y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -3.8e+42) || (~((a <= 5.2e+28)) && ((a <= 1.45e+100) || ~((a <= 1.5e+139))))) tmp = x * exp((a * -(z + b))); else tmp = x * exp((t * -y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.8e+42], And[N[Not[LessEqual[a, 5.2e+28]], $MachinePrecision], Or[LessEqual[a, 1.45e+100], N[Not[LessEqual[a, 1.5e+139]], $MachinePrecision]]]], N[(x * N[Exp[N[(a * (-N[(z + b), $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{+42} \lor \neg \left(a \leq 5.2 \cdot 10^{+28}\right) \land \left(a \leq 1.45 \cdot 10^{+100} \lor \neg \left(a \leq 1.5 \cdot 10^{+139}\right)\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-\left(z + b\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\end{array}
\end{array}
if a < -3.7999999999999998e42 or 5.2000000000000004e28 < a < 1.45e100 or 1.5e139 < a Initial program 90.6%
Taylor expanded in y around 0 71.2%
sub-neg71.2%
mul-1-neg71.2%
log1p-define82.5%
mul-1-neg82.5%
Simplified82.5%
Taylor expanded in z around 0 82.5%
mul-1-neg82.5%
unsub-neg82.5%
mul-1-neg82.5%
Simplified82.5%
if -3.7999999999999998e42 < a < 5.2000000000000004e28 or 1.45e100 < a < 1.5e139Initial program 99.3%
Taylor expanded in t around inf 80.5%
mul-1-neg80.5%
distribute-lft-neg-out80.5%
*-commutative80.5%
Simplified80.5%
Final simplification81.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))) (t_2 (* x (exp (* t (- y))))))
(if (<= t -500.0)
t_2
(if (<= t -1.5e-260)
t_1
(if (<= t 7e-262)
(* x (exp (* a (- b))))
(if (<= t 1.2e+41) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * pow(z, y);
double t_2 = x * exp((t * -y));
double tmp;
if (t <= -500.0) {
tmp = t_2;
} else if (t <= -1.5e-260) {
tmp = t_1;
} else if (t <= 7e-262) {
tmp = x * exp((a * -b));
} else if (t <= 1.2e+41) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * (z ** y)
t_2 = x * exp((t * -y))
if (t <= (-500.0d0)) then
tmp = t_2
else if (t <= (-1.5d-260)) then
tmp = t_1
else if (t <= 7d-262) then
tmp = x * exp((a * -b))
else if (t <= 1.2d+41) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.pow(z, y);
double t_2 = x * Math.exp((t * -y));
double tmp;
if (t <= -500.0) {
tmp = t_2;
} else if (t <= -1.5e-260) {
tmp = t_1;
} else if (t <= 7e-262) {
tmp = x * Math.exp((a * -b));
} else if (t <= 1.2e+41) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.pow(z, y) t_2 = x * math.exp((t * -y)) tmp = 0 if t <= -500.0: tmp = t_2 elif t <= -1.5e-260: tmp = t_1 elif t <= 7e-262: tmp = x * math.exp((a * -b)) elif t <= 1.2e+41: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * (z ^ y)) t_2 = Float64(x * exp(Float64(t * Float64(-y)))) tmp = 0.0 if (t <= -500.0) tmp = t_2; elseif (t <= -1.5e-260) tmp = t_1; elseif (t <= 7e-262) tmp = Float64(x * exp(Float64(a * Float64(-b)))); elseif (t <= 1.2e+41) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (z ^ y); t_2 = x * exp((t * -y)); tmp = 0.0; if (t <= -500.0) tmp = t_2; elseif (t <= -1.5e-260) tmp = t_1; elseif (t <= 7e-262) tmp = x * exp((a * -b)); elseif (t <= 1.2e+41) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -500.0], t$95$2, If[LessEqual[t, -1.5e-260], t$95$1, If[LessEqual[t, 7e-262], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e+41], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
t_2 := x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{if}\;t \leq -500:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -1.5 \cdot 10^{-260}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-262}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -500 or 1.2000000000000001e41 < t Initial program 96.2%
Taylor expanded in t around inf 85.2%
mul-1-neg85.2%
distribute-lft-neg-out85.2%
*-commutative85.2%
Simplified85.2%
if -500 < t < -1.5e-260 or 7.00000000000000023e-262 < t < 1.2000000000000001e41Initial program 95.9%
Taylor expanded in y around inf 73.2%
Taylor expanded in t around 0 73.2%
if -1.5e-260 < t < 7.00000000000000023e-262Initial program 94.2%
Taylor expanded in b around inf 82.5%
mul-1-neg82.5%
distribute-rgt-neg-out82.5%
Simplified82.5%
Final simplification80.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.3e+38) (not (<= y 0.0013))) (* x (pow z y)) (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.3e+38) || !(y <= 0.0013)) {
tmp = x * pow(z, y);
} else {
tmp = x * exp((a * -b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.3d+38)) .or. (.not. (y <= 0.0013d0))) then
tmp = x * (z ** y)
else
tmp = x * exp((a * -b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.3e+38) || !(y <= 0.0013)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * Math.exp((a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.3e+38) or not (y <= 0.0013): tmp = x * math.pow(z, y) else: tmp = x * math.exp((a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.3e+38) || !(y <= 0.0013)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(a * Float64(-b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.3e+38) || ~((y <= 0.0013))) tmp = x * (z ^ y); else tmp = x * exp((a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.3e+38], N[Not[LessEqual[y, 0.0013]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+38} \lor \neg \left(y \leq 0.0013\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -1.3e38 or 0.0012999999999999999 < y Initial program 97.7%
Taylor expanded in y around inf 92.1%
Taylor expanded in t around 0 70.5%
if -1.3e38 < y < 0.0012999999999999999Initial program 94.3%
Taylor expanded in b around inf 70.7%
mul-1-neg70.7%
distribute-rgt-neg-out70.7%
Simplified70.7%
Final simplification70.6%
(FPCore (x y z t a b) :precision binary64 (if (<= t -420.0) (* x (- 1.0 (* y t))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -420.0) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * pow(z, y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-420.0d0)) then
tmp = x * (1.0d0 - (y * t))
else
tmp = x * (z ** y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -420.0) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -420.0: tmp = x * (1.0 - (y * t)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -420.0) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -420.0) tmp = x * (1.0 - (y * t)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -420.0], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -420:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -420Initial program 96.8%
Taylor expanded in t around inf 82.6%
mul-1-neg82.6%
distribute-lft-neg-out82.6%
*-commutative82.6%
Simplified82.6%
Taylor expanded in y around 0 29.2%
associate-*r*29.2%
mul-1-neg29.2%
*-commutative29.2%
Simplified29.2%
Taylor expanded in x around 0 33.8%
mul-1-neg33.8%
*-commutative33.8%
sub-neg33.8%
Simplified33.8%
if -420 < t Initial program 95.7%
Taylor expanded in y around inf 76.7%
Taylor expanded in t around 0 67.2%
Final simplification59.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -9.5e-5) (not (<= y 1.8e-6))) (* b (* x (- a))) (* x (- 1.0 (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -9.5e-5) || !(y <= 1.8e-6)) {
tmp = b * (x * -a);
} 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 ((y <= (-9.5d-5)) .or. (.not. (y <= 1.8d-6))) then
tmp = b * (x * -a)
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 ((y <= -9.5e-5) || !(y <= 1.8e-6)) {
tmp = b * (x * -a);
} else {
tmp = x * (1.0 - (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -9.5e-5) or not (y <= 1.8e-6): tmp = b * (x * -a) else: tmp = x * (1.0 - (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -9.5e-5) || !(y <= 1.8e-6)) tmp = Float64(b * Float64(x * Float64(-a))); 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 ((y <= -9.5e-5) || ~((y <= 1.8e-6))) tmp = b * (x * -a); else tmp = x * (1.0 - (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -9.5e-5], N[Not[LessEqual[y, 1.8e-6]], $MachinePrecision]], N[(b * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{-5} \lor \neg \left(y \leq 1.8 \cdot 10^{-6}\right):\\
\;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\end{array}
\end{array}
if y < -9.5000000000000005e-5 or 1.79999999999999992e-6 < y Initial program 97.2%
Taylor expanded in b around inf 31.6%
mul-1-neg31.6%
distribute-rgt-neg-out31.6%
Simplified31.6%
Taylor expanded in a around 0 11.3%
mul-1-neg11.3%
unsub-neg11.3%
Simplified11.3%
Taylor expanded in a around inf 20.2%
mul-1-neg20.2%
*-commutative20.2%
associate-*r*22.8%
distribute-lft-neg-in22.8%
*-commutative22.8%
Simplified22.8%
if -9.5000000000000005e-5 < y < 1.79999999999999992e-6Initial program 94.3%
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 48.2%
mul-1-neg48.2%
unsub-neg48.2%
Simplified48.2%
Final simplification33.9%
(FPCore (x y z t a b) :precision binary64 (if (<= a -5.5e+54) (* x (- 1.0 (* a b))) (if (<= a 5e+145) (* x (- 1.0 (* y t))) (* a (* x (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.5e+54) {
tmp = x * (1.0 - (a * b));
} else if (a <= 5e+145) {
tmp = x * (1.0 - (y * t));
} 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 (a <= (-5.5d+54)) then
tmp = x * (1.0d0 - (a * b))
else if (a <= 5d+145) then
tmp = x * (1.0d0 - (y * t))
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 (a <= -5.5e+54) {
tmp = x * (1.0 - (a * b));
} else if (a <= 5e+145) {
tmp = x * (1.0 - (y * t));
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -5.5e+54: tmp = x * (1.0 - (a * b)) elif a <= 5e+145: tmp = x * (1.0 - (y * t)) else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -5.5e+54) tmp = Float64(x * Float64(1.0 - Float64(a * b))); elseif (a <= 5e+145) tmp = Float64(x * Float64(1.0 - Float64(y * t))); 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 (a <= -5.5e+54) tmp = x * (1.0 - (a * b)); elseif (a <= 5e+145) tmp = x * (1.0 - (y * t)); else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -5.5e+54], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5e+145], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{+54}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{elif}\;a \leq 5 \cdot 10^{+145}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if a < -5.50000000000000026e54Initial program 91.4%
Taylor expanded in b around inf 70.8%
mul-1-neg70.8%
distribute-rgt-neg-out70.8%
Simplified70.8%
Taylor expanded in a around 0 35.0%
mul-1-neg35.0%
unsub-neg35.0%
Simplified35.0%
if -5.50000000000000026e54 < a < 4.99999999999999967e145Initial program 98.6%
Taylor expanded in t around inf 75.7%
mul-1-neg75.7%
distribute-lft-neg-out75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in y around 0 33.7%
associate-*r*33.7%
mul-1-neg33.7%
*-commutative33.7%
Simplified33.7%
Taylor expanded in x around 0 35.3%
mul-1-neg35.3%
*-commutative35.3%
sub-neg35.3%
Simplified35.3%
if 4.99999999999999967e145 < a Initial program 87.0%
Taylor expanded in b around inf 70.8%
mul-1-neg70.8%
distribute-rgt-neg-out70.8%
Simplified70.8%
Taylor expanded in a around 0 25.7%
mul-1-neg25.7%
unsub-neg25.7%
Simplified25.7%
Taylor expanded in a around inf 38.3%
mul-1-neg38.3%
distribute-rgt-neg-in38.3%
distribute-rgt-neg-in38.3%
Simplified38.3%
Final simplification35.6%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.48e+57) (- x (* (+ z b) (* x a))) (if (<= a 3.3e+142) (* x (- 1.0 (* y t))) (* a (* x (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.48e+57) {
tmp = x - ((z + b) * (x * a));
} else if (a <= 3.3e+142) {
tmp = x * (1.0 - (y * t));
} 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 (a <= (-1.48d+57)) then
tmp = x - ((z + b) * (x * a))
else if (a <= 3.3d+142) then
tmp = x * (1.0d0 - (y * t))
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 (a <= -1.48e+57) {
tmp = x - ((z + b) * (x * a));
} else if (a <= 3.3e+142) {
tmp = x * (1.0 - (y * t));
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.48e+57: tmp = x - ((z + b) * (x * a)) elif a <= 3.3e+142: tmp = x * (1.0 - (y * t)) else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.48e+57) tmp = Float64(x - Float64(Float64(z + b) * Float64(x * a))); elseif (a <= 3.3e+142) tmp = Float64(x * Float64(1.0 - Float64(y * t))); 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 (a <= -1.48e+57) tmp = x - ((z + b) * (x * a)); elseif (a <= 3.3e+142) tmp = x * (1.0 - (y * t)); else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.48e+57], N[(x - N[(N[(z + b), $MachinePrecision] * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.3e+142], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.48 \cdot 10^{+57}:\\
\;\;\;\;x - \left(z + b\right) \cdot \left(x \cdot a\right)\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{+142}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if a < -1.47999999999999999e57Initial program 91.4%
Taylor expanded in y around 0 70.8%
sub-neg70.8%
mul-1-neg70.8%
log1p-define77.1%
mul-1-neg77.1%
Simplified77.1%
Taylor expanded in z around 0 77.1%
mul-1-neg77.1%
unsub-neg77.1%
mul-1-neg77.1%
Simplified77.1%
Taylor expanded in a around 0 31.0%
mul-1-neg31.0%
unsub-neg31.0%
associate-*r*36.8%
*-commutative36.8%
Simplified36.8%
if -1.47999999999999999e57 < a < 3.3000000000000002e142Initial program 98.6%
Taylor expanded in t around inf 75.7%
mul-1-neg75.7%
distribute-lft-neg-out75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in y around 0 33.7%
associate-*r*33.7%
mul-1-neg33.7%
*-commutative33.7%
Simplified33.7%
Taylor expanded in x around 0 35.3%
mul-1-neg35.3%
*-commutative35.3%
sub-neg35.3%
Simplified35.3%
if 3.3000000000000002e142 < a Initial program 87.0%
Taylor expanded in b around inf 70.8%
mul-1-neg70.8%
distribute-rgt-neg-out70.8%
Simplified70.8%
Taylor expanded in a around 0 25.7%
mul-1-neg25.7%
unsub-neg25.7%
Simplified25.7%
Taylor expanded in a around inf 38.3%
mul-1-neg38.3%
distribute-rgt-neg-in38.3%
distribute-rgt-neg-in38.3%
Simplified38.3%
Final simplification35.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.75e-107) (not (<= y 1400000.0))) (* a (* x (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.75e-107) || !(y <= 1400000.0)) {
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 <= (-2.75d-107)) .or. (.not. (y <= 1400000.0d0))) 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 <= -2.75e-107) || !(y <= 1400000.0)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.75e-107) or not (y <= 1400000.0): tmp = a * (x * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.75e-107) || !(y <= 1400000.0)) 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 <= -2.75e-107) || ~((y <= 1400000.0))) tmp = a * (x * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.75e-107], N[Not[LessEqual[y, 1400000.0]], $MachinePrecision]], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.75 \cdot 10^{-107} \lor \neg \left(y \leq 1400000\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.74999999999999993e-107 or 1.4e6 < y Initial program 96.8%
Taylor expanded in b around inf 33.5%
mul-1-neg33.5%
distribute-rgt-neg-out33.5%
Simplified33.5%
Taylor expanded in a around 0 12.6%
mul-1-neg12.6%
unsub-neg12.6%
Simplified12.6%
Taylor expanded in a around inf 19.9%
mul-1-neg19.9%
distribute-rgt-neg-in19.9%
distribute-rgt-neg-in19.9%
Simplified19.9%
if -2.74999999999999993e-107 < y < 1.4e6Initial program 94.6%
Taylor expanded in b around inf 77.2%
mul-1-neg77.2%
distribute-rgt-neg-out77.2%
Simplified77.2%
Taylor expanded in a around 0 42.0%
Final simplification28.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.75e-107) (not (<= y 1.72e-6))) (* b (* x (- a))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.75e-107) || !(y <= 1.72e-6)) {
tmp = b * (x * -a);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.75d-107)) .or. (.not. (y <= 1.72d-6))) then
tmp = b * (x * -a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.75e-107) || !(y <= 1.72e-6)) {
tmp = b * (x * -a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.75e-107) or not (y <= 1.72e-6): tmp = b * (x * -a) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.75e-107) || !(y <= 1.72e-6)) tmp = Float64(b * Float64(x * Float64(-a))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.75e-107) || ~((y <= 1.72e-6))) tmp = b * (x * -a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.75e-107], N[Not[LessEqual[y, 1.72e-6]], $MachinePrecision]], N[(b * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.75 \cdot 10^{-107} \lor \neg \left(y \leq 1.72 \cdot 10^{-6}\right):\\
\;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.74999999999999993e-107 or 1.72e-6 < y Initial program 96.9%
Taylor expanded in b around inf 34.1%
mul-1-neg34.1%
distribute-rgt-neg-out34.1%
Simplified34.1%
Taylor expanded in a around 0 12.5%
mul-1-neg12.5%
unsub-neg12.5%
Simplified12.5%
Taylor expanded in a around inf 19.6%
mul-1-neg19.6%
*-commutative19.6%
associate-*r*22.4%
distribute-lft-neg-in22.4%
*-commutative22.4%
Simplified22.4%
if -2.74999999999999993e-107 < y < 1.72e-6Initial program 94.3%
Taylor expanded in b around inf 78.1%
mul-1-neg78.1%
distribute-rgt-neg-out78.1%
Simplified78.1%
Taylor expanded in a around 0 43.5%
Final simplification30.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.05e-5) (not (<= y 1400000.0))) (* a (* x b)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.05e-5) || !(y <= 1400000.0)) {
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 <= (-1.05d-5)) .or. (.not. (y <= 1400000.0d0))) 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 <= -1.05e-5) || !(y <= 1400000.0)) {
tmp = a * (x * b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.05e-5) or not (y <= 1400000.0): tmp = a * (x * b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.05e-5) || !(y <= 1400000.0)) tmp = Float64(a * Float64(x * b)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.05e-5) || ~((y <= 1400000.0))) tmp = a * (x * b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.05e-5], N[Not[LessEqual[y, 1400000.0]], $MachinePrecision]], N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{-5} \lor \neg \left(y \leq 1400000\right):\\
\;\;\;\;a \cdot \left(x \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.04999999999999994e-5 or 1.4e6 < y Initial program 97.2%
Taylor expanded in b around inf 30.9%
mul-1-neg30.9%
distribute-rgt-neg-out30.9%
Simplified30.9%
Taylor expanded in a around 0 11.4%
mul-1-neg11.4%
unsub-neg11.4%
Simplified11.4%
Taylor expanded in a around inf 20.6%
mul-1-neg20.6%
distribute-rgt-neg-in20.6%
distribute-rgt-neg-in20.6%
Simplified20.6%
add020.6%
add-sqr-sqrt8.1%
sqrt-unprod25.2%
sqr-neg25.2%
sqrt-unprod9.0%
add-sqr-sqrt14.9%
Applied egg-rr14.9%
add014.9%
Simplified14.9%
if -1.04999999999999994e-5 < y < 1.4e6Initial program 94.5%
Taylor expanded in b around inf 73.6%
mul-1-neg73.6%
distribute-rgt-neg-out73.6%
Simplified73.6%
Taylor expanded in a around 0 37.2%
Final simplification25.0%
(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 96.0%
Taylor expanded in b around inf 50.3%
mul-1-neg50.3%
distribute-rgt-neg-out50.3%
Simplified50.3%
Taylor expanded in a around 0 19.1%
Final simplification19.1%
herbie shell --seed 2024046
(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))))))