
(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 14 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 (if (<= z 5e-42) (fma a (* 27.0 b) (fma x 2.0 (* y (* t (* z -9.0))))) (fma x 2.0 (fma z (* y (* t -9.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 <= 5e-42) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (t * (z * -9.0)))));
} else {
tmp = fma(x, 2.0, fma(z, (y * (t * -9.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 <= 5e-42) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(t * Float64(z * -9.0))))); else tmp = fma(x, 2.0, fma(z, Float64(y * Float64(t * -9.0)), Float64(b * Float64(a * 27.0)))); 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, 5e-42], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * 2.0 + N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $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 5 \cdot 10^{-42}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(z, y \cdot \left(t \cdot -9\right), b \cdot \left(a \cdot 27\right)\right)\right)\\
\end{array}
\end{array}
if z < 5.00000000000000003e-42Initial program 97.6%
+-commutative97.6%
associate-+r-97.6%
cancel-sign-sub-inv97.6%
*-commutative97.6%
distribute-rgt-neg-out97.6%
associate-*r*90.7%
*-commutative90.7%
distribute-rgt-neg-in90.7%
associate-+r+90.7%
sub-neg90.7%
associate-*l*90.7%
fma-def90.6%
fma-neg90.6%
associate-*l*91.2%
*-commutative91.2%
associate-*r*96.6%
distribute-rgt-neg-in96.6%
Simplified96.7%
if 5.00000000000000003e-42 < z Initial program 91.8%
+-commutative91.8%
associate-+r-91.8%
cancel-sign-sub-inv91.8%
*-commutative91.8%
distribute-rgt-neg-out91.8%
associate-*r*95.7%
*-commutative95.7%
distribute-rgt-neg-in95.7%
associate-+r+95.7%
sub-neg95.7%
+-commutative95.7%
associate-+l-95.7%
fma-neg95.7%
associate-*l*91.8%
fma-neg93.2%
*-commutative93.2%
fma-neg91.8%
Simplified97.1%
Final simplification96.8%
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 (<= (* y 9.0) -4e+64) (fma a (* 27.0 b) (fma x 2.0 (* y (* t (* z -9.0))))) (fma x 2.0 (+ (* z (* y (* t -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 ((y * 9.0) <= -4e+64) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (t * (z * -9.0)))));
} else {
tmp = fma(x, 2.0, ((z * (y * (t * -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 (Float64(y * 9.0) <= -4e+64) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(t * Float64(z * -9.0))))); else tmp = fma(x, 2.0, Float64(Float64(z * Float64(y * Float64(t * -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[N[(y * 9.0), $MachinePrecision], -4e+64], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * 2.0 + N[(N[(z * N[(y * N[(t * -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}\;y \cdot 9 \leq -4 \cdot 10^{+64}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, z \cdot \left(y \cdot \left(t \cdot -9\right)\right) + a \cdot \left(27 \cdot b\right)\right)\\
\end{array}
\end{array}
if (*.f64 y 9) < -4.00000000000000009e64Initial program 92.1%
+-commutative92.1%
associate-+r-92.1%
cancel-sign-sub-inv92.1%
*-commutative92.1%
distribute-rgt-neg-out92.1%
associate-*r*81.7%
*-commutative81.7%
distribute-rgt-neg-in81.7%
associate-+r+81.7%
sub-neg81.7%
associate-*l*81.7%
fma-def83.3%
fma-neg83.3%
associate-*l*84.8%
*-commutative84.8%
associate-*r*98.2%
distribute-rgt-neg-in98.2%
Simplified98.3%
if -4.00000000000000009e64 < (*.f64 y 9) Initial program 97.2%
+-commutative97.2%
associate-+r-97.2%
cancel-sign-sub-inv97.2%
*-commutative97.2%
distribute-rgt-neg-out97.2%
associate-*r*95.4%
*-commutative95.4%
distribute-rgt-neg-in95.4%
associate-+r+95.4%
sub-neg95.4%
+-commutative95.4%
associate-+l-95.4%
fma-neg95.4%
associate-*l*94.9%
fma-neg94.9%
*-commutative94.9%
fma-neg94.9%
Simplified95.9%
fma-udef95.4%
associate-*r*95.4%
Applied egg-rr95.4%
Final simplification96.1%
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 (* a (* 27.0 b))))
(if (<= (* y 9.0) -1e+68)
(+ t_1 (- (* x 2.0) (* (* y 9.0) (* z t))))
(fma x 2.0 (+ (* z (* y (* t -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 = a * (27.0 * b);
double tmp;
if ((y * 9.0) <= -1e+68) {
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = fma(x, 2.0, ((z * (y * (t * -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(a * Float64(27.0 * b)) tmp = 0.0 if (Float64(y * 9.0) <= -1e+68) tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t)))); else tmp = fma(x, 2.0, Float64(Float64(z * Float64(y * Float64(t * -9.0))) + 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[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * 9.0), $MachinePrecision], -1e+68], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * 2.0 + N[(N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $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 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;y \cdot 9 \leq -1 \cdot 10^{+68}:\\
\;\;\;\;t_1 + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, z \cdot \left(y \cdot \left(t \cdot -9\right)\right) + t_1\right)\\
\end{array}
\end{array}
if (*.f64 y 9) < -9.99999999999999953e67Initial program 93.4%
sub-neg93.4%
distribute-lft-neg-in93.4%
associate-*l*93.4%
*-commutative93.4%
*-commutative93.4%
cancel-sign-sub-inv93.4%
*-commutative93.4%
*-commutative93.4%
associate-*l*93.4%
associate-*l*96.6%
associate-*l*96.6%
Simplified96.6%
if -9.99999999999999953e67 < (*.f64 y 9) Initial program 96.8%
+-commutative96.8%
associate-+r-96.8%
cancel-sign-sub-inv96.8%
*-commutative96.8%
distribute-rgt-neg-out96.8%
associate-*r*95.0%
*-commutative95.0%
distribute-rgt-neg-in95.0%
associate-+r+95.0%
sub-neg95.0%
+-commutative95.0%
associate-+l-95.0%
fma-neg95.0%
associate-*l*94.5%
fma-neg95.0%
*-commutative95.0%
fma-neg94.5%
Simplified96.0%
fma-udef95.0%
associate-*r*95.0%
Applied egg-rr95.0%
Final simplification95.4%
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 (* t (* z y)))) (t_2 (* 27.0 (* a b))))
(if (<= z -3.2e+117)
(* y (* t (* z -9.0)))
(if (<= z -5.4e-70)
(- (* x 2.0) t_1)
(if (<= z 4.4e-185) (+ t_2 (* x 2.0)) (- t_2 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 = 9.0 * (t * (z * y));
double t_2 = 27.0 * (a * b);
double tmp;
if (z <= -3.2e+117) {
tmp = y * (t * (z * -9.0));
} else if (z <= -5.4e-70) {
tmp = (x * 2.0) - t_1;
} else if (z <= 4.4e-185) {
tmp = t_2 + (x * 2.0);
} else {
tmp = t_2 - 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) :: t_2
real(8) :: tmp
t_1 = 9.0d0 * (t * (z * y))
t_2 = 27.0d0 * (a * b)
if (z <= (-3.2d+117)) then
tmp = y * (t * (z * (-9.0d0)))
else if (z <= (-5.4d-70)) then
tmp = (x * 2.0d0) - t_1
else if (z <= 4.4d-185) then
tmp = t_2 + (x * 2.0d0)
else
tmp = t_2 - 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 = 9.0 * (t * (z * y));
double t_2 = 27.0 * (a * b);
double tmp;
if (z <= -3.2e+117) {
tmp = y * (t * (z * -9.0));
} else if (z <= -5.4e-70) {
tmp = (x * 2.0) - t_1;
} else if (z <= 4.4e-185) {
tmp = t_2 + (x * 2.0);
} else {
tmp = t_2 - 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 = 9.0 * (t * (z * y)) t_2 = 27.0 * (a * b) tmp = 0 if z <= -3.2e+117: tmp = y * (t * (z * -9.0)) elif z <= -5.4e-70: tmp = (x * 2.0) - t_1 elif z <= 4.4e-185: tmp = t_2 + (x * 2.0) else: tmp = t_2 - 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(9.0 * Float64(t * Float64(z * y))) t_2 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -3.2e+117) tmp = Float64(y * Float64(t * Float64(z * -9.0))); elseif (z <= -5.4e-70) tmp = Float64(Float64(x * 2.0) - t_1); elseif (z <= 4.4e-185) tmp = Float64(t_2 + Float64(x * 2.0)); else tmp = Float64(t_2 - 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 = 9.0 * (t * (z * y));
t_2 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -3.2e+117)
tmp = y * (t * (z * -9.0));
elseif (z <= -5.4e-70)
tmp = (x * 2.0) - t_1;
elseif (z <= 4.4e-185)
tmp = t_2 + (x * 2.0);
else
tmp = t_2 - 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[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e+117], N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.4e-70], N[(N[(x * 2.0), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[z, 4.4e-185], N[(t$95$2 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(t$95$2 - 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 := 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+117}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq -5.4 \cdot 10^{-70}:\\
\;\;\;\;x \cdot 2 - t_1\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-185}:\\
\;\;\;\;t_2 + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_2 - t_1\\
\end{array}
\end{array}
if z < -3.20000000000000005e117Initial program 89.9%
sub-neg89.9%
distribute-lft-neg-in89.9%
associate-*l*90.0%
*-commutative90.0%
*-commutative90.0%
cancel-sign-sub-inv90.0%
*-commutative90.0%
*-commutative90.0%
associate-*l*89.9%
associate-*l*80.5%
associate-*l*80.4%
Simplified80.4%
Taylor expanded in y around inf 53.3%
*-commutative53.3%
associate-*r*59.6%
*-commutative59.6%
associate-*r*59.8%
associate-*l*53.7%
Simplified53.7%
if -3.20000000000000005e117 < z < -5.4000000000000003e-70Initial program 99.7%
sub-neg99.7%
distribute-lft-neg-in99.7%
associate-*l*99.7%
*-commutative99.7%
*-commutative99.7%
cancel-sign-sub-inv99.7%
*-commutative99.7%
*-commutative99.7%
associate-*l*99.7%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in a around 0 64.7%
if -5.4000000000000003e-70 < z < 4.4000000000000001e-185Initial program 98.5%
sub-neg98.5%
distribute-lft-neg-in98.5%
associate-*l*98.5%
*-commutative98.5%
*-commutative98.5%
cancel-sign-sub-inv98.5%
*-commutative98.5%
*-commutative98.5%
associate-*l*98.5%
associate-*l*99.7%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 85.1%
if 4.4000000000000001e-185 < z Initial program 94.4%
sub-neg94.4%
distribute-lft-neg-in94.4%
associate-*l*94.5%
*-commutative94.5%
*-commutative94.5%
cancel-sign-sub-inv94.5%
*-commutative94.5%
*-commutative94.5%
associate-*l*94.4%
associate-*l*93.6%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in x around 0 79.4%
Final simplification76.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
(let* ((t_1 (* 27.0 (* a b))))
(if (<= z -3.2e+117)
(* y (* t (* z -9.0)))
(if (<= z -2.3e-71)
(- (* x 2.0) (* 9.0 (* t (* z y))))
(if (<= z 5.7e-185) (+ t_1 (* x 2.0)) (- t_1 (* t (* y (* z 9.0)))))))))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 = 27.0 * (a * b);
double tmp;
if (z <= -3.2e+117) {
tmp = y * (t * (z * -9.0));
} else if (z <= -2.3e-71) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else if (z <= 5.7e-185) {
tmp = t_1 + (x * 2.0);
} else {
tmp = t_1 - (t * (y * (z * 9.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) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (z <= (-3.2d+117)) then
tmp = y * (t * (z * (-9.0d0)))
else if (z <= (-2.3d-71)) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
else if (z <= 5.7d-185) then
tmp = t_1 + (x * 2.0d0)
else
tmp = t_1 - (t * (y * (z * 9.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 t_1 = 27.0 * (a * b);
double tmp;
if (z <= -3.2e+117) {
tmp = y * (t * (z * -9.0));
} else if (z <= -2.3e-71) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else if (z <= 5.7e-185) {
tmp = t_1 + (x * 2.0);
} else {
tmp = t_1 - (t * (y * (z * 9.0)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if z <= -3.2e+117: tmp = y * (t * (z * -9.0)) elif z <= -2.3e-71: tmp = (x * 2.0) - (9.0 * (t * (z * y))) elif z <= 5.7e-185: tmp = t_1 + (x * 2.0) else: tmp = t_1 - (t * (y * (z * 9.0))) 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(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -3.2e+117) tmp = Float64(y * Float64(t * Float64(z * -9.0))); elseif (z <= -2.3e-71) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); elseif (z <= 5.7e-185) tmp = Float64(t_1 + Float64(x * 2.0)); else tmp = Float64(t_1 - Float64(t * Float64(y * Float64(z * 9.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)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -3.2e+117)
tmp = y * (t * (z * -9.0));
elseif (z <= -2.3e-71)
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
elseif (z <= 5.7e-185)
tmp = t_1 + (x * 2.0);
else
tmp = t_1 - (t * (y * (z * 9.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_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e+117], N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.3e-71], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.7e-185], N[(t$95$1 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(t * N[(y * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+117}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-71}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;z \leq 5.7 \cdot 10^{-185}:\\
\;\;\;\;t_1 + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_1 - t \cdot \left(y \cdot \left(z \cdot 9\right)\right)\\
\end{array}
\end{array}
if z < -3.20000000000000005e117Initial program 89.9%
sub-neg89.9%
distribute-lft-neg-in89.9%
associate-*l*90.0%
*-commutative90.0%
*-commutative90.0%
cancel-sign-sub-inv90.0%
*-commutative90.0%
*-commutative90.0%
associate-*l*89.9%
associate-*l*80.5%
associate-*l*80.4%
Simplified80.4%
Taylor expanded in y around inf 53.3%
*-commutative53.3%
associate-*r*59.6%
*-commutative59.6%
associate-*r*59.8%
associate-*l*53.7%
Simplified53.7%
if -3.20000000000000005e117 < z < -2.2999999999999998e-71Initial program 99.7%
sub-neg99.7%
distribute-lft-neg-in99.7%
associate-*l*99.7%
*-commutative99.7%
*-commutative99.7%
cancel-sign-sub-inv99.7%
*-commutative99.7%
*-commutative99.7%
associate-*l*99.7%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in a around 0 64.7%
if -2.2999999999999998e-71 < z < 5.69999999999999986e-185Initial program 98.5%
sub-neg98.5%
distribute-lft-neg-in98.5%
associate-*l*98.5%
*-commutative98.5%
*-commutative98.5%
cancel-sign-sub-inv98.5%
*-commutative98.5%
*-commutative98.5%
associate-*l*98.5%
associate-*l*99.7%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 85.1%
if 5.69999999999999986e-185 < z Initial program 94.4%
sub-neg94.4%
distribute-lft-neg-in94.4%
associate-*l*94.5%
*-commutative94.5%
*-commutative94.5%
cancel-sign-sub-inv94.5%
*-commutative94.5%
*-commutative94.5%
associate-*l*94.4%
associate-*l*93.6%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in x around 0 79.4%
expm1-log1p-u47.6%
expm1-udef44.4%
Applied egg-rr44.4%
expm1-def47.6%
expm1-log1p79.4%
*-commutative79.4%
associate-*l*79.4%
associate-*l*79.4%
Simplified79.4%
Final simplification76.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 6e-11) (+ (* a (* 27.0 b)) (- (* x 2.0) (* (* y 9.0) (* z t)))) (- (* 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 <= 6e-11) {
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
} 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 <= 6d-11) then
tmp = (a * (27.0d0 * b)) + ((x * 2.0d0) - ((y * 9.0d0) * (z * t)))
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 <= 6e-11) {
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
} 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 <= 6e-11: tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t))) 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 <= 6e-11) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t)))); 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 <= 6e-11)
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
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, 6e-11], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $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 6 \cdot 10^{-11}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\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 < 6e-11Initial program 97.7%
sub-neg97.7%
distribute-lft-neg-in97.7%
associate-*l*97.7%
*-commutative97.7%
*-commutative97.7%
cancel-sign-sub-inv97.7%
*-commutative97.7%
*-commutative97.7%
associate-*l*97.7%
associate-*l*96.3%
associate-*l*96.3%
Simplified96.3%
if 6e-11 < z Initial program 91.3%
sub-neg91.3%
distribute-lft-neg-in91.3%
associate-*l*91.3%
*-commutative91.3%
*-commutative91.3%
cancel-sign-sub-inv91.3%
*-commutative91.3%
*-commutative91.3%
associate-*l*91.3%
associate-*l*91.3%
associate-*l*91.4%
Simplified91.4%
Taylor expanded in x around 0 83.4%
Final simplification92.8%
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 6.2e-56) (+ (* a (* 27.0 b)) (- (* x 2.0) (* (* y 9.0) (* z t)))) (+ (* b (* a 27.0)) (- (* x 2.0) (* t (* z (* y 9.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.2e-56) {
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (z * (y * 9.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.2d-56) then
tmp = (a * (27.0d0 * b)) + ((x * 2.0d0) - ((y * 9.0d0) * (z * t)))
else
tmp = (b * (a * 27.0d0)) + ((x * 2.0d0) - (t * (z * (y * 9.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.2e-56) {
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (z * (y * 9.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.2e-56: tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t))) else: tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (z * (y * 9.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.2e-56) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t)))); else tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.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.2e-56)
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
else
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (z * (y * 9.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[LessEqual[z, 6.2e-56], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $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 6.2 \cdot 10^{-56}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right)\\
\end{array}
\end{array}
if z < 6.19999999999999975e-56Initial program 97.6%
sub-neg97.6%
distribute-lft-neg-in97.6%
associate-*l*97.6%
*-commutative97.6%
*-commutative97.6%
cancel-sign-sub-inv97.6%
*-commutative97.6%
*-commutative97.6%
associate-*l*97.6%
associate-*l*96.1%
associate-*l*96.1%
Simplified96.1%
if 6.19999999999999975e-56 < z Initial program 92.2%
Final simplification94.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 -4e+116)
(* y (* t (* z -9.0)))
(if (or (<= z -7e-70) (not (<= z 2.7e-57)))
(- (* x 2.0) (* 9.0 (* t (* z y))))
(+ (* 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 (z <= -4e+116) {
tmp = y * (t * (z * -9.0));
} else if ((z <= -7e-70) || !(z <= 2.7e-57)) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else {
tmp = (27.0 * (a * b)) + (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 (z <= (-4d+116)) then
tmp = y * (t * (z * (-9.0d0)))
else if ((z <= (-7d-70)) .or. (.not. (z <= 2.7d-57))) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
else
tmp = (27.0d0 * (a * b)) + (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 (z <= -4e+116) {
tmp = y * (t * (z * -9.0));
} else if ((z <= -7e-70) || !(z <= 2.7e-57)) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else {
tmp = (27.0 * (a * b)) + (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 z <= -4e+116: tmp = y * (t * (z * -9.0)) elif (z <= -7e-70) or not (z <= 2.7e-57): tmp = (x * 2.0) - (9.0 * (t * (z * y))) else: tmp = (27.0 * (a * b)) + (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 (z <= -4e+116) tmp = Float64(y * Float64(t * Float64(z * -9.0))); elseif ((z <= -7e-70) || !(z <= 2.7e-57)) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); else tmp = Float64(Float64(27.0 * Float64(a * b)) + 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 (z <= -4e+116)
tmp = y * (t * (z * -9.0));
elseif ((z <= -7e-70) || ~((z <= 2.7e-57)))
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
else
tmp = (27.0 * (a * b)) + (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[LessEqual[z, -4e+116], N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -7e-70], N[Not[LessEqual[z, 2.7e-57]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $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 -4 \cdot 10^{+116}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-70} \lor \neg \left(z \leq 2.7 \cdot 10^{-57}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\end{array}
\end{array}
if z < -4.00000000000000006e116Initial program 89.9%
sub-neg89.9%
distribute-lft-neg-in89.9%
associate-*l*90.0%
*-commutative90.0%
*-commutative90.0%
cancel-sign-sub-inv90.0%
*-commutative90.0%
*-commutative90.0%
associate-*l*89.9%
associate-*l*80.5%
associate-*l*80.4%
Simplified80.4%
Taylor expanded in y around inf 53.3%
*-commutative53.3%
associate-*r*59.6%
*-commutative59.6%
associate-*r*59.8%
associate-*l*53.7%
Simplified53.7%
if -4.00000000000000006e116 < z < -6.99999999999999949e-70 or 2.7000000000000002e-57 < z Initial program 94.7%
sub-neg94.7%
distribute-lft-neg-in94.7%
associate-*l*94.7%
*-commutative94.7%
*-commutative94.7%
cancel-sign-sub-inv94.7%
*-commutative94.7%
*-commutative94.7%
associate-*l*94.7%
associate-*l*93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in a around 0 68.0%
if -6.99999999999999949e-70 < z < 2.7000000000000002e-57Initial program 98.8%
sub-neg98.8%
distribute-lft-neg-in98.8%
associate-*l*98.9%
*-commutative98.9%
*-commutative98.9%
cancel-sign-sub-inv98.9%
*-commutative98.9%
*-commutative98.9%
associate-*l*98.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 83.6%
Final simplification73.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 -8.5e+36) (* y (* t (* z -9.0))) (if (<= z 0.00095) (+ (* 27.0 (* a b)) (* x 2.0)) (* z (* t (* y -9.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 <= -8.5e+36) {
tmp = y * (t * (z * -9.0));
} else if (z <= 0.00095) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = z * (t * (y * -9.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 <= (-8.5d+36)) then
tmp = y * (t * (z * (-9.0d0)))
else if (z <= 0.00095d0) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = z * (t * (y * (-9.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 <= -8.5e+36) {
tmp = y * (t * (z * -9.0));
} else if (z <= 0.00095) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = z * (t * (y * -9.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 <= -8.5e+36: tmp = y * (t * (z * -9.0)) elif z <= 0.00095: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = z * (t * (y * -9.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 <= -8.5e+36) tmp = Float64(y * Float64(t * Float64(z * -9.0))); elseif (z <= 0.00095) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(z * Float64(t * Float64(y * -9.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 <= -8.5e+36)
tmp = y * (t * (z * -9.0));
elseif (z <= 0.00095)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = z * (t * (y * -9.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[LessEqual[z, -8.5e+36], N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.00095], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(t * N[(y * -9.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 -8.5 \cdot 10^{+36}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 0.00095:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -8.50000000000000014e36Initial program 93.4%
sub-neg93.4%
distribute-lft-neg-in93.4%
associate-*l*93.5%
*-commutative93.5%
*-commutative93.5%
cancel-sign-sub-inv93.5%
*-commutative93.5%
*-commutative93.5%
associate-*l*93.4%
associate-*l*87.3%
associate-*l*87.3%
Simplified87.3%
Taylor expanded in y around inf 56.9%
*-commutative56.9%
associate-*r*61.1%
*-commutative61.1%
associate-*r*61.2%
associate-*l*57.2%
Simplified57.2%
if -8.50000000000000014e36 < z < 9.49999999999999998e-4Initial program 99.0%
sub-neg99.0%
distribute-lft-neg-in99.0%
associate-*l*99.0%
*-commutative99.0%
*-commutative99.0%
cancel-sign-sub-inv99.0%
*-commutative99.0%
*-commutative99.0%
associate-*l*99.0%
associate-*l*99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in y around 0 79.8%
if 9.49999999999999998e-4 < z Initial program 90.9%
sub-neg90.9%
distribute-lft-neg-in90.9%
associate-*l*90.9%
*-commutative90.9%
*-commutative90.9%
cancel-sign-sub-inv90.9%
*-commutative90.9%
*-commutative90.9%
associate-*l*90.9%
associate-*l*91.0%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in y around inf 62.2%
*-commutative62.2%
associate-*l*61.0%
associate-*l*61.0%
*-commutative61.0%
*-commutative61.0%
associate-*l*65.0%
Simplified65.0%
Final simplification72.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 (or (<= b -2.7e-58) (not (<= b 1.9e+89))) (* 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 <= -2.7e-58) || !(b <= 1.9e+89)) {
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 <= (-2.7d-58)) .or. (.not. (b <= 1.9d+89))) 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 <= -2.7e-58) || !(b <= 1.9e+89)) {
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 <= -2.7e-58) or not (b <= 1.9e+89): 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 <= -2.7e-58) || !(b <= 1.9e+89)) 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 <= -2.7e-58) || ~((b <= 1.9e+89)))
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, -2.7e-58], N[Not[LessEqual[b, 1.9e+89]], $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 -2.7 \cdot 10^{-58} \lor \neg \left(b \leq 1.9 \cdot 10^{+89}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -2.6999999999999999e-58 or 1.90000000000000012e89 < b Initial program 95.8%
sub-neg95.8%
distribute-lft-neg-in95.8%
associate-*l*95.8%
*-commutative95.8%
*-commutative95.8%
cancel-sign-sub-inv95.8%
*-commutative95.8%
*-commutative95.8%
associate-*l*95.8%
associate-*l*94.4%
associate-*l*94.4%
Simplified94.4%
Taylor expanded in a around inf 62.6%
if -2.6999999999999999e-58 < b < 1.90000000000000012e89Initial program 96.2%
sub-neg96.2%
distribute-lft-neg-in96.2%
associate-*l*96.2%
*-commutative96.2%
*-commutative96.2%
cancel-sign-sub-inv96.2%
*-commutative96.2%
*-commutative96.2%
associate-*l*96.2%
associate-*l*95.5%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in x around inf 36.9%
Final simplification49.4%
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 (<= y -9.6e+73) (* -9.0 (* t (* z y))) (* 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 (y <= -9.6e+73) {
tmp = -9.0 * (t * (z * y));
} 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 (y <= (-9.6d+73)) then
tmp = (-9.0d0) * (t * (z * y))
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 (y <= -9.6e+73) {
tmp = -9.0 * (t * (z * y));
} 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 y <= -9.6e+73: tmp = -9.0 * (t * (z * y)) 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 (y <= -9.6e+73) tmp = Float64(-9.0 * Float64(t * Float64(z * y))); 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 (y <= -9.6e+73)
tmp = -9.0 * (t * (z * y));
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[y, -9.6e+73], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $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}\;y \leq -9.6 \cdot 10^{+73}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if y < -9.60000000000000009e73Initial program 94.7%
sub-neg94.7%
distribute-lft-neg-in94.7%
associate-*l*94.7%
*-commutative94.7%
*-commutative94.7%
cancel-sign-sub-inv94.7%
*-commutative94.7%
*-commutative94.7%
associate-*l*94.7%
associate-*l*96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in y around inf 60.1%
if -9.60000000000000009e73 < y Initial program 96.3%
sub-neg96.3%
distribute-lft-neg-in96.3%
associate-*l*96.4%
*-commutative96.4%
*-commutative96.4%
cancel-sign-sub-inv96.4%
*-commutative96.4%
*-commutative96.4%
associate-*l*96.3%
associate-*l*94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in a around inf 46.1%
Final simplification49.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 (<= y -1.15e+74) (* y (* -9.0 (* z t))) (* 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 (y <= -1.15e+74) {
tmp = y * (-9.0 * (z * t));
} 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 (y <= (-1.15d+74)) then
tmp = y * ((-9.0d0) * (z * t))
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 (y <= -1.15e+74) {
tmp = y * (-9.0 * (z * t));
} 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 y <= -1.15e+74: tmp = y * (-9.0 * (z * t)) 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 (y <= -1.15e+74) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); 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 (y <= -1.15e+74)
tmp = y * (-9.0 * (z * t));
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[y, -1.15e+74], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $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}\;y \leq -1.15 \cdot 10^{+74}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if y < -1.1499999999999999e74Initial program 94.7%
sub-neg94.7%
distribute-lft-neg-in94.7%
associate-*l*94.7%
*-commutative94.7%
*-commutative94.7%
cancel-sign-sub-inv94.7%
*-commutative94.7%
*-commutative94.7%
associate-*l*94.7%
associate-*l*96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in y around inf 60.1%
*-commutative60.1%
associate-*r*51.9%
*-commutative51.9%
associate-*r*51.9%
associate-*l*63.6%
Simplified63.6%
Taylor expanded in t around 0 63.5%
if -1.1499999999999999e74 < y Initial program 96.3%
sub-neg96.3%
distribute-lft-neg-in96.3%
associate-*l*96.4%
*-commutative96.4%
*-commutative96.4%
cancel-sign-sub-inv96.4%
*-commutative96.4%
*-commutative96.4%
associate-*l*96.3%
associate-*l*94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in a around inf 46.1%
Final simplification49.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 (<= y -1e+74) (* y (* t (* z -9.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 (y <= -1e+74) {
tmp = y * (t * (z * -9.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 (y <= (-1d+74)) then
tmp = y * (t * (z * (-9.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 (y <= -1e+74) {
tmp = y * (t * (z * -9.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 y <= -1e+74: tmp = y * (t * (z * -9.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 (y <= -1e+74) tmp = Float64(y * Float64(t * Float64(z * -9.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 (y <= -1e+74)
tmp = y * (t * (z * -9.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[y, -1e+74], N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $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}\;y \leq -1 \cdot 10^{+74}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if y < -9.99999999999999952e73Initial program 94.7%
sub-neg94.7%
distribute-lft-neg-in94.7%
associate-*l*94.7%
*-commutative94.7%
*-commutative94.7%
cancel-sign-sub-inv94.7%
*-commutative94.7%
*-commutative94.7%
associate-*l*94.7%
associate-*l*96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in y around inf 60.1%
*-commutative60.1%
associate-*r*51.9%
*-commutative51.9%
associate-*r*51.9%
associate-*l*63.6%
Simplified63.6%
if -9.99999999999999952e73 < y Initial program 96.3%
sub-neg96.3%
distribute-lft-neg-in96.3%
associate-*l*96.4%
*-commutative96.4%
*-commutative96.4%
cancel-sign-sub-inv96.4%
*-commutative96.4%
*-commutative96.4%
associate-*l*96.3%
associate-*l*94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in a around inf 46.1%
Final simplification49.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 (* 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 96.0%
sub-neg96.0%
distribute-lft-neg-in96.0%
associate-*l*96.0%
*-commutative96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
*-commutative96.0%
*-commutative96.0%
associate-*l*96.0%
associate-*l*95.0%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in x around inf 26.5%
Final simplification26.5%
(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 2023271
(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)))