
(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 4e-31) (fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t))))) (fma a (* 27.0 b) (- (* x 2.0) (* (* z y) (* 9.0 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 (z <= 4e-31) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
} else {
tmp = fma(a, (27.0 * b), ((x * 2.0) - ((z * y) * (9.0 * 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 (z <= 4e-31) tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))))); else tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(Float64(z * y) * Float64(9.0 * t)))); 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, 4e-31], 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[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(z * y), $MachinePrecision] * N[(9.0 * 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}\;z \leq 4 \cdot 10^{-31}:\\
\;\;\;\;\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(a, 27 \cdot b, x \cdot 2 - \left(z \cdot y\right) \cdot \left(9 \cdot t\right)\right)\\
\end{array}
\end{array}
if z < 4e-31Initial program 95.8%
+-commutative95.8%
associate-*l*95.2%
fma-def95.8%
associate-*l*95.9%
*-commutative95.9%
associate-*l*96.4%
Simplified96.4%
if 4e-31 < z Initial program 89.9%
+-commutative89.9%
associate-*l*89.9%
fma-def91.4%
associate-*l*95.7%
*-commutative95.7%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in y around 0 95.6%
*-commutative95.6%
*-commutative95.6%
*-commutative95.6%
associate-*r*91.4%
associate-*r*91.4%
*-commutative91.4%
associate-*l*91.5%
Simplified91.5%
Final simplification95.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 8.8e+58) (fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t))))) (+ (- (* x 2.0) (* t (* z (* 9.0 y)))) (* 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 <= 8.8e+58) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
} else {
tmp = ((x * 2.0) - (t * (z * (9.0 * y)))) + (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 <= 8.8e+58) tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(9.0 * y)))) + 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, 8.8e+58], 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[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 8.8 \cdot 10^{+58}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(9 \cdot y\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 8.8000000000000003e58Initial program 96.1%
+-commutative96.1%
associate-*l*95.6%
fma-def96.1%
associate-*l*96.3%
*-commutative96.3%
associate-*l*96.8%
Simplified96.8%
if 8.8000000000000003e58 < z Initial program 86.0%
Final simplification94.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 (* z (* 9.0 y))))
(if (<= t_1 2e+261)
(+ (- (* x 2.0) (* t t_1)) (* b (* a 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 t_1 = z * (9.0 * y);
double tmp;
if (t_1 <= 2e+261) {
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 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) :: t_1
real(8) :: tmp
t_1 = z * (9.0d0 * y)
if (t_1 <= 2d+261) then
tmp = ((x * 2.0d0) - (t * t_1)) + (b * (a * 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 t_1 = z * (9.0 * y);
double tmp;
if (t_1 <= 2e+261) {
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 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): t_1 = z * (9.0 * y) tmp = 0 if t_1 <= 2e+261: tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 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) t_1 = Float64(z * Float64(9.0 * y)) tmp = 0.0 if (t_1 <= 2e+261) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * t_1)) + Float64(b * Float64(a * 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)
t_1 = z * (9.0 * y);
tmp = 0.0;
if (t_1 <= 2e+261)
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 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_] := Block[{t$95$1 = N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+261], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 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}
t_1 := z \cdot \left(9 \cdot y\right)\\
\mathbf{if}\;t_1 \leq 2 \cdot 10^{+261}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot t_1\right) + b \cdot \left(a \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 (*.f64 (*.f64 y 9) z) < 1.9999999999999999e261Initial program 96.6%
if 1.9999999999999999e261 < (*.f64 (*.f64 y 9) z) Initial program 72.9%
+-commutative72.9%
associate-*l*72.9%
fma-def80.9%
associate-*l*96.2%
*-commutative96.2%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in x around 0 91.2%
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
(if (<= (* x 2.0) -5e+24)
(- (* x 2.0) (* a (* b -27.0)))
(if (<= (* x 2.0) 9.8e-36)
(- (* 27.0 (* a b)) (* 9.0 (* y (* z t))))
(+ (* x 2.0) (* b (* a 27.0))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x * 2.0) <= -5e+24) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else if ((x * 2.0) <= 9.8e-36) {
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
} else {
tmp = (x * 2.0) + (b * (a * 27.0));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x * 2.0d0) <= (-5d+24)) then
tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
else if ((x * 2.0d0) <= 9.8d-36) then
tmp = (27.0d0 * (a * b)) - (9.0d0 * (y * (z * t)))
else
tmp = (x * 2.0d0) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x * 2.0) <= -5e+24) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else if ((x * 2.0) <= 9.8e-36) {
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
} else {
tmp = (x * 2.0) + (b * (a * 27.0));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if (x * 2.0) <= -5e+24: tmp = (x * 2.0) - (a * (b * -27.0)) elif (x * 2.0) <= 9.8e-36: tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t))) else: tmp = (x * 2.0) + (b * (a * 27.0)) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x * 2.0) <= -5e+24) tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0))); elseif (Float64(x * 2.0) <= 9.8e-36) tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * Float64(y * Float64(z * t)))); else tmp = Float64(Float64(x * 2.0) + Float64(b * Float64(a * 27.0))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((x * 2.0) <= -5e+24)
tmp = (x * 2.0) - (a * (b * -27.0));
elseif ((x * 2.0) <= 9.8e-36)
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
else
tmp = (x * 2.0) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x * 2.0), $MachinePrecision], -5e+24], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * 2.0), $MachinePrecision], 9.8e-36], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq -5 \cdot 10^{+24}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{elif}\;x \cdot 2 \leq 9.8 \cdot 10^{-36}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if (*.f64 x 2) < -5.00000000000000045e24Initial program 91.8%
associate-+l-91.8%
sub-neg91.8%
neg-mul-191.8%
metadata-eval91.8%
metadata-eval91.8%
cancel-sign-sub-inv91.8%
metadata-eval91.8%
*-lft-identity91.8%
associate-*l*96.6%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in y around 0 83.6%
*-commutative83.6%
associate-*l*80.3%
Simplified80.3%
if -5.00000000000000045e24 < (*.f64 x 2) < 9.7999999999999994e-36Initial program 94.7%
+-commutative94.7%
associate-*l*94.6%
fma-def95.4%
associate-*l*95.0%
*-commutative95.0%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in x around 0 84.1%
if 9.7999999999999994e-36 < (*.f64 x 2) Initial program 95.6%
+-commutative95.6%
associate-*l*95.6%
fma-def95.6%
associate-*l*98.5%
*-commutative98.5%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 85.7%
+-commutative85.7%
*-commutative85.7%
fma-def85.7%
*-commutative85.7%
Simplified85.7%
fma-udef85.7%
associate-*r*85.7%
*-commutative85.7%
Applied egg-rr85.7%
Final simplification83.6%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))) (t_2 (* (* y (* z t)) -9.0)))
(if (<= t -3.3e-49)
t_2
(if (<= t 6.6e-193)
t_1
(if (<= t 2.6e+18)
(* x 2.0)
(if (<= t 1.1e+82)
t_1
(if (<= t 5.2e+105) (* x 2.0) (if (<= t 4.5e+121) 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 = (y * (z * t)) * -9.0;
double tmp;
if (t <= -3.3e-49) {
tmp = t_2;
} else if (t <= 6.6e-193) {
tmp = t_1;
} else if (t <= 2.6e+18) {
tmp = x * 2.0;
} else if (t <= 1.1e+82) {
tmp = t_1;
} else if (t <= 5.2e+105) {
tmp = x * 2.0;
} else if (t <= 4.5e+121) {
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 = (y * (z * t)) * (-9.0d0)
if (t <= (-3.3d-49)) then
tmp = t_2
else if (t <= 6.6d-193) then
tmp = t_1
else if (t <= 2.6d+18) then
tmp = x * 2.0d0
else if (t <= 1.1d+82) then
tmp = t_1
else if (t <= 5.2d+105) then
tmp = x * 2.0d0
else if (t <= 4.5d+121) 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 = (y * (z * t)) * -9.0;
double tmp;
if (t <= -3.3e-49) {
tmp = t_2;
} else if (t <= 6.6e-193) {
tmp = t_1;
} else if (t <= 2.6e+18) {
tmp = x * 2.0;
} else if (t <= 1.1e+82) {
tmp = t_1;
} else if (t <= 5.2e+105) {
tmp = x * 2.0;
} else if (t <= 4.5e+121) {
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 = (y * (z * t)) * -9.0 tmp = 0 if t <= -3.3e-49: tmp = t_2 elif t <= 6.6e-193: tmp = t_1 elif t <= 2.6e+18: tmp = x * 2.0 elif t <= 1.1e+82: tmp = t_1 elif t <= 5.2e+105: tmp = x * 2.0 elif t <= 4.5e+121: 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(Float64(y * Float64(z * t)) * -9.0) tmp = 0.0 if (t <= -3.3e-49) tmp = t_2; elseif (t <= 6.6e-193) tmp = t_1; elseif (t <= 2.6e+18) tmp = Float64(x * 2.0); elseif (t <= 1.1e+82) tmp = t_1; elseif (t <= 5.2e+105) tmp = Float64(x * 2.0); elseif (t <= 4.5e+121) 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 = (y * (z * t)) * -9.0;
tmp = 0.0;
if (t <= -3.3e-49)
tmp = t_2;
elseif (t <= 6.6e-193)
tmp = t_1;
elseif (t <= 2.6e+18)
tmp = x * 2.0;
elseif (t <= 1.1e+82)
tmp = t_1;
elseif (t <= 5.2e+105)
tmp = x * 2.0;
elseif (t <= 4.5e+121)
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[(N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision]}, If[LessEqual[t, -3.3e-49], t$95$2, If[LessEqual[t, 6.6e-193], t$95$1, If[LessEqual[t, 2.6e+18], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 1.1e+82], t$95$1, If[LessEqual[t, 5.2e+105], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 4.5e+121], 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 := \left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{if}\;t \leq -3.3 \cdot 10^{-49}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{-193}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+18}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+82}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{+105}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+121}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -3.3e-49 or 4.5000000000000003e121 < t Initial program 96.1%
+-commutative96.1%
associate-*l*96.1%
fma-def97.9%
associate-*l*93.7%
*-commutative93.7%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in y around inf 48.1%
if -3.3e-49 < t < 6.5999999999999998e-193 or 2.6e18 < t < 1.1000000000000001e82 or 5.2000000000000004e105 < t < 4.5000000000000003e121Initial program 91.5%
+-commutative91.5%
associate-*l*90.5%
fma-def90.5%
associate-*l*96.4%
*-commutative96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in a around inf 45.5%
if 6.5999999999999998e-193 < t < 2.6e18 or 1.1000000000000001e82 < t < 5.2000000000000004e105Initial program 95.9%
+-commutative95.9%
associate-*l*95.9%
fma-def95.9%
associate-*l*99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 54.4%
Final simplification48.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 (<= t -2.2e-53)
(* (* y (* z t)) -9.0)
(if (<= t 2.7e-192)
t_1
(if (<= t 1.02e+19)
(* x 2.0)
(if (<= t 4.3e+77)
t_1
(if (<= t 5.5e+105)
(* x 2.0)
(if (<= t 1.2e+121) t_1 (* y (* t (* z -9.0)))))))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (t <= -2.2e-53) {
tmp = (y * (z * t)) * -9.0;
} else if (t <= 2.7e-192) {
tmp = t_1;
} else if (t <= 1.02e+19) {
tmp = x * 2.0;
} else if (t <= 4.3e+77) {
tmp = t_1;
} else if (t <= 5.5e+105) {
tmp = x * 2.0;
} else if (t <= 1.2e+121) {
tmp = t_1;
} else {
tmp = y * (t * (z * -9.0));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (t <= (-2.2d-53)) then
tmp = (y * (z * t)) * (-9.0d0)
else if (t <= 2.7d-192) then
tmp = t_1
else if (t <= 1.02d+19) then
tmp = x * 2.0d0
else if (t <= 4.3d+77) then
tmp = t_1
else if (t <= 5.5d+105) then
tmp = x * 2.0d0
else if (t <= 1.2d+121) then
tmp = t_1
else
tmp = y * (t * (z * (-9.0d0)))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (t <= -2.2e-53) {
tmp = (y * (z * t)) * -9.0;
} else if (t <= 2.7e-192) {
tmp = t_1;
} else if (t <= 1.02e+19) {
tmp = x * 2.0;
} else if (t <= 4.3e+77) {
tmp = t_1;
} else if (t <= 5.5e+105) {
tmp = x * 2.0;
} else if (t <= 1.2e+121) {
tmp = t_1;
} else {
tmp = y * (t * (z * -9.0));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if t <= -2.2e-53: tmp = (y * (z * t)) * -9.0 elif t <= 2.7e-192: tmp = t_1 elif t <= 1.02e+19: tmp = x * 2.0 elif t <= 4.3e+77: tmp = t_1 elif t <= 5.5e+105: tmp = x * 2.0 elif t <= 1.2e+121: tmp = t_1 else: tmp = y * (t * (z * -9.0)) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (t <= -2.2e-53) tmp = Float64(Float64(y * Float64(z * t)) * -9.0); elseif (t <= 2.7e-192) tmp = t_1; elseif (t <= 1.02e+19) tmp = Float64(x * 2.0); elseif (t <= 4.3e+77) tmp = t_1; elseif (t <= 5.5e+105) tmp = Float64(x * 2.0); elseif (t <= 1.2e+121) tmp = t_1; else tmp = Float64(y * Float64(t * Float64(z * -9.0))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (t <= -2.2e-53)
tmp = (y * (z * t)) * -9.0;
elseif (t <= 2.7e-192)
tmp = t_1;
elseif (t <= 1.02e+19)
tmp = x * 2.0;
elseif (t <= 4.3e+77)
tmp = t_1;
elseif (t <= 5.5e+105)
tmp = x * 2.0;
elseif (t <= 1.2e+121)
tmp = t_1;
else
tmp = y * (t * (z * -9.0));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.2e-53], N[(N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision], If[LessEqual[t, 2.7e-192], t$95$1, If[LessEqual[t, 1.02e+19], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 4.3e+77], t$95$1, If[LessEqual[t, 5.5e+105], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 1.2e+121], t$95$1, N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;t \leq -2.2 \cdot 10^{-53}:\\
\;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-192}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{+19}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{+77}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+105}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{+121}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\end{array}
\end{array}
if t < -2.20000000000000018e-53Initial program 95.9%
+-commutative95.9%
associate-*l*95.8%
fma-def97.2%
associate-*l*96.0%
*-commutative96.0%
associate-*l*97.3%
Simplified97.3%
Taylor expanded in y around inf 42.0%
if -2.20000000000000018e-53 < t < 2.69999999999999991e-192 or 1.02e19 < t < 4.29999999999999991e77 or 5.49999999999999979e105 < t < 1.2e121Initial program 91.5%
+-commutative91.5%
associate-*l*90.5%
fma-def90.5%
associate-*l*96.4%
*-commutative96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in a around inf 45.5%
if 2.69999999999999991e-192 < t < 1.02e19 or 4.29999999999999991e77 < t < 5.49999999999999979e105Initial program 95.9%
+-commutative95.9%
associate-*l*95.9%
fma-def95.9%
associate-*l*99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 54.4%
if 1.2e121 < t Initial program 96.6%
+-commutative96.6%
associate-*l*96.6%
fma-def99.6%
associate-*l*88.3%
*-commutative88.3%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in y around 0 88.3%
*-commutative88.3%
*-commutative88.3%
*-commutative88.3%
associate-*r*99.4%
associate-*r*99.6%
*-commutative99.6%
associate-*l*99.5%
Simplified99.5%
Taylor expanded in y around inf 61.9%
*-commutative61.9%
*-commutative61.9%
associate-*l*61.9%
*-commutative61.9%
Simplified61.9%
Taylor expanded in t around 0 61.9%
*-commutative61.9%
associate-*l*61.8%
Simplified61.8%
Final simplification48.2%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -4.2e+122) (- (* 27.0 (* a 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 <= -4.2e+122) {
tmp = (27.0 * (a * 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 <= (-4.2d+122)) then
tmp = (27.0d0 * (a * 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 <= -4.2e+122) {
tmp = (27.0 * (a * 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 <= -4.2e+122: tmp = (27.0 * (a * 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 <= -4.2e+122) tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * Float64(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 <= -4.2e+122)
tmp = (27.0 * (a * 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, -4.2e+122], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * 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 -4.2 \cdot 10^{+122}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \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 < -4.20000000000000032e122Initial program 80.8%
+-commutative80.8%
associate-*l*80.8%
fma-def84.8%
associate-*l*92.4%
*-commutative92.4%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in x around 0 68.4%
if -4.20000000000000032e122 < z Initial program 95.7%
Taylor expanded in y around 0 96.1%
Final simplification93.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 -5.6e+122) (- (* 27.0 (* a b)) (* 9.0 (* y (* z t)))) (+ (* b (* a 27.0)) (- (* x 2.0) (* t (* y (* z 9.0)))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.6e+122) {
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (y * (z * 9.0))));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-5.6d+122)) then
tmp = (27.0d0 * (a * b)) - (9.0d0 * (y * (z * t)))
else
tmp = (b * (a * 27.0d0)) + ((x * 2.0d0) - (t * (y * (z * 9.0d0))))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.6e+122) {
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (y * (z * 9.0))));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -5.6e+122: tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t))) else: tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (y * (z * 9.0)))) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5.6e+122) tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * Float64(y * Float64(z * t)))); else tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(z * 9.0))))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -5.6e+122)
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
else
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (y * (z * 9.0))));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.6e+122], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * 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[(y * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+122}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot \left(y \cdot \left(z \cdot 9\right)\right)\right)\\
\end{array}
\end{array}
if z < -5.5999999999999999e122Initial program 80.8%
+-commutative80.8%
associate-*l*80.8%
fma-def84.8%
associate-*l*92.4%
*-commutative92.4%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in x around 0 68.4%
if -5.5999999999999999e122 < z Initial program 95.7%
Taylor expanded in y around 0 96.1%
*-commutative96.1%
associate-*r*96.1%
Simplified96.1%
Final simplification93.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 1.5e+34) (+ (* x 2.0) (- (* a (* 27.0 b)) (* (* z t) (* 9.0 y)))) (+ (* b (* a 27.0)) (- (* x 2.0) (* t (* y (* z 9.0)))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.5e+34) {
tmp = (x * 2.0) + ((a * (27.0 * b)) - ((z * t) * (9.0 * y)));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (y * (z * 9.0))));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 1.5d+34) then
tmp = (x * 2.0d0) + ((a * (27.0d0 * b)) - ((z * t) * (9.0d0 * y)))
else
tmp = (b * (a * 27.0d0)) + ((x * 2.0d0) - (t * (y * (z * 9.0d0))))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.5e+34) {
tmp = (x * 2.0) + ((a * (27.0 * b)) - ((z * t) * (9.0 * y)));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (y * (z * 9.0))));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 1.5e+34: tmp = (x * 2.0) + ((a * (27.0 * b)) - ((z * t) * (9.0 * y))) else: tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (y * (z * 9.0)))) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1.5e+34) tmp = Float64(Float64(x * 2.0) + Float64(Float64(a * Float64(27.0 * b)) - Float64(Float64(z * t) * Float64(9.0 * y)))); else tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(z * 9.0))))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 1.5e+34)
tmp = (x * 2.0) + ((a * (27.0 * b)) - ((z * t) * (9.0 * y)));
else
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (y * (z * 9.0))));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.5e+34], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] - N[(N[(z * t), $MachinePrecision] * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.5 \cdot 10^{+34}:\\
\;\;\;\;x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) - \left(z \cdot t\right) \cdot \left(9 \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot \left(y \cdot \left(z \cdot 9\right)\right)\right)\\
\end{array}
\end{array}
if z < 1.50000000000000009e34Initial program 96.1%
associate-+l-96.1%
sub-neg96.1%
neg-mul-196.1%
metadata-eval96.1%
metadata-eval96.1%
cancel-sign-sub-inv96.1%
metadata-eval96.1%
*-lft-identity96.1%
associate-*l*96.2%
associate-*l*95.7%
Simplified95.7%
if 1.50000000000000009e34 < z Initial program 87.3%
Taylor expanded in y around 0 87.3%
*-commutative87.3%
associate-*r*87.2%
Simplified87.2%
Final simplification93.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 (* 27.0 (* a b))))
(if (<= z -3.5e+19)
(* (* y (* z t)) -9.0)
(if (<= z -1.55e-221)
t_1
(if (<= z 1.05e-303)
(* x 2.0)
(if (<= z 2.1e-271)
t_1
(if (<= z 3.4e-33) (* 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) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -3.5e+19) {
tmp = (y * (z * t)) * -9.0;
} else if (z <= -1.55e-221) {
tmp = t_1;
} else if (z <= 1.05e-303) {
tmp = x * 2.0;
} else if (z <= 2.1e-271) {
tmp = t_1;
} else if (z <= 3.4e-33) {
tmp = x * 2.0;
} else {
tmp = z * (-9.0 * (y * 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 = 27.0d0 * (a * b)
if (z <= (-3.5d+19)) then
tmp = (y * (z * t)) * (-9.0d0)
else if (z <= (-1.55d-221)) then
tmp = t_1
else if (z <= 1.05d-303) then
tmp = x * 2.0d0
else if (z <= 2.1d-271) then
tmp = t_1
else if (z <= 3.4d-33) then
tmp = x * 2.0d0
else
tmp = z * ((-9.0d0) * (y * 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 = 27.0 * (a * b);
double tmp;
if (z <= -3.5e+19) {
tmp = (y * (z * t)) * -9.0;
} else if (z <= -1.55e-221) {
tmp = t_1;
} else if (z <= 1.05e-303) {
tmp = x * 2.0;
} else if (z <= 2.1e-271) {
tmp = t_1;
} else if (z <= 3.4e-33) {
tmp = x * 2.0;
} else {
tmp = z * (-9.0 * (y * 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 = 27.0 * (a * b) tmp = 0 if z <= -3.5e+19: tmp = (y * (z * t)) * -9.0 elif z <= -1.55e-221: tmp = t_1 elif z <= 1.05e-303: tmp = x * 2.0 elif z <= 2.1e-271: tmp = t_1 elif z <= 3.4e-33: tmp = x * 2.0 else: tmp = z * (-9.0 * (y * 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(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -3.5e+19) tmp = Float64(Float64(y * Float64(z * t)) * -9.0); elseif (z <= -1.55e-221) tmp = t_1; elseif (z <= 1.05e-303) tmp = Float64(x * 2.0); elseif (z <= 2.1e-271) tmp = t_1; elseif (z <= 3.4e-33) tmp = Float64(x * 2.0); else tmp = Float64(z * Float64(-9.0 * Float64(y * 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 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -3.5e+19)
tmp = (y * (z * t)) * -9.0;
elseif (z <= -1.55e-221)
tmp = t_1;
elseif (z <= 1.05e-303)
tmp = x * 2.0;
elseif (z <= 2.1e-271)
tmp = t_1;
elseif (z <= 3.4e-33)
tmp = x * 2.0;
else
tmp = z * (-9.0 * (y * 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[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e+19], N[(N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision], If[LessEqual[z, -1.55e-221], t$95$1, If[LessEqual[z, 1.05e-303], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 2.1e-271], t$95$1, If[LessEqual[z, 3.4e-33], N[(x * 2.0), $MachinePrecision], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{+19}:\\
\;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-221}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-303}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-271}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-33}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < -3.5e19Initial program 87.1%
+-commutative87.1%
associate-*l*87.1%
fma-def89.3%
associate-*l*91.5%
*-commutative91.5%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in y around inf 48.4%
if -3.5e19 < z < -1.55e-221 or 1.05e-303 < z < 2.1000000000000001e-271Initial program 99.7%
+-commutative99.7%
associate-*l*99.7%
fma-def99.7%
associate-*l*98.2%
*-commutative98.2%
associate-*l*98.3%
Simplified98.3%
Taylor expanded in a around inf 49.0%
if -1.55e-221 < z < 1.05e-303 or 2.1000000000000001e-271 < z < 3.4000000000000001e-33Initial program 97.4%
+-commutative97.4%
associate-*l*96.0%
fma-def96.0%
associate-*l*96.4%
*-commutative96.4%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in x around inf 50.1%
if 3.4000000000000001e-33 < z Initial program 89.9%
+-commutative89.9%
associate-*l*89.9%
fma-def91.4%
associate-*l*95.7%
*-commutative95.7%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in y around inf 57.7%
*-commutative57.7%
*-commutative57.7%
associate-*r*57.9%
associate-*r*57.9%
*-commutative57.9%
associate-*l*60.5%
Simplified60.5%
Taylor expanded in y around 0 60.5%
Final simplification52.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 -2.7e+19)
(* (* y (* z t)) -9.0)
(if (<= z -2e-219)
t_1
(if (<= z 1.1e-303)
(* x 2.0)
(if (<= z 1.16e-271)
t_1
(if (<= z 9.2e-33) (* 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) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -2.7e+19) {
tmp = (y * (z * t)) * -9.0;
} else if (z <= -2e-219) {
tmp = t_1;
} else if (z <= 1.1e-303) {
tmp = x * 2.0;
} else if (z <= 1.16e-271) {
tmp = t_1;
} else if (z <= 9.2e-33) {
tmp = x * 2.0;
} else {
tmp = z * (y * (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 (z <= (-2.7d+19)) then
tmp = (y * (z * t)) * (-9.0d0)
else if (z <= (-2d-219)) then
tmp = t_1
else if (z <= 1.1d-303) then
tmp = x * 2.0d0
else if (z <= 1.16d-271) then
tmp = t_1
else if (z <= 9.2d-33) then
tmp = x * 2.0d0
else
tmp = z * (y * (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 (z <= -2.7e+19) {
tmp = (y * (z * t)) * -9.0;
} else if (z <= -2e-219) {
tmp = t_1;
} else if (z <= 1.1e-303) {
tmp = x * 2.0;
} else if (z <= 1.16e-271) {
tmp = t_1;
} else if (z <= 9.2e-33) {
tmp = x * 2.0;
} else {
tmp = z * (y * (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 z <= -2.7e+19: tmp = (y * (z * t)) * -9.0 elif z <= -2e-219: tmp = t_1 elif z <= 1.1e-303: tmp = x * 2.0 elif z <= 1.16e-271: tmp = t_1 elif z <= 9.2e-33: tmp = x * 2.0 else: tmp = z * (y * (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 (z <= -2.7e+19) tmp = Float64(Float64(y * Float64(z * t)) * -9.0); elseif (z <= -2e-219) tmp = t_1; elseif (z <= 1.1e-303) tmp = Float64(x * 2.0); elseif (z <= 1.16e-271) tmp = t_1; elseif (z <= 9.2e-33) tmp = Float64(x * 2.0); else tmp = Float64(z * Float64(y * 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 (z <= -2.7e+19)
tmp = (y * (z * t)) * -9.0;
elseif (z <= -2e-219)
tmp = t_1;
elseif (z <= 1.1e-303)
tmp = x * 2.0;
elseif (z <= 1.16e-271)
tmp = t_1;
elseif (z <= 9.2e-33)
tmp = x * 2.0;
else
tmp = z * (y * (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[z, -2.7e+19], N[(N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision], If[LessEqual[z, -2e-219], t$95$1, If[LessEqual[z, 1.1e-303], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.16e-271], t$95$1, If[LessEqual[z, 9.2e-33], N[(x * 2.0), $MachinePrecision], N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{+19}:\\
\;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-219}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-303}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{-271}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-33}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -2.7e19Initial program 87.1%
+-commutative87.1%
associate-*l*87.1%
fma-def89.3%
associate-*l*91.5%
*-commutative91.5%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in y around inf 48.4%
if -2.7e19 < z < -2.0000000000000001e-219 or 1.10000000000000007e-303 < z < 1.15999999999999998e-271Initial program 99.7%
+-commutative99.7%
associate-*l*99.7%
fma-def99.7%
associate-*l*98.2%
*-commutative98.2%
associate-*l*98.3%
Simplified98.3%
Taylor expanded in a around inf 48.3%
if -2.0000000000000001e-219 < z < 1.10000000000000007e-303 or 1.15999999999999998e-271 < z < 9.19999999999999942e-33Initial program 97.4%
+-commutative97.4%
associate-*l*96.0%
fma-def96.0%
associate-*l*96.5%
*-commutative96.5%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in x around inf 49.5%
if 9.19999999999999942e-33 < z Initial program 89.9%
+-commutative89.9%
associate-*l*89.9%
fma-def91.4%
associate-*l*95.7%
*-commutative95.7%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in y around inf 57.7%
*-commutative57.7%
*-commutative57.7%
associate-*r*57.9%
associate-*r*57.9%
*-commutative57.9%
associate-*l*60.5%
Simplified60.5%
Final simplification51.9%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= b -2.9e-64)
(- (* x 2.0) (* a (* b -27.0)))
(if (<= b 7.8e+20)
(+ (* x 2.0) (* y (* z (* t -9.0))))
(+ (* x 2.0) (* b (* a 27.0))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.9e-64) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else if (b <= 7.8e+20) {
tmp = (x * 2.0) + (y * (z * (t * -9.0)));
} else {
tmp = (x * 2.0) + (b * (a * 27.0));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-2.9d-64)) then
tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
else if (b <= 7.8d+20) then
tmp = (x * 2.0d0) + (y * (z * (t * (-9.0d0))))
else
tmp = (x * 2.0d0) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.9e-64) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else if (b <= 7.8e+20) {
tmp = (x * 2.0) + (y * (z * (t * -9.0)));
} else {
tmp = (x * 2.0) + (b * (a * 27.0));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -2.9e-64: tmp = (x * 2.0) - (a * (b * -27.0)) elif b <= 7.8e+20: tmp = (x * 2.0) + (y * (z * (t * -9.0))) else: tmp = (x * 2.0) + (b * (a * 27.0)) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.9e-64) tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0))); elseif (b <= 7.8e+20) tmp = Float64(Float64(x * 2.0) + Float64(y * Float64(z * Float64(t * -9.0)))); else tmp = Float64(Float64(x * 2.0) + Float64(b * Float64(a * 27.0))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -2.9e-64)
tmp = (x * 2.0) - (a * (b * -27.0));
elseif (b <= 7.8e+20)
tmp = (x * 2.0) + (y * (z * (t * -9.0)));
else
tmp = (x * 2.0) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.9e-64], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.8e+20], 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[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.9 \cdot 10^{-64}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{elif}\;b \leq 7.8 \cdot 10^{+20}:\\
\;\;\;\;x \cdot 2 + y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if b < -2.8999999999999999e-64Initial program 90.2%
associate-+l-90.2%
sub-neg90.2%
neg-mul-190.2%
metadata-eval90.2%
metadata-eval90.2%
cancel-sign-sub-inv90.2%
metadata-eval90.2%
*-lft-identity90.2%
associate-*l*97.2%
associate-*l*94.8%
Simplified94.8%
Taylor expanded in y around 0 74.6%
*-commutative74.6%
associate-*l*72.2%
Simplified72.2%
if -2.8999999999999999e-64 < b < 7.8e20Initial program 96.0%
Taylor expanded in y around 0 96.0%
*-commutative96.0%
associate-*r*96.0%
Simplified96.0%
Taylor expanded in a around 0 82.7%
cancel-sign-sub-inv82.7%
metadata-eval82.7%
*-commutative82.7%
*-commutative82.7%
associate-*r*82.7%
*-commutative82.7%
*-commutative82.7%
associate-*r*82.8%
Simplified82.8%
if 7.8e20 < b Initial program 96.3%
+-commutative96.3%
associate-*l*96.3%
fma-def96.3%
associate-*l*98.1%
*-commutative98.1%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 79.4%
+-commutative79.4%
*-commutative79.4%
fma-def79.4%
*-commutative79.4%
Simplified79.4%
fma-udef79.4%
associate-*r*79.4%
*-commutative79.4%
Applied egg-rr79.4%
Final simplification78.8%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -2e+46) (* (* y (* z t)) -9.0) (if (<= z 1.66e+25) (+ (* x 2.0) (* b (* a 27.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) {
double tmp;
if (z <= -2e+46) {
tmp = (y * (z * t)) * -9.0;
} else if (z <= 1.66e+25) {
tmp = (x * 2.0) + (b * (a * 27.0));
} else {
tmp = z * (y * (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 (z <= (-2d+46)) then
tmp = (y * (z * t)) * (-9.0d0)
else if (z <= 1.66d+25) then
tmp = (x * 2.0d0) + (b * (a * 27.0d0))
else
tmp = z * (y * (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 (z <= -2e+46) {
tmp = (y * (z * t)) * -9.0;
} else if (z <= 1.66e+25) {
tmp = (x * 2.0) + (b * (a * 27.0));
} else {
tmp = z * (y * (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 z <= -2e+46: tmp = (y * (z * t)) * -9.0 elif z <= 1.66e+25: tmp = (x * 2.0) + (b * (a * 27.0)) else: tmp = z * (y * (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 (z <= -2e+46) tmp = Float64(Float64(y * Float64(z * t)) * -9.0); elseif (z <= 1.66e+25) tmp = Float64(Float64(x * 2.0) + Float64(b * Float64(a * 27.0))); else tmp = Float64(z * Float64(y * 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 (z <= -2e+46)
tmp = (y * (z * t)) * -9.0;
elseif (z <= 1.66e+25)
tmp = (x * 2.0) + (b * (a * 27.0));
else
tmp = z * (y * (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[z, -2e+46], N[(N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision], If[LessEqual[z, 1.66e+25], N[(N[(x * 2.0), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+46}:\\
\;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{elif}\;z \leq 1.66 \cdot 10^{+25}:\\
\;\;\;\;x \cdot 2 + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -2e46Initial program 85.1%
+-commutative85.1%
associate-*l*85.1%
fma-def87.7%
associate-*l*90.3%
*-commutative90.3%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in y around inf 47.7%
if -2e46 < z < 1.6600000000000001e25Initial program 98.7%
+-commutative98.7%
associate-*l*98.0%
fma-def98.0%
associate-*l*97.6%
*-commutative97.6%
associate-*l*98.2%
Simplified98.2%
Taylor expanded in y around 0 77.7%
+-commutative77.7%
*-commutative77.7%
fma-def77.7%
*-commutative77.7%
Simplified77.7%
fma-udef77.7%
associate-*r*77.7%
*-commutative77.7%
Applied egg-rr77.7%
if 1.6600000000000001e25 < z Initial program 87.7%
+-commutative87.7%
associate-*l*87.7%
fma-def89.6%
associate-*l*94.8%
*-commutative94.8%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in y around inf 57.2%
*-commutative57.2%
*-commutative57.2%
associate-*r*57.5%
associate-*r*57.5%
*-commutative57.5%
associate-*l*60.7%
Simplified60.7%
Final simplification69.5%
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 -4.8e+47) (* (* y (* z t)) -9.0) (if (<= z 1.2e+27) (- (* x 2.0) (* a (* b -27.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) {
double tmp;
if (z <= -4.8e+47) {
tmp = (y * (z * t)) * -9.0;
} else if (z <= 1.2e+27) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = z * (y * (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 (z <= (-4.8d+47)) then
tmp = (y * (z * t)) * (-9.0d0)
else if (z <= 1.2d+27) then
tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
else
tmp = z * (y * (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 (z <= -4.8e+47) {
tmp = (y * (z * t)) * -9.0;
} else if (z <= 1.2e+27) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = z * (y * (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 z <= -4.8e+47: tmp = (y * (z * t)) * -9.0 elif z <= 1.2e+27: tmp = (x * 2.0) - (a * (b * -27.0)) else: tmp = z * (y * (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 (z <= -4.8e+47) tmp = Float64(Float64(y * Float64(z * t)) * -9.0); elseif (z <= 1.2e+27) tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0))); else tmp = Float64(z * Float64(y * 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 (z <= -4.8e+47)
tmp = (y * (z * t)) * -9.0;
elseif (z <= 1.2e+27)
tmp = (x * 2.0) - (a * (b * -27.0));
else
tmp = z * (y * (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[z, -4.8e+47], N[(N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision], If[LessEqual[z, 1.2e+27], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+47}:\\
\;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+27}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -4.80000000000000037e47Initial program 85.1%
+-commutative85.1%
associate-*l*85.1%
fma-def87.7%
associate-*l*90.3%
*-commutative90.3%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in y around inf 47.7%
if -4.80000000000000037e47 < z < 1.19999999999999999e27Initial program 98.7%
associate-+l-98.7%
sub-neg98.7%
neg-mul-198.7%
metadata-eval98.7%
metadata-eval98.7%
cancel-sign-sub-inv98.7%
metadata-eval98.7%
*-lft-identity98.7%
associate-*l*98.2%
associate-*l*97.6%
Simplified97.6%
Taylor expanded in y around 0 77.7%
*-commutative77.7%
associate-*l*77.1%
Simplified77.1%
if 1.19999999999999999e27 < z Initial program 87.7%
+-commutative87.7%
associate-*l*87.7%
fma-def89.6%
associate-*l*94.8%
*-commutative94.8%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in y around inf 57.2%
*-commutative57.2%
*-commutative57.2%
associate-*r*57.5%
associate-*r*57.5%
*-commutative57.5%
associate-*l*60.7%
Simplified60.7%
Final simplification69.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 (<= x -2.9e-11) (* x 2.0) (if (<= x 4.6e+28) (* 27.0 (* a b)) (* x 2.0))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.9e-11) {
tmp = x * 2.0;
} else if (x <= 4.6e+28) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-2.9d-11)) then
tmp = x * 2.0d0
else if (x <= 4.6d+28) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.9e-11) {
tmp = x * 2.0;
} else if (x <= 4.6e+28) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if x <= -2.9e-11: tmp = x * 2.0 elif x <= 4.6e+28: tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.9e-11) tmp = Float64(x * 2.0); elseif (x <= 4.6e+28) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (x <= -2.9e-11)
tmp = x * 2.0;
elseif (x <= 4.6e+28)
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.9e-11], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, 4.6e+28], 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}\;x \leq -2.9 \cdot 10^{-11}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+28}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -2.9e-11 or 4.59999999999999968e28 < x Initial program 94.5%
+-commutative94.5%
associate-*l*93.8%
fma-def94.6%
associate-*l*96.1%
*-commutative96.1%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in x around inf 55.2%
if -2.9e-11 < x < 4.59999999999999968e28Initial program 94.0%
+-commutative94.0%
associate-*l*93.9%
fma-def94.7%
associate-*l*95.6%
*-commutative95.6%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in a around inf 43.6%
Final simplification49.2%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* 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.2%
+-commutative94.2%
associate-*l*93.8%
fma-def94.6%
associate-*l*95.9%
*-commutative95.9%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in x around inf 32.7%
Final simplification32.7%
(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 2023215
(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)))