
(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 16 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 -1.22e-234) (fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t))))) (fma x 2.0 (fma t (* (* z y) -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 <= -1.22e-234) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
} else {
tmp = fma(x, 2.0, fma(t, ((z * y) * -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 <= -1.22e-234) tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))))); else tmp = fma(x, 2.0, fma(t, Float64(Float64(z * y) * -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, -1.22e-234], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * 2.0 + N[(t * N[(N[(z * y), $MachinePrecision] * -9.0), $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 -1.22 \cdot 10^{-234}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(t, \left(z \cdot y\right) \cdot -9, b \cdot \left(a \cdot 27\right)\right)\right)\\
\end{array}
\end{array}
if z < -1.21999999999999998e-234Initial program 95.4%
+-commutative95.4%
associate-*l*95.4%
fma-def96.3%
associate-*l*93.7%
*-commutative93.7%
associate-*l*93.8%
Simplified93.8%
if -1.21999999999999998e-234 < z Initial program 97.1%
associate-+l-97.1%
fma-neg97.1%
neg-sub097.1%
associate-+l-97.1%
neg-sub097.1%
*-commutative97.1%
distribute-rgt-neg-in97.1%
fma-def97.8%
*-commutative97.8%
associate-*r*97.9%
distribute-rgt-neg-in97.9%
*-commutative97.9%
metadata-eval97.9%
Simplified97.9%
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 (if (<= z -6.2e-234) (+ (* x 2.0) (- (* a (* 27.0 b)) (* (* 9.0 y) (* z t)))) (+ (* x 2.0) (fma t (* y (* z -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 <= -6.2e-234) {
tmp = (x * 2.0) + ((a * (27.0 * b)) - ((9.0 * y) * (z * t)));
} else {
tmp = (x * 2.0) + fma(t, (y * (z * -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 <= -6.2e-234) tmp = Float64(Float64(x * 2.0) + Float64(Float64(a * Float64(27.0 * b)) - Float64(Float64(9.0 * y) * Float64(z * t)))); else tmp = Float64(Float64(x * 2.0) + fma(t, Float64(y * Float64(z * -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, -6.2e-234], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] - N[(N[(9.0 * y), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(t * N[(y * N[(z * -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 -6.2 \cdot 10^{-234}:\\
\;\;\;\;x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) - \left(9 \cdot y\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \mathsf{fma}\left(t, y \cdot \left(z \cdot -9\right), b \cdot \left(a \cdot 27\right)\right)\\
\end{array}
\end{array}
if z < -6.2000000000000003e-234Initial program 95.4%
associate-+l-95.4%
sub-neg95.4%
neg-mul-195.4%
metadata-eval95.4%
metadata-eval95.4%
cancel-sign-sub-inv95.4%
metadata-eval95.4%
*-lft-identity95.4%
associate-*l*92.9%
associate-*l*92.8%
Simplified92.8%
if -6.2000000000000003e-234 < z Initial program 97.1%
associate-+l-97.1%
fma-neg97.1%
neg-sub097.1%
associate-+l-97.1%
neg-sub097.1%
*-commutative97.1%
distribute-rgt-neg-in97.1%
fma-def97.8%
*-commutative97.8%
associate-*r*97.9%
distribute-rgt-neg-in97.9%
*-commutative97.9%
metadata-eval97.9%
Simplified97.9%
fma-udef97.9%
associate-*l*97.8%
Applied egg-rr97.8%
Final simplification95.7%
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-234) (fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t))))) (+ (* x 2.0) (fma t (* y (* z -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-234) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
} else {
tmp = (x * 2.0) + fma(t, (y * (z * -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-234) tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))))); else tmp = Float64(Float64(x * 2.0) + fma(t, Float64(y * Float64(z * -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-234], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(t * N[(y * N[(z * -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^{-234}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \mathsf{fma}\left(t, y \cdot \left(z \cdot -9\right), b \cdot \left(a \cdot 27\right)\right)\\
\end{array}
\end{array}
if z < -4.99999999999999979e-234Initial program 95.4%
+-commutative95.4%
associate-*l*95.4%
fma-def96.3%
associate-*l*93.7%
*-commutative93.7%
associate-*l*93.8%
Simplified93.8%
if -4.99999999999999979e-234 < z Initial program 97.1%
associate-+l-97.1%
fma-neg97.1%
neg-sub097.1%
associate-+l-97.1%
neg-sub097.1%
*-commutative97.1%
distribute-rgt-neg-in97.1%
fma-def97.8%
*-commutative97.8%
associate-*r*97.9%
distribute-rgt-neg-in97.9%
*-commutative97.9%
metadata-eval97.9%
Simplified97.9%
fma-udef97.9%
associate-*l*97.8%
Applied egg-rr97.8%
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 (- (* x 2.0) (* b (* a -27.0))))
(t_2 (* y (* -9.0 (* z t))))
(t_3 (* t (* (* z y) -9.0))))
(if (<= z -6.5e+72)
t_2
(if (<= z -5.5e-140)
t_1
(if (<= z -2.4e-144)
t_3
(if (<= z 3.25e+31)
t_1
(if (<= z 5.8e+49) t_2 (if (<= z 1.85e+84) t_1 t_3))))))))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) - (b * (a * -27.0));
double t_2 = y * (-9.0 * (z * t));
double t_3 = t * ((z * y) * -9.0);
double tmp;
if (z <= -6.5e+72) {
tmp = t_2;
} else if (z <= -5.5e-140) {
tmp = t_1;
} else if (z <= -2.4e-144) {
tmp = t_3;
} else if (z <= 3.25e+31) {
tmp = t_1;
} else if (z <= 5.8e+49) {
tmp = t_2;
} else if (z <= 1.85e+84) {
tmp = t_1;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = (x * 2.0d0) - (b * (a * (-27.0d0)))
t_2 = y * ((-9.0d0) * (z * t))
t_3 = t * ((z * y) * (-9.0d0))
if (z <= (-6.5d+72)) then
tmp = t_2
else if (z <= (-5.5d-140)) then
tmp = t_1
else if (z <= (-2.4d-144)) then
tmp = t_3
else if (z <= 3.25d+31) then
tmp = t_1
else if (z <= 5.8d+49) then
tmp = t_2
else if (z <= 1.85d+84) then
tmp = t_1
else
tmp = t_3
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) - (b * (a * -27.0));
double t_2 = y * (-9.0 * (z * t));
double t_3 = t * ((z * y) * -9.0);
double tmp;
if (z <= -6.5e+72) {
tmp = t_2;
} else if (z <= -5.5e-140) {
tmp = t_1;
} else if (z <= -2.4e-144) {
tmp = t_3;
} else if (z <= 3.25e+31) {
tmp = t_1;
} else if (z <= 5.8e+49) {
tmp = t_2;
} else if (z <= 1.85e+84) {
tmp = t_1;
} else {
tmp = t_3;
}
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) - (b * (a * -27.0)) t_2 = y * (-9.0 * (z * t)) t_3 = t * ((z * y) * -9.0) tmp = 0 if z <= -6.5e+72: tmp = t_2 elif z <= -5.5e-140: tmp = t_1 elif z <= -2.4e-144: tmp = t_3 elif z <= 3.25e+31: tmp = t_1 elif z <= 5.8e+49: tmp = t_2 elif z <= 1.85e+84: tmp = t_1 else: tmp = t_3 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(b * Float64(a * -27.0))) t_2 = Float64(y * Float64(-9.0 * Float64(z * t))) t_3 = Float64(t * Float64(Float64(z * y) * -9.0)) tmp = 0.0 if (z <= -6.5e+72) tmp = t_2; elseif (z <= -5.5e-140) tmp = t_1; elseif (z <= -2.4e-144) tmp = t_3; elseif (z <= 3.25e+31) tmp = t_1; elseif (z <= 5.8e+49) tmp = t_2; elseif (z <= 1.85e+84) tmp = t_1; else tmp = t_3; 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) - (b * (a * -27.0));
t_2 = y * (-9.0 * (z * t));
t_3 = t * ((z * y) * -9.0);
tmp = 0.0;
if (z <= -6.5e+72)
tmp = t_2;
elseif (z <= -5.5e-140)
tmp = t_1;
elseif (z <= -2.4e-144)
tmp = t_3;
elseif (z <= 3.25e+31)
tmp = t_1;
elseif (z <= 5.8e+49)
tmp = t_2;
elseif (z <= 1.85e+84)
tmp = t_1;
else
tmp = t_3;
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[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(N[(z * y), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.5e+72], t$95$2, If[LessEqual[z, -5.5e-140], t$95$1, If[LessEqual[z, -2.4e-144], t$95$3, If[LessEqual[z, 3.25e+31], t$95$1, If[LessEqual[z, 5.8e+49], t$95$2, If[LessEqual[z, 1.85e+84], t$95$1, t$95$3]]]]]]]]]
\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 - b \cdot \left(a \cdot -27\right)\\
t_2 := y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
t_3 := t \cdot \left(\left(z \cdot y\right) \cdot -9\right)\\
\mathbf{if}\;z \leq -6.5 \cdot 10^{+72}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-140}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-144}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 3.25 \cdot 10^{+31}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+49}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+84}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -6.5000000000000001e72 or 3.2500000000000002e31 < z < 5.8e49Initial program 90.6%
Taylor expanded in y around 0 90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in y around inf 41.1%
*-commutative41.1%
associate-*l*41.0%
Simplified41.0%
if -6.5000000000000001e72 < z < -5.50000000000000026e-140 or -2.39999999999999994e-144 < z < 3.2500000000000002e31 or 5.8e49 < z < 1.85e84Initial program 98.5%
associate-+l-98.5%
sub-neg98.5%
neg-mul-198.5%
metadata-eval98.5%
metadata-eval98.5%
cancel-sign-sub-inv98.5%
metadata-eval98.5%
*-lft-identity98.5%
associate-*l*98.3%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in y around 0 80.0%
*-commutative80.0%
Simplified80.0%
Taylor expanded in a around 0 80.0%
*-commutative80.0%
*-commutative80.0%
associate-*l*80.0%
Simplified80.0%
if -5.50000000000000026e-140 < z < -2.39999999999999994e-144 or 1.85e84 < z Initial program 95.1%
Taylor expanded in y around 0 95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in y around inf 60.7%
*-commutative60.7%
Simplified60.7%
Taylor expanded in y around 0 60.7%
*-commutative60.7%
*-commutative60.7%
associate-*r*63.5%
associate-*l*63.5%
*-commutative63.5%
*-commutative63.5%
Simplified63.5%
Final simplification69.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 (- (* x 2.0) (* b (* a -27.0))))
(t_2 (* y (* -9.0 (* z t))))
(t_3 (* t (* (* z y) -9.0))))
(if (<= z -7.4e+68)
t_2
(if (<= z -5.5e-140)
t_1
(if (<= z -2.4e-144)
t_3
(if (<= z 6.4e+31)
(- (* x 2.0) (* -27.0 (* a b)))
(if (<= z 1.65e+50) t_2 (if (<= z 9.5e+83) t_1 t_3))))))))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) - (b * (a * -27.0));
double t_2 = y * (-9.0 * (z * t));
double t_3 = t * ((z * y) * -9.0);
double tmp;
if (z <= -7.4e+68) {
tmp = t_2;
} else if (z <= -5.5e-140) {
tmp = t_1;
} else if (z <= -2.4e-144) {
tmp = t_3;
} else if (z <= 6.4e+31) {
tmp = (x * 2.0) - (-27.0 * (a * b));
} else if (z <= 1.65e+50) {
tmp = t_2;
} else if (z <= 9.5e+83) {
tmp = t_1;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = (x * 2.0d0) - (b * (a * (-27.0d0)))
t_2 = y * ((-9.0d0) * (z * t))
t_3 = t * ((z * y) * (-9.0d0))
if (z <= (-7.4d+68)) then
tmp = t_2
else if (z <= (-5.5d-140)) then
tmp = t_1
else if (z <= (-2.4d-144)) then
tmp = t_3
else if (z <= 6.4d+31) then
tmp = (x * 2.0d0) - ((-27.0d0) * (a * b))
else if (z <= 1.65d+50) then
tmp = t_2
else if (z <= 9.5d+83) then
tmp = t_1
else
tmp = t_3
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) - (b * (a * -27.0));
double t_2 = y * (-9.0 * (z * t));
double t_3 = t * ((z * y) * -9.0);
double tmp;
if (z <= -7.4e+68) {
tmp = t_2;
} else if (z <= -5.5e-140) {
tmp = t_1;
} else if (z <= -2.4e-144) {
tmp = t_3;
} else if (z <= 6.4e+31) {
tmp = (x * 2.0) - (-27.0 * (a * b));
} else if (z <= 1.65e+50) {
tmp = t_2;
} else if (z <= 9.5e+83) {
tmp = t_1;
} else {
tmp = t_3;
}
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) - (b * (a * -27.0)) t_2 = y * (-9.0 * (z * t)) t_3 = t * ((z * y) * -9.0) tmp = 0 if z <= -7.4e+68: tmp = t_2 elif z <= -5.5e-140: tmp = t_1 elif z <= -2.4e-144: tmp = t_3 elif z <= 6.4e+31: tmp = (x * 2.0) - (-27.0 * (a * b)) elif z <= 1.65e+50: tmp = t_2 elif z <= 9.5e+83: tmp = t_1 else: tmp = t_3 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(b * Float64(a * -27.0))) t_2 = Float64(y * Float64(-9.0 * Float64(z * t))) t_3 = Float64(t * Float64(Float64(z * y) * -9.0)) tmp = 0.0 if (z <= -7.4e+68) tmp = t_2; elseif (z <= -5.5e-140) tmp = t_1; elseif (z <= -2.4e-144) tmp = t_3; elseif (z <= 6.4e+31) tmp = Float64(Float64(x * 2.0) - Float64(-27.0 * Float64(a * b))); elseif (z <= 1.65e+50) tmp = t_2; elseif (z <= 9.5e+83) tmp = t_1; else tmp = t_3; 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) - (b * (a * -27.0));
t_2 = y * (-9.0 * (z * t));
t_3 = t * ((z * y) * -9.0);
tmp = 0.0;
if (z <= -7.4e+68)
tmp = t_2;
elseif (z <= -5.5e-140)
tmp = t_1;
elseif (z <= -2.4e-144)
tmp = t_3;
elseif (z <= 6.4e+31)
tmp = (x * 2.0) - (-27.0 * (a * b));
elseif (z <= 1.65e+50)
tmp = t_2;
elseif (z <= 9.5e+83)
tmp = t_1;
else
tmp = t_3;
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[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(N[(z * y), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.4e+68], t$95$2, If[LessEqual[z, -5.5e-140], t$95$1, If[LessEqual[z, -2.4e-144], t$95$3, If[LessEqual[z, 6.4e+31], N[(N[(x * 2.0), $MachinePrecision] - N[(-27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e+50], t$95$2, If[LessEqual[z, 9.5e+83], t$95$1, t$95$3]]]]]]]]]
\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 - b \cdot \left(a \cdot -27\right)\\
t_2 := y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
t_3 := t \cdot \left(\left(z \cdot y\right) \cdot -9\right)\\
\mathbf{if}\;z \leq -7.4 \cdot 10^{+68}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-140}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-144}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{+31}:\\
\;\;\;\;x \cdot 2 - -27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+50}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+83}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -7.39999999999999996e68 or 6.4000000000000001e31 < z < 1.65e50Initial program 90.6%
Taylor expanded in y around 0 90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in y around inf 41.1%
*-commutative41.1%
associate-*l*41.0%
Simplified41.0%
if -7.39999999999999996e68 < z < -5.50000000000000026e-140 or 1.65e50 < z < 9.5000000000000002e83Initial program 95.7%
associate-+l-95.7%
sub-neg95.7%
neg-mul-195.7%
metadata-eval95.7%
metadata-eval95.7%
cancel-sign-sub-inv95.7%
metadata-eval95.7%
*-lft-identity95.7%
associate-*l*99.7%
associate-*l*97.8%
Simplified97.8%
Taylor expanded in y around 0 69.2%
*-commutative69.2%
Simplified69.2%
Taylor expanded in a around 0 69.2%
*-commutative69.2%
*-commutative69.2%
associate-*l*69.2%
Simplified69.2%
if -5.50000000000000026e-140 < z < -2.39999999999999994e-144 or 9.5000000000000002e83 < z Initial program 95.1%
Taylor expanded in y around 0 95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in y around inf 60.7%
*-commutative60.7%
Simplified60.7%
Taylor expanded in y around 0 60.7%
*-commutative60.7%
*-commutative60.7%
associate-*r*63.5%
associate-*l*63.5%
*-commutative63.5%
*-commutative63.5%
Simplified63.5%
if -2.39999999999999994e-144 < z < 6.4000000000000001e31Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
neg-mul-199.7%
metadata-eval99.7%
metadata-eval99.7%
cancel-sign-sub-inv99.7%
metadata-eval99.7%
*-lft-identity99.7%
associate-*l*97.7%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in y around 0 84.6%
*-commutative84.6%
Simplified84.6%
Final simplification69.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 (* 27.0 (* a b))) (t_2 (* t (* (* z y) -9.0))))
(if (<= a -1.85e+97)
t_1
(if (<= a -2.6e+49)
(* x 2.0)
(if (<= a -4.8e+22)
t_1
(if (<= a -1.52e-24)
t_2
(if (<= a -3.2e-131)
(* x 2.0)
(if (<= a -2.75e-249)
t_2
(if (<= a 1.45e-109) (* x 2.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 = 27.0 * (a * b);
double t_2 = t * ((z * y) * -9.0);
double tmp;
if (a <= -1.85e+97) {
tmp = t_1;
} else if (a <= -2.6e+49) {
tmp = x * 2.0;
} else if (a <= -4.8e+22) {
tmp = t_1;
} else if (a <= -1.52e-24) {
tmp = t_2;
} else if (a <= -3.2e-131) {
tmp = x * 2.0;
} else if (a <= -2.75e-249) {
tmp = t_2;
} else if (a <= 1.45e-109) {
tmp = x * 2.0;
} 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) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = t * ((z * y) * (-9.0d0))
if (a <= (-1.85d+97)) then
tmp = t_1
else if (a <= (-2.6d+49)) then
tmp = x * 2.0d0
else if (a <= (-4.8d+22)) then
tmp = t_1
else if (a <= (-1.52d-24)) then
tmp = t_2
else if (a <= (-3.2d-131)) then
tmp = x * 2.0d0
else if (a <= (-2.75d-249)) then
tmp = t_2
else if (a <= 1.45d-109) then
tmp = x * 2.0d0
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 = 27.0 * (a * b);
double t_2 = t * ((z * y) * -9.0);
double tmp;
if (a <= -1.85e+97) {
tmp = t_1;
} else if (a <= -2.6e+49) {
tmp = x * 2.0;
} else if (a <= -4.8e+22) {
tmp = t_1;
} else if (a <= -1.52e-24) {
tmp = t_2;
} else if (a <= -3.2e-131) {
tmp = x * 2.0;
} else if (a <= -2.75e-249) {
tmp = t_2;
} else if (a <= 1.45e-109) {
tmp = x * 2.0;
} 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 = 27.0 * (a * b) t_2 = t * ((z * y) * -9.0) tmp = 0 if a <= -1.85e+97: tmp = t_1 elif a <= -2.6e+49: tmp = x * 2.0 elif a <= -4.8e+22: tmp = t_1 elif a <= -1.52e-24: tmp = t_2 elif a <= -3.2e-131: tmp = x * 2.0 elif a <= -2.75e-249: tmp = t_2 elif a <= 1.45e-109: tmp = x * 2.0 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(27.0 * Float64(a * b)) t_2 = Float64(t * Float64(Float64(z * y) * -9.0)) tmp = 0.0 if (a <= -1.85e+97) tmp = t_1; elseif (a <= -2.6e+49) tmp = Float64(x * 2.0); elseif (a <= -4.8e+22) tmp = t_1; elseif (a <= -1.52e-24) tmp = t_2; elseif (a <= -3.2e-131) tmp = Float64(x * 2.0); elseif (a <= -2.75e-249) tmp = t_2; elseif (a <= 1.45e-109) tmp = Float64(x * 2.0); 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 = 27.0 * (a * b);
t_2 = t * ((z * y) * -9.0);
tmp = 0.0;
if (a <= -1.85e+97)
tmp = t_1;
elseif (a <= -2.6e+49)
tmp = x * 2.0;
elseif (a <= -4.8e+22)
tmp = t_1;
elseif (a <= -1.52e-24)
tmp = t_2;
elseif (a <= -3.2e-131)
tmp = x * 2.0;
elseif (a <= -2.75e-249)
tmp = t_2;
elseif (a <= 1.45e-109)
tmp = x * 2.0;
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[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(z * y), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.85e+97], t$95$1, If[LessEqual[a, -2.6e+49], N[(x * 2.0), $MachinePrecision], If[LessEqual[a, -4.8e+22], t$95$1, If[LessEqual[a, -1.52e-24], t$95$2, If[LessEqual[a, -3.2e-131], N[(x * 2.0), $MachinePrecision], If[LessEqual[a, -2.75e-249], t$95$2, If[LessEqual[a, 1.45e-109], N[(x * 2.0), $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 := 27 \cdot \left(a \cdot b\right)\\
t_2 := t \cdot \left(\left(z \cdot y\right) \cdot -9\right)\\
\mathbf{if}\;a \leq -1.85 \cdot 10^{+97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -2.6 \cdot 10^{+49}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;a \leq -4.8 \cdot 10^{+22}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -1.52 \cdot 10^{-24}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -3.2 \cdot 10^{-131}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;a \leq -2.75 \cdot 10^{-249}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{-109}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -1.85e97 or -2.59999999999999989e49 < a < -4.8e22 or 1.45e-109 < a Initial program 95.6%
Taylor expanded in y around 0 95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in a around inf 50.6%
if -1.85e97 < a < -2.59999999999999989e49 or -1.51999999999999992e-24 < a < -3.2e-131 or -2.74999999999999999e-249 < a < 1.45e-109Initial program 97.5%
associate-+l-97.5%
fma-neg97.5%
neg-sub097.5%
associate-+l-97.5%
neg-sub097.5%
*-commutative97.5%
distribute-rgt-neg-in97.5%
fma-def97.5%
*-commutative97.5%
associate-*r*97.6%
distribute-rgt-neg-in97.6%
*-commutative97.6%
metadata-eval97.6%
Simplified97.6%
Taylor expanded in x around inf 49.3%
if -4.8e22 < a < -1.51999999999999992e-24 or -3.2e-131 < a < -2.74999999999999999e-249Initial program 96.8%
Taylor expanded in y around 0 96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in y around inf 41.3%
*-commutative41.3%
Simplified41.3%
Taylor expanded in y around 0 41.3%
*-commutative41.3%
*-commutative41.3%
associate-*r*44.1%
associate-*l*44.1%
*-commutative44.1%
*-commutative44.1%
Simplified44.1%
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
(let* ((t_1 (* 27.0 (* a b))))
(if (<= a -1.15e+99)
t_1
(if (<= a -2.8e+49)
(* x 2.0)
(if (<= a -4.5e+23)
t_1
(if (<= a -1.6e-25)
(* t (* (* z y) -9.0))
(if (<= a -2.05e-131)
(* x 2.0)
(if (<= a -2e-245)
(* y (* -9.0 (* z t)))
(if (<= a 2.5e-109) (* x 2.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 = 27.0 * (a * b);
double tmp;
if (a <= -1.15e+99) {
tmp = t_1;
} else if (a <= -2.8e+49) {
tmp = x * 2.0;
} else if (a <= -4.5e+23) {
tmp = t_1;
} else if (a <= -1.6e-25) {
tmp = t * ((z * y) * -9.0);
} else if (a <= -2.05e-131) {
tmp = x * 2.0;
} else if (a <= -2e-245) {
tmp = y * (-9.0 * (z * t));
} else if (a <= 2.5e-109) {
tmp = x * 2.0;
} 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 = 27.0d0 * (a * b)
if (a <= (-1.15d+99)) then
tmp = t_1
else if (a <= (-2.8d+49)) then
tmp = x * 2.0d0
else if (a <= (-4.5d+23)) then
tmp = t_1
else if (a <= (-1.6d-25)) then
tmp = t * ((z * y) * (-9.0d0))
else if (a <= (-2.05d-131)) then
tmp = x * 2.0d0
else if (a <= (-2d-245)) then
tmp = y * ((-9.0d0) * (z * t))
else if (a <= 2.5d-109) then
tmp = x * 2.0d0
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 = 27.0 * (a * b);
double tmp;
if (a <= -1.15e+99) {
tmp = t_1;
} else if (a <= -2.8e+49) {
tmp = x * 2.0;
} else if (a <= -4.5e+23) {
tmp = t_1;
} else if (a <= -1.6e-25) {
tmp = t * ((z * y) * -9.0);
} else if (a <= -2.05e-131) {
tmp = x * 2.0;
} else if (a <= -2e-245) {
tmp = y * (-9.0 * (z * t));
} else if (a <= 2.5e-109) {
tmp = x * 2.0;
} 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 = 27.0 * (a * b) tmp = 0 if a <= -1.15e+99: tmp = t_1 elif a <= -2.8e+49: tmp = x * 2.0 elif a <= -4.5e+23: tmp = t_1 elif a <= -1.6e-25: tmp = t * ((z * y) * -9.0) elif a <= -2.05e-131: tmp = x * 2.0 elif a <= -2e-245: tmp = y * (-9.0 * (z * t)) elif a <= 2.5e-109: tmp = x * 2.0 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(27.0 * Float64(a * b)) tmp = 0.0 if (a <= -1.15e+99) tmp = t_1; elseif (a <= -2.8e+49) tmp = Float64(x * 2.0); elseif (a <= -4.5e+23) tmp = t_1; elseif (a <= -1.6e-25) tmp = Float64(t * Float64(Float64(z * y) * -9.0)); elseif (a <= -2.05e-131) tmp = Float64(x * 2.0); elseif (a <= -2e-245) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (a <= 2.5e-109) tmp = Float64(x * 2.0); 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 = 27.0 * (a * b);
tmp = 0.0;
if (a <= -1.15e+99)
tmp = t_1;
elseif (a <= -2.8e+49)
tmp = x * 2.0;
elseif (a <= -4.5e+23)
tmp = t_1;
elseif (a <= -1.6e-25)
tmp = t * ((z * y) * -9.0);
elseif (a <= -2.05e-131)
tmp = x * 2.0;
elseif (a <= -2e-245)
tmp = y * (-9.0 * (z * t));
elseif (a <= 2.5e-109)
tmp = x * 2.0;
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[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.15e+99], t$95$1, If[LessEqual[a, -2.8e+49], N[(x * 2.0), $MachinePrecision], If[LessEqual[a, -4.5e+23], t$95$1, If[LessEqual[a, -1.6e-25], N[(t * N[(N[(z * y), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -2.05e-131], N[(x * 2.0), $MachinePrecision], If[LessEqual[a, -2e-245], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.5e-109], N[(x * 2.0), $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 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;a \leq -1.15 \cdot 10^{+99}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -2.8 \cdot 10^{+49}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;a \leq -4.5 \cdot 10^{+23}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -1.6 \cdot 10^{-25}:\\
\;\;\;\;t \cdot \left(\left(z \cdot y\right) \cdot -9\right)\\
\mathbf{elif}\;a \leq -2.05 \cdot 10^{-131}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;a \leq -2 \cdot 10^{-245}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;a \leq 2.5 \cdot 10^{-109}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -1.1500000000000001e99 or -2.7999999999999998e49 < a < -4.49999999999999979e23 or 2.5000000000000001e-109 < a Initial program 95.6%
Taylor expanded in y around 0 95.6%
*-commutative95.6%
Simplified95.6%
Taylor expanded in a around inf 50.3%
if -1.1500000000000001e99 < a < -2.7999999999999998e49 or -1.6000000000000001e-25 < a < -2.0500000000000001e-131 or -1.9999999999999999e-245 < a < 2.5000000000000001e-109Initial program 97.5%
associate-+l-97.5%
fma-neg97.5%
neg-sub097.5%
associate-+l-97.5%
neg-sub097.5%
*-commutative97.5%
distribute-rgt-neg-in97.5%
fma-def97.5%
*-commutative97.5%
associate-*r*97.6%
distribute-rgt-neg-in97.6%
*-commutative97.6%
metadata-eval97.6%
Simplified97.6%
Taylor expanded in x around inf 48.8%
if -4.49999999999999979e23 < a < -1.6000000000000001e-25Initial program 99.9%
Taylor expanded in y around 0 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 44.6%
*-commutative44.6%
Simplified44.6%
Taylor expanded in y around 0 44.6%
*-commutative44.6%
*-commutative44.6%
associate-*r*52.1%
associate-*l*52.1%
*-commutative52.1%
*-commutative52.1%
Simplified52.1%
if -2.0500000000000001e-131 < a < -1.9999999999999999e-245Initial program 95.0%
Taylor expanded in y around 0 94.9%
*-commutative94.9%
Simplified94.9%
Taylor expanded in y around inf 39.3%
*-commutative39.3%
associate-*l*39.2%
Simplified39.2%
Final simplification49.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 (<= b -2.6e-52)
(- (* x 2.0) (* b (* a -27.0)))
(if (<= b 1.3e-21)
(+ (* x 2.0) (* -9.0 (* t (* z y))))
(if (<= b 6.5e+132)
(- (* x 2.0) (* a (* b -27.0)))
(- (* 27.0 (* a b)) (* 9.0 (* y (* z t))))))))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.6e-52) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else if (b <= 1.3e-21) {
tmp = (x * 2.0) + (-9.0 * (t * (z * y)));
} else if (b <= 6.5e+132) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
}
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.6d-52)) then
tmp = (x * 2.0d0) - (b * (a * (-27.0d0)))
else if (b <= 1.3d-21) then
tmp = (x * 2.0d0) + ((-9.0d0) * (t * (z * y)))
else if (b <= 6.5d+132) then
tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
else
tmp = (27.0d0 * (a * b)) - (9.0d0 * (y * (z * t)))
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.6e-52) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else if (b <= 1.3e-21) {
tmp = (x * 2.0) + (-9.0 * (t * (z * y)));
} else if (b <= 6.5e+132) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
}
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.6e-52: tmp = (x * 2.0) - (b * (a * -27.0)) elif b <= 1.3e-21: tmp = (x * 2.0) + (-9.0 * (t * (z * y))) elif b <= 6.5e+132: tmp = (x * 2.0) - (a * (b * -27.0)) else: tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t))) 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.6e-52) tmp = Float64(Float64(x * 2.0) - Float64(b * Float64(a * -27.0))); elseif (b <= 1.3e-21) tmp = Float64(Float64(x * 2.0) + Float64(-9.0 * Float64(t * Float64(z * y)))); elseif (b <= 6.5e+132) tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0))); else tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * Float64(y * Float64(z * t)))); 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.6e-52)
tmp = (x * 2.0) - (b * (a * -27.0));
elseif (b <= 1.3e-21)
tmp = (x * 2.0) + (-9.0 * (t * (z * y)));
elseif (b <= 6.5e+132)
tmp = (x * 2.0) - (a * (b * -27.0));
else
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
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, -2.6e-52], N[(N[(x * 2.0), $MachinePrecision] - N[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.3e-21], N[(N[(x * 2.0), $MachinePrecision] + N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.5e+132], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $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}\;b \leq -2.6 \cdot 10^{-52}:\\
\;\;\;\;x \cdot 2 - b \cdot \left(a \cdot -27\right)\\
\mathbf{elif}\;b \leq 1.3 \cdot 10^{-21}:\\
\;\;\;\;x \cdot 2 + -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;b \leq 6.5 \cdot 10^{+132}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if b < -2.5999999999999999e-52Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
neg-mul-199.8%
metadata-eval99.8%
metadata-eval99.8%
cancel-sign-sub-inv99.8%
metadata-eval99.8%
*-lft-identity99.8%
associate-*l*94.0%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in y around 0 78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in a around 0 78.3%
*-commutative78.3%
*-commutative78.3%
associate-*l*78.4%
Simplified78.4%
if -2.5999999999999999e-52 < b < 1.30000000000000009e-21Initial program 96.2%
Taylor expanded in a around 0 83.3%
cancel-sign-sub-inv83.3%
*-commutative83.3%
add-sqr-sqrt39.0%
fma-def39.0%
metadata-eval39.0%
Applied egg-rr39.0%
*-commutative39.0%
associate-*r*39.0%
associate-*l*39.0%
*-commutative39.0%
fma-def39.0%
add-sqr-sqrt83.2%
+-commutative83.2%
*-commutative83.2%
associate-*l*83.2%
associate-*r*83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
associate-*l*84.9%
Applied egg-rr84.9%
if 1.30000000000000009e-21 < b < 6.4999999999999994e132Initial program 94.7%
associate-+l-94.7%
sub-neg94.7%
neg-mul-194.7%
metadata-eval94.7%
metadata-eval94.7%
cancel-sign-sub-inv94.7%
metadata-eval94.7%
*-lft-identity94.7%
associate-*l*99.7%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 79.1%
*-commutative79.1%
Simplified79.1%
sub-neg79.1%
associate-*l*79.1%
Applied egg-rr79.1%
if 6.4999999999999994e132 < b Initial program 89.7%
Taylor expanded in x around 0 74.4%
Final simplification80.7%
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 (<= t 3e-37)
(+ t_1 (- (* x 2.0) (* z (* 9.0 (* y t)))))
(+ t_1 (- (* x 2.0) (* t (* z (* 9.0 y))))))))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 (t <= 3e-37) {
tmp = t_1 + ((x * 2.0) - (z * (9.0 * (y * t))));
} else {
tmp = t_1 + ((x * 2.0) - (t * (z * (9.0 * 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) :: t_1
real(8) :: tmp
t_1 = b * (a * 27.0d0)
if (t <= 3d-37) then
tmp = t_1 + ((x * 2.0d0) - (z * (9.0d0 * (y * t))))
else
tmp = t_1 + ((x * 2.0d0) - (t * (z * (9.0d0 * 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 t_1 = b * (a * 27.0);
double tmp;
if (t <= 3e-37) {
tmp = t_1 + ((x * 2.0) - (z * (9.0 * (y * t))));
} else {
tmp = t_1 + ((x * 2.0) - (t * (z * (9.0 * y))));
}
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 t <= 3e-37: tmp = t_1 + ((x * 2.0) - (z * (9.0 * (y * t)))) else: tmp = t_1 + ((x * 2.0) - (t * (z * (9.0 * y)))) 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 (t <= 3e-37) tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(z * Float64(9.0 * Float64(y * t))))); else tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(9.0 * 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)
t_1 = b * (a * 27.0);
tmp = 0.0;
if (t <= 3e-37)
tmp = t_1 + ((x * 2.0) - (z * (9.0 * (y * t))));
else
tmp = t_1 + ((x * 2.0) - (t * (z * (9.0 * 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_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 3e-37], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(z * N[(9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(9.0 * y), $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}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;t \leq 3 \cdot 10^{-37}:\\
\;\;\;\;t_1 + \left(x \cdot 2 - z \cdot \left(9 \cdot \left(y \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(x \cdot 2 - t \cdot \left(z \cdot \left(9 \cdot y\right)\right)\right)\\
\end{array}
\end{array}
if t < 3e-37Initial program 95.5%
Taylor expanded in y around 0 95.4%
associate-*r*95.3%
*-commutative95.3%
associate-*r*97.7%
Simplified97.7%
Taylor expanded in y around 0 97.7%
if 3e-37 < t Initial program 98.4%
Final simplification97.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 (<= t 1e-37)
(+ t_1 (- (* x 2.0) (* z (* 9.0 (* y t)))))
(+ t_1 (- (* x 2.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 t_1 = b * (a * 27.0);
double tmp;
if (t <= 1e-37) {
tmp = t_1 + ((x * 2.0) - (z * (9.0 * (y * t))));
} else {
tmp = t_1 + ((x * 2.0) - (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) :: t_1
real(8) :: tmp
t_1 = b * (a * 27.0d0)
if (t <= 1d-37) then
tmp = t_1 + ((x * 2.0d0) - (z * (9.0d0 * (y * t))))
else
tmp = t_1 + ((x * 2.0d0) - (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 t_1 = b * (a * 27.0);
double tmp;
if (t <= 1e-37) {
tmp = t_1 + ((x * 2.0) - (z * (9.0 * (y * t))));
} else {
tmp = t_1 + ((x * 2.0) - (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): t_1 = b * (a * 27.0) tmp = 0 if t <= 1e-37: tmp = t_1 + ((x * 2.0) - (z * (9.0 * (y * t)))) else: tmp = t_1 + ((x * 2.0) - (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) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (t <= 1e-37) tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(z * Float64(9.0 * Float64(y * t))))); else tmp = Float64(t_1 + Float64(Float64(x * 2.0) - 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)
t_1 = b * (a * 27.0);
tmp = 0.0;
if (t <= 1e-37)
tmp = t_1 + ((x * 2.0) - (z * (9.0 * (y * t))));
else
tmp = t_1 + ((x * 2.0) - (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_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 1e-37], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(z * N[(9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(9.0 * N[(z * y), $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}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;t \leq 10^{-37}:\\
\;\;\;\;t_1 + \left(x \cdot 2 - z \cdot \left(9 \cdot \left(y \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right)\\
\end{array}
\end{array}
if t < 1.00000000000000007e-37Initial program 95.5%
Taylor expanded in y around 0 95.4%
associate-*r*95.3%
*-commutative95.3%
associate-*r*97.7%
Simplified97.7%
Taylor expanded in y around 0 97.7%
if 1.00000000000000007e-37 < t Initial program 98.5%
Taylor expanded in y around 0 98.5%
*-commutative98.5%
Simplified98.5%
Final simplification97.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 -1.1e-234) (+ (* x 2.0) (- (* a (* 27.0 b)) (* (* 9.0 y) (* z t)))) (+ (* b (* a 27.0)) (- (* x 2.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.1e-234) {
tmp = (x * 2.0) + ((a * (27.0 * b)) - ((9.0 * y) * (z * t)));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (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.1d-234)) then
tmp = (x * 2.0d0) + ((a * (27.0d0 * b)) - ((9.0d0 * y) * (z * t)))
else
tmp = (b * (a * 27.0d0)) + ((x * 2.0d0) - (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.1e-234) {
tmp = (x * 2.0) + ((a * (27.0 * b)) - ((9.0 * y) * (z * t)));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (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.1e-234: tmp = (x * 2.0) + ((a * (27.0 * b)) - ((9.0 * y) * (z * t))) else: tmp = (b * (a * 27.0)) + ((x * 2.0) - (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.1e-234) tmp = Float64(Float64(x * 2.0) + Float64(Float64(a * Float64(27.0 * b)) - Float64(Float64(9.0 * y) * Float64(z * t)))); else tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - 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.1e-234)
tmp = (x * 2.0) + ((a * (27.0 * b)) - ((9.0 * y) * (z * t)));
else
tmp = (b * (a * 27.0)) + ((x * 2.0) - (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.1e-234], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] - N[(N[(9.0 * y), $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[(9.0 * N[(z * y), $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 -1.1 \cdot 10^{-234}:\\
\;\;\;\;x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) - \left(9 \cdot y\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right)\\
\end{array}
\end{array}
if z < -1.1e-234Initial program 95.4%
associate-+l-95.4%
sub-neg95.4%
neg-mul-195.4%
metadata-eval95.4%
metadata-eval95.4%
cancel-sign-sub-inv95.4%
metadata-eval95.4%
*-lft-identity95.4%
associate-*l*92.9%
associate-*l*92.8%
Simplified92.8%
if -1.1e-234 < z Initial program 97.1%
Taylor expanded in y around 0 97.1%
*-commutative97.1%
Simplified97.1%
Final simplification95.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 (+ (* b (* a 27.0)) (- (* x 2.0) (* z (* 9.0 (* y t))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
return (b * (a * 27.0)) + ((x * 2.0) - (z * (9.0 * (y * t))));
}
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 = (b * (a * 27.0d0)) + ((x * 2.0d0) - (z * (9.0d0 * (y * t))))
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 (b * (a * 27.0)) + ((x * 2.0) - (z * (9.0 * (y * t))));
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): return (b * (a * 27.0)) + ((x * 2.0) - (z * (9.0 * (y * t))))
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) return Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(z * Float64(9.0 * Float64(y * t))))) 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 = (b * (a * 27.0)) + ((x * 2.0) - (z * (9.0 * (y * t))));
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[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(z * N[(9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - z \cdot \left(9 \cdot \left(y \cdot t\right)\right)\right)
\end{array}
Initial program 96.4%
Taylor expanded in y around 0 93.7%
associate-*r*93.6%
*-commutative93.6%
associate-*r*95.3%
Simplified95.3%
Taylor expanded in y around 0 95.4%
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
(if (<= a -1.9e+24)
(- (* x 2.0) (* b (* a -27.0)))
(if (<= a 2.5e-109)
(+ (* x 2.0) (* y (* z (* t -9.0))))
(- (* 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 (a <= -1.9e+24) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else if (a <= 2.5e-109) {
tmp = (x * 2.0) + (y * (z * (t * -9.0)));
} else {
tmp = (x * 2.0) - (-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 (a <= (-1.9d+24)) then
tmp = (x * 2.0d0) - (b * (a * (-27.0d0)))
else if (a <= 2.5d-109) then
tmp = (x * 2.0d0) + (y * (z * (t * (-9.0d0))))
else
tmp = (x * 2.0d0) - ((-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 (a <= -1.9e+24) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else if (a <= 2.5e-109) {
tmp = (x * 2.0) + (y * (z * (t * -9.0)));
} else {
tmp = (x * 2.0) - (-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 a <= -1.9e+24: tmp = (x * 2.0) - (b * (a * -27.0)) elif a <= 2.5e-109: tmp = (x * 2.0) + (y * (z * (t * -9.0))) else: tmp = (x * 2.0) - (-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 (a <= -1.9e+24) tmp = Float64(Float64(x * 2.0) - Float64(b * Float64(a * -27.0))); elseif (a <= 2.5e-109) tmp = Float64(Float64(x * 2.0) + Float64(y * Float64(z * Float64(t * -9.0)))); else tmp = Float64(Float64(x * 2.0) - 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 (a <= -1.9e+24)
tmp = (x * 2.0) - (b * (a * -27.0));
elseif (a <= 2.5e-109)
tmp = (x * 2.0) + (y * (z * (t * -9.0)));
else
tmp = (x * 2.0) - (-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[a, -1.9e+24], N[(N[(x * 2.0), $MachinePrecision] - N[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.5e-109], N[(N[(x * 2.0), $MachinePrecision] + N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(-27.0 * N[(a * b), $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}\;a \leq -1.9 \cdot 10^{+24}:\\
\;\;\;\;x \cdot 2 - b \cdot \left(a \cdot -27\right)\\
\mathbf{elif}\;a \leq 2.5 \cdot 10^{-109}:\\
\;\;\;\;x \cdot 2 + y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - -27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -1.90000000000000008e24Initial program 98.0%
associate-+l-98.0%
sub-neg98.0%
neg-mul-198.0%
metadata-eval98.0%
metadata-eval98.0%
cancel-sign-sub-inv98.0%
metadata-eval98.0%
*-lft-identity98.0%
associate-*l*90.9%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in y around 0 74.4%
*-commutative74.4%
Simplified74.4%
Taylor expanded in a around 0 74.4%
*-commutative74.4%
*-commutative74.4%
associate-*l*74.6%
Simplified74.6%
if -1.90000000000000008e24 < a < 2.5000000000000001e-109Initial program 97.1%
associate-+l-97.1%
fma-neg97.1%
neg-sub097.1%
associate-+l-97.1%
neg-sub097.1%
*-commutative97.1%
distribute-rgt-neg-in97.1%
fma-def97.1%
*-commutative97.1%
associate-*r*97.1%
distribute-rgt-neg-in97.1%
*-commutative97.1%
metadata-eval97.1%
Simplified97.1%
fma-udef97.1%
associate-*l*97.1%
Applied egg-rr97.1%
Taylor expanded in t around inf 79.1%
associate-*r*80.5%
associate-*r*80.5%
metadata-eval80.5%
distribute-lft-neg-in80.5%
associate-*r*80.5%
*-commutative80.5%
associate-*r*80.5%
distribute-rgt-neg-in80.5%
associate-*l*79.1%
distribute-lft-neg-in79.1%
metadata-eval79.1%
Simplified79.1%
if 2.5000000000000001e-109 < a Initial program 94.8%
associate-+l-94.8%
sub-neg94.8%
neg-mul-194.8%
metadata-eval94.8%
metadata-eval94.8%
cancel-sign-sub-inv94.8%
metadata-eval94.8%
*-lft-identity94.8%
associate-*l*93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in y around 0 71.0%
*-commutative71.0%
Simplified71.0%
Final simplification75.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 (<= a -2.1e+24)
(- (* x 2.0) (* b (* a -27.0)))
(if (<= a 4.1e-109)
(- (* x 2.0) (* 9.0 (* y (* z t))))
(- (* 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 (a <= -2.1e+24) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else if (a <= 4.1e-109) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else {
tmp = (x * 2.0) - (-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 (a <= (-2.1d+24)) then
tmp = (x * 2.0d0) - (b * (a * (-27.0d0)))
else if (a <= 4.1d-109) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
else
tmp = (x * 2.0d0) - ((-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 (a <= -2.1e+24) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else if (a <= 4.1e-109) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else {
tmp = (x * 2.0) - (-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 a <= -2.1e+24: tmp = (x * 2.0) - (b * (a * -27.0)) elif a <= 4.1e-109: tmp = (x * 2.0) - (9.0 * (y * (z * t))) else: tmp = (x * 2.0) - (-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 (a <= -2.1e+24) tmp = Float64(Float64(x * 2.0) - Float64(b * Float64(a * -27.0))); elseif (a <= 4.1e-109) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); else tmp = Float64(Float64(x * 2.0) - 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 (a <= -2.1e+24)
tmp = (x * 2.0) - (b * (a * -27.0));
elseif (a <= 4.1e-109)
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
else
tmp = (x * 2.0) - (-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[a, -2.1e+24], N[(N[(x * 2.0), $MachinePrecision] - N[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.1e-109], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(-27.0 * N[(a * b), $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}\;a \leq -2.1 \cdot 10^{+24}:\\
\;\;\;\;x \cdot 2 - b \cdot \left(a \cdot -27\right)\\
\mathbf{elif}\;a \leq 4.1 \cdot 10^{-109}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - -27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -2.1000000000000001e24Initial program 98.0%
associate-+l-98.0%
sub-neg98.0%
neg-mul-198.0%
metadata-eval98.0%
metadata-eval98.0%
cancel-sign-sub-inv98.0%
metadata-eval98.0%
*-lft-identity98.0%
associate-*l*90.9%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in y around 0 74.4%
*-commutative74.4%
Simplified74.4%
Taylor expanded in a around 0 74.4%
*-commutative74.4%
*-commutative74.4%
associate-*l*74.6%
Simplified74.6%
if -2.1000000000000001e24 < a < 4.1000000000000002e-109Initial program 97.1%
Taylor expanded in a around 0 79.1%
if 4.1000000000000002e-109 < a Initial program 94.8%
associate-+l-94.8%
sub-neg94.8%
neg-mul-194.8%
metadata-eval94.8%
metadata-eval94.8%
cancel-sign-sub-inv94.8%
metadata-eval94.8%
*-lft-identity94.8%
associate-*l*93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in y around 0 71.0%
*-commutative71.0%
Simplified71.0%
Final simplification75.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 (if (or (<= a -1.85e+97) (not (<= a 2.5e-109))) (* 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 ((a <= -1.85e+97) || !(a <= 2.5e-109)) {
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 ((a <= (-1.85d+97)) .or. (.not. (a <= 2.5d-109))) 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 ((a <= -1.85e+97) || !(a <= 2.5e-109)) {
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 (a <= -1.85e+97) or not (a <= 2.5e-109): 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 ((a <= -1.85e+97) || !(a <= 2.5e-109)) 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 ((a <= -1.85e+97) || ~((a <= 2.5e-109)))
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[a, -1.85e+97], N[Not[LessEqual[a, 2.5e-109]], $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}\;a \leq -1.85 \cdot 10^{+97} \lor \neg \left(a \leq 2.5 \cdot 10^{-109}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -1.85e97 or 2.5000000000000001e-109 < a Initial program 95.5%
Taylor expanded in y around 0 95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in a around inf 50.2%
if -1.85e97 < a < 2.5000000000000001e-109Initial program 97.4%
associate-+l-97.4%
fma-neg97.4%
neg-sub097.4%
associate-+l-97.4%
neg-sub097.4%
*-commutative97.4%
distribute-rgt-neg-in97.4%
fma-def97.4%
*-commutative97.4%
associate-*r*97.5%
distribute-rgt-neg-in97.5%
*-commutative97.5%
metadata-eval97.5%
Simplified97.5%
Taylor expanded in x around inf 44.6%
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 (* 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.4%
associate-+l-96.4%
fma-neg96.4%
neg-sub096.4%
associate-+l-96.4%
neg-sub096.4%
*-commutative96.4%
distribute-rgt-neg-in96.4%
fma-def96.8%
*-commutative96.8%
associate-*r*96.8%
distribute-rgt-neg-in96.8%
*-commutative96.8%
metadata-eval96.8%
Simplified96.8%
Taylor expanded in x around inf 32.5%
Final simplification32.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 2023207
(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)))