
(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 14 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 (- (* y (- (log z) t)) (* a (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) - (a * (z + b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) - (a * (z + b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) - (a * (z + b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) - (a * (z + b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) - Float64(a * Float64(z + b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) - (a * (z + b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot \left(z + b\right)}
\end{array}
Initial program 97.7%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (- (* y t))))))
(if (<= t -6.2e+55)
t_1
(if (<= t -2.25e+31)
(* x (exp (* a (- (log (- 1.0 z)) b))))
(if (or (<= t -1200.0) (not (<= t 1.25e+178)))
t_1
(* x (exp (- (* y (log z)) (* a b)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp(-(y * t));
double tmp;
if (t <= -6.2e+55) {
tmp = t_1;
} else if (t <= -2.25e+31) {
tmp = x * exp((a * (log((1.0 - z)) - b)));
} else if ((t <= -1200.0) || !(t <= 1.25e+178)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * exp(-(y * t))
if (t <= (-6.2d+55)) then
tmp = t_1
else if (t <= (-2.25d+31)) then
tmp = x * exp((a * (log((1.0d0 - z)) - b)))
else if ((t <= (-1200.0d0)) .or. (.not. (t <= 1.25d+178))) then
tmp = t_1
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 t_1 = x * Math.exp(-(y * t));
double tmp;
if (t <= -6.2e+55) {
tmp = t_1;
} else if (t <= -2.25e+31) {
tmp = x * Math.exp((a * (Math.log((1.0 - z)) - b)));
} else if ((t <= -1200.0) || !(t <= 1.25e+178)) {
tmp = t_1;
} else {
tmp = x * Math.exp(((y * Math.log(z)) - (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp(-(y * t)) tmp = 0 if t <= -6.2e+55: tmp = t_1 elif t <= -2.25e+31: tmp = x * math.exp((a * (math.log((1.0 - z)) - b))) elif (t <= -1200.0) or not (t <= 1.25e+178): tmp = t_1 else: tmp = x * math.exp(((y * math.log(z)) - (a * b))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(-Float64(y * t)))) tmp = 0.0 if (t <= -6.2e+55) tmp = t_1; elseif (t <= -2.25e+31) tmp = Float64(x * exp(Float64(a * Float64(log(Float64(1.0 - z)) - b)))); elseif ((t <= -1200.0) || !(t <= 1.25e+178)) tmp = t_1; 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) t_1 = x * exp(-(y * t)); tmp = 0.0; if (t <= -6.2e+55) tmp = t_1; elseif (t <= -2.25e+31) tmp = x * exp((a * (log((1.0 - z)) - b))); elseif ((t <= -1200.0) || ~((t <= 1.25e+178))) tmp = t_1; else tmp = x * exp(((y * log(z)) - (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[(-N[(y * t), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.2e+55], t$95$1, If[LessEqual[t, -2.25e+31], N[(x * N[Exp[N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -1200.0], N[Not[LessEqual[t, 1.25e+178]], $MachinePrecision]], t$95$1, 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}
t_1 := x \cdot e^{-y \cdot t}\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{+55}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2.25 \cdot 10^{+31}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right)}\\
\mathbf{elif}\;t \leq -1200 \lor \neg \left(t \leq 1.25 \cdot 10^{+178}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \log z - a \cdot b}\\
\end{array}
\end{array}
if t < -6.19999999999999987e55 or -2.2499999999999998e31 < t < -1200 or 1.24999999999999998e178 < t Initial program 98.9%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in t around inf 88.4%
associate-*r*88.4%
neg-mul-188.4%
Simplified88.4%
if -6.19999999999999987e55 < t < -2.2499999999999998e31Initial program 99.7%
Taylor expanded in y around 0 99.7%
if -1200 < t < 1.24999999999999998e178Initial program 96.9%
Taylor expanded in z around 0 96.3%
+-commutative96.3%
mul-1-neg96.3%
sub-neg96.3%
Simplified96.3%
Taylor expanded in t around 0 95.6%
Final simplification93.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.65e+18) (not (<= y 3.05e-71))) (* x (exp (* y (- (log z) t)))) (* x (exp (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.65e+18) || !(y <= 3.05e-71)) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = x * exp((a * (log((1.0 - 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 <= (-1.65d+18)) .or. (.not. (y <= 3.05d-71))) then
tmp = x * exp((y * (log(z) - t)))
else
tmp = x * exp((a * (log((1.0d0 - 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 <= -1.65e+18) || !(y <= 3.05e-71)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((a * (Math.log((1.0 - z)) - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.65e+18) or not (y <= 3.05e-71): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((a * (math.log((1.0 - z)) - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.65e+18) || !(y <= 3.05e-71)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(Float64(a * Float64(log(Float64(1.0 - z)) - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.65e+18) || ~((y <= 3.05e-71))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp((a * (log((1.0 - z)) - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.65e+18], N[Not[LessEqual[y, 3.05e-71]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{+18} \lor \neg \left(y \leq 3.05 \cdot 10^{-71}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right)}\\
\end{array}
\end{array}
if y < -1.65e18 or 3.0499999999999999e-71 < y Initial program 99.2%
Taylor expanded in a around 0 90.1%
if -1.65e18 < y < 3.0499999999999999e-71Initial program 96.2%
Taylor expanded in y around 0 84.4%
Final simplification87.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.9) (not (<= y 1.45e-72))) (* x (exp (* y (- (log z) t)))) (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.9) || !(y <= 1.45e-72)) {
tmp = x * exp((y * (log(z) - t)));
} 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 <= (-2.9d0)) .or. (.not. (y <= 1.45d-72))) then
tmp = x * exp((y * (log(z) - t)))
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 <= -2.9) || !(y <= 1.45e-72)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.9) or not (y <= 1.45e-72): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.9) || !(y <= 1.45e-72)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); 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 <= -2.9) || ~((y <= 1.45e-72))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp((a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.9], N[Not[LessEqual[y, 1.45e-72]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \lor \neg \left(y \leq 1.45 \cdot 10^{-72}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -2.89999999999999991 or 1.44999999999999999e-72 < y Initial program 99.3%
Taylor expanded in a around 0 89.1%
if -2.89999999999999991 < y < 1.44999999999999999e-72Initial program 96.0%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in b around inf 85.1%
neg-mul-185.1%
distribute-rgt-neg-in85.1%
Simplified85.1%
Final simplification87.2%
(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.7%
Taylor expanded in z around 0 96.9%
+-commutative96.9%
mul-1-neg96.9%
sub-neg96.9%
Simplified96.9%
Final simplification96.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.05e+67) (not (<= y 5400000000.0))) (* 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 <= -3.05e+67) || !(y <= 5400000000.0)) {
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 <= (-3.05d+67)) .or. (.not. (y <= 5400000000.0d0))) 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 <= -3.05e+67) || !(y <= 5400000000.0)) {
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 <= -3.05e+67) or not (y <= 5400000000.0): 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 <= -3.05e+67) || !(y <= 5400000000.0)) 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 <= -3.05e+67) || ~((y <= 5400000000.0))) 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, -3.05e+67], N[Not[LessEqual[y, 5400000000.0]], $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 -3.05 \cdot 10^{+67} \lor \neg \left(y \leq 5400000000\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -3.05e67 or 5.4e9 < y Initial program 100.0%
Taylor expanded in a around 0 92.6%
Taylor expanded in t around 0 65.0%
if -3.05e67 < y < 5.4e9Initial program 96.1%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in b around inf 80.1%
neg-mul-180.1%
distribute-rgt-neg-in80.1%
Simplified80.1%
Final simplification73.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.5e+59) (not (<= y 4.5e-71))) (* x (exp (- (* y t)))) (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.5e+59) || !(y <= 4.5e-71)) {
tmp = x * exp(-(y * t));
} 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 <= (-2.5d+59)) .or. (.not. (y <= 4.5d-71))) then
tmp = x * exp(-(y * t))
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 <= -2.5e+59) || !(y <= 4.5e-71)) {
tmp = x * Math.exp(-(y * t));
} else {
tmp = x * Math.exp((a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.5e+59) or not (y <= 4.5e-71): tmp = x * math.exp(-(y * t)) else: tmp = x * math.exp((a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.5e+59) || !(y <= 4.5e-71)) tmp = Float64(x * exp(Float64(-Float64(y * t)))); 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 <= -2.5e+59) || ~((y <= 4.5e-71))) tmp = x * exp(-(y * t)); else tmp = x * exp((a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.5e+59], N[Not[LessEqual[y, 4.5e-71]], $MachinePrecision]], N[(x * N[Exp[(-N[(y * t), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+59} \lor \neg \left(y \leq 4.5 \cdot 10^{-71}\right):\\
\;\;\;\;x \cdot e^{-y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -2.4999999999999999e59 or 4.5000000000000002e-71 < y Initial program 99.2%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in t around inf 68.0%
associate-*r*68.0%
neg-mul-168.0%
Simplified68.0%
if -2.4999999999999999e59 < y < 4.5000000000000002e-71Initial program 96.4%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in b around inf 83.1%
neg-mul-183.1%
distribute-rgt-neg-in83.1%
Simplified83.1%
Final simplification75.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -4.6e+54) (* 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 <= -4.6e+54) {
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 <= (-4.6d+54)) 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 <= -4.6e+54) {
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 <= -4.6e+54: 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 <= -4.6e+54) 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 <= -4.6e+54) 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, -4.6e+54], 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 -4.6 \cdot 10^{+54}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -4.59999999999999988e54Initial program 98.3%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in t around inf 86.9%
associate-*r*86.9%
neg-mul-186.9%
Simplified86.9%
Taylor expanded in t around 0 37.7%
mul-1-neg37.7%
*-commutative37.7%
unsub-neg37.7%
Simplified37.7%
if -4.59999999999999988e54 < t Initial program 97.5%
Taylor expanded in a around 0 69.1%
Taylor expanded in t around 0 60.7%
Final simplification55.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (* x (- t)))))
(if (<= y -8500000000000.0)
t_1
(if (<= y -4.1e-19)
(* a (* x (- b)))
(if (<= y 3.4e-284)
x
(if (<= y 6.5e-159) (* t (* x (- y))) (if (<= y 1.55e-56) x t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (x * -t);
double tmp;
if (y <= -8500000000000.0) {
tmp = t_1;
} else if (y <= -4.1e-19) {
tmp = a * (x * -b);
} else if (y <= 3.4e-284) {
tmp = x;
} else if (y <= 6.5e-159) {
tmp = t * (x * -y);
} else if (y <= 1.55e-56) {
tmp = x;
} 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 = y * (x * -t)
if (y <= (-8500000000000.0d0)) then
tmp = t_1
else if (y <= (-4.1d-19)) then
tmp = a * (x * -b)
else if (y <= 3.4d-284) then
tmp = x
else if (y <= 6.5d-159) then
tmp = t * (x * -y)
else if (y <= 1.55d-56) then
tmp = x
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 = y * (x * -t);
double tmp;
if (y <= -8500000000000.0) {
tmp = t_1;
} else if (y <= -4.1e-19) {
tmp = a * (x * -b);
} else if (y <= 3.4e-284) {
tmp = x;
} else if (y <= 6.5e-159) {
tmp = t * (x * -y);
} else if (y <= 1.55e-56) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (x * -t) tmp = 0 if y <= -8500000000000.0: tmp = t_1 elif y <= -4.1e-19: tmp = a * (x * -b) elif y <= 3.4e-284: tmp = x elif y <= 6.5e-159: tmp = t * (x * -y) elif y <= 1.55e-56: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(x * Float64(-t))) tmp = 0.0 if (y <= -8500000000000.0) tmp = t_1; elseif (y <= -4.1e-19) tmp = Float64(a * Float64(x * Float64(-b))); elseif (y <= 3.4e-284) tmp = x; elseif (y <= 6.5e-159) tmp = Float64(t * Float64(x * Float64(-y))); elseif (y <= 1.55e-56) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y * (x * -t); tmp = 0.0; if (y <= -8500000000000.0) tmp = t_1; elseif (y <= -4.1e-19) tmp = a * (x * -b); elseif (y <= 3.4e-284) tmp = x; elseif (y <= 6.5e-159) tmp = t * (x * -y); elseif (y <= 1.55e-56) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(x * (-t)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8500000000000.0], t$95$1, If[LessEqual[y, -4.1e-19], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e-284], x, If[LessEqual[y, 6.5e-159], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.55e-56], x, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot \left(-t\right)\right)\\
\mathbf{if}\;y \leq -8500000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -4.1 \cdot 10^{-19}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-284}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-159}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-56}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -8.5e12 or 1.54999999999999994e-56 < y Initial program 99.2%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in t around inf 67.2%
associate-*r*67.2%
neg-mul-167.2%
Simplified67.2%
Taylor expanded in t around 0 25.2%
mul-1-neg25.2%
*-commutative25.2%
unsub-neg25.2%
Simplified25.2%
Taylor expanded in y around inf 25.7%
mul-1-neg25.7%
associate-*r*28.0%
*-commutative28.0%
*-commutative28.0%
distribute-lft-neg-in28.0%
Simplified28.0%
if -8.5e12 < y < -4.09999999999999985e-19Initial program 93.0%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in b around inf 69.7%
neg-mul-169.7%
distribute-rgt-neg-in69.7%
Simplified69.7%
Taylor expanded in a around 0 22.8%
mul-1-neg22.8%
unsub-neg22.8%
Simplified22.8%
Taylor expanded in a around inf 45.6%
associate-*r*45.6%
neg-mul-145.6%
Simplified45.6%
if -4.09999999999999985e-19 < y < 3.39999999999999991e-284 or 6.5000000000000001e-159 < y < 1.54999999999999994e-56Initial program 98.9%
Taylor expanded in a around 0 63.2%
Taylor expanded in y around 0 45.7%
if 3.39999999999999991e-284 < y < 6.5000000000000001e-159Initial program 86.3%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in t around inf 27.2%
associate-*r*27.2%
neg-mul-127.2%
Simplified27.2%
Taylor expanded in t around 0 22.9%
mul-1-neg22.9%
*-commutative22.9%
unsub-neg22.9%
Simplified22.9%
Taylor expanded in y around inf 45.5%
Final simplification36.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (- 1.0 (* a b)))) (t_2 (* y (* x (- t)))))
(if (<= y -22500000000000.0)
t_2
(if (<= y 1.78e-236)
t_1
(if (<= y 6.5e-159) (* t (* x (- y))) (if (<= y 0.206) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (1.0 - (a * b));
double t_2 = y * (x * -t);
double tmp;
if (y <= -22500000000000.0) {
tmp = t_2;
} else if (y <= 1.78e-236) {
tmp = t_1;
} else if (y <= 6.5e-159) {
tmp = t * (x * -y);
} else if (y <= 0.206) {
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 * (1.0d0 - (a * b))
t_2 = y * (x * -t)
if (y <= (-22500000000000.0d0)) then
tmp = t_2
else if (y <= 1.78d-236) then
tmp = t_1
else if (y <= 6.5d-159) then
tmp = t * (x * -y)
else if (y <= 0.206d0) 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 * (1.0 - (a * b));
double t_2 = y * (x * -t);
double tmp;
if (y <= -22500000000000.0) {
tmp = t_2;
} else if (y <= 1.78e-236) {
tmp = t_1;
} else if (y <= 6.5e-159) {
tmp = t * (x * -y);
} else if (y <= 0.206) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * (1.0 - (a * b)) t_2 = y * (x * -t) tmp = 0 if y <= -22500000000000.0: tmp = t_2 elif y <= 1.78e-236: tmp = t_1 elif y <= 6.5e-159: tmp = t * (x * -y) elif y <= 0.206: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(1.0 - Float64(a * b))) t_2 = Float64(y * Float64(x * Float64(-t))) tmp = 0.0 if (y <= -22500000000000.0) tmp = t_2; elseif (y <= 1.78e-236) tmp = t_1; elseif (y <= 6.5e-159) tmp = Float64(t * Float64(x * Float64(-y))); elseif (y <= 0.206) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (1.0 - (a * b)); t_2 = y * (x * -t); tmp = 0.0; if (y <= -22500000000000.0) tmp = t_2; elseif (y <= 1.78e-236) tmp = t_1; elseif (y <= 6.5e-159) tmp = t * (x * -y); elseif (y <= 0.206) 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[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(x * (-t)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -22500000000000.0], t$95$2, If[LessEqual[y, 1.78e-236], t$95$1, If[LessEqual[y, 6.5e-159], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.206], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - a \cdot b\right)\\
t_2 := y \cdot \left(x \cdot \left(-t\right)\right)\\
\mathbf{if}\;y \leq -22500000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.78 \cdot 10^{-236}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-159}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 0.206:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -2.25e13 or 0.205999999999999989 < y Initial program 100.0%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in t around inf 67.9%
associate-*r*67.9%
neg-mul-167.9%
Simplified67.9%
Taylor expanded in t around 0 26.8%
mul-1-neg26.8%
*-commutative26.8%
unsub-neg26.8%
Simplified26.8%
Taylor expanded in y around inf 27.3%
mul-1-neg27.3%
associate-*r*29.8%
*-commutative29.8%
*-commutative29.8%
distribute-lft-neg-in29.8%
Simplified29.8%
if -2.25e13 < y < 1.78000000000000001e-236 or 6.5000000000000001e-159 < y < 0.205999999999999989Initial program 96.2%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in b around inf 81.3%
neg-mul-181.3%
distribute-rgt-neg-in81.3%
Simplified81.3%
Taylor expanded in a around 0 43.5%
mul-1-neg43.5%
unsub-neg43.5%
Simplified43.5%
if 1.78000000000000001e-236 < y < 6.5000000000000001e-159Initial program 91.1%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in t around inf 30.5%
associate-*r*30.5%
neg-mul-130.5%
Simplified30.5%
Taylor expanded in t around 0 21.9%
mul-1-neg21.9%
*-commutative21.9%
unsub-neg21.9%
Simplified21.9%
Taylor expanded in y around inf 57.5%
Final simplification37.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (* x (- t)))))
(if (<= y -21000000000000.0)
t_1
(if (<= y -6.5e-19) (* a (* x (- b))) (if (<= y 1.6e-56) x t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (x * -t);
double tmp;
if (y <= -21000000000000.0) {
tmp = t_1;
} else if (y <= -6.5e-19) {
tmp = a * (x * -b);
} else if (y <= 1.6e-56) {
tmp = x;
} 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 = y * (x * -t)
if (y <= (-21000000000000.0d0)) then
tmp = t_1
else if (y <= (-6.5d-19)) then
tmp = a * (x * -b)
else if (y <= 1.6d-56) then
tmp = x
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 = y * (x * -t);
double tmp;
if (y <= -21000000000000.0) {
tmp = t_1;
} else if (y <= -6.5e-19) {
tmp = a * (x * -b);
} else if (y <= 1.6e-56) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (x * -t) tmp = 0 if y <= -21000000000000.0: tmp = t_1 elif y <= -6.5e-19: tmp = a * (x * -b) elif y <= 1.6e-56: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(x * Float64(-t))) tmp = 0.0 if (y <= -21000000000000.0) tmp = t_1; elseif (y <= -6.5e-19) tmp = Float64(a * Float64(x * Float64(-b))); elseif (y <= 1.6e-56) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y * (x * -t); tmp = 0.0; if (y <= -21000000000000.0) tmp = t_1; elseif (y <= -6.5e-19) tmp = a * (x * -b); elseif (y <= 1.6e-56) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(x * (-t)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -21000000000000.0], t$95$1, If[LessEqual[y, -6.5e-19], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-56], x, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot \left(-t\right)\right)\\
\mathbf{if}\;y \leq -21000000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-19}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-56}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -2.1e13 or 1.59999999999999993e-56 < y Initial program 99.2%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in t around inf 67.2%
associate-*r*67.2%
neg-mul-167.2%
Simplified67.2%
Taylor expanded in t around 0 25.2%
mul-1-neg25.2%
*-commutative25.2%
unsub-neg25.2%
Simplified25.2%
Taylor expanded in y around inf 25.7%
mul-1-neg25.7%
associate-*r*28.0%
*-commutative28.0%
*-commutative28.0%
distribute-lft-neg-in28.0%
Simplified28.0%
if -2.1e13 < y < -6.5000000000000001e-19Initial program 93.0%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in b around inf 69.7%
neg-mul-169.7%
distribute-rgt-neg-in69.7%
Simplified69.7%
Taylor expanded in a around 0 22.8%
mul-1-neg22.8%
unsub-neg22.8%
Simplified22.8%
Taylor expanded in a around inf 45.6%
associate-*r*45.6%
neg-mul-145.6%
Simplified45.6%
if -6.5000000000000001e-19 < y < 1.59999999999999993e-56Initial program 96.6%
Taylor expanded in a around 0 56.6%
Taylor expanded in y around 0 41.4%
Final simplification35.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -8.8e-19) (not (<= y 1.7e-14))) (* a (* x (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -8.8e-19) || !(y <= 1.7e-14)) {
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 <= (-8.8d-19)) .or. (.not. (y <= 1.7d-14))) 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 <= -8.8e-19) || !(y <= 1.7e-14)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -8.8e-19) or not (y <= 1.7e-14): tmp = a * (x * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -8.8e-19) || !(y <= 1.7e-14)) 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 <= -8.8e-19) || ~((y <= 1.7e-14))) tmp = a * (x * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -8.8e-19], N[Not[LessEqual[y, 1.7e-14]], $MachinePrecision]], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.8 \cdot 10^{-19} \lor \neg \left(y \leq 1.7 \cdot 10^{-14}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -8.7999999999999994e-19 or 1.70000000000000001e-14 < y Initial program 99.3%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in b around inf 35.7%
neg-mul-135.7%
distribute-rgt-neg-in35.7%
Simplified35.7%
Taylor expanded in a around 0 8.8%
mul-1-neg8.8%
unsub-neg8.8%
Simplified8.8%
Taylor expanded in a around inf 17.6%
associate-*r*17.6%
neg-mul-117.6%
Simplified17.6%
if -8.7999999999999994e-19 < y < 1.70000000000000001e-14Initial program 95.9%
Taylor expanded in a around 0 56.0%
Taylor expanded in y around 0 39.8%
Final simplification28.0%
(FPCore (x y z t a b) :precision binary64 (if (<= a 4.5e+137) (* x (- 1.0 (* y t))) (* t (* x (- y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= 4.5e+137) {
tmp = x * (1.0 - (y * t));
} else {
tmp = 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.5d+137) then
tmp = x * (1.0d0 - (y * t))
else
tmp = 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.5e+137) {
tmp = x * (1.0 - (y * t));
} else {
tmp = t * (x * -y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= 4.5e+137: tmp = x * (1.0 - (y * t)) else: tmp = t * (x * -y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= 4.5e+137) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(t * Float64(x * Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= 4.5e+137) tmp = x * (1.0 - (y * t)); else tmp = t * (x * -y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, 4.5e+137], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.5 \cdot 10^{+137}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\end{array}
\end{array}
if a < 4.5000000000000001e137Initial program 99.1%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in t around inf 66.0%
associate-*r*66.0%
neg-mul-166.0%
Simplified66.0%
Taylor expanded in t around 0 35.8%
mul-1-neg35.8%
*-commutative35.8%
unsub-neg35.8%
Simplified35.8%
if 4.5000000000000001e137 < a Initial program 88.6%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in t around inf 26.4%
associate-*r*26.4%
neg-mul-126.4%
Simplified26.4%
Taylor expanded in t around 0 4.5%
mul-1-neg4.5%
*-commutative4.5%
unsub-neg4.5%
Simplified4.5%
Taylor expanded in y around inf 32.2%
Final simplification35.3%
(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.7%
Taylor expanded in a around 0 73.2%
Taylor expanded in y around 0 21.0%
Final simplification21.0%
herbie shell --seed 2024020
(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))))))