
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * 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 + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * 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 + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ y (- (+ x z) (fma z (log t) (* b (- 0.5 a))))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
return y + ((x + z) - fma(z, log(t), (b * (0.5 - a))));
}
x, y = sort([x, y]) function code(x, y, z, t, a, b) return Float64(y + Float64(Float64(x + z) - fma(z, log(t), Float64(b * Float64(0.5 - a))))) end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(y + N[(N[(x + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision] + N[(b * N[(0.5 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
y + \left(\left(x + z\right) - \mathsf{fma}\left(z, \log t, b \cdot \left(0.5 - a\right)\right)\right)
\end{array}
Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Final simplification99.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (log t))) (t_2 (* b (- a 0.5))))
(if (<= z -1.35e+210)
(- (+ z t_2) t_1)
(if (or (<= z -1.1e+85) (not (<= z 6.6e+109)))
(+ (- (+ z (+ y x)) t_1) (* b -0.5))
(+ y (+ (+ x z) t_2))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * log(t);
double t_2 = b * (a - 0.5);
double tmp;
if (z <= -1.35e+210) {
tmp = (z + t_2) - t_1;
} else if ((z <= -1.1e+85) || !(z <= 6.6e+109)) {
tmp = ((z + (y + x)) - t_1) + (b * -0.5);
} else {
tmp = y + ((x + z) + t_2);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = z * log(t)
t_2 = b * (a - 0.5d0)
if (z <= (-1.35d+210)) then
tmp = (z + t_2) - t_1
else if ((z <= (-1.1d+85)) .or. (.not. (z <= 6.6d+109))) then
tmp = ((z + (y + x)) - t_1) + (b * (-0.5d0))
else
tmp = y + ((x + z) + t_2)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * Math.log(t);
double t_2 = b * (a - 0.5);
double tmp;
if (z <= -1.35e+210) {
tmp = (z + t_2) - t_1;
} else if ((z <= -1.1e+85) || !(z <= 6.6e+109)) {
tmp = ((z + (y + x)) - t_1) + (b * -0.5);
} else {
tmp = y + ((x + z) + t_2);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): t_1 = z * math.log(t) t_2 = b * (a - 0.5) tmp = 0 if z <= -1.35e+210: tmp = (z + t_2) - t_1 elif (z <= -1.1e+85) or not (z <= 6.6e+109): tmp = ((z + (y + x)) - t_1) + (b * -0.5) else: tmp = y + ((x + z) + t_2) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) t_1 = Float64(z * log(t)) t_2 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (z <= -1.35e+210) tmp = Float64(Float64(z + t_2) - t_1); elseif ((z <= -1.1e+85) || !(z <= 6.6e+109)) tmp = Float64(Float64(Float64(z + Float64(y + x)) - t_1) + Float64(b * -0.5)); else tmp = Float64(y + Float64(Float64(x + z) + t_2)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = z * log(t);
t_2 = b * (a - 0.5);
tmp = 0.0;
if (z <= -1.35e+210)
tmp = (z + t_2) - t_1;
elseif ((z <= -1.1e+85) || ~((z <= 6.6e+109)))
tmp = ((z + (y + x)) - t_1) + (b * -0.5);
else
tmp = y + ((x + z) + t_2);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35e+210], N[(N[(z + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision], If[Or[LessEqual[z, -1.1e+85], N[Not[LessEqual[z, 6.6e+109]], $MachinePrecision]], N[(N[(N[(z + N[(y + x), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(b * -0.5), $MachinePrecision]), $MachinePrecision], N[(y + N[(N[(x + z), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := z \cdot \log t\\
t_2 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{+210}:\\
\;\;\;\;\left(z + t_2\right) - t_1\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{+85} \lor \neg \left(z \leq 6.6 \cdot 10^{+109}\right):\\
\;\;\;\;\left(\left(z + \left(y + x\right)\right) - t_1\right) + b \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;y + \left(\left(x + z\right) + t_2\right)\\
\end{array}
\end{array}
if z < -1.35e210Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in y around 0 99.9%
if -1.35e210 < z < -1.1000000000000001e85 or 6.5999999999999998e109 < z Initial program 99.6%
Taylor expanded in a around 0 91.7%
*-commutative91.7%
Simplified91.7%
if -1.1000000000000001e85 < z < 6.5999999999999998e109Initial program 100.0%
associate-+l-100.0%
+-commutative100.0%
associate-+l+100.0%
associate--l+100.0%
fma-neg100.0%
distribute-lft-neg-in100.0%
*-commutative100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 96.0%
Final simplification95.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))) (t_2 (+ t_1 (* z (- 1.0 (log t))))))
(if (<= z -9.2e+174)
t_2
(if (<= z -1.6e+88)
(+ x (- y (- (* z (log t)) z)))
(if (<= z 1.55e+109) (+ y (+ (+ x z) t_1)) t_2)))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = t_1 + (z * (1.0 - log(t)));
double tmp;
if (z <= -9.2e+174) {
tmp = t_2;
} else if (z <= -1.6e+88) {
tmp = x + (y - ((z * log(t)) - z));
} else if (z <= 1.55e+109) {
tmp = y + ((x + z) + t_1);
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = b * (a - 0.5d0)
t_2 = t_1 + (z * (1.0d0 - log(t)))
if (z <= (-9.2d+174)) then
tmp = t_2
else if (z <= (-1.6d+88)) then
tmp = x + (y - ((z * log(t)) - z))
else if (z <= 1.55d+109) then
tmp = y + ((x + z) + t_1)
else
tmp = t_2
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = t_1 + (z * (1.0 - Math.log(t)));
double tmp;
if (z <= -9.2e+174) {
tmp = t_2;
} else if (z <= -1.6e+88) {
tmp = x + (y - ((z * Math.log(t)) - z));
} else if (z <= 1.55e+109) {
tmp = y + ((x + z) + t_1);
} else {
tmp = t_2;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) t_2 = t_1 + (z * (1.0 - math.log(t))) tmp = 0 if z <= -9.2e+174: tmp = t_2 elif z <= -1.6e+88: tmp = x + (y - ((z * math.log(t)) - z)) elif z <= 1.55e+109: tmp = y + ((x + z) + t_1) else: tmp = t_2 return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) t_2 = Float64(t_1 + Float64(z * Float64(1.0 - log(t)))) tmp = 0.0 if (z <= -9.2e+174) tmp = t_2; elseif (z <= -1.6e+88) tmp = Float64(x + Float64(y - Float64(Float64(z * log(t)) - z))); elseif (z <= 1.55e+109) tmp = Float64(y + Float64(Float64(x + z) + t_1)); else tmp = t_2; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a - 0.5);
t_2 = t_1 + (z * (1.0 - log(t)));
tmp = 0.0;
if (z <= -9.2e+174)
tmp = t_2;
elseif (z <= -1.6e+88)
tmp = x + (y - ((z * log(t)) - z));
elseif (z <= 1.55e+109)
tmp = y + ((x + z) + t_1);
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.2e+174], t$95$2, If[LessEqual[z, -1.6e+88], N[(x + N[(y - N[(N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e+109], N[(y + N[(N[(x + z), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
t_2 := t_1 + z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -9.2 \cdot 10^{+174}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{+88}:\\
\;\;\;\;x + \left(y - \left(z \cdot \log t - z\right)\right)\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+109}:\\
\;\;\;\;y + \left(\left(x + z\right) + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -9.1999999999999991e174 or 1.54999999999999996e109 < z Initial program 99.7%
remove-double-neg99.7%
distribute-rgt-neg-out99.7%
associate--l+99.7%
distribute-rgt-neg-in99.7%
sub-neg99.7%
metadata-eval99.7%
remove-double-neg99.7%
Simplified99.7%
Taylor expanded in x around 0 92.5%
Taylor expanded in y around 0 87.1%
Taylor expanded in z around 0 87.2%
if -9.1999999999999991e174 < z < -1.5999999999999999e88Initial program 99.8%
remove-double-neg99.8%
distribute-rgt-neg-out99.8%
associate--l+99.8%
distribute-rgt-neg-in99.8%
sub-neg99.8%
metadata-eval99.8%
remove-double-neg99.8%
Simplified99.8%
Taylor expanded in a around 0 99.7%
Taylor expanded in b around 0 88.1%
associate--l+88.1%
associate--l+88.1%
Simplified88.1%
if -1.5999999999999999e88 < z < 1.54999999999999996e109Initial program 100.0%
associate-+l-100.0%
+-commutative100.0%
associate-+l+100.0%
associate--l+100.0%
fma-neg100.0%
distribute-lft-neg-in100.0%
*-commutative100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 96.0%
Final simplification93.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (log t))) (t_2 (* b (- a 0.5))))
(if (<= z -1.8e+175)
(- (+ z t_2) t_1)
(if (<= z -3.6e+87)
(+ x (- y (- t_1 z)))
(if (<= z 1.9e+109)
(+ y (+ (+ x z) t_2))
(+ t_2 (* z (- 1.0 (log t)))))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * log(t);
double t_2 = b * (a - 0.5);
double tmp;
if (z <= -1.8e+175) {
tmp = (z + t_2) - t_1;
} else if (z <= -3.6e+87) {
tmp = x + (y - (t_1 - z));
} else if (z <= 1.9e+109) {
tmp = y + ((x + z) + t_2);
} else {
tmp = t_2 + (z * (1.0 - log(t)));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = z * log(t)
t_2 = b * (a - 0.5d0)
if (z <= (-1.8d+175)) then
tmp = (z + t_2) - t_1
else if (z <= (-3.6d+87)) then
tmp = x + (y - (t_1 - z))
else if (z <= 1.9d+109) then
tmp = y + ((x + z) + t_2)
else
tmp = t_2 + (z * (1.0d0 - log(t)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * Math.log(t);
double t_2 = b * (a - 0.5);
double tmp;
if (z <= -1.8e+175) {
tmp = (z + t_2) - t_1;
} else if (z <= -3.6e+87) {
tmp = x + (y - (t_1 - z));
} else if (z <= 1.9e+109) {
tmp = y + ((x + z) + t_2);
} else {
tmp = t_2 + (z * (1.0 - Math.log(t)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): t_1 = z * math.log(t) t_2 = b * (a - 0.5) tmp = 0 if z <= -1.8e+175: tmp = (z + t_2) - t_1 elif z <= -3.6e+87: tmp = x + (y - (t_1 - z)) elif z <= 1.9e+109: tmp = y + ((x + z) + t_2) else: tmp = t_2 + (z * (1.0 - math.log(t))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) t_1 = Float64(z * log(t)) t_2 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (z <= -1.8e+175) tmp = Float64(Float64(z + t_2) - t_1); elseif (z <= -3.6e+87) tmp = Float64(x + Float64(y - Float64(t_1 - z))); elseif (z <= 1.9e+109) tmp = Float64(y + Float64(Float64(x + z) + t_2)); else tmp = Float64(t_2 + Float64(z * Float64(1.0 - log(t)))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = z * log(t);
t_2 = b * (a - 0.5);
tmp = 0.0;
if (z <= -1.8e+175)
tmp = (z + t_2) - t_1;
elseif (z <= -3.6e+87)
tmp = x + (y - (t_1 - z));
elseif (z <= 1.9e+109)
tmp = y + ((x + z) + t_2);
else
tmp = t_2 + (z * (1.0 - log(t)));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e+175], N[(N[(z + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[z, -3.6e+87], N[(x + N[(y - N[(t$95$1 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e+109], N[(y + N[(N[(x + z), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := z \cdot \log t\\
t_2 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+175}:\\
\;\;\;\;\left(z + t_2\right) - t_1\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{+87}:\\
\;\;\;\;x + \left(y - \left(t_1 - z\right)\right)\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+109}:\\
\;\;\;\;y + \left(\left(x + z\right) + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 + z \cdot \left(1 - \log t\right)\\
\end{array}
\end{array}
if z < -1.80000000000000017e175Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 95.8%
Taylor expanded in y around 0 95.8%
if -1.80000000000000017e175 < z < -3.59999999999999994e87Initial program 99.8%
remove-double-neg99.8%
distribute-rgt-neg-out99.8%
associate--l+99.8%
distribute-rgt-neg-in99.8%
sub-neg99.8%
metadata-eval99.8%
remove-double-neg99.8%
Simplified99.8%
Taylor expanded in a around 0 99.7%
Taylor expanded in b around 0 88.1%
associate--l+88.1%
associate--l+88.1%
Simplified88.1%
if -3.59999999999999994e87 < z < 1.90000000000000019e109Initial program 100.0%
associate-+l-100.0%
+-commutative100.0%
associate-+l+100.0%
associate--l+100.0%
fma-neg100.0%
distribute-lft-neg-in100.0%
*-commutative100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 96.0%
if 1.90000000000000019e109 < z Initial program 99.5%
remove-double-neg99.5%
distribute-rgt-neg-out99.5%
associate--l+99.6%
distribute-rgt-neg-in99.6%
sub-neg99.6%
metadata-eval99.6%
remove-double-neg99.6%
Simplified99.6%
Taylor expanded in x around 0 90.7%
Taylor expanded in y around 0 82.4%
Taylor expanded in z around 0 82.5%
Final simplification93.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (log t))) (t_2 (* b (- a 0.5))))
(if (<= z -1.15e+83)
(- (+ y (+ z t_2)) t_1)
(if (<= z 3.2e+110)
(+ y (+ (+ x z) t_2))
(+ (- (+ z (+ y x)) t_1) (* b -0.5))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * log(t);
double t_2 = b * (a - 0.5);
double tmp;
if (z <= -1.15e+83) {
tmp = (y + (z + t_2)) - t_1;
} else if (z <= 3.2e+110) {
tmp = y + ((x + z) + t_2);
} else {
tmp = ((z + (y + x)) - t_1) + (b * -0.5);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = z * log(t)
t_2 = b * (a - 0.5d0)
if (z <= (-1.15d+83)) then
tmp = (y + (z + t_2)) - t_1
else if (z <= 3.2d+110) then
tmp = y + ((x + z) + t_2)
else
tmp = ((z + (y + x)) - t_1) + (b * (-0.5d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * Math.log(t);
double t_2 = b * (a - 0.5);
double tmp;
if (z <= -1.15e+83) {
tmp = (y + (z + t_2)) - t_1;
} else if (z <= 3.2e+110) {
tmp = y + ((x + z) + t_2);
} else {
tmp = ((z + (y + x)) - t_1) + (b * -0.5);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): t_1 = z * math.log(t) t_2 = b * (a - 0.5) tmp = 0 if z <= -1.15e+83: tmp = (y + (z + t_2)) - t_1 elif z <= 3.2e+110: tmp = y + ((x + z) + t_2) else: tmp = ((z + (y + x)) - t_1) + (b * -0.5) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) t_1 = Float64(z * log(t)) t_2 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (z <= -1.15e+83) tmp = Float64(Float64(y + Float64(z + t_2)) - t_1); elseif (z <= 3.2e+110) tmp = Float64(y + Float64(Float64(x + z) + t_2)); else tmp = Float64(Float64(Float64(z + Float64(y + x)) - t_1) + Float64(b * -0.5)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = z * log(t);
t_2 = b * (a - 0.5);
tmp = 0.0;
if (z <= -1.15e+83)
tmp = (y + (z + t_2)) - t_1;
elseif (z <= 3.2e+110)
tmp = y + ((x + z) + t_2);
else
tmp = ((z + (y + x)) - t_1) + (b * -0.5);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e+83], N[(N[(y + N[(z + t$95$2), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[z, 3.2e+110], N[(y + N[(N[(x + z), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z + N[(y + x), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(b * -0.5), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := z \cdot \log t\\
t_2 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{+83}:\\
\;\;\;\;\left(y + \left(z + t_2\right)\right) - t_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+110}:\\
\;\;\;\;y + \left(\left(x + z\right) + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(z + \left(y + x\right)\right) - t_1\right) + b \cdot -0.5\\
\end{array}
\end{array}
if z < -1.14999999999999997e83Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 90.7%
if -1.14999999999999997e83 < z < 3.19999999999999994e110Initial program 100.0%
associate-+l-100.0%
+-commutative100.0%
associate-+l+100.0%
associate--l+100.0%
fma-neg100.0%
distribute-lft-neg-in100.0%
*-commutative100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 96.0%
if 3.19999999999999994e110 < z Initial program 99.5%
Taylor expanded in a around 0 92.8%
*-commutative92.8%
Simplified92.8%
Final simplification94.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= z -3.2e+215)
(- z (* z (log t)))
(if (<= z -1.8e+133)
(+ t_1 (+ y x))
(if (or (<= z -2.9e+123) (not (<= z 7e+141)))
(+ x (* z (- 1.0 (log t))))
(+ y (+ (+ x z) t_1)))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (z <= -3.2e+215) {
tmp = z - (z * log(t));
} else if (z <= -1.8e+133) {
tmp = t_1 + (y + x);
} else if ((z <= -2.9e+123) || !(z <= 7e+141)) {
tmp = x + (z * (1.0 - log(t)));
} else {
tmp = y + ((x + z) + t_1);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = b * (a - 0.5d0)
if (z <= (-3.2d+215)) then
tmp = z - (z * log(t))
else if (z <= (-1.8d+133)) then
tmp = t_1 + (y + x)
else if ((z <= (-2.9d+123)) .or. (.not. (z <= 7d+141))) then
tmp = x + (z * (1.0d0 - log(t)))
else
tmp = y + ((x + z) + t_1)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (z <= -3.2e+215) {
tmp = z - (z * Math.log(t));
} else if (z <= -1.8e+133) {
tmp = t_1 + (y + x);
} else if ((z <= -2.9e+123) || !(z <= 7e+141)) {
tmp = x + (z * (1.0 - Math.log(t)));
} else {
tmp = y + ((x + z) + t_1);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if z <= -3.2e+215: tmp = z - (z * math.log(t)) elif z <= -1.8e+133: tmp = t_1 + (y + x) elif (z <= -2.9e+123) or not (z <= 7e+141): tmp = x + (z * (1.0 - math.log(t))) else: tmp = y + ((x + z) + t_1) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (z <= -3.2e+215) tmp = Float64(z - Float64(z * log(t))); elseif (z <= -1.8e+133) tmp = Float64(t_1 + Float64(y + x)); elseif ((z <= -2.9e+123) || !(z <= 7e+141)) tmp = Float64(x + Float64(z * Float64(1.0 - log(t)))); else tmp = Float64(y + Float64(Float64(x + z) + t_1)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a - 0.5);
tmp = 0.0;
if (z <= -3.2e+215)
tmp = z - (z * log(t));
elseif (z <= -1.8e+133)
tmp = t_1 + (y + x);
elseif ((z <= -2.9e+123) || ~((z <= 7e+141)))
tmp = x + (z * (1.0 - log(t)));
else
tmp = y + ((x + z) + t_1);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e+215], N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.8e+133], N[(t$95$1 + N[(y + x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -2.9e+123], N[Not[LessEqual[z, 7e+141]], $MachinePrecision]], N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(N[(x + z), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+215}:\\
\;\;\;\;z - z \cdot \log t\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{+133}:\\
\;\;\;\;t_1 + \left(y + x\right)\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{+123} \lor \neg \left(z \leq 7 \cdot 10^{+141}\right):\\
\;\;\;\;x + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;y + \left(\left(x + z\right) + t_1\right)\\
\end{array}
\end{array}
if z < -3.1999999999999999e215Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around inf 82.2%
sub-neg82.2%
log-rec82.2%
distribute-lft-in82.4%
log-rec82.4%
distribute-rgt-neg-in82.4%
unsub-neg82.4%
*-rgt-identity82.4%
Simplified82.4%
if -3.1999999999999999e215 < z < -1.79999999999999989e133Initial program 100.0%
associate-+l-100.0%
+-commutative100.0%
associate-+l+100.0%
associate--l+100.0%
fma-neg100.0%
distribute-lft-neg-in100.0%
*-commutative100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 79.9%
if -1.79999999999999989e133 < z < -2.9000000000000001e123 or 6.9999999999999999e141 < z Initial program 99.5%
remove-double-neg99.5%
distribute-rgt-neg-out99.5%
associate--l+99.5%
distribute-rgt-neg-in99.5%
sub-neg99.5%
metadata-eval99.5%
remove-double-neg99.5%
Simplified99.5%
Taylor expanded in a around 0 99.5%
Taylor expanded in z around inf 73.8%
Taylor expanded in z around 0 74.0%
if -2.9000000000000001e123 < z < 6.9999999999999999e141Initial program 100.0%
associate-+l-100.0%
+-commutative100.0%
associate-+l+100.0%
associate--l+100.0%
fma-neg100.0%
distribute-lft-neg-in100.0%
*-commutative100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 94.0%
Final simplification89.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))) (t_2 (* z (- 1.0 (log t)))))
(if (<= z -2.9e+215)
(- z (* z (log t)))
(if (<= z -3.9e+139)
(+ t_1 (+ y x))
(if (<= z -2.25e+88)
(+ y t_2)
(if (<= z 2.4e+142) (+ y (+ (+ x z) t_1)) (+ x t_2)))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = z * (1.0 - log(t));
double tmp;
if (z <= -2.9e+215) {
tmp = z - (z * log(t));
} else if (z <= -3.9e+139) {
tmp = t_1 + (y + x);
} else if (z <= -2.25e+88) {
tmp = y + t_2;
} else if (z <= 2.4e+142) {
tmp = y + ((x + z) + t_1);
} else {
tmp = x + t_2;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = b * (a - 0.5d0)
t_2 = z * (1.0d0 - log(t))
if (z <= (-2.9d+215)) then
tmp = z - (z * log(t))
else if (z <= (-3.9d+139)) then
tmp = t_1 + (y + x)
else if (z <= (-2.25d+88)) then
tmp = y + t_2
else if (z <= 2.4d+142) then
tmp = y + ((x + z) + t_1)
else
tmp = x + t_2
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = z * (1.0 - Math.log(t));
double tmp;
if (z <= -2.9e+215) {
tmp = z - (z * Math.log(t));
} else if (z <= -3.9e+139) {
tmp = t_1 + (y + x);
} else if (z <= -2.25e+88) {
tmp = y + t_2;
} else if (z <= 2.4e+142) {
tmp = y + ((x + z) + t_1);
} else {
tmp = x + t_2;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) t_2 = z * (1.0 - math.log(t)) tmp = 0 if z <= -2.9e+215: tmp = z - (z * math.log(t)) elif z <= -3.9e+139: tmp = t_1 + (y + x) elif z <= -2.25e+88: tmp = y + t_2 elif z <= 2.4e+142: tmp = y + ((x + z) + t_1) else: tmp = x + t_2 return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) t_2 = Float64(z * Float64(1.0 - log(t))) tmp = 0.0 if (z <= -2.9e+215) tmp = Float64(z - Float64(z * log(t))); elseif (z <= -3.9e+139) tmp = Float64(t_1 + Float64(y + x)); elseif (z <= -2.25e+88) tmp = Float64(y + t_2); elseif (z <= 2.4e+142) tmp = Float64(y + Float64(Float64(x + z) + t_1)); else tmp = Float64(x + t_2); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a - 0.5);
t_2 = z * (1.0 - log(t));
tmp = 0.0;
if (z <= -2.9e+215)
tmp = z - (z * log(t));
elseif (z <= -3.9e+139)
tmp = t_1 + (y + x);
elseif (z <= -2.25e+88)
tmp = y + t_2;
elseif (z <= 2.4e+142)
tmp = y + ((x + z) + t_1);
else
tmp = x + t_2;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e+215], N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.9e+139], N[(t$95$1 + N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.25e+88], N[(y + t$95$2), $MachinePrecision], If[LessEqual[z, 2.4e+142], N[(y + N[(N[(x + z), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
t_2 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+215}:\\
\;\;\;\;z - z \cdot \log t\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{+139}:\\
\;\;\;\;t_1 + \left(y + x\right)\\
\mathbf{elif}\;z \leq -2.25 \cdot 10^{+88}:\\
\;\;\;\;y + t_2\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+142}:\\
\;\;\;\;y + \left(\left(x + z\right) + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;x + t_2\\
\end{array}
\end{array}
if z < -2.8999999999999999e215Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around inf 82.2%
sub-neg82.2%
log-rec82.2%
distribute-lft-in82.4%
log-rec82.4%
distribute-rgt-neg-in82.4%
unsub-neg82.4%
*-rgt-identity82.4%
Simplified82.4%
if -2.8999999999999999e215 < z < -3.90000000000000006e139Initial program 100.0%
associate-+l-100.0%
+-commutative100.0%
associate-+l+100.0%
associate--l+100.0%
fma-neg100.0%
distribute-lft-neg-in100.0%
*-commutative100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 78.4%
if -3.90000000000000006e139 < z < -2.25e88Initial program 99.6%
associate-+l-99.6%
+-commutative99.6%
associate-+l+99.6%
associate--l+99.6%
fma-neg99.6%
distribute-lft-neg-in99.6%
*-commutative99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in z around inf 73.7%
if -2.25e88 < z < 2.3999999999999999e142Initial program 100.0%
associate-+l-100.0%
+-commutative100.0%
associate-+l+100.0%
associate--l+100.0%
fma-neg100.0%
distribute-lft-neg-in100.0%
*-commutative100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 95.2%
if 2.3999999999999999e142 < z Initial program 99.4%
remove-double-neg99.4%
distribute-rgt-neg-out99.4%
associate--l+99.5%
distribute-rgt-neg-in99.5%
sub-neg99.5%
metadata-eval99.5%
remove-double-neg99.5%
Simplified99.5%
Taylor expanded in a around 0 99.4%
Taylor expanded in z around inf 71.3%
Taylor expanded in z around 0 71.5%
Final simplification89.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ (+ (- z (* z (log t))) (+ y x)) (* b (+ a -0.5))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
return ((z - (z * log(t))) + (y + x)) + (b * (a + -0.5));
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = ((z - (z * log(t))) + (y + x)) + (b * (a + (-0.5d0)))
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
return ((z - (z * Math.log(t))) + (y + x)) + (b * (a + -0.5));
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): return ((z - (z * math.log(t))) + (y + x)) + (b * (a + -0.5))
x, y = sort([x, y]) function code(x, y, z, t, a, b) return Float64(Float64(Float64(z - Float64(z * log(t))) + Float64(y + x)) + Float64(b * Float64(a + -0.5))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a, b)
tmp = ((z - (z * log(t))) + (y + x)) + (b * (a + -0.5));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\left(\left(z - z \cdot \log t\right) + \left(y + x\right)\right) + b \cdot \left(a + -0.5\right)
\end{array}
Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Final simplification99.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))) (t_2 (* z (- 1.0 (log t)))))
(if (<= z -9e+214)
t_2
(if (<= z -9.8e+132)
(+ t_1 (+ y x))
(if (or (<= z -2.9e+123) (not (<= z 2.2e+230)))
t_2
(+ y (+ (+ x z) t_1)))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = z * (1.0 - log(t));
double tmp;
if (z <= -9e+214) {
tmp = t_2;
} else if (z <= -9.8e+132) {
tmp = t_1 + (y + x);
} else if ((z <= -2.9e+123) || !(z <= 2.2e+230)) {
tmp = t_2;
} else {
tmp = y + ((x + z) + t_1);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = b * (a - 0.5d0)
t_2 = z * (1.0d0 - log(t))
if (z <= (-9d+214)) then
tmp = t_2
else if (z <= (-9.8d+132)) then
tmp = t_1 + (y + x)
else if ((z <= (-2.9d+123)) .or. (.not. (z <= 2.2d+230))) then
tmp = t_2
else
tmp = y + ((x + z) + t_1)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = z * (1.0 - Math.log(t));
double tmp;
if (z <= -9e+214) {
tmp = t_2;
} else if (z <= -9.8e+132) {
tmp = t_1 + (y + x);
} else if ((z <= -2.9e+123) || !(z <= 2.2e+230)) {
tmp = t_2;
} else {
tmp = y + ((x + z) + t_1);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) t_2 = z * (1.0 - math.log(t)) tmp = 0 if z <= -9e+214: tmp = t_2 elif z <= -9.8e+132: tmp = t_1 + (y + x) elif (z <= -2.9e+123) or not (z <= 2.2e+230): tmp = t_2 else: tmp = y + ((x + z) + t_1) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) t_2 = Float64(z * Float64(1.0 - log(t))) tmp = 0.0 if (z <= -9e+214) tmp = t_2; elseif (z <= -9.8e+132) tmp = Float64(t_1 + Float64(y + x)); elseif ((z <= -2.9e+123) || !(z <= 2.2e+230)) tmp = t_2; else tmp = Float64(y + Float64(Float64(x + z) + t_1)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a - 0.5);
t_2 = z * (1.0 - log(t));
tmp = 0.0;
if (z <= -9e+214)
tmp = t_2;
elseif (z <= -9.8e+132)
tmp = t_1 + (y + x);
elseif ((z <= -2.9e+123) || ~((z <= 2.2e+230)))
tmp = t_2;
else
tmp = y + ((x + z) + t_1);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9e+214], t$95$2, If[LessEqual[z, -9.8e+132], N[(t$95$1 + N[(y + x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -2.9e+123], N[Not[LessEqual[z, 2.2e+230]], $MachinePrecision]], t$95$2, N[(y + N[(N[(x + z), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
t_2 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -9 \cdot 10^{+214}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -9.8 \cdot 10^{+132}:\\
\;\;\;\;t_1 + \left(y + x\right)\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{+123} \lor \neg \left(z \leq 2.2 \cdot 10^{+230}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;y + \left(\left(x + z\right) + t_1\right)\\
\end{array}
\end{array}
if z < -8.99999999999999935e214 or -9.8000000000000003e132 < z < -2.9000000000000001e123 or 2.2000000000000001e230 < z Initial program 99.6%
remove-double-neg99.6%
distribute-rgt-neg-out99.6%
associate--l+99.6%
distribute-rgt-neg-in99.6%
sub-neg99.6%
metadata-eval99.6%
remove-double-neg99.6%
Simplified99.6%
Taylor expanded in a around 0 99.6%
Taylor expanded in z around inf 78.1%
if -8.99999999999999935e214 < z < -9.8000000000000003e132Initial program 100.0%
associate-+l-100.0%
+-commutative100.0%
associate-+l+100.0%
associate--l+100.0%
fma-neg100.0%
distribute-lft-neg-in100.0%
*-commutative100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 79.9%
if -2.9000000000000001e123 < z < 2.2000000000000001e230Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 90.8%
Final simplification88.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= z -8.2e+215)
(- z (* z (log t)))
(if (<= z -2.25e+132)
(+ t_1 (+ y x))
(if (or (<= z -2.9e+123) (not (<= z 4.1e+229)))
(* z (- 1.0 (log t)))
(+ y (+ (+ x z) t_1)))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (z <= -8.2e+215) {
tmp = z - (z * log(t));
} else if (z <= -2.25e+132) {
tmp = t_1 + (y + x);
} else if ((z <= -2.9e+123) || !(z <= 4.1e+229)) {
tmp = z * (1.0 - log(t));
} else {
tmp = y + ((x + z) + t_1);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = b * (a - 0.5d0)
if (z <= (-8.2d+215)) then
tmp = z - (z * log(t))
else if (z <= (-2.25d+132)) then
tmp = t_1 + (y + x)
else if ((z <= (-2.9d+123)) .or. (.not. (z <= 4.1d+229))) then
tmp = z * (1.0d0 - log(t))
else
tmp = y + ((x + z) + t_1)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (z <= -8.2e+215) {
tmp = z - (z * Math.log(t));
} else if (z <= -2.25e+132) {
tmp = t_1 + (y + x);
} else if ((z <= -2.9e+123) || !(z <= 4.1e+229)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = y + ((x + z) + t_1);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if z <= -8.2e+215: tmp = z - (z * math.log(t)) elif z <= -2.25e+132: tmp = t_1 + (y + x) elif (z <= -2.9e+123) or not (z <= 4.1e+229): tmp = z * (1.0 - math.log(t)) else: tmp = y + ((x + z) + t_1) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (z <= -8.2e+215) tmp = Float64(z - Float64(z * log(t))); elseif (z <= -2.25e+132) tmp = Float64(t_1 + Float64(y + x)); elseif ((z <= -2.9e+123) || !(z <= 4.1e+229)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(y + Float64(Float64(x + z) + t_1)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a - 0.5);
tmp = 0.0;
if (z <= -8.2e+215)
tmp = z - (z * log(t));
elseif (z <= -2.25e+132)
tmp = t_1 + (y + x);
elseif ((z <= -2.9e+123) || ~((z <= 4.1e+229)))
tmp = z * (1.0 - log(t));
else
tmp = y + ((x + z) + t_1);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e+215], N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.25e+132], N[(t$95$1 + N[(y + x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -2.9e+123], N[Not[LessEqual[z, 4.1e+229]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(N[(x + z), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;z \leq -8.2 \cdot 10^{+215}:\\
\;\;\;\;z - z \cdot \log t\\
\mathbf{elif}\;z \leq -2.25 \cdot 10^{+132}:\\
\;\;\;\;t_1 + \left(y + x\right)\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{+123} \lor \neg \left(z \leq 4.1 \cdot 10^{+229}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;y + \left(\left(x + z\right) + t_1\right)\\
\end{array}
\end{array}
if z < -8.2000000000000007e215Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around inf 82.2%
sub-neg82.2%
log-rec82.2%
distribute-lft-in82.4%
log-rec82.4%
distribute-rgt-neg-in82.4%
unsub-neg82.4%
*-rgt-identity82.4%
Simplified82.4%
if -8.2000000000000007e215 < z < -2.24999999999999986e132Initial program 100.0%
associate-+l-100.0%
+-commutative100.0%
associate-+l+100.0%
associate--l+100.0%
fma-neg100.0%
distribute-lft-neg-in100.0%
*-commutative100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 79.9%
if -2.24999999999999986e132 < z < -2.9000000000000001e123 or 4.1000000000000001e229 < z Initial program 99.5%
remove-double-neg99.5%
distribute-rgt-neg-out99.5%
associate--l+99.5%
distribute-rgt-neg-in99.5%
sub-neg99.5%
metadata-eval99.5%
remove-double-neg99.5%
Simplified99.5%
Taylor expanded in a around 0 99.5%
Taylor expanded in z around inf 75.4%
if -2.9000000000000001e123 < z < 4.1000000000000001e229Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 90.8%
Final simplification88.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= b -1.3e-21)
(+ t_1 (+ y x))
(if (<= b 1.15e-37)
(+ x (- y (- (* z (log t)) z)))
(+ y (+ (+ x z) t_1))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (b <= -1.3e-21) {
tmp = t_1 + (y + x);
} else if (b <= 1.15e-37) {
tmp = x + (y - ((z * log(t)) - z));
} else {
tmp = y + ((x + z) + t_1);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = b * (a - 0.5d0)
if (b <= (-1.3d-21)) then
tmp = t_1 + (y + x)
else if (b <= 1.15d-37) then
tmp = x + (y - ((z * log(t)) - z))
else
tmp = y + ((x + z) + t_1)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (b <= -1.3e-21) {
tmp = t_1 + (y + x);
} else if (b <= 1.15e-37) {
tmp = x + (y - ((z * Math.log(t)) - z));
} else {
tmp = y + ((x + z) + t_1);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if b <= -1.3e-21: tmp = t_1 + (y + x) elif b <= 1.15e-37: tmp = x + (y - ((z * math.log(t)) - z)) else: tmp = y + ((x + z) + t_1) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (b <= -1.3e-21) tmp = Float64(t_1 + Float64(y + x)); elseif (b <= 1.15e-37) tmp = Float64(x + Float64(y - Float64(Float64(z * log(t)) - z))); else tmp = Float64(y + Float64(Float64(x + z) + t_1)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a - 0.5);
tmp = 0.0;
if (b <= -1.3e-21)
tmp = t_1 + (y + x);
elseif (b <= 1.15e-37)
tmp = x + (y - ((z * log(t)) - z));
else
tmp = y + ((x + z) + t_1);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.3e-21], N[(t$95$1 + N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.15e-37], N[(x + N[(y - N[(N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(N[(x + z), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;b \leq -1.3 \cdot 10^{-21}:\\
\;\;\;\;t_1 + \left(y + x\right)\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{-37}:\\
\;\;\;\;x + \left(y - \left(z \cdot \log t - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y + \left(\left(x + z\right) + t_1\right)\\
\end{array}
\end{array}
if b < -1.30000000000000009e-21Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 91.2%
if -1.30000000000000009e-21 < b < 1.15e-37Initial program 99.8%
remove-double-neg99.8%
distribute-rgt-neg-out99.8%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in a around 0 99.8%
Taylor expanded in b around 0 93.3%
associate--l+93.4%
associate--l+93.4%
Simplified93.4%
if 1.15e-37 < b Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 85.5%
Final simplification90.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= b -2.7e-16)
t_1
(if (<= b 2.2e-33)
(+ y x)
(if (<= b 2.25e+90) (+ x (* b a)) (if (<= b 2.1e+119) (+ y x) t_1))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (b <= -2.7e-16) {
tmp = t_1;
} else if (b <= 2.2e-33) {
tmp = y + x;
} else if (b <= 2.25e+90) {
tmp = x + (b * a);
} else if (b <= 2.1e+119) {
tmp = y + x;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = b * (a - 0.5d0)
if (b <= (-2.7d-16)) then
tmp = t_1
else if (b <= 2.2d-33) then
tmp = y + x
else if (b <= 2.25d+90) then
tmp = x + (b * a)
else if (b <= 2.1d+119) then
tmp = y + x
else
tmp = t_1
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (b <= -2.7e-16) {
tmp = t_1;
} else if (b <= 2.2e-33) {
tmp = y + x;
} else if (b <= 2.25e+90) {
tmp = x + (b * a);
} else if (b <= 2.1e+119) {
tmp = y + x;
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if b <= -2.7e-16: tmp = t_1 elif b <= 2.2e-33: tmp = y + x elif b <= 2.25e+90: tmp = x + (b * a) elif b <= 2.1e+119: tmp = y + x else: tmp = t_1 return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (b <= -2.7e-16) tmp = t_1; elseif (b <= 2.2e-33) tmp = Float64(y + x); elseif (b <= 2.25e+90) tmp = Float64(x + Float64(b * a)); elseif (b <= 2.1e+119) tmp = Float64(y + x); else tmp = t_1; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a - 0.5);
tmp = 0.0;
if (b <= -2.7e-16)
tmp = t_1;
elseif (b <= 2.2e-33)
tmp = y + x;
elseif (b <= 2.25e+90)
tmp = x + (b * a);
elseif (b <= 2.1e+119)
tmp = y + x;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.7e-16], t$95$1, If[LessEqual[b, 2.2e-33], N[(y + x), $MachinePrecision], If[LessEqual[b, 2.25e+90], N[(x + N[(b * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.1e+119], N[(y + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;b \leq -2.7 \cdot 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 2.2 \cdot 10^{-33}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;b \leq 2.25 \cdot 10^{+90}:\\
\;\;\;\;x + b \cdot a\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{+119}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -2.69999999999999999e-16 or 2.09999999999999983e119 < b Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in b around inf 73.6%
if -2.69999999999999999e-16 < b < 2.20000000000000005e-33 or 2.25e90 < b < 2.09999999999999983e119Initial program 99.8%
associate-+l-99.8%
+-commutative99.8%
associate-+l+99.8%
associate--l+99.8%
fma-neg99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around inf 61.4%
if 2.20000000000000005e-33 < b < 2.25e90Initial program 99.8%
remove-double-neg99.8%
distribute-rgt-neg-out99.8%
associate--l+99.8%
distribute-rgt-neg-in99.8%
sub-neg99.8%
metadata-eval99.8%
remove-double-neg99.8%
Simplified99.8%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 69.0%
Taylor expanded in a around inf 53.9%
*-commutative53.9%
Simplified53.9%
Final simplification65.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (+ y x) -2e-94) (- x (* b (- 0.5 a))) (+ y (+ z (* b (- a 0.5))))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y + x) <= -2e-94) {
tmp = x - (b * (0.5 - a));
} else {
tmp = y + (z + (b * (a - 0.5)));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 + x) <= (-2d-94)) then
tmp = x - (b * (0.5d0 - a))
else
tmp = y + (z + (b * (a - 0.5d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y + x) <= -2e-94) {
tmp = x - (b * (0.5 - a));
} else {
tmp = y + (z + (b * (a - 0.5)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): tmp = 0 if (y + x) <= -2e-94: tmp = x - (b * (0.5 - a)) else: tmp = y + (z + (b * (a - 0.5))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y + x) <= -2e-94) tmp = Float64(x - Float64(b * Float64(0.5 - a))); else tmp = Float64(y + Float64(z + Float64(b * Float64(a - 0.5)))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((y + x) <= -2e-94)
tmp = x - (b * (0.5 - a));
else
tmp = y + (z + (b * (a - 0.5)));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y + x), $MachinePrecision], -2e-94], N[(x - N[(b * N[(0.5 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(z + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y + x \leq -2 \cdot 10^{-94}:\\
\;\;\;\;x - b \cdot \left(0.5 - a\right)\\
\mathbf{else}:\\
\;\;\;\;y + \left(z + b \cdot \left(a - 0.5\right)\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -1.9999999999999999e-94Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 82.8%
Taylor expanded in b around inf 58.6%
if -1.9999999999999999e-94 < (+.f64 x y) Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 82.2%
+-commutative82.2%
fma-def82.2%
Simplified82.2%
Taylor expanded in z around 0 57.5%
Final simplification58.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= a -1.65e+156)
(* b a)
(if (or (<= a -6.8e+111) (and (not (<= a -5.5e+48)) (<= a 3.8e+28)))
(+ y x)
(* b a))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.65e+156) {
tmp = b * a;
} else if ((a <= -6.8e+111) || (!(a <= -5.5e+48) && (a <= 3.8e+28))) {
tmp = y + x;
} else {
tmp = b * a;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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.65d+156)) then
tmp = b * a
else if ((a <= (-6.8d+111)) .or. (.not. (a <= (-5.5d+48))) .and. (a <= 3.8d+28)) then
tmp = y + x
else
tmp = b * a
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.65e+156) {
tmp = b * a;
} else if ((a <= -6.8e+111) || (!(a <= -5.5e+48) && (a <= 3.8e+28))) {
tmp = y + x;
} else {
tmp = b * a;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): tmp = 0 if a <= -1.65e+156: tmp = b * a elif (a <= -6.8e+111) or (not (a <= -5.5e+48) and (a <= 3.8e+28)): tmp = y + x else: tmp = b * a return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.65e+156) tmp = Float64(b * a); elseif ((a <= -6.8e+111) || (!(a <= -5.5e+48) && (a <= 3.8e+28))) tmp = Float64(y + x); else tmp = Float64(b * a); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (a <= -1.65e+156)
tmp = b * a;
elseif ((a <= -6.8e+111) || (~((a <= -5.5e+48)) && (a <= 3.8e+28)))
tmp = y + x;
else
tmp = b * a;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.65e+156], N[(b * a), $MachinePrecision], If[Or[LessEqual[a, -6.8e+111], And[N[Not[LessEqual[a, -5.5e+48]], $MachinePrecision], LessEqual[a, 3.8e+28]]], N[(y + x), $MachinePrecision], N[(b * a), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.65 \cdot 10^{+156}:\\
\;\;\;\;b \cdot a\\
\mathbf{elif}\;a \leq -6.8 \cdot 10^{+111} \lor \neg \left(a \leq -5.5 \cdot 10^{+48}\right) \land a \leq 3.8 \cdot 10^{+28}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;b \cdot a\\
\end{array}
\end{array}
if a < -1.6499999999999999e156 or -6.8000000000000003e111 < a < -5.5000000000000002e48 or 3.7999999999999999e28 < a Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in a around inf 62.4%
*-commutative62.4%
Simplified62.4%
if -1.6499999999999999e156 < a < -6.8000000000000003e111 or -5.5000000000000002e48 < a < 3.7999999999999999e28Initial program 99.9%
associate-+l-99.8%
+-commutative99.8%
associate-+l+99.8%
associate--l+99.8%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around inf 50.9%
Final simplification55.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= a -5.6e+48)
(* b a)
(if (<= a -2.5e-155)
x
(if (<= a 6.2e-182) y (if (<= a 350000000000.0) (* b -0.5) (* b a))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.6e+48) {
tmp = b * a;
} else if (a <= -2.5e-155) {
tmp = x;
} else if (a <= 6.2e-182) {
tmp = y;
} else if (a <= 350000000000.0) {
tmp = b * -0.5;
} else {
tmp = b * a;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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.6d+48)) then
tmp = b * a
else if (a <= (-2.5d-155)) then
tmp = x
else if (a <= 6.2d-182) then
tmp = y
else if (a <= 350000000000.0d0) then
tmp = b * (-0.5d0)
else
tmp = b * a
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.6e+48) {
tmp = b * a;
} else if (a <= -2.5e-155) {
tmp = x;
} else if (a <= 6.2e-182) {
tmp = y;
} else if (a <= 350000000000.0) {
tmp = b * -0.5;
} else {
tmp = b * a;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): tmp = 0 if a <= -5.6e+48: tmp = b * a elif a <= -2.5e-155: tmp = x elif a <= 6.2e-182: tmp = y elif a <= 350000000000.0: tmp = b * -0.5 else: tmp = b * a return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -5.6e+48) tmp = Float64(b * a); elseif (a <= -2.5e-155) tmp = x; elseif (a <= 6.2e-182) tmp = y; elseif (a <= 350000000000.0) tmp = Float64(b * -0.5); else tmp = Float64(b * a); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (a <= -5.6e+48)
tmp = b * a;
elseif (a <= -2.5e-155)
tmp = x;
elseif (a <= 6.2e-182)
tmp = y;
elseif (a <= 350000000000.0)
tmp = b * -0.5;
else
tmp = b * a;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -5.6e+48], N[(b * a), $MachinePrecision], If[LessEqual[a, -2.5e-155], x, If[LessEqual[a, 6.2e-182], y, If[LessEqual[a, 350000000000.0], N[(b * -0.5), $MachinePrecision], N[(b * a), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.6 \cdot 10^{+48}:\\
\;\;\;\;b \cdot a\\
\mathbf{elif}\;a \leq -2.5 \cdot 10^{-155}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{-182}:\\
\;\;\;\;y\\
\mathbf{elif}\;a \leq 350000000000:\\
\;\;\;\;b \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;b \cdot a\\
\end{array}
\end{array}
if a < -5.60000000000000025e48 or 3.5e11 < a Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in a around inf 57.9%
*-commutative57.9%
Simplified57.9%
if -5.60000000000000025e48 < a < -2.4999999999999999e-155Initial program 99.8%
remove-double-neg99.8%
distribute-rgt-neg-out99.8%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in a around 0 99.8%
Taylor expanded in x around inf 26.4%
if -2.4999999999999999e-155 < a < 6.20000000000000016e-182Initial program 99.8%
associate-+l-99.8%
+-commutative99.8%
associate-+l+99.8%
associate--l+99.8%
fma-neg99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in y around inf 22.3%
if 6.20000000000000016e-182 < a < 3.5e11Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in b around inf 39.2%
Taylor expanded in a around 0 35.1%
Final simplification39.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= b -6e-16)
t_1
(if (<= b 1e-23) (+ y x) (if (<= b 2.3e+199) (+ y (* b a)) t_1)))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (b <= -6e-16) {
tmp = t_1;
} else if (b <= 1e-23) {
tmp = y + x;
} else if (b <= 2.3e+199) {
tmp = y + (b * a);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = b * (a - 0.5d0)
if (b <= (-6d-16)) then
tmp = t_1
else if (b <= 1d-23) then
tmp = y + x
else if (b <= 2.3d+199) then
tmp = y + (b * a)
else
tmp = t_1
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (b <= -6e-16) {
tmp = t_1;
} else if (b <= 1e-23) {
tmp = y + x;
} else if (b <= 2.3e+199) {
tmp = y + (b * a);
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if b <= -6e-16: tmp = t_1 elif b <= 1e-23: tmp = y + x elif b <= 2.3e+199: tmp = y + (b * a) else: tmp = t_1 return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (b <= -6e-16) tmp = t_1; elseif (b <= 1e-23) tmp = Float64(y + x); elseif (b <= 2.3e+199) tmp = Float64(y + Float64(b * a)); else tmp = t_1; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a - 0.5);
tmp = 0.0;
if (b <= -6e-16)
tmp = t_1;
elseif (b <= 1e-23)
tmp = y + x;
elseif (b <= 2.3e+199)
tmp = y + (b * a);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -6e-16], t$95$1, If[LessEqual[b, 1e-23], N[(y + x), $MachinePrecision], If[LessEqual[b, 2.3e+199], N[(y + N[(b * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;b \leq -6 \cdot 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 10^{-23}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{+199}:\\
\;\;\;\;y + b \cdot a\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -5.99999999999999987e-16 or 2.29999999999999995e199 < b Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in b around inf 73.7%
if -5.99999999999999987e-16 < b < 9.9999999999999996e-24Initial program 99.8%
associate-+l-99.8%
+-commutative99.8%
associate-+l+99.8%
associate--l+99.8%
fma-neg99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around inf 59.8%
if 9.9999999999999996e-24 < b < 2.29999999999999995e199Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in a around inf 51.5%
*-commutative51.5%
Simplified51.5%
Final simplification63.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (+ y x) -5e-127) (- x (* b (- 0.5 a))) (+ y (* b (- a 0.5)))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y + x) <= -5e-127) {
tmp = x - (b * (0.5 - a));
} else {
tmp = y + (b * (a - 0.5));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 + x) <= (-5d-127)) then
tmp = x - (b * (0.5d0 - a))
else
tmp = y + (b * (a - 0.5d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y + x) <= -5e-127) {
tmp = x - (b * (0.5 - a));
} else {
tmp = y + (b * (a - 0.5));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): tmp = 0 if (y + x) <= -5e-127: tmp = x - (b * (0.5 - a)) else: tmp = y + (b * (a - 0.5)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y + x) <= -5e-127) tmp = Float64(x - Float64(b * Float64(0.5 - a))); else tmp = Float64(y + Float64(b * Float64(a - 0.5))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((y + x) <= -5e-127)
tmp = x - (b * (0.5 - a));
else
tmp = y + (b * (a - 0.5));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y + x), $MachinePrecision], -5e-127], N[(x - N[(b * N[(0.5 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y + x \leq -5 \cdot 10^{-127}:\\
\;\;\;\;x - b \cdot \left(0.5 - a\right)\\
\mathbf{else}:\\
\;\;\;\;y + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -4.9999999999999997e-127Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 81.6%
Taylor expanded in b around inf 58.4%
if -4.9999999999999997e-127 < (+.f64 x y) Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in b around inf 56.3%
Final simplification57.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ y (+ (+ x z) (* b (- a 0.5)))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
return y + ((x + z) + (b * (a - 0.5)));
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = y + ((x + z) + (b * (a - 0.5d0)))
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
return y + ((x + z) + (b * (a - 0.5)));
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): return y + ((x + z) + (b * (a - 0.5)))
x, y = sort([x, y]) function code(x, y, z, t, a, b) return Float64(y + Float64(Float64(x + z) + Float64(b * Float64(a - 0.5)))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a, b)
tmp = y + ((x + z) + (b * (a - 0.5)));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(y + N[(N[(x + z), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
y + \left(\left(x + z\right) + b \cdot \left(a - 0.5\right)\right)
\end{array}
Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 78.8%
Final simplification78.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= x -4.4e+40) x (if (<= x -4.6e-262) y (if (<= x 1.26e-217) (* b -0.5) y))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -4.4e+40) {
tmp = x;
} else if (x <= -4.6e-262) {
tmp = y;
} else if (x <= 1.26e-217) {
tmp = b * -0.5;
} else {
tmp = y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 (x <= (-4.4d+40)) then
tmp = x
else if (x <= (-4.6d-262)) then
tmp = y
else if (x <= 1.26d-217) then
tmp = b * (-0.5d0)
else
tmp = y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -4.4e+40) {
tmp = x;
} else if (x <= -4.6e-262) {
tmp = y;
} else if (x <= 1.26e-217) {
tmp = b * -0.5;
} else {
tmp = y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): tmp = 0 if x <= -4.4e+40: tmp = x elif x <= -4.6e-262: tmp = y elif x <= 1.26e-217: tmp = b * -0.5 else: tmp = y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -4.4e+40) tmp = x; elseif (x <= -4.6e-262) tmp = y; elseif (x <= 1.26e-217) tmp = Float64(b * -0.5); else tmp = y; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (x <= -4.4e+40)
tmp = x;
elseif (x <= -4.6e-262)
tmp = y;
elseif (x <= 1.26e-217)
tmp = b * -0.5;
else
tmp = y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4.4e+40], x, If[LessEqual[x, -4.6e-262], y, If[LessEqual[x, 1.26e-217], N[(b * -0.5), $MachinePrecision], y]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{+40}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -4.6 \cdot 10^{-262}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 1.26 \cdot 10^{-217}:\\
\;\;\;\;b \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -4.3999999999999998e40Initial program 99.8%
remove-double-neg99.8%
distribute-rgt-neg-out99.8%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in a around 0 99.8%
Taylor expanded in x around inf 40.6%
if -4.3999999999999998e40 < x < -4.6000000000000002e-262 or 1.2599999999999999e-217 < x Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around inf 27.2%
if -4.6000000000000002e-262 < x < 1.2599999999999999e-217Initial program 99.8%
remove-double-neg99.8%
distribute-rgt-neg-out99.8%
associate--l+99.8%
distribute-rgt-neg-in99.8%
sub-neg99.8%
metadata-eval99.8%
remove-double-neg99.8%
Simplified99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in b around inf 65.8%
Taylor expanded in a around 0 37.9%
Final simplification30.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= b -4.9e-14) (not (<= b 1.2e+119))) (* b (- a 0.5)) (+ y x)))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4.9e-14) || !(b <= 1.2e+119)) {
tmp = b * (a - 0.5);
} else {
tmp = y + x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-4.9d-14)) .or. (.not. (b <= 1.2d+119))) then
tmp = b * (a - 0.5d0)
else
tmp = y + x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4.9e-14) || !(b <= 1.2e+119)) {
tmp = b * (a - 0.5);
} else {
tmp = y + x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -4.9e-14) or not (b <= 1.2e+119): tmp = b * (a - 0.5) else: tmp = y + x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -4.9e-14) || !(b <= 1.2e+119)) tmp = Float64(b * Float64(a - 0.5)); else tmp = Float64(y + x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -4.9e-14) || ~((b <= 1.2e+119)))
tmp = b * (a - 0.5);
else
tmp = y + x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -4.9e-14], N[Not[LessEqual[b, 1.2e+119]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.9 \cdot 10^{-14} \lor \neg \left(b \leq 1.2 \cdot 10^{+119}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if b < -4.89999999999999995e-14 or 1.2e119 < b Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in b around inf 73.6%
if -4.89999999999999995e-14 < b < 1.2e119Initial program 99.8%
associate-+l-99.8%
+-commutative99.8%
associate-+l+99.8%
associate--l+99.8%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around inf 56.4%
Final simplification63.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= y 2.3e+21) (- x (* b (- 0.5 a))) (+ y (* b a))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.3e+21) {
tmp = x - (b * (0.5 - a));
} else {
tmp = y + (b * a);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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.3d+21) then
tmp = x - (b * (0.5d0 - a))
else
tmp = y + (b * a)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.3e+21) {
tmp = x - (b * (0.5 - a));
} else {
tmp = y + (b * a);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): tmp = 0 if y <= 2.3e+21: tmp = x - (b * (0.5 - a)) else: tmp = y + (b * a) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 2.3e+21) tmp = Float64(x - Float64(b * Float64(0.5 - a))); else tmp = Float64(y + Float64(b * a)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (y <= 2.3e+21)
tmp = x - (b * (0.5 - a));
else
tmp = y + (b * a);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 2.3e+21], N[(x - N[(b * N[(0.5 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(b * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3 \cdot 10^{+21}:\\
\;\;\;\;x - b \cdot \left(0.5 - a\right)\\
\mathbf{else}:\\
\;\;\;\;y + b \cdot a\\
\end{array}
\end{array}
if y < 2.3e21Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 77.9%
Taylor expanded in b around inf 62.3%
if 2.3e21 < y Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in a around inf 54.3%
*-commutative54.3%
Simplified54.3%
Final simplification60.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ (* b (- a 0.5)) (+ y x)))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
return (b * (a - 0.5)) + (y + x);
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = (b * (a - 0.5d0)) + (y + x)
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
return (b * (a - 0.5)) + (y + x);
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): return (b * (a - 0.5)) + (y + x)
x, y = sort([x, y]) function code(x, y, z, t, a, b) return Float64(Float64(b * Float64(a - 0.5)) + Float64(y + x)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a, b)
tmp = (b * (a - 0.5)) + (y + x);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
b \cdot \left(a - 0.5\right) + \left(y + x\right)
\end{array}
Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 77.8%
Final simplification77.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= x -2.3e+40) x y))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.3e+40) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 (x <= (-2.3d+40)) then
tmp = x
else
tmp = y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.3e+40) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): tmp = 0 if x <= -2.3e+40: tmp = x else: tmp = y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.3e+40) tmp = x; else tmp = y; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (x <= -2.3e+40)
tmp = x;
else
tmp = y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.3e+40], x, y]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+40}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -2.29999999999999994e40Initial program 99.8%
remove-double-neg99.8%
distribute-rgt-neg-out99.8%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in a around 0 99.8%
Taylor expanded in x around inf 40.6%
if -2.29999999999999994e40 < x Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around inf 25.8%
Final simplification28.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 x)
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): return x
x, y = sort([x, y]) function code(x, y, z, t, a, b) return x end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
x
\end{array}
Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
associate--l+99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in x around inf 20.2%
Final simplification20.2%
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - pow(log(t), 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * 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 + y) + (((1.0d0 - (log(t) ** 2.0d0)) * z) / (1.0d0 + log(t)))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - Math.pow(Math.log(t), 2.0)) * z) / (1.0 + Math.log(t)))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return ((x + y) + (((1.0 - math.pow(math.log(t), 2.0)) * z) / (1.0 + math.log(t)))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + y) + Float64(Float64(Float64(1.0 - (log(t) ^ 2.0)) * z) / Float64(1.0 + log(t)))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + y) + (((1.0 - (log(t) ^ 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + y), $MachinePrecision] + N[(N[(N[(1.0 - N[Power[N[Log[t], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] / N[(1.0 + N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y\right) + \frac{\left(1 - {\log t}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b
\end{array}
herbie shell --seed 2023293
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))