
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * 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 * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * 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 * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* a 27.0))))
(if (<= z 5e-75)
(fma x 2.0 (fma y (* -9.0 (* z t)) t_1))
(fma x 2.0 (fma t (* -9.0 (* z y)) t_1)))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if (z <= 5e-75) {
tmp = fma(x, 2.0, fma(y, (-9.0 * (z * t)), t_1));
} else {
tmp = fma(x, 2.0, fma(t, (-9.0 * (z * y)), t_1));
}
return tmp;
}
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (z <= 5e-75) tmp = fma(x, 2.0, fma(y, Float64(-9.0 * Float64(z * t)), t_1)); else tmp = fma(x, 2.0, fma(t, Float64(-9.0 * Float64(z * y)), t_1)); end return tmp end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b 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 * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 5e-75], N[(x * 2.0 + N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(x * 2.0 + N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;z \leq 5 \cdot 10^{-75}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(y, -9 \cdot \left(z \cdot t\right), t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(t, -9 \cdot \left(z \cdot y\right), t_1\right)\right)\\
\end{array}
\end{array}
if z < 4.99999999999999979e-75Initial program 96.1%
associate-+l-96.1%
fma-neg96.1%
neg-sub096.1%
associate-+l-96.1%
neg-sub096.1%
associate-*l*95.5%
associate-*l*95.4%
distribute-rgt-neg-in95.4%
fma-def96.6%
*-commutative96.6%
distribute-rgt-neg-in96.6%
metadata-eval96.6%
Simplified96.6%
if 4.99999999999999979e-75 < z Initial program 91.5%
associate-+l-91.5%
fma-neg91.5%
neg-sub091.5%
associate-+l-91.5%
neg-sub091.5%
*-commutative91.5%
distribute-rgt-neg-in91.5%
fma-def91.5%
*-commutative91.5%
associate-*r*91.5%
distribute-rgt-neg-in91.5%
*-commutative91.5%
metadata-eval91.5%
Simplified91.5%
Final simplification95.0%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* a 27.0))))
(if (<= z 5e-75)
(+ (- (* x 2.0) (* y (* 9.0 (* z t)))) t_1)
(fma x 2.0 (fma t (* -9.0 (* z y)) t_1)))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if (z <= 5e-75) {
tmp = ((x * 2.0) - (y * (9.0 * (z * t)))) + t_1;
} else {
tmp = fma(x, 2.0, fma(t, (-9.0 * (z * y)), t_1));
}
return tmp;
}
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (z <= 5e-75) tmp = Float64(Float64(Float64(x * 2.0) - Float64(y * Float64(9.0 * Float64(z * t)))) + t_1); else tmp = fma(x, 2.0, fma(t, Float64(-9.0 * Float64(z * y)), t_1)); end return tmp end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b 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 * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 5e-75], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(x * 2.0 + N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;z \leq 5 \cdot 10^{-75}:\\
\;\;\;\;\left(x \cdot 2 - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(t, -9 \cdot \left(z \cdot y\right), t_1\right)\right)\\
\end{array}
\end{array}
if z < 4.99999999999999979e-75Initial program 96.1%
Taylor expanded in y around 0 95.5%
*-commutative95.5%
*-commutative95.5%
associate-*r*95.4%
*-commutative95.4%
*-commutative95.4%
Simplified95.4%
if 4.99999999999999979e-75 < z Initial program 91.5%
associate-+l-91.5%
fma-neg91.5%
neg-sub091.5%
associate-+l-91.5%
neg-sub091.5%
*-commutative91.5%
distribute-rgt-neg-in91.5%
fma-def91.5%
*-commutative91.5%
associate-*r*91.5%
distribute-rgt-neg-in91.5%
*-commutative91.5%
metadata-eval91.5%
Simplified91.5%
Final simplification94.2%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 1.2e-73) (+ (- (* x 2.0) (* y (* 9.0 (* z t)))) (* b (* a 27.0))) (fma x 2.0 (+ (* t (* y (* z -9.0))) (* a (* 27.0 b))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.2e-73) {
tmp = ((x * 2.0) - (y * (9.0 * (z * t)))) + (b * (a * 27.0));
} else {
tmp = fma(x, 2.0, ((t * (y * (z * -9.0))) + (a * (27.0 * b))));
}
return tmp;
}
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1.2e-73) tmp = Float64(Float64(Float64(x * 2.0) - Float64(y * Float64(9.0 * Float64(z * t)))) + Float64(b * Float64(a * 27.0))); else tmp = fma(x, 2.0, Float64(Float64(t * Float64(y * Float64(z * -9.0))) + Float64(a * Float64(27.0 * b)))); end return tmp end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.2e-73], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * 2.0 + N[(N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.2 \cdot 10^{-73}:\\
\;\;\;\;\left(x \cdot 2 - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right) + a \cdot \left(27 \cdot b\right)\right)\\
\end{array}
\end{array}
if z < 1.20000000000000003e-73Initial program 96.1%
Taylor expanded in y around 0 95.5%
*-commutative95.5%
*-commutative95.5%
associate-*r*95.4%
*-commutative95.4%
*-commutative95.4%
Simplified95.4%
if 1.20000000000000003e-73 < z Initial program 91.5%
associate-+l-91.5%
fma-neg91.5%
neg-sub091.5%
associate-+l-91.5%
neg-sub091.5%
*-commutative91.5%
distribute-rgt-neg-in91.5%
fma-def91.5%
*-commutative91.5%
associate-*r*91.5%
distribute-rgt-neg-in91.5%
*-commutative91.5%
metadata-eval91.5%
Simplified91.5%
fma-udef91.5%
associate-*l*91.5%
associate-*r*92.6%
Applied egg-rr92.6%
Final simplification94.6%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (* x 2.0) (* 9.0 (* y (* z t)))))
(t_2 (- (* x 2.0) (* b (* a -27.0)))))
(if (<= b -1.7e-46)
t_2
(if (<= b 6.4e-6)
t_1
(if (<= b 35000000000.0)
(- (* x 2.0) (* (* a b) -27.0))
(if (<= b 3.3e+78) t_1 t_2))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * 2.0) - (9.0 * (y * (z * t)));
double t_2 = (x * 2.0) - (b * (a * -27.0));
double tmp;
if (b <= -1.7e-46) {
tmp = t_2;
} else if (b <= 6.4e-6) {
tmp = t_1;
} else if (b <= 35000000000.0) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else if (b <= 3.3e+78) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b 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 = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
t_2 = (x * 2.0d0) - (b * (a * (-27.0d0)))
if (b <= (-1.7d-46)) then
tmp = t_2
else if (b <= 6.4d-6) then
tmp = t_1
else if (b <= 35000000000.0d0) then
tmp = (x * 2.0d0) - ((a * b) * (-27.0d0))
else if (b <= 3.3d+78) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * 2.0) - (9.0 * (y * (z * t)));
double t_2 = (x * 2.0) - (b * (a * -27.0));
double tmp;
if (b <= -1.7e-46) {
tmp = t_2;
} else if (b <= 6.4e-6) {
tmp = t_1;
} else if (b <= 35000000000.0) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else if (b <= 3.3e+78) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = (x * 2.0) - (9.0 * (y * (z * t))) t_2 = (x * 2.0) - (b * (a * -27.0)) tmp = 0 if b <= -1.7e-46: tmp = t_2 elif b <= 6.4e-6: tmp = t_1 elif b <= 35000000000.0: tmp = (x * 2.0) - ((a * b) * -27.0) elif b <= 3.3e+78: tmp = t_1 else: tmp = t_2 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))) t_2 = Float64(Float64(x * 2.0) - Float64(b * Float64(a * -27.0))) tmp = 0.0 if (b <= -1.7e-46) tmp = t_2; elseif (b <= 6.4e-6) tmp = t_1; elseif (b <= 35000000000.0) tmp = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -27.0)); elseif (b <= 3.3e+78) tmp = t_1; else tmp = t_2; end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (x * 2.0) - (9.0 * (y * (z * t)));
t_2 = (x * 2.0) - (b * (a * -27.0));
tmp = 0.0;
if (b <= -1.7e-46)
tmp = t_2;
elseif (b <= 6.4e-6)
tmp = t_1;
elseif (b <= 35000000000.0)
tmp = (x * 2.0) - ((a * b) * -27.0);
elseif (b <= 3.3e+78)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 2.0), $MachinePrecision] - N[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.7e-46], t$95$2, If[LessEqual[b, 6.4e-6], t$95$1, If[LessEqual[b, 35000000000.0], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.3e+78], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
t_2 := x \cdot 2 - b \cdot \left(a \cdot -27\right)\\
\mathbf{if}\;b \leq -1.7 \cdot 10^{-46}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq 6.4 \cdot 10^{-6}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 35000000000:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\mathbf{elif}\;b \leq 3.3 \cdot 10^{+78}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if b < -1.69999999999999998e-46 or 3.3e78 < b Initial program 93.6%
associate-+l-93.6%
sub-neg93.6%
neg-mul-193.6%
metadata-eval93.6%
metadata-eval93.6%
cancel-sign-sub-inv93.6%
metadata-eval93.6%
*-lft-identity93.6%
associate-*l*96.3%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in y around 0 77.8%
*-commutative77.8%
associate-*l*77.0%
Simplified77.0%
Taylor expanded in a around 0 77.8%
*-commutative77.8%
*-commutative77.8%
associate-*l*77.8%
Simplified77.8%
if -1.69999999999999998e-46 < b < 6.3999999999999997e-6 or 3.5e10 < b < 3.3e78Initial program 95.5%
Taylor expanded in a around 0 76.7%
if 6.3999999999999997e-6 < b < 3.5e10Initial program 99.1%
associate-+l-99.1%
sub-neg99.1%
neg-mul-199.1%
metadata-eval99.1%
metadata-eval99.1%
cancel-sign-sub-inv99.1%
metadata-eval99.1%
*-lft-identity99.1%
associate-*l*80.2%
associate-*l*80.2%
Simplified80.2%
Taylor expanded in y around 0 80.3%
*-commutative80.3%
Simplified80.3%
Final simplification77.3%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 1.35e+69) (+ (- (* x 2.0) (* y (* 9.0 (* z t)))) (* b (* a 27.0))) (- (* 27.0 (* a b)) (* 9.0 (* t (* z y))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.35e+69) {
tmp = ((x * 2.0) - (y * (9.0 * (z * t)))) + (b * (a * 27.0));
} else {
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b 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 (z <= 1.35d+69) then
tmp = ((x * 2.0d0) - (y * (9.0d0 * (z * t)))) + (b * (a * 27.0d0))
else
tmp = (27.0d0 * (a * b)) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.35e+69) {
tmp = ((x * 2.0) - (y * (9.0 * (z * t)))) + (b * (a * 27.0));
} else {
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 1.35e+69: tmp = ((x * 2.0) - (y * (9.0 * (z * t)))) + (b * (a * 27.0)) else: tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y))) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1.35e+69) tmp = Float64(Float64(Float64(x * 2.0) - Float64(y * Float64(9.0 * Float64(z * t)))) + Float64(b * Float64(a * 27.0))); else tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 1.35e+69)
tmp = ((x * 2.0) - (y * (9.0 * (z * t)))) + (b * (a * 27.0));
else
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.35e+69], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.35 \cdot 10^{+69}:\\
\;\;\;\;\left(x \cdot 2 - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < 1.3499999999999999e69Initial program 95.7%
Taylor expanded in y around 0 95.7%
*-commutative95.7%
*-commutative95.7%
associate-*r*95.6%
*-commutative95.6%
*-commutative95.6%
Simplified95.6%
if 1.3499999999999999e69 < z Initial program 90.2%
Taylor expanded in x around 0 69.9%
expm1-log1p-u42.1%
expm1-udef42.0%
*-commutative42.0%
Applied egg-rr42.0%
expm1-def42.1%
expm1-log1p69.9%
associate-*r*72.1%
Simplified72.1%
Final simplification91.2%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* a 27.0))))
(if (<= z 1.3e-15)
(+ (- (* x 2.0) (* y (* 9.0 (* z t)))) t_1)
(+ (- (* x 2.0) (* t (* z (* y 9.0)))) t_1))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if (z <= 1.3e-15) {
tmp = ((x * 2.0) - (y * (9.0 * (z * t)))) + t_1;
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + t_1;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b 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 * 27.0d0)
if (z <= 1.3d-15) then
tmp = ((x * 2.0d0) - (y * (9.0d0 * (z * t)))) + t_1
else
tmp = ((x * 2.0d0) - (t * (z * (y * 9.0d0)))) + t_1
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if (z <= 1.3e-15) {
tmp = ((x * 2.0) - (y * (9.0 * (z * t)))) + t_1;
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + t_1;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = b * (a * 27.0) tmp = 0 if z <= 1.3e-15: tmp = ((x * 2.0) - (y * (9.0 * (z * t)))) + t_1 else: tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + t_1 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (z <= 1.3e-15) tmp = Float64(Float64(Float64(x * 2.0) - Float64(y * Float64(9.0 * Float64(z * t)))) + t_1); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + t_1); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a * 27.0);
tmp = 0.0;
if (z <= 1.3e-15)
tmp = ((x * 2.0) - (y * (9.0 * (z * t)))) + t_1;
else
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + t_1;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b 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 * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 1.3e-15], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;z \leq 1.3 \cdot 10^{-15}:\\
\;\;\;\;\left(x \cdot 2 - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + t_1\\
\end{array}
\end{array}
if z < 1.30000000000000002e-15Initial program 96.3%
Taylor expanded in y around 0 95.8%
*-commutative95.8%
*-commutative95.8%
associate-*r*95.8%
*-commutative95.8%
*-commutative95.8%
Simplified95.8%
if 1.30000000000000002e-15 < z Initial program 89.5%
Final simplification94.2%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* -9.0 (* y (* z t)))) (t_2 (* b (* a 27.0))))
(if (<= b -3.8e-59)
t_2
(if (<= b -5.2e-291)
(* x 2.0)
(if (<= b 2.3e-5)
t_1
(if (<= b 39000000000.0)
(* 27.0 (* a b))
(if (<= b 2e+79) t_1 t_2)))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (y * (z * t));
double t_2 = b * (a * 27.0);
double tmp;
if (b <= -3.8e-59) {
tmp = t_2;
} else if (b <= -5.2e-291) {
tmp = x * 2.0;
} else if (b <= 2.3e-5) {
tmp = t_1;
} else if (b <= 39000000000.0) {
tmp = 27.0 * (a * b);
} else if (b <= 2e+79) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b 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 = (-9.0d0) * (y * (z * t))
t_2 = b * (a * 27.0d0)
if (b <= (-3.8d-59)) then
tmp = t_2
else if (b <= (-5.2d-291)) then
tmp = x * 2.0d0
else if (b <= 2.3d-5) then
tmp = t_1
else if (b <= 39000000000.0d0) then
tmp = 27.0d0 * (a * b)
else if (b <= 2d+79) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (y * (z * t));
double t_2 = b * (a * 27.0);
double tmp;
if (b <= -3.8e-59) {
tmp = t_2;
} else if (b <= -5.2e-291) {
tmp = x * 2.0;
} else if (b <= 2.3e-5) {
tmp = t_1;
} else if (b <= 39000000000.0) {
tmp = 27.0 * (a * b);
} else if (b <= 2e+79) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = -9.0 * (y * (z * t)) t_2 = b * (a * 27.0) tmp = 0 if b <= -3.8e-59: tmp = t_2 elif b <= -5.2e-291: tmp = x * 2.0 elif b <= 2.3e-5: tmp = t_1 elif b <= 39000000000.0: tmp = 27.0 * (a * b) elif b <= 2e+79: tmp = t_1 else: tmp = t_2 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(y * Float64(z * t))) t_2 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (b <= -3.8e-59) tmp = t_2; elseif (b <= -5.2e-291) tmp = Float64(x * 2.0); elseif (b <= 2.3e-5) tmp = t_1; elseif (b <= 39000000000.0) tmp = Float64(27.0 * Float64(a * b)); elseif (b <= 2e+79) tmp = t_1; else tmp = t_2; end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (y * (z * t));
t_2 = b * (a * 27.0);
tmp = 0.0;
if (b <= -3.8e-59)
tmp = t_2;
elseif (b <= -5.2e-291)
tmp = x * 2.0;
elseif (b <= 2.3e-5)
tmp = t_1;
elseif (b <= 39000000000.0)
tmp = 27.0 * (a * b);
elseif (b <= 2e+79)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.8e-59], t$95$2, If[LessEqual[b, -5.2e-291], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 2.3e-5], t$95$1, If[LessEqual[b, 39000000000.0], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2e+79], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
t_2 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;b \leq -3.8 \cdot 10^{-59}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq -5.2 \cdot 10^{-291}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{-5}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 39000000000:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;b \leq 2 \cdot 10^{+79}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if b < -3.79999999999999983e-59 or 1.99999999999999993e79 < b Initial program 93.7%
Taylor expanded in x around 0 78.1%
expm1-log1p-u54.0%
expm1-udef53.0%
associate-*r*53.0%
*-commutative53.0%
Applied egg-rr53.0%
expm1-def54.0%
expm1-log1p78.0%
*-commutative78.0%
associate-*l*72.9%
*-commutative72.9%
Simplified72.9%
Taylor expanded in a around inf 58.8%
associate-*r*58.8%
*-commutative58.8%
Simplified58.8%
if -3.79999999999999983e-59 < b < -5.1999999999999997e-291Initial program 95.9%
associate-+l-95.9%
fma-neg95.9%
neg-sub095.9%
associate-+l-95.9%
neg-sub095.9%
associate-*l*94.3%
associate-*l*94.2%
distribute-rgt-neg-in94.2%
fma-def94.2%
*-commutative94.2%
distribute-rgt-neg-in94.2%
metadata-eval94.2%
Simplified94.2%
Taylor expanded in x around inf 39.0%
if -5.1999999999999997e-291 < b < 2.3e-5 or 3.9e10 < b < 1.99999999999999993e79Initial program 95.1%
Taylor expanded in y around 0 93.1%
*-commutative93.1%
*-commutative93.1%
associate-*r*93.0%
*-commutative93.0%
*-commutative93.0%
Simplified93.0%
Taylor expanded in y around inf 49.1%
if 2.3e-5 < b < 3.9e10Initial program 99.1%
Taylor expanded in y around 0 80.2%
*-commutative80.2%
*-commutative80.2%
associate-*r*80.2%
*-commutative80.2%
*-commutative80.2%
Simplified80.2%
Taylor expanded in a around inf 60.4%
Final simplification51.9%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* a 27.0))))
(if (<= b -1.02e-57)
t_1
(if (<= b -4.6e-291)
(* x 2.0)
(if (<= b 1.4e-5)
(* -9.0 (* y (* z t)))
(if (<= b 46000000000.0)
(* 27.0 (* a b))
(if (<= b 1.5e+79) (* t (* -9.0 (* z y))) t_1)))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if (b <= -1.02e-57) {
tmp = t_1;
} else if (b <= -4.6e-291) {
tmp = x * 2.0;
} else if (b <= 1.4e-5) {
tmp = -9.0 * (y * (z * t));
} else if (b <= 46000000000.0) {
tmp = 27.0 * (a * b);
} else if (b <= 1.5e+79) {
tmp = t * (-9.0 * (z * y));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b 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 * 27.0d0)
if (b <= (-1.02d-57)) then
tmp = t_1
else if (b <= (-4.6d-291)) then
tmp = x * 2.0d0
else if (b <= 1.4d-5) then
tmp = (-9.0d0) * (y * (z * t))
else if (b <= 46000000000.0d0) then
tmp = 27.0d0 * (a * b)
else if (b <= 1.5d+79) then
tmp = t * ((-9.0d0) * (z * y))
else
tmp = t_1
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if (b <= -1.02e-57) {
tmp = t_1;
} else if (b <= -4.6e-291) {
tmp = x * 2.0;
} else if (b <= 1.4e-5) {
tmp = -9.0 * (y * (z * t));
} else if (b <= 46000000000.0) {
tmp = 27.0 * (a * b);
} else if (b <= 1.5e+79) {
tmp = t * (-9.0 * (z * y));
} else {
tmp = t_1;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = b * (a * 27.0) tmp = 0 if b <= -1.02e-57: tmp = t_1 elif b <= -4.6e-291: tmp = x * 2.0 elif b <= 1.4e-5: tmp = -9.0 * (y * (z * t)) elif b <= 46000000000.0: tmp = 27.0 * (a * b) elif b <= 1.5e+79: tmp = t * (-9.0 * (z * y)) else: tmp = t_1 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (b <= -1.02e-57) tmp = t_1; elseif (b <= -4.6e-291) tmp = Float64(x * 2.0); elseif (b <= 1.4e-5) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (b <= 46000000000.0) tmp = Float64(27.0 * Float64(a * b)); elseif (b <= 1.5e+79) tmp = Float64(t * Float64(-9.0 * Float64(z * y))); else tmp = t_1; end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a * 27.0);
tmp = 0.0;
if (b <= -1.02e-57)
tmp = t_1;
elseif (b <= -4.6e-291)
tmp = x * 2.0;
elseif (b <= 1.4e-5)
tmp = -9.0 * (y * (z * t));
elseif (b <= 46000000000.0)
tmp = 27.0 * (a * b);
elseif (b <= 1.5e+79)
tmp = t * (-9.0 * (z * y));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b 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 * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.02e-57], t$95$1, If[LessEqual[b, -4.6e-291], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 1.4e-5], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 46000000000.0], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.5e+79], N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;b \leq -1.02 \cdot 10^{-57}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -4.6 \cdot 10^{-291}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 1.4 \cdot 10^{-5}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;b \leq 46000000000:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{+79}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -1.02e-57 or 1.49999999999999987e79 < b Initial program 93.7%
Taylor expanded in x around 0 78.1%
expm1-log1p-u54.0%
expm1-udef53.0%
associate-*r*53.0%
*-commutative53.0%
Applied egg-rr53.0%
expm1-def54.0%
expm1-log1p78.0%
*-commutative78.0%
associate-*l*72.9%
*-commutative72.9%
Simplified72.9%
Taylor expanded in a around inf 58.8%
associate-*r*58.8%
*-commutative58.8%
Simplified58.8%
if -1.02e-57 < b < -4.6000000000000001e-291Initial program 95.9%
associate-+l-95.9%
fma-neg95.9%
neg-sub095.9%
associate-+l-95.9%
neg-sub095.9%
associate-*l*94.3%
associate-*l*94.2%
distribute-rgt-neg-in94.2%
fma-def94.2%
*-commutative94.2%
distribute-rgt-neg-in94.2%
metadata-eval94.2%
Simplified94.2%
Taylor expanded in x around inf 39.0%
if -4.6000000000000001e-291 < b < 1.39999999999999998e-5Initial program 94.3%
Taylor expanded in y around 0 91.9%
*-commutative91.9%
*-commutative91.9%
associate-*r*91.8%
*-commutative91.8%
*-commutative91.8%
Simplified91.8%
Taylor expanded in y around inf 50.2%
if 1.39999999999999998e-5 < b < 4.6e10Initial program 99.1%
Taylor expanded in y around 0 80.2%
*-commutative80.2%
*-commutative80.2%
associate-*r*80.2%
*-commutative80.2%
*-commutative80.2%
Simplified80.2%
Taylor expanded in a around inf 60.4%
if 4.6e10 < b < 1.49999999999999987e79Initial program 99.7%
Taylor expanded in y around 0 99.9%
*-commutative99.9%
*-commutative99.9%
associate-*r*99.7%
*-commutative99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 43.4%
*-commutative43.4%
associate-*l*43.3%
Simplified43.3%
Taylor expanded in y around 0 43.4%
*-commutative43.4%
associate-*r*43.3%
*-commutative43.3%
associate-*l*43.4%
*-commutative43.4%
Simplified43.4%
Final simplification51.9%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* a 27.0))))
(if (<= b -3.15e-55)
t_1
(if (<= b -8e-292)
(* x 2.0)
(if (<= b 0.000205)
(* y (* t (* z -9.0)))
(if (<= b 52000000000.0)
(* 27.0 (* a b))
(if (<= b 1.4e+79) (* t (* -9.0 (* z y))) t_1)))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if (b <= -3.15e-55) {
tmp = t_1;
} else if (b <= -8e-292) {
tmp = x * 2.0;
} else if (b <= 0.000205) {
tmp = y * (t * (z * -9.0));
} else if (b <= 52000000000.0) {
tmp = 27.0 * (a * b);
} else if (b <= 1.4e+79) {
tmp = t * (-9.0 * (z * y));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b 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 * 27.0d0)
if (b <= (-3.15d-55)) then
tmp = t_1
else if (b <= (-8d-292)) then
tmp = x * 2.0d0
else if (b <= 0.000205d0) then
tmp = y * (t * (z * (-9.0d0)))
else if (b <= 52000000000.0d0) then
tmp = 27.0d0 * (a * b)
else if (b <= 1.4d+79) then
tmp = t * ((-9.0d0) * (z * y))
else
tmp = t_1
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if (b <= -3.15e-55) {
tmp = t_1;
} else if (b <= -8e-292) {
tmp = x * 2.0;
} else if (b <= 0.000205) {
tmp = y * (t * (z * -9.0));
} else if (b <= 52000000000.0) {
tmp = 27.0 * (a * b);
} else if (b <= 1.4e+79) {
tmp = t * (-9.0 * (z * y));
} else {
tmp = t_1;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = b * (a * 27.0) tmp = 0 if b <= -3.15e-55: tmp = t_1 elif b <= -8e-292: tmp = x * 2.0 elif b <= 0.000205: tmp = y * (t * (z * -9.0)) elif b <= 52000000000.0: tmp = 27.0 * (a * b) elif b <= 1.4e+79: tmp = t * (-9.0 * (z * y)) else: tmp = t_1 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (b <= -3.15e-55) tmp = t_1; elseif (b <= -8e-292) tmp = Float64(x * 2.0); elseif (b <= 0.000205) tmp = Float64(y * Float64(t * Float64(z * -9.0))); elseif (b <= 52000000000.0) tmp = Float64(27.0 * Float64(a * b)); elseif (b <= 1.4e+79) tmp = Float64(t * Float64(-9.0 * Float64(z * y))); else tmp = t_1; end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a * 27.0);
tmp = 0.0;
if (b <= -3.15e-55)
tmp = t_1;
elseif (b <= -8e-292)
tmp = x * 2.0;
elseif (b <= 0.000205)
tmp = y * (t * (z * -9.0));
elseif (b <= 52000000000.0)
tmp = 27.0 * (a * b);
elseif (b <= 1.4e+79)
tmp = t * (-9.0 * (z * y));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b 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 * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.15e-55], t$95$1, If[LessEqual[b, -8e-292], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 0.000205], N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 52000000000.0], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.4e+79], N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;b \leq -3.15 \cdot 10^{-55}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -8 \cdot 10^{-292}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 0.000205:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{elif}\;b \leq 52000000000:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;b \leq 1.4 \cdot 10^{+79}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -3.1499999999999999e-55 or 1.4000000000000001e79 < b Initial program 93.7%
Taylor expanded in x around 0 78.1%
expm1-log1p-u54.0%
expm1-udef53.0%
associate-*r*53.0%
*-commutative53.0%
Applied egg-rr53.0%
expm1-def54.0%
expm1-log1p78.0%
*-commutative78.0%
associate-*l*72.9%
*-commutative72.9%
Simplified72.9%
Taylor expanded in a around inf 58.8%
associate-*r*58.8%
*-commutative58.8%
Simplified58.8%
if -3.1499999999999999e-55 < b < -8.0000000000000004e-292Initial program 95.9%
associate-+l-95.9%
fma-neg95.9%
neg-sub095.9%
associate-+l-95.9%
neg-sub095.9%
associate-*l*94.3%
associate-*l*94.2%
distribute-rgt-neg-in94.2%
fma-def94.2%
*-commutative94.2%
distribute-rgt-neg-in94.2%
metadata-eval94.2%
Simplified94.2%
Taylor expanded in x around inf 39.0%
if -8.0000000000000004e-292 < b < 2.05e-4Initial program 94.3%
Taylor expanded in y around 0 91.9%
*-commutative91.9%
*-commutative91.9%
associate-*r*91.8%
*-commutative91.8%
*-commutative91.8%
Simplified91.8%
Taylor expanded in y around inf 50.2%
*-commutative50.2%
associate-*l*50.1%
Simplified50.1%
Taylor expanded in t around 0 50.1%
*-commutative50.1%
associate-*r*50.2%
Simplified50.2%
if 2.05e-4 < b < 5.2e10Initial program 99.1%
Taylor expanded in y around 0 80.2%
*-commutative80.2%
*-commutative80.2%
associate-*r*80.2%
*-commutative80.2%
*-commutative80.2%
Simplified80.2%
Taylor expanded in a around inf 60.4%
if 5.2e10 < b < 1.4000000000000001e79Initial program 99.7%
Taylor expanded in y around 0 99.9%
*-commutative99.9%
*-commutative99.9%
associate-*r*99.7%
*-commutative99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 43.4%
*-commutative43.4%
associate-*l*43.3%
Simplified43.3%
Taylor expanded in y around 0 43.4%
*-commutative43.4%
associate-*r*43.3%
*-commutative43.3%
associate-*l*43.4%
*-commutative43.4%
Simplified43.4%
Final simplification51.9%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= z -6.8e-146) (not (<= z 3.7e-100))) (+ (* a (* 27.0 b)) (* -9.0 (* y (* z t)))) (- (* x 2.0) (* b (* a -27.0)))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.8e-146) || !(z <= 3.7e-100)) {
tmp = (a * (27.0 * b)) + (-9.0 * (y * (z * t)));
} else {
tmp = (x * 2.0) - (b * (a * -27.0));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b 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 ((z <= (-6.8d-146)) .or. (.not. (z <= 3.7d-100))) then
tmp = (a * (27.0d0 * b)) + ((-9.0d0) * (y * (z * t)))
else
tmp = (x * 2.0d0) - (b * (a * (-27.0d0)))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.8e-146) || !(z <= 3.7e-100)) {
tmp = (a * (27.0 * b)) + (-9.0 * (y * (z * t)));
} else {
tmp = (x * 2.0) - (b * (a * -27.0));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if (z <= -6.8e-146) or not (z <= 3.7e-100): tmp = (a * (27.0 * b)) + (-9.0 * (y * (z * t))) else: tmp = (x * 2.0) - (b * (a * -27.0)) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6.8e-146) || !(z <= 3.7e-100)) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(-9.0 * Float64(y * Float64(z * t)))); else tmp = Float64(Float64(x * 2.0) - Float64(b * Float64(a * -27.0))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((z <= -6.8e-146) || ~((z <= 3.7e-100)))
tmp = (a * (27.0 * b)) + (-9.0 * (y * (z * t)));
else
tmp = (x * 2.0) - (b * (a * -27.0));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6.8e-146], N[Not[LessEqual[z, 3.7e-100]], $MachinePrecision]], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{-146} \lor \neg \left(z \leq 3.7 \cdot 10^{-100}\right):\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - b \cdot \left(a \cdot -27\right)\\
\end{array}
\end{array}
if z < -6.8000000000000001e-146 or 3.70000000000000018e-100 < z Initial program 93.0%
Taylor expanded in x around 0 72.8%
cancel-sign-sub-inv72.8%
associate-*r*72.3%
*-commutative72.3%
associate-*r*72.8%
metadata-eval72.8%
*-commutative72.8%
Applied egg-rr72.8%
if -6.8000000000000001e-146 < z < 3.70000000000000018e-100Initial program 98.6%
associate-+l-98.6%
sub-neg98.6%
neg-mul-198.6%
metadata-eval98.6%
metadata-eval98.6%
cancel-sign-sub-inv98.6%
metadata-eval98.6%
*-lft-identity98.6%
associate-*l*98.6%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in y around 0 83.4%
*-commutative83.4%
associate-*l*82.1%
Simplified82.1%
Taylor expanded in a around 0 83.4%
*-commutative83.4%
*-commutative83.4%
associate-*l*83.5%
Simplified83.5%
Final simplification76.0%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.3e-145)
(+ (* a (* 27.0 b)) (* -9.0 (* y (* z t))))
(if (<= z 1.35e-94)
(- (* x 2.0) (* b (* a -27.0)))
(- (* 27.0 (* a b)) (* 9.0 (* t (* z y)))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.3e-145) {
tmp = (a * (27.0 * b)) + (-9.0 * (y * (z * t)));
} else if (z <= 1.35e-94) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else {
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b 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 (z <= (-2.3d-145)) then
tmp = (a * (27.0d0 * b)) + ((-9.0d0) * (y * (z * t)))
else if (z <= 1.35d-94) then
tmp = (x * 2.0d0) - (b * (a * (-27.0d0)))
else
tmp = (27.0d0 * (a * b)) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.3e-145) {
tmp = (a * (27.0 * b)) + (-9.0 * (y * (z * t)));
} else if (z <= 1.35e-94) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else {
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -2.3e-145: tmp = (a * (27.0 * b)) + (-9.0 * (y * (z * t))) elif z <= 1.35e-94: tmp = (x * 2.0) - (b * (a * -27.0)) else: tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y))) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.3e-145) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(-9.0 * Float64(y * Float64(z * t)))); elseif (z <= 1.35e-94) tmp = Float64(Float64(x * 2.0) - Float64(b * Float64(a * -27.0))); else tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -2.3e-145)
tmp = (a * (27.0 * b)) + (-9.0 * (y * (z * t)));
elseif (z <= 1.35e-94)
tmp = (x * 2.0) - (b * (a * -27.0));
else
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.3e-145], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e-94], N[(N[(x * 2.0), $MachinePrecision] - N[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{-145}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-94}:\\
\;\;\;\;x \cdot 2 - b \cdot \left(a \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -2.30000000000000007e-145Initial program 94.0%
Taylor expanded in x around 0 74.7%
cancel-sign-sub-inv74.7%
associate-*r*74.7%
*-commutative74.7%
associate-*r*74.7%
metadata-eval74.7%
*-commutative74.7%
Applied egg-rr74.7%
if -2.30000000000000007e-145 < z < 1.3500000000000001e-94Initial program 98.6%
associate-+l-98.6%
sub-neg98.6%
neg-mul-198.6%
metadata-eval98.6%
metadata-eval98.6%
cancel-sign-sub-inv98.6%
metadata-eval98.6%
*-lft-identity98.6%
associate-*l*98.6%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in y around 0 83.4%
*-commutative83.4%
associate-*l*82.1%
Simplified82.1%
Taylor expanded in a around 0 83.4%
*-commutative83.4%
*-commutative83.4%
associate-*l*83.5%
Simplified83.5%
if 1.3500000000000001e-94 < z Initial program 91.8%
Taylor expanded in x around 0 70.5%
expm1-log1p-u40.4%
expm1-udef38.7%
*-commutative38.7%
Applied egg-rr38.7%
expm1-def40.4%
expm1-log1p70.5%
associate-*r*70.6%
Simplified70.6%
Final simplification76.0%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -1.9e-57) (* -9.0 (* y (* z t))) (if (<= z 5.2e+43) (- (* x 2.0) (* a (* b -27.0))) (* t (* -9.0 (* z y))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.9e-57) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 5.2e+43) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = t * (-9.0 * (z * y));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b 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 (z <= (-1.9d-57)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= 5.2d+43) then
tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
else
tmp = t * ((-9.0d0) * (z * y))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.9e-57) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 5.2e+43) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = t * (-9.0 * (z * y));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.9e-57: tmp = -9.0 * (y * (z * t)) elif z <= 5.2e+43: tmp = (x * 2.0) - (a * (b * -27.0)) else: tmp = t * (-9.0 * (z * y)) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.9e-57) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= 5.2e+43) tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0))); else tmp = Float64(t * Float64(-9.0 * Float64(z * y))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.9e-57)
tmp = -9.0 * (y * (z * t));
elseif (z <= 5.2e+43)
tmp = (x * 2.0) - (a * (b * -27.0));
else
tmp = t * (-9.0 * (z * y));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.9e-57], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e+43], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-57}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+43}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -1.8999999999999999e-57Initial program 91.5%
Taylor expanded in y around 0 91.4%
*-commutative91.4%
*-commutative91.4%
associate-*r*91.3%
*-commutative91.3%
*-commutative91.3%
Simplified91.3%
Taylor expanded in y around inf 50.7%
if -1.8999999999999999e-57 < z < 5.20000000000000042e43Initial program 98.4%
associate-+l-98.4%
sub-neg98.4%
neg-mul-198.4%
metadata-eval98.4%
metadata-eval98.4%
cancel-sign-sub-inv98.4%
metadata-eval98.4%
*-lft-identity98.4%
associate-*l*97.7%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in y around 0 79.2%
*-commutative79.2%
associate-*l*78.5%
Simplified78.5%
if 5.20000000000000042e43 < z Initial program 89.5%
Taylor expanded in y around 0 91.0%
*-commutative91.0%
*-commutative91.0%
associate-*r*91.0%
*-commutative91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in y around inf 47.9%
*-commutative47.9%
associate-*l*47.9%
Simplified47.9%
Taylor expanded in y around 0 47.9%
*-commutative47.9%
associate-*r*49.8%
*-commutative49.8%
associate-*l*49.8%
*-commutative49.8%
Simplified49.8%
Final simplification64.9%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -2.1e-57) (* -9.0 (* y (* z t))) (if (<= z 4.5e+45) (- (* x 2.0) (* b (* a -27.0))) (* t (* -9.0 (* z y))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.1e-57) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 4.5e+45) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else {
tmp = t * (-9.0 * (z * y));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b 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 (z <= (-2.1d-57)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= 4.5d+45) then
tmp = (x * 2.0d0) - (b * (a * (-27.0d0)))
else
tmp = t * ((-9.0d0) * (z * y))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.1e-57) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 4.5e+45) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else {
tmp = t * (-9.0 * (z * y));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -2.1e-57: tmp = -9.0 * (y * (z * t)) elif z <= 4.5e+45: tmp = (x * 2.0) - (b * (a * -27.0)) else: tmp = t * (-9.0 * (z * y)) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.1e-57) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= 4.5e+45) tmp = Float64(Float64(x * 2.0) - Float64(b * Float64(a * -27.0))); else tmp = Float64(t * Float64(-9.0 * Float64(z * y))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -2.1e-57)
tmp = -9.0 * (y * (z * t));
elseif (z <= 4.5e+45)
tmp = (x * 2.0) - (b * (a * -27.0));
else
tmp = t * (-9.0 * (z * y));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.1e-57], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e+45], N[(N[(x * 2.0), $MachinePrecision] - N[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-57}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+45}:\\
\;\;\;\;x \cdot 2 - b \cdot \left(a \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -2.0999999999999999e-57Initial program 91.5%
Taylor expanded in y around 0 91.4%
*-commutative91.4%
*-commutative91.4%
associate-*r*91.3%
*-commutative91.3%
*-commutative91.3%
Simplified91.3%
Taylor expanded in y around inf 50.7%
if -2.0999999999999999e-57 < z < 4.4999999999999998e45Initial program 98.4%
associate-+l-98.4%
sub-neg98.4%
neg-mul-198.4%
metadata-eval98.4%
metadata-eval98.4%
cancel-sign-sub-inv98.4%
metadata-eval98.4%
*-lft-identity98.4%
associate-*l*97.7%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in y around 0 79.2%
*-commutative79.2%
associate-*l*78.5%
Simplified78.5%
Taylor expanded in a around 0 79.2%
*-commutative79.2%
*-commutative79.2%
associate-*l*78.5%
Simplified78.5%
if 4.4999999999999998e45 < z Initial program 89.5%
Taylor expanded in y around 0 91.0%
*-commutative91.0%
*-commutative91.0%
associate-*r*91.0%
*-commutative91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in y around inf 47.9%
*-commutative47.9%
associate-*l*47.9%
Simplified47.9%
Taylor expanded in y around 0 47.9%
*-commutative47.9%
associate-*r*49.8%
*-commutative49.8%
associate-*l*49.8%
*-commutative49.8%
Simplified49.8%
Final simplification64.9%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -2.1e-57) (* -9.0 (* y (* z t))) (if (<= z 1.7e+45) (- (* x 2.0) (* (* a b) -27.0)) (* t (* -9.0 (* z y))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.1e-57) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 1.7e+45) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else {
tmp = t * (-9.0 * (z * y));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b 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 (z <= (-2.1d-57)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= 1.7d+45) then
tmp = (x * 2.0d0) - ((a * b) * (-27.0d0))
else
tmp = t * ((-9.0d0) * (z * y))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.1e-57) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 1.7e+45) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else {
tmp = t * (-9.0 * (z * y));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -2.1e-57: tmp = -9.0 * (y * (z * t)) elif z <= 1.7e+45: tmp = (x * 2.0) - ((a * b) * -27.0) else: tmp = t * (-9.0 * (z * y)) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.1e-57) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= 1.7e+45) tmp = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -27.0)); else tmp = Float64(t * Float64(-9.0 * Float64(z * y))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -2.1e-57)
tmp = -9.0 * (y * (z * t));
elseif (z <= 1.7e+45)
tmp = (x * 2.0) - ((a * b) * -27.0);
else
tmp = t * (-9.0 * (z * y));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.1e-57], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e+45], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-57}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+45}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -2.0999999999999999e-57Initial program 91.5%
Taylor expanded in y around 0 91.4%
*-commutative91.4%
*-commutative91.4%
associate-*r*91.3%
*-commutative91.3%
*-commutative91.3%
Simplified91.3%
Taylor expanded in y around inf 50.7%
if -2.0999999999999999e-57 < z < 1.7e45Initial program 98.4%
associate-+l-98.4%
sub-neg98.4%
neg-mul-198.4%
metadata-eval98.4%
metadata-eval98.4%
cancel-sign-sub-inv98.4%
metadata-eval98.4%
*-lft-identity98.4%
associate-*l*97.7%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in y around 0 79.2%
*-commutative79.2%
Simplified79.2%
if 1.7e45 < z Initial program 89.5%
Taylor expanded in y around 0 91.0%
*-commutative91.0%
*-commutative91.0%
associate-*r*91.0%
*-commutative91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in y around inf 47.9%
*-commutative47.9%
associate-*l*47.9%
Simplified47.9%
Taylor expanded in y around 0 47.9%
*-commutative47.9%
associate-*r*49.8%
*-commutative49.8%
associate-*l*49.8%
*-commutative49.8%
Simplified49.8%
Final simplification65.3%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= b -7.2e-56) (not (<= b 2.6e-28))) (* 27.0 (* a b)) (* x 2.0)))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -7.2e-56) || !(b <= 2.6e-28)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b 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 <= (-7.2d-56)) .or. (.not. (b <= 2.6d-28))) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -7.2e-56) || !(b <= 2.6e-28)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -7.2e-56) or not (b <= 2.6e-28): tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -7.2e-56) || !(b <= 2.6e-28)) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -7.2e-56) || ~((b <= 2.6e-28)))
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -7.2e-56], N[Not[LessEqual[b, 2.6e-28]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.2 \cdot 10^{-56} \lor \neg \left(b \leq 2.6 \cdot 10^{-28}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -7.19999999999999956e-56 or 2.6e-28 < b Initial program 93.4%
Taylor expanded in y around 0 95.0%
*-commutative95.0%
*-commutative95.0%
associate-*r*94.9%
*-commutative94.9%
*-commutative94.9%
Simplified94.9%
Taylor expanded in a around inf 55.2%
if -7.19999999999999956e-56 < b < 2.6e-28Initial program 96.3%
associate-+l-96.3%
fma-neg96.3%
neg-sub096.3%
associate-+l-96.3%
neg-sub096.3%
associate-*l*94.1%
associate-*l*94.0%
distribute-rgt-neg-in94.0%
fma-def94.1%
*-commutative94.1%
distribute-rgt-neg-in94.1%
metadata-eval94.1%
Simplified94.1%
Taylor expanded in x around inf 37.4%
Final simplification47.6%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= b -1.3e-60) (* b (* a 27.0)) (if (<= b 3e-25) (* x 2.0) (* 27.0 (* a b)))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.3e-60) {
tmp = b * (a * 27.0);
} else if (b <= 3e-25) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b 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 <= (-1.3d-60)) then
tmp = b * (a * 27.0d0)
else if (b <= 3d-25) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.3e-60) {
tmp = b * (a * 27.0);
} else if (b <= 3e-25) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -1.3e-60: tmp = b * (a * 27.0) elif b <= 3e-25: tmp = x * 2.0 else: tmp = 27.0 * (a * b) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.3e-60) tmp = Float64(b * Float64(a * 27.0)); elseif (b <= 3e-25) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -1.3e-60)
tmp = b * (a * 27.0);
elseif (b <= 3e-25)
tmp = x * 2.0;
else
tmp = 27.0 * (a * b);
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.3e-60], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3e-25], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.3 \cdot 10^{-60}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;b \leq 3 \cdot 10^{-25}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if b < -1.2999999999999999e-60Initial program 93.4%
Taylor expanded in x around 0 78.0%
expm1-log1p-u54.4%
expm1-udef53.7%
associate-*r*53.7%
*-commutative53.7%
Applied egg-rr53.7%
expm1-def54.4%
expm1-log1p78.0%
*-commutative78.0%
associate-*l*74.1%
*-commutative74.1%
Simplified74.1%
Taylor expanded in a around inf 55.9%
associate-*r*55.9%
*-commutative55.9%
Simplified55.9%
if -1.2999999999999999e-60 < b < 2.9999999999999998e-25Initial program 96.3%
associate-+l-96.3%
fma-neg96.3%
neg-sub096.3%
associate-+l-96.3%
neg-sub096.3%
associate-*l*94.1%
associate-*l*94.0%
distribute-rgt-neg-in94.0%
fma-def94.1%
*-commutative94.1%
distribute-rgt-neg-in94.1%
metadata-eval94.1%
Simplified94.1%
Taylor expanded in x around inf 37.4%
if 2.9999999999999998e-25 < b Initial program 93.5%
Taylor expanded in y around 0 92.8%
*-commutative92.8%
*-commutative92.8%
associate-*r*92.8%
*-commutative92.8%
*-commutative92.8%
Simplified92.8%
Taylor expanded in a around inf 53.1%
Final simplification47.2%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* x 2.0))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b 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 * 2.0d0
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): return x * 2.0
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
x \cdot 2
\end{array}
Initial program 94.7%
associate-+l-94.7%
fma-neg94.7%
neg-sub094.7%
associate-+l-94.7%
neg-sub094.7%
associate-*l*94.6%
associate-*l*94.6%
distribute-rgt-neg-in94.6%
fma-def95.4%
*-commutative95.4%
distribute-rgt-neg-in95.4%
metadata-eval95.4%
Simplified95.4%
Taylor expanded in x around inf 27.3%
Final simplification27.3%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * 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 < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * 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 < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2023181
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b)))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))