
(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 13 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-31) (fma a (* 27.0 b) (fma x 2.0 (* y (* t (* z -9.0))))) (fma a (* 27.0 b) (fma 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 <= -5e-31) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (t * (z * -9.0)))));
} else {
tmp = fma(a, (27.0 * b), fma(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 <= -5e-31) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(t * Float64(z * -9.0))))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(-9.0 * Float64(z * y))))); 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-31], 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[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + 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 -5 \cdot 10^{-31}:\\
\;\;\;\;\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(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\right)\right)\\
\end{array}
\end{array}
if z < -5e-31Initial program 93.7%
Simplified96.1%
if -5e-31 < z Initial program 95.4%
+-commutative95.4%
associate-+r-95.4%
*-commutative95.4%
cancel-sign-sub-inv95.4%
associate-*r*94.9%
distribute-lft-neg-in94.9%
*-commutative94.9%
cancel-sign-sub-inv94.9%
associate-+r-94.9%
associate-*l*94.9%
fma-def95.5%
cancel-sign-sub-inv95.5%
fma-def95.5%
distribute-lft-neg-in95.5%
distribute-rgt-neg-in95.5%
*-commutative95.5%
associate-*r*96.0%
distribute-rgt-neg-out96.0%
*-commutative96.0%
associate-*r*96.0%
Simplified96.0%
Final simplification96.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 (fma a (* 27.0 b) (fma 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) {
return fma(a, (27.0 * b), fma(x, 2.0, (t * (-9.0 * (z * y)))));
}
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) return fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(-9.0 * Float64(z * y))))) 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[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + 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])\\
\\
\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\right)\right)
\end{array}
Initial program 94.9%
+-commutative94.9%
associate-+r-94.9%
*-commutative94.9%
cancel-sign-sub-inv94.9%
associate-*r*95.5%
distribute-lft-neg-in95.5%
*-commutative95.5%
cancel-sign-sub-inv95.5%
associate-+r-95.5%
associate-*l*95.5%
fma-def95.9%
cancel-sign-sub-inv95.9%
fma-def95.9%
distribute-lft-neg-in95.9%
distribute-rgt-neg-in95.9%
*-commutative95.9%
associate-*r*95.3%
distribute-rgt-neg-out95.3%
*-commutative95.3%
associate-*r*95.3%
Simplified95.3%
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
(let* ((t_1 (* a (* 27.0 b))))
(if (<= (* z (* y 9.0)) 2e+250)
(+ (+ t_1 (* x 2.0)) (* (* z y) (* t -9.0)))
(+ t_1 (- (* x 2.0) (* (* y 9.0) (* 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 t_1 = a * (27.0 * b);
double tmp;
if ((z * (y * 9.0)) <= 2e+250) {
tmp = (t_1 + (x * 2.0)) + ((z * y) * (t * -9.0));
} else {
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (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) :: t_1
real(8) :: tmp
t_1 = a * (27.0d0 * b)
if ((z * (y * 9.0d0)) <= 2d+250) then
tmp = (t_1 + (x * 2.0d0)) + ((z * y) * (t * (-9.0d0)))
else
tmp = t_1 + ((x * 2.0d0) - ((y * 9.0d0) * (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 t_1 = a * (27.0 * b);
double tmp;
if ((z * (y * 9.0)) <= 2e+250) {
tmp = (t_1 + (x * 2.0)) + ((z * y) * (t * -9.0));
} else {
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = a * (27.0 * b) tmp = 0 if (z * (y * 9.0)) <= 2e+250: tmp = (t_1 + (x * 2.0)) + ((z * y) * (t * -9.0)) else: tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t))) 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(z * Float64(y * 9.0)) <= 2e+250) tmp = Float64(Float64(t_1 + Float64(x * 2.0)) + Float64(Float64(z * y) * Float64(t * -9.0))); else tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * 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)
t_1 = a * (27.0 * b);
tmp = 0.0;
if ((z * (y * 9.0)) <= 2e+250)
tmp = (t_1 + (x * 2.0)) + ((z * y) * (t * -9.0));
else
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (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_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision], 2e+250], N[(N[(t$95$1 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * 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}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \cdot \left(y \cdot 9\right) \leq 2 \cdot 10^{+250}:\\
\;\;\;\;\left(t_1 + x \cdot 2\right) + \left(z \cdot y\right) \cdot \left(t \cdot -9\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 1.9999999999999998e250Initial program 95.9%
+-commutative95.9%
associate-+r-95.9%
*-commutative95.9%
cancel-sign-sub-inv95.9%
associate-*r*94.9%
distribute-lft-neg-in94.9%
*-commutative94.9%
cancel-sign-sub-inv94.9%
associate-+r-94.9%
associate-*l*94.9%
fma-def95.4%
cancel-sign-sub-inv95.4%
fma-def95.4%
distribute-lft-neg-in95.4%
distribute-rgt-neg-in95.4%
*-commutative95.4%
associate-*r*96.3%
distribute-rgt-neg-out96.3%
*-commutative96.3%
associate-*r*96.3%
Simplified96.3%
fma-udef95.9%
fma-udef95.9%
associate-+r+95.9%
*-commutative95.9%
associate-*r*95.9%
Applied egg-rr95.9%
if 1.9999999999999998e250 < (*.f64 (*.f64 y 9) z) Initial program 86.4%
sub-neg86.4%
sub-neg86.4%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Final simplification96.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))) (t_2 (* -9.0 (* t (* z y)))))
(if (<= z -7.4e-25)
t_2
(if (<= z -5.4e-182)
(* a (* 27.0 b))
(if (<= z -5.5e-252)
(* x 2.0)
(if (<= z 3.8e-308)
t_1
(if (<= z 9e-275) (* x 2.0) (if (<= z 4.1e-16) t_1 t_2))))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (t * (z * y));
double tmp;
if (z <= -7.4e-25) {
tmp = t_2;
} else if (z <= -5.4e-182) {
tmp = a * (27.0 * b);
} else if (z <= -5.5e-252) {
tmp = x * 2.0;
} else if (z <= 3.8e-308) {
tmp = t_1;
} else if (z <= 9e-275) {
tmp = x * 2.0;
} else if (z <= 4.1e-16) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = (-9.0d0) * (t * (z * y))
if (z <= (-7.4d-25)) then
tmp = t_2
else if (z <= (-5.4d-182)) then
tmp = a * (27.0d0 * b)
else if (z <= (-5.5d-252)) then
tmp = x * 2.0d0
else if (z <= 3.8d-308) then
tmp = t_1
else if (z <= 9d-275) then
tmp = x * 2.0d0
else if (z <= 4.1d-16) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (t * (z * y));
double tmp;
if (z <= -7.4e-25) {
tmp = t_2;
} else if (z <= -5.4e-182) {
tmp = a * (27.0 * b);
} else if (z <= -5.5e-252) {
tmp = x * 2.0;
} else if (z <= 3.8e-308) {
tmp = t_1;
} else if (z <= 9e-275) {
tmp = x * 2.0;
} else if (z <= 4.1e-16) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = -9.0 * (t * (z * y)) tmp = 0 if z <= -7.4e-25: tmp = t_2 elif z <= -5.4e-182: tmp = a * (27.0 * b) elif z <= -5.5e-252: tmp = x * 2.0 elif z <= 3.8e-308: tmp = t_1 elif z <= 9e-275: tmp = x * 2.0 elif z <= 4.1e-16: tmp = t_1 else: tmp = t_2 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(-9.0 * Float64(t * Float64(z * y))) tmp = 0.0 if (z <= -7.4e-25) tmp = t_2; elseif (z <= -5.4e-182) tmp = Float64(a * Float64(27.0 * b)); elseif (z <= -5.5e-252) tmp = Float64(x * 2.0); elseif (z <= 3.8e-308) tmp = t_1; elseif (z <= 9e-275) tmp = Float64(x * 2.0); elseif (z <= 4.1e-16) tmp = t_1; else tmp = t_2; end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = -9.0 * (t * (z * y));
tmp = 0.0;
if (z <= -7.4e-25)
tmp = t_2;
elseif (z <= -5.4e-182)
tmp = a * (27.0 * b);
elseif (z <= -5.5e-252)
tmp = x * 2.0;
elseif (z <= 3.8e-308)
tmp = t_1;
elseif (z <= 9e-275)
tmp = x * 2.0;
elseif (z <= 4.1e-16)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.4e-25], t$95$2, If[LessEqual[z, -5.4e-182], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.5e-252], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 3.8e-308], t$95$1, If[LessEqual[z, 9e-275], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 4.1e-16], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;z \leq -7.4 \cdot 10^{-25}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -5.4 \cdot 10^{-182}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-252}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-308}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-275}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -7.40000000000000017e-25 or 4.10000000000000006e-16 < z Initial program 92.3%
sub-neg92.3%
sub-neg92.3%
associate-*l*94.4%
associate-*l*94.4%
Simplified94.4%
Taylor expanded in y around inf 52.9%
if -7.40000000000000017e-25 < z < -5.39999999999999999e-182Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*99.7%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in a around inf 50.9%
associate-*r*50.7%
*-commutative50.7%
associate-*r*50.9%
Simplified50.9%
if -5.39999999999999999e-182 < z < -5.5e-252 or 3.79999999999999975e-308 < z < 8.99999999999999957e-275Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*99.9%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around inf 57.4%
if -5.5e-252 < z < 3.79999999999999975e-308 or 8.99999999999999957e-275 < z < 4.10000000000000006e-16Initial program 96.8%
sub-neg96.8%
sub-neg96.8%
associate-*l*96.8%
associate-*l*96.8%
Simplified96.8%
Taylor expanded in a around inf 45.6%
Final simplification51.2%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))))
(if (<= z -4e-26)
(* -9.0 (* z (* y t)))
(if (<= z -3.9e-177)
(* a (* 27.0 b))
(if (<= z -5.5e-252)
(* x 2.0)
(if (<= z 1.7e-307)
t_1
(if (<= z 2.4e-271)
(* x 2.0)
(if (<= z 2.4e-16) t_1 (* -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 t_1 = 27.0 * (a * b);
double tmp;
if (z <= -4e-26) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -3.9e-177) {
tmp = a * (27.0 * b);
} else if (z <= -5.5e-252) {
tmp = x * 2.0;
} else if (z <= 1.7e-307) {
tmp = t_1;
} else if (z <= 2.4e-271) {
tmp = x * 2.0;
} else if (z <= 2.4e-16) {
tmp = t_1;
} else {
tmp = -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) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (z <= (-4d-26)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= (-3.9d-177)) then
tmp = a * (27.0d0 * b)
else if (z <= (-5.5d-252)) then
tmp = x * 2.0d0
else if (z <= 1.7d-307) then
tmp = t_1
else if (z <= 2.4d-271) then
tmp = x * 2.0d0
else if (z <= 2.4d-16) then
tmp = t_1
else
tmp = (-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 t_1 = 27.0 * (a * b);
double tmp;
if (z <= -4e-26) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -3.9e-177) {
tmp = a * (27.0 * b);
} else if (z <= -5.5e-252) {
tmp = x * 2.0;
} else if (z <= 1.7e-307) {
tmp = t_1;
} else if (z <= 2.4e-271) {
tmp = x * 2.0;
} else if (z <= 2.4e-16) {
tmp = t_1;
} else {
tmp = -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): t_1 = 27.0 * (a * b) tmp = 0 if z <= -4e-26: tmp = -9.0 * (z * (y * t)) elif z <= -3.9e-177: tmp = a * (27.0 * b) elif z <= -5.5e-252: tmp = x * 2.0 elif z <= 1.7e-307: tmp = t_1 elif z <= 2.4e-271: tmp = x * 2.0 elif z <= 2.4e-16: tmp = t_1 else: tmp = -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) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -4e-26) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= -3.9e-177) tmp = Float64(a * Float64(27.0 * b)); elseif (z <= -5.5e-252) tmp = Float64(x * 2.0); elseif (z <= 1.7e-307) tmp = t_1; elseif (z <= 2.4e-271) tmp = Float64(x * 2.0); elseif (z <= 2.4e-16) tmp = t_1; else tmp = 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)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -4e-26)
tmp = -9.0 * (z * (y * t));
elseif (z <= -3.9e-177)
tmp = a * (27.0 * b);
elseif (z <= -5.5e-252)
tmp = x * 2.0;
elseif (z <= 1.7e-307)
tmp = t_1;
elseif (z <= 2.4e-271)
tmp = x * 2.0;
elseif (z <= 2.4e-16)
tmp = t_1;
else
tmp = -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_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e-26], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.9e-177], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.5e-252], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.7e-307], t$95$1, If[LessEqual[z, 2.4e-271], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 2.4e-16], t$95$1, N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -4 \cdot 10^{-26}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{-177}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-252}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-307}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-271}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -4.0000000000000002e-26Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*96.1%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in y around inf 57.7%
expm1-log1p-u30.8%
expm1-udef24.7%
*-commutative24.7%
associate-*l*25.8%
Applied egg-rr25.8%
expm1-def32.0%
expm1-log1p59.1%
associate-*r*57.7%
*-commutative57.7%
associate-*r*55.7%
Simplified55.7%
if -4.0000000000000002e-26 < z < -3.90000000000000014e-177Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*99.6%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in a around inf 53.3%
associate-*r*53.0%
*-commutative53.0%
associate-*r*53.2%
Simplified53.2%
if -3.90000000000000014e-177 < z < -5.5e-252 or 1.69999999999999994e-307 < z < 2.4000000000000002e-271Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*99.9%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 58.8%
if -5.5e-252 < z < 1.69999999999999994e-307 or 2.4000000000000002e-271 < z < 2.40000000000000005e-16Initial program 96.8%
sub-neg96.8%
sub-neg96.8%
associate-*l*96.8%
associate-*l*96.8%
Simplified96.8%
Taylor expanded in a around inf 45.6%
if 2.40000000000000005e-16 < z Initial program 91.1%
sub-neg91.1%
sub-neg91.1%
associate-*l*92.6%
associate-*l*92.6%
Simplified92.6%
Taylor expanded in y around inf 47.6%
Final simplification51.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 (<= x -9.2e+58)
(+ (* x 2.0) (* 27.0 (* a b)))
(if (<= x 2.5e-26)
(+ (* a (* 27.0 b)) (* t (* -9.0 (* z y))))
(- (* x 2.0) (* y (* z (* t 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 (x <= -9.2e+58) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else if (x <= 2.5e-26) {
tmp = (a * (27.0 * b)) + (t * (-9.0 * (z * y)));
} else {
tmp = (x * 2.0) - (y * (z * (t * 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 (x <= (-9.2d+58)) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else if (x <= 2.5d-26) then
tmp = (a * (27.0d0 * b)) + (t * ((-9.0d0) * (z * y)))
else
tmp = (x * 2.0d0) - (y * (z * (t * 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 (x <= -9.2e+58) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else if (x <= 2.5e-26) {
tmp = (a * (27.0 * b)) + (t * (-9.0 * (z * y)));
} else {
tmp = (x * 2.0) - (y * (z * (t * 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 x <= -9.2e+58: tmp = (x * 2.0) + (27.0 * (a * b)) elif x <= 2.5e-26: tmp = (a * (27.0 * b)) + (t * (-9.0 * (z * y))) else: tmp = (x * 2.0) - (y * (z * (t * 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 (x <= -9.2e+58) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); elseif (x <= 2.5e-26) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(t * Float64(-9.0 * Float64(z * y)))); else tmp = Float64(Float64(x * 2.0) - Float64(y * Float64(z * Float64(t * 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 (x <= -9.2e+58)
tmp = (x * 2.0) + (27.0 * (a * b));
elseif (x <= 2.5e-26)
tmp = (a * (27.0 * b)) + (t * (-9.0 * (z * y)));
else
tmp = (x * 2.0) - (y * (z * (t * 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[x, -9.2e+58], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.5e-26], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(z * N[(t * 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}
\mathbf{if}\;x \leq -9.2 \cdot 10^{+58}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-26}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - y \cdot \left(z \cdot \left(t \cdot 9\right)\right)\\
\end{array}
\end{array}
if x < -9.2000000000000001e58Initial program 92.7%
sub-neg92.7%
sub-neg92.7%
associate-*l*98.0%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in y around 0 88.9%
if -9.2000000000000001e58 < x < 2.5000000000000001e-26Initial program 95.0%
sub-neg95.0%
sub-neg95.0%
associate-*l*96.4%
associate-*l*96.3%
Simplified96.3%
Taylor expanded in x around 0 88.2%
sub-neg88.2%
+-commutative88.2%
distribute-lft-neg-in88.2%
metadata-eval88.2%
*-commutative88.2%
associate-*r*88.1%
*-commutative88.1%
associate-*r*88.1%
associate-*r*88.1%
*-commutative88.1%
associate-*l*88.1%
Applied egg-rr88.1%
Taylor expanded in y around 0 88.1%
if 2.5000000000000001e-26 < x Initial program 96.5%
sub-neg96.5%
sub-neg96.5%
associate-*l*93.5%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in a around 0 80.1%
expm1-log1p-u17.7%
expm1-udef17.6%
*-commutative17.6%
associate-*l*17.6%
Applied egg-rr57.5%
expm1-def17.7%
expm1-log1p28.7%
associate-*r*30.2%
*-commutative30.2%
associate-*r*30.2%
Simplified80.2%
Taylor expanded in t around 0 80.1%
associate-*r*80.3%
associate-*r*80.3%
*-commutative80.3%
associate-*l*77.0%
*-commutative77.0%
*-commutative77.0%
Simplified77.0%
Final simplification85.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 (* 27.0 (* a b))))
(if (<= x -9.5e+59)
(+ (* x 2.0) t_1)
(if (<= x 2.6e-25)
(- t_1 (* 9.0 (* t (* z y))))
(- (* x 2.0) (* y (* z (* t 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 (x <= -9.5e+59) {
tmp = (x * 2.0) + t_1;
} else if (x <= 2.6e-25) {
tmp = t_1 - (9.0 * (t * (z * y)));
} else {
tmp = (x * 2.0) - (y * (z * (t * 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 (x <= (-9.5d+59)) then
tmp = (x * 2.0d0) + t_1
else if (x <= 2.6d-25) then
tmp = t_1 - (9.0d0 * (t * (z * y)))
else
tmp = (x * 2.0d0) - (y * (z * (t * 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 (x <= -9.5e+59) {
tmp = (x * 2.0) + t_1;
} else if (x <= 2.6e-25) {
tmp = t_1 - (9.0 * (t * (z * y)));
} else {
tmp = (x * 2.0) - (y * (z * (t * 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 x <= -9.5e+59: tmp = (x * 2.0) + t_1 elif x <= 2.6e-25: tmp = t_1 - (9.0 * (t * (z * y))) else: tmp = (x * 2.0) - (y * (z * (t * 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 (x <= -9.5e+59) tmp = Float64(Float64(x * 2.0) + t_1); elseif (x <= 2.6e-25) tmp = Float64(t_1 - Float64(9.0 * Float64(t * Float64(z * y)))); else tmp = Float64(Float64(x * 2.0) - Float64(y * Float64(z * Float64(t * 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 (x <= -9.5e+59)
tmp = (x * 2.0) + t_1;
elseif (x <= 2.6e-25)
tmp = t_1 - (9.0 * (t * (z * y)));
else
tmp = (x * 2.0) - (y * (z * (t * 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[x, -9.5e+59], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[x, 2.6e-25], N[(t$95$1 - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(z * N[(t * 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}\;x \leq -9.5 \cdot 10^{+59}:\\
\;\;\;\;x \cdot 2 + t_1\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{-25}:\\
\;\;\;\;t_1 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - y \cdot \left(z \cdot \left(t \cdot 9\right)\right)\\
\end{array}
\end{array}
if x < -9.50000000000000023e59Initial program 92.7%
sub-neg92.7%
sub-neg92.7%
associate-*l*98.0%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in y around 0 88.9%
if -9.50000000000000023e59 < x < 2.6e-25Initial program 95.0%
sub-neg95.0%
sub-neg95.0%
associate-*l*96.4%
associate-*l*96.3%
Simplified96.3%
Taylor expanded in x around 0 88.2%
if 2.6e-25 < x Initial program 96.5%
sub-neg96.5%
sub-neg96.5%
associate-*l*93.5%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in a around 0 80.1%
expm1-log1p-u17.7%
expm1-udef17.6%
*-commutative17.6%
associate-*l*17.6%
Applied egg-rr57.5%
expm1-def17.7%
expm1-log1p28.7%
associate-*r*30.2%
*-commutative30.2%
associate-*r*30.2%
Simplified80.2%
Taylor expanded in t around 0 80.1%
associate-*r*80.3%
associate-*r*80.3%
*-commutative80.3%
associate-*l*77.0%
*-commutative77.0%
*-commutative77.0%
Simplified77.0%
Final simplification85.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 (+ (+ (* a (* 27.0 b)) (* x 2.0)) (* (* z y) (* t -9.0))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
return ((a * (27.0 * b)) + (x * 2.0)) + ((z * y) * (t * -9.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 = ((a * (27.0d0 * b)) + (x * 2.0d0)) + ((z * y) * (t * (-9.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 ((a * (27.0 * b)) + (x * 2.0)) + ((z * y) * (t * -9.0));
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): return ((a * (27.0 * b)) + (x * 2.0)) + ((z * y) * (t * -9.0))
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) return Float64(Float64(Float64(a * Float64(27.0 * b)) + Float64(x * 2.0)) + Float64(Float64(z * y) * Float64(t * -9.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 = ((a * (27.0 * b)) + (x * 2.0)) + ((z * y) * (t * -9.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[(N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\left(a \cdot \left(27 \cdot b\right) + x \cdot 2\right) + \left(z \cdot y\right) \cdot \left(t \cdot -9\right)
\end{array}
Initial program 94.9%
+-commutative94.9%
associate-+r-94.9%
*-commutative94.9%
cancel-sign-sub-inv94.9%
associate-*r*95.5%
distribute-lft-neg-in95.5%
*-commutative95.5%
cancel-sign-sub-inv95.5%
associate-+r-95.5%
associate-*l*95.5%
fma-def95.9%
cancel-sign-sub-inv95.9%
fma-def95.9%
distribute-lft-neg-in95.9%
distribute-rgt-neg-in95.9%
*-commutative95.9%
associate-*r*95.3%
distribute-rgt-neg-out95.3%
*-commutative95.3%
associate-*r*95.3%
Simplified95.3%
fma-udef94.9%
fma-udef94.9%
associate-+r+94.9%
*-commutative94.9%
associate-*r*94.9%
Applied egg-rr94.9%
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 (or (<= z -3.1e-49) (not (<= z 4.2e-16))) (- (* x 2.0) (* 9.0 (* t (* z y)))) (+ (* 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 ((z <= -3.1e-49) || !(z <= 4.2e-16)) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} 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 ((z <= (-3.1d-49)) .or. (.not. (z <= 4.2d-16))) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
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 ((z <= -3.1e-49) || !(z <= 4.2e-16)) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} 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 (z <= -3.1e-49) or not (z <= 4.2e-16): tmp = (x * 2.0) - (9.0 * (t * (z * y))) 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 ((z <= -3.1e-49) || !(z <= 4.2e-16)) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); 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 ((z <= -3.1e-49) || ~((z <= 4.2e-16)))
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
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[Or[LessEqual[z, -3.1e-49], N[Not[LessEqual[z, 4.2e-16]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $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}\;z \leq -3.1 \cdot 10^{-49} \lor \neg \left(z \leq 4.2 \cdot 10^{-16}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -3.1e-49 or 4.2000000000000002e-16 < z Initial program 92.5%
sub-neg92.5%
sub-neg92.5%
associate-*l*94.5%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in a around 0 68.4%
if -3.1e-49 < z < 4.2000000000000002e-16Initial program 97.9%
sub-neg97.9%
sub-neg97.9%
associate-*l*98.0%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in y around 0 86.6%
Final simplification76.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 (<= z -7.9e-25)
(- (* x 2.0) (* 9.0 (* z (* y t))))
(if (<= z 2.8e-15)
(+ (* x 2.0) (* 27.0 (* a b)))
(- (* x 2.0) (* 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 <= -7.9e-25) {
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
} else if (z <= 2.8e-15) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (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 <= (-7.9d-25)) then
tmp = (x * 2.0d0) - (9.0d0 * (z * (y * t)))
else if (z <= 2.8d-15) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) - (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 <= -7.9e-25) {
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
} else if (z <= 2.8e-15) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (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 <= -7.9e-25: tmp = (x * 2.0) - (9.0 * (z * (y * t))) elif z <= 2.8e-15: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) - (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 <= -7.9e-25) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t)))); elseif (z <= 2.8e-15) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) - 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 <= -7.9e-25)
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
elseif (z <= 2.8e-15)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) - (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, -7.9e-25], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e-15], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $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 -7.9 \cdot 10^{-25}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-15}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -7.8999999999999997e-25Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*96.1%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in a around 0 70.1%
expm1-log1p-u30.8%
expm1-udef24.7%
*-commutative24.7%
associate-*l*25.8%
Applied egg-rr36.3%
expm1-def32.0%
expm1-log1p59.1%
associate-*r*57.7%
*-commutative57.7%
associate-*r*55.7%
Simplified70.7%
if -7.8999999999999997e-25 < z < 2.80000000000000014e-15Initial program 98.0%
sub-neg98.0%
sub-neg98.0%
associate-*l*98.0%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in y around 0 86.9%
if 2.80000000000000014e-15 < z Initial program 91.1%
sub-neg91.1%
sub-neg91.1%
associate-*l*92.6%
associate-*l*92.6%
Simplified92.6%
Taylor expanded in a around 0 66.6%
Final simplification76.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 -1e-23) (* -9.0 (* z (* y t))) (if (<= z 1.8e+78) (+ (* x 2.0) (* 27.0 (* a b))) (* -9.0 (* t (* z y))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1e-23) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 1.8e+78) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = -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 <= (-1d-23)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= 1.8d+78) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (-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 <= -1e-23) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 1.8e+78) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = -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 <= -1e-23: tmp = -9.0 * (z * (y * t)) elif z <= 1.8e+78: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = -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 <= -1e-23) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= 1.8e+78) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = 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 <= -1e-23)
tmp = -9.0 * (z * (y * t));
elseif (z <= 1.8e+78)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = -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, -1e-23], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e+78], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-23}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+78}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -9.9999999999999996e-24Initial program 93.3%
sub-neg93.3%
sub-neg93.3%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in y around inf 58.5%
expm1-log1p-u31.2%
expm1-udef25.0%
*-commutative25.0%
associate-*l*26.1%
Applied egg-rr26.1%
expm1-def32.4%
expm1-log1p59.8%
associate-*r*58.5%
*-commutative58.5%
associate-*r*56.4%
Simplified56.4%
if -9.9999999999999996e-24 < z < 1.8000000000000001e78Initial program 98.3%
sub-neg98.3%
sub-neg98.3%
associate-*l*98.3%
associate-*l*98.3%
Simplified98.3%
Taylor expanded in y around 0 84.8%
if 1.8000000000000001e78 < z Initial program 87.2%
sub-neg87.2%
sub-neg87.2%
associate-*l*89.4%
associate-*l*89.4%
Simplified89.4%
Taylor expanded in y around inf 54.9%
Final simplification71.3%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= x -4.6e+73) (not (<= x 0.68))) (* 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 ((x <= -4.6e+73) || !(x <= 0.68)) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x <= (-4.6d+73)) .or. (.not. (x <= 0.68d0))) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -4.6e+73) || !(x <= 0.68)) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if (x <= -4.6e+73) or not (x <= 0.68): tmp = x * 2.0 else: tmp = 27.0 * (a * b) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -4.6e+73) || !(x <= 0.68)) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((x <= -4.6e+73) || ~((x <= 0.68)))
tmp = x * 2.0;
else
tmp = 27.0 * (a * b);
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -4.6e+73], N[Not[LessEqual[x, 0.68]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{+73} \lor \neg \left(x \leq 0.68\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if x < -4.6e73 or 0.680000000000000049 < x Initial program 94.4%
sub-neg94.4%
sub-neg94.4%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in x around inf 59.1%
if -4.6e73 < x < 0.680000000000000049Initial program 95.2%
sub-neg95.2%
sub-neg95.2%
associate-*l*96.5%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in a around inf 46.9%
Final simplification52.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 (* x 2.0))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * 2.0d0
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): return x * 2.0
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
x \cdot 2
\end{array}
Initial program 94.9%
sub-neg94.9%
sub-neg94.9%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in x around inf 29.9%
Final simplification29.9%
(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 2023308
(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)))