
(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 15 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. (FPCore (x y z t a b) :precision binary64 (if (<= (* (* y 9.0) z) -1e-128) (fma a (* 27.0 b) (fma x 2.0 (* t (* (* y z) -9.0)))) (- (+ (* a (* 27.0 b)) (* x 2.0)) (* y (* 9.0 (* z t))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((y * 9.0) * z) <= -1e-128) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * ((y * z) * -9.0))));
} else {
tmp = ((a * (27.0 * b)) + (x * 2.0)) - (y * (9.0 * (z * t)));
}
return tmp;
}
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(y * 9.0) * z) <= -1e-128) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(Float64(y * z) * -9.0)))); else tmp = Float64(Float64(Float64(a * Float64(27.0 * b)) + Float64(x * 2.0)) - Float64(y * Float64(9.0 * Float64(z * t)))); end return tmp end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision], -1e-128], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(N[(y * z), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(y \cdot 9\right) \cdot z \leq -1 \cdot 10^{-128}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(\left(y \cdot z\right) \cdot -9\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot \left(27 \cdot b\right) + x \cdot 2\right) - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < -1.00000000000000005e-128Initial program 92.9%
+-commutative92.9%
associate-+r-92.9%
*-commutative92.9%
cancel-sign-sub-inv92.9%
associate-*r*91.8%
distribute-lft-neg-in91.8%
*-commutative91.8%
cancel-sign-sub-inv91.8%
associate-+r-91.8%
associate-*l*91.9%
fma-def93.1%
cancel-sign-sub-inv93.1%
fma-def93.1%
distribute-lft-neg-in93.1%
distribute-rgt-neg-in93.1%
*-commutative93.1%
associate-*r*94.2%
distribute-rgt-neg-out94.2%
*-commutative94.2%
associate-*r*94.1%
Simplified94.1%
if -1.00000000000000005e-128 < (*.f64 (*.f64 y 9) z) Initial program 97.6%
sub-neg97.6%
sub-neg97.6%
associate-*l*95.3%
associate-*l*95.3%
Simplified95.3%
+-commutative95.3%
associate-+r-95.3%
associate-*l*95.4%
Applied egg-rr95.4%
Final simplification94.9%
NOTE: y, z, and t 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 -1.3e+40)
(+ t_1 (* z (* t (* y -9.0))))
(+ t_1 (+ (* x 2.0) (* (* y z) (* t -9.0)))))))assert(y < z && z < t);
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 <= -1.3e+40) {
tmp = t_1 + (z * (t * (y * -9.0)));
} else {
tmp = t_1 + ((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.
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 <= (-1.3d+40)) then
tmp = t_1 + (z * (t * (y * (-9.0d0))))
else
tmp = t_1 + ((x * 2.0d0) + ((y * z) * (t * (-9.0d0))))
end if
code = tmp
end function
assert y < z && z < t;
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 <= -1.3e+40) {
tmp = t_1 + (z * (t * (y * -9.0)));
} else {
tmp = t_1 + ((x * 2.0) + ((y * z) * (t * -9.0)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = a * (27.0 * b) tmp = 0 if z <= -1.3e+40: tmp = t_1 + (z * (t * (y * -9.0))) else: tmp = t_1 + ((x * 2.0) + ((y * z) * (t * -9.0))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (z <= -1.3e+40) tmp = Float64(t_1 + Float64(z * Float64(t * Float64(y * -9.0)))); else tmp = Float64(t_1 + Float64(Float64(x * 2.0) + Float64(Float64(y * z) * Float64(t * -9.0)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = a * (27.0 * b);
tmp = 0.0;
if (z <= -1.3e+40)
tmp = t_1 + (z * (t * (y * -9.0)));
else
tmp = t_1 + ((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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.3e+40], N[(t$95$1 + N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] + N[(N[(y * z), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{+40}:\\
\;\;\;\;t_1 + z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(x \cdot 2 + \left(y \cdot z\right) \cdot \left(t \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -1.3e40Initial program 90.5%
sub-neg90.5%
sub-neg90.5%
associate-*l*83.0%
associate-*l*83.0%
Simplified83.0%
Taylor expanded in x around 0 69.9%
sub-neg69.9%
*-commutative69.9%
associate-*r*69.9%
*-commutative69.9%
+-commutative69.9%
*-commutative69.9%
distribute-rgt-neg-in69.9%
*-commutative69.9%
associate-*r*66.1%
*-commutative66.1%
metadata-eval66.1%
associate-*r*66.0%
associate-*l*73.6%
Applied egg-rr73.6%
if -1.3e40 < z Initial program 97.5%
sub-neg97.5%
sub-neg97.5%
associate-*l*96.9%
associate-*l*97.0%
Simplified97.0%
associate-*r*97.5%
cancel-sign-sub-inv97.5%
distribute-lft-neg-in97.5%
distribute-rgt-neg-in97.5%
metadata-eval97.5%
associate-*r*97.4%
*-commutative97.4%
associate-*l*97.5%
associate-*l*97.4%
Applied egg-rr97.4%
Final simplification92.6%
NOTE: y, z, and t 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 -1e+40)
(+ t_1 (- (* x 2.0) (* 9.0 (* z (* y t)))))
(+ t_1 (+ (* x 2.0) (* (* y z) (* t -9.0)))))))assert(y < z && z < t);
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 <= -1e+40) {
tmp = t_1 + ((x * 2.0) - (9.0 * (z * (y * t))));
} else {
tmp = t_1 + ((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.
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 <= (-1d+40)) then
tmp = t_1 + ((x * 2.0d0) - (9.0d0 * (z * (y * t))))
else
tmp = t_1 + ((x * 2.0d0) + ((y * z) * (t * (-9.0d0))))
end if
code = tmp
end function
assert y < z && z < t;
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 <= -1e+40) {
tmp = t_1 + ((x * 2.0) - (9.0 * (z * (y * t))));
} else {
tmp = t_1 + ((x * 2.0) + ((y * z) * (t * -9.0)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = a * (27.0 * b) tmp = 0 if z <= -1e+40: tmp = t_1 + ((x * 2.0) - (9.0 * (z * (y * t)))) else: tmp = t_1 + ((x * 2.0) + ((y * z) * (t * -9.0))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (z <= -1e+40) tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t))))); else tmp = Float64(t_1 + Float64(Float64(x * 2.0) + Float64(Float64(y * z) * Float64(t * -9.0)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = a * (27.0 * b);
tmp = 0.0;
if (z <= -1e+40)
tmp = t_1 + ((x * 2.0) - (9.0 * (z * (y * t))));
else
tmp = t_1 + ((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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e+40], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] + N[(N[(y * z), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq -1 \cdot 10^{+40}:\\
\;\;\;\;t_1 + \left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(x \cdot 2 + \left(y \cdot z\right) \cdot \left(t \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -1.00000000000000003e40Initial program 90.5%
sub-neg90.5%
sub-neg90.5%
associate-*l*83.0%
associate-*l*83.0%
Simplified83.0%
Taylor expanded in y around 0 90.5%
associate-*r*94.3%
Simplified94.3%
if -1.00000000000000003e40 < z Initial program 97.5%
sub-neg97.5%
sub-neg97.5%
associate-*l*96.9%
associate-*l*97.0%
Simplified97.0%
associate-*r*97.5%
cancel-sign-sub-inv97.5%
distribute-lft-neg-in97.5%
distribute-rgt-neg-in97.5%
metadata-eval97.5%
associate-*r*97.4%
*-commutative97.4%
associate-*l*97.5%
associate-*l*97.4%
Applied egg-rr97.4%
Final simplification96.8%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 6e+102) (+ (* a (* 27.0 b)) (- (* x 2.0) (* (* y 9.0) (* z t)))) (- (* x 2.0) (* 9.0 (* t (* y z))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 6e+102) {
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 6d+102) then
tmp = (a * (27.0d0 * b)) + ((x * 2.0d0) - ((y * 9.0d0) * (z * t)))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 6e+102) {
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= 6e+102: tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t))) else: tmp = (x * 2.0) - (9.0 * (t * (y * z))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 6e+102) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t)))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 6e+102)
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 6e+102], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 6 \cdot 10^{+102}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < 5.9999999999999996e102Initial program 96.6%
sub-neg96.6%
sub-neg96.6%
associate-*l*95.2%
associate-*l*95.3%
Simplified95.3%
if 5.9999999999999996e102 < z Initial program 93.2%
sub-neg93.2%
sub-neg93.2%
associate-*l*88.5%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in a around 0 73.2%
Final simplification91.6%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 6e+102) (- (+ (* a (* 27.0 b)) (* x 2.0)) (* y (* 9.0 (* z t)))) (- (* x 2.0) (* 9.0 (* t (* y z))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 6e+102) {
tmp = ((a * (27.0 * b)) + (x * 2.0)) - (y * (9.0 * (z * t)));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 6d+102) then
tmp = ((a * (27.0d0 * b)) + (x * 2.0d0)) - (y * (9.0d0 * (z * t)))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 6e+102) {
tmp = ((a * (27.0 * b)) + (x * 2.0)) - (y * (9.0 * (z * t)));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= 6e+102: tmp = ((a * (27.0 * b)) + (x * 2.0)) - (y * (9.0 * (z * t))) else: tmp = (x * 2.0) - (9.0 * (t * (y * z))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 6e+102) tmp = Float64(Float64(Float64(a * Float64(27.0 * b)) + Float64(x * 2.0)) - Float64(y * Float64(9.0 * Float64(z * t)))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 6e+102)
tmp = ((a * (27.0 * b)) + (x * 2.0)) - (y * (9.0 * (z * t)));
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 6e+102], N[(N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 6 \cdot 10^{+102}:\\
\;\;\;\;\left(a \cdot \left(27 \cdot b\right) + x \cdot 2\right) - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < 5.9999999999999996e102Initial program 96.6%
sub-neg96.6%
sub-neg96.6%
associate-*l*95.2%
associate-*l*95.3%
Simplified95.3%
+-commutative95.3%
associate-+r-95.3%
associate-*l*95.3%
Applied egg-rr95.3%
if 5.9999999999999996e102 < z Initial program 93.2%
sub-neg93.2%
sub-neg93.2%
associate-*l*88.5%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in a around 0 73.2%
Final simplification91.6%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= x -1.05e+100)
(- (* x 2.0) (* 9.0 (* t (* y z))))
(if (<= x 1.15e-104)
(+ (* a (* 27.0 b)) (* z (* t (* y -9.0))))
(+ (* x 2.0) (* 27.0 (* a b))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.05e+100) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else if (x <= 1.15e-104) {
tmp = (a * (27.0 * b)) + (z * (t * (y * -9.0)));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
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 <= (-1.05d+100)) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
else if (x <= 1.15d-104) then
tmp = (a * (27.0d0 * b)) + (z * (t * (y * (-9.0d0))))
else
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.05e+100) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else if (x <= 1.15e-104) {
tmp = (a * (27.0 * b)) + (z * (t * (y * -9.0)));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if x <= -1.05e+100: tmp = (x * 2.0) - (9.0 * (t * (y * z))) elif x <= 1.15e-104: tmp = (a * (27.0 * b)) + (z * (t * (y * -9.0))) else: tmp = (x * 2.0) + (27.0 * (a * b)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.05e+100) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); elseif (x <= 1.15e-104) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(z * Float64(t * Float64(y * -9.0)))); else tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (x <= -1.05e+100)
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
elseif (x <= 1.15e-104)
tmp = (a * (27.0 * b)) + (z * (t * (y * -9.0)));
else
tmp = (x * 2.0) + (27.0 * (a * b));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.05e+100], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.15e-104], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+100}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-104}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if x < -1.0499999999999999e100Initial program 97.6%
sub-neg97.6%
sub-neg97.6%
associate-*l*84.6%
associate-*l*84.6%
Simplified84.6%
Taylor expanded in a around 0 92.6%
if -1.0499999999999999e100 < x < 1.15e-104Initial program 96.7%
sub-neg96.7%
sub-neg96.7%
associate-*l*97.3%
associate-*l*97.4%
Simplified97.4%
Taylor expanded in x around 0 87.8%
sub-neg87.8%
*-commutative87.8%
associate-*r*87.7%
*-commutative87.7%
+-commutative87.7%
*-commutative87.7%
distribute-rgt-neg-in87.7%
*-commutative87.7%
associate-*r*88.4%
*-commutative88.4%
metadata-eval88.4%
associate-*r*88.4%
associate-*l*85.6%
Applied egg-rr85.6%
if 1.15e-104 < x Initial program 94.2%
sub-neg94.2%
sub-neg94.2%
associate-*l*94.2%
associate-*l*94.2%
Simplified94.2%
Taylor expanded in y around 0 78.6%
Final simplification84.5%
NOTE: y, z, and t 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 (* y z)))))
(if (<= x -5.6e+42)
(- (* x 2.0) t_2)
(if (<= x 8.6e+71) (- t_1 t_2) (+ (* x 2.0) t_1)))))assert(y < z && z < t);
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 * (y * z));
double tmp;
if (x <= -5.6e+42) {
tmp = (x * 2.0) - t_2;
} else if (x <= 8.6e+71) {
tmp = t_1 - t_2;
} else {
tmp = (x * 2.0) + t_1;
}
return tmp;
}
NOTE: y, z, and t 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 * (y * z))
if (x <= (-5.6d+42)) then
tmp = (x * 2.0d0) - t_2
else if (x <= 8.6d+71) then
tmp = t_1 - t_2
else
tmp = (x * 2.0d0) + t_1
end if
code = tmp
end function
assert y < z && z < t;
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 * (y * z));
double tmp;
if (x <= -5.6e+42) {
tmp = (x * 2.0) - t_2;
} else if (x <= 8.6e+71) {
tmp = t_1 - t_2;
} else {
tmp = (x * 2.0) + t_1;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = 9.0 * (t * (y * z)) tmp = 0 if x <= -5.6e+42: tmp = (x * 2.0) - t_2 elif x <= 8.6e+71: tmp = t_1 - t_2 else: tmp = (x * 2.0) + t_1 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(9.0 * Float64(t * Float64(y * z))) tmp = 0.0 if (x <= -5.6e+42) tmp = Float64(Float64(x * 2.0) - t_2); elseif (x <= 8.6e+71) tmp = Float64(t_1 - t_2); else tmp = Float64(Float64(x * 2.0) + t_1); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = 9.0 * (t * (y * z));
tmp = 0.0;
if (x <= -5.6e+42)
tmp = (x * 2.0) - t_2;
elseif (x <= 8.6e+71)
tmp = t_1 - t_2;
else
tmp = (x * 2.0) + t_1;
end
tmp_2 = tmp;
end
NOTE: y, z, and t 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[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.6e+42], N[(N[(x * 2.0), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[x, 8.6e+71], N[(t$95$1 - t$95$2), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;x \leq -5.6 \cdot 10^{+42}:\\
\;\;\;\;x \cdot 2 - t_2\\
\mathbf{elif}\;x \leq 8.6 \cdot 10^{+71}:\\
\;\;\;\;t_1 - t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + t_1\\
\end{array}
\end{array}
if x < -5.5999999999999999e42Initial program 98.2%
sub-neg98.2%
sub-neg98.2%
associate-*l*88.1%
associate-*l*88.0%
Simplified88.0%
Taylor expanded in a around 0 89.1%
if -5.5999999999999999e42 < x < 8.59999999999999967e71Initial program 96.4%
sub-neg96.4%
sub-neg96.4%
associate-*l*95.6%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in x around 0 86.0%
if 8.59999999999999967e71 < x Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in y around 0 87.4%
Final simplification87.0%
NOTE: y, z, and t 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 -1.2e+78)
(* x 2.0)
(if (<= x -1.75e-86)
(* y (* z (* 9.0 (- t))))
(if (<= x -2.5e-175)
t_1
(if (<= x 5.5e-242)
(* z (* t (* y -9.0)))
(if (<= x 5.1e-5) t_1 (* x 2.0))))))))assert(y < z && z < t);
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 <= -1.2e+78) {
tmp = x * 2.0;
} else if (x <= -1.75e-86) {
tmp = y * (z * (9.0 * -t));
} else if (x <= -2.5e-175) {
tmp = t_1;
} else if (x <= 5.5e-242) {
tmp = z * (t * (y * -9.0));
} else if (x <= 5.1e-5) {
tmp = t_1;
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: y, z, and t 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 <= (-1.2d+78)) then
tmp = x * 2.0d0
else if (x <= (-1.75d-86)) then
tmp = y * (z * (9.0d0 * -t))
else if (x <= (-2.5d-175)) then
tmp = t_1
else if (x <= 5.5d-242) then
tmp = z * (t * (y * (-9.0d0)))
else if (x <= 5.1d-5) then
tmp = t_1
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert y < z && z < t;
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 <= -1.2e+78) {
tmp = x * 2.0;
} else if (x <= -1.75e-86) {
tmp = y * (z * (9.0 * -t));
} else if (x <= -2.5e-175) {
tmp = t_1;
} else if (x <= 5.5e-242) {
tmp = z * (t * (y * -9.0));
} else if (x <= 5.1e-5) {
tmp = t_1;
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if x <= -1.2e+78: tmp = x * 2.0 elif x <= -1.75e-86: tmp = y * (z * (9.0 * -t)) elif x <= -2.5e-175: tmp = t_1 elif x <= 5.5e-242: tmp = z * (t * (y * -9.0)) elif x <= 5.1e-5: tmp = t_1 else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (x <= -1.2e+78) tmp = Float64(x * 2.0); elseif (x <= -1.75e-86) tmp = Float64(y * Float64(z * Float64(9.0 * Float64(-t)))); elseif (x <= -2.5e-175) tmp = t_1; elseif (x <= 5.5e-242) tmp = Float64(z * Float64(t * Float64(y * -9.0))); elseif (x <= 5.1e-5) tmp = t_1; else tmp = Float64(x * 2.0); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (x <= -1.2e+78)
tmp = x * 2.0;
elseif (x <= -1.75e-86)
tmp = y * (z * (9.0 * -t));
elseif (x <= -2.5e-175)
tmp = t_1;
elseif (x <= 5.5e-242)
tmp = z * (t * (y * -9.0));
elseif (x <= 5.1e-5)
tmp = t_1;
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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.2e+78], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -1.75e-86], N[(y * N[(z * N[(9.0 * (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.5e-175], t$95$1, If[LessEqual[x, 5.5e-242], N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.1e-5], t$95$1, N[(x * 2.0), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{+78}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-86}:\\
\;\;\;\;y \cdot \left(z \cdot \left(9 \cdot \left(-t\right)\right)\right)\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{-175}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-242}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{-5}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -1.1999999999999999e78 or 5.09999999999999996e-5 < x Initial program 94.7%
sub-neg94.7%
sub-neg94.7%
associate-*l*90.3%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in x around inf 64.1%
if -1.1999999999999999e78 < x < -1.7500000000000001e-86Initial program 97.0%
sub-neg97.0%
sub-neg97.0%
associate-*l*96.9%
associate-*l*96.8%
Simplified96.8%
Taylor expanded in y around inf 47.7%
*-commutative47.7%
associate-*l*47.7%
associate-*r*47.5%
*-commutative47.5%
associate-*l*47.7%
*-commutative47.7%
Simplified47.7%
associate-*r*47.7%
*-commutative47.7%
associate-*r*47.7%
*-commutative47.7%
metadata-eval47.7%
distribute-lft-neg-in47.7%
*-commutative47.7%
*-commutative47.7%
associate-*l*47.6%
associate-*r*47.6%
associate-*l*47.5%
*-commutative47.5%
Applied egg-rr47.5%
if -1.7500000000000001e-86 < x < -2.5e-175 or 5.4999999999999998e-242 < x < 5.09999999999999996e-5Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*95.4%
associate-*l*95.5%
Simplified95.5%
+-commutative95.5%
associate-+r-95.5%
associate-*l*95.5%
Applied egg-rr95.5%
Taylor expanded in a around inf 59.2%
if -2.5e-175 < x < 5.4999999999999998e-242Initial program 92.9%
sub-neg92.9%
sub-neg92.9%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in a around 0 55.5%
Taylor expanded in x around 0 53.3%
*-commutative53.3%
associate-*r*53.3%
*-commutative53.3%
associate-*r*53.4%
*-commutative53.4%
associate-*l*55.0%
*-commutative55.0%
Simplified55.0%
Final simplification59.1%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.9e-73) (not (<= a 1.8e-152))) (+ (* x 2.0) (* 27.0 (* a b))) (- (* x 2.0) (* 9.0 (* t (* y z))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.9e-73) || !(a <= 1.8e-152)) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-2.9d-73)) .or. (.not. (a <= 1.8d-152))) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.9e-73) || !(a <= 1.8e-152)) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.9e-73) or not (a <= 1.8e-152): tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) - (9.0 * (t * (y * z))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.9e-73) || !(a <= 1.8e-152)) 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(y * z)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -2.9e-73) || ~((a <= 1.8e-152)))
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.9e-73], N[Not[LessEqual[a, 1.8e-152]], $MachinePrecision]], 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[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.9 \cdot 10^{-73} \lor \neg \left(a \leq 1.8 \cdot 10^{-152}\right):\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if a < -2.9e-73 or 1.8e-152 < a Initial program 95.7%
sub-neg95.7%
sub-neg95.7%
associate-*l*94.0%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in y around 0 73.1%
if -2.9e-73 < a < 1.8e-152Initial program 96.6%
sub-neg96.6%
sub-neg96.6%
associate-*l*94.4%
associate-*l*94.4%
Simplified94.4%
Taylor expanded in a around 0 91.9%
Final simplification79.5%
NOTE: y, z, and t 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 -1.28e+73)
(* x 2.0)
(if (<= x -4.3e-175)
t_1
(if (<= x 9e-243)
(* z (* t (* y -9.0)))
(if (<= x 0.00014) t_1 (* x 2.0)))))))assert(y < z && z < t);
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 <= -1.28e+73) {
tmp = x * 2.0;
} else if (x <= -4.3e-175) {
tmp = t_1;
} else if (x <= 9e-243) {
tmp = z * (t * (y * -9.0));
} else if (x <= 0.00014) {
tmp = t_1;
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: y, z, and t 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 <= (-1.28d+73)) then
tmp = x * 2.0d0
else if (x <= (-4.3d-175)) then
tmp = t_1
else if (x <= 9d-243) then
tmp = z * (t * (y * (-9.0d0)))
else if (x <= 0.00014d0) then
tmp = t_1
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert y < z && z < t;
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 <= -1.28e+73) {
tmp = x * 2.0;
} else if (x <= -4.3e-175) {
tmp = t_1;
} else if (x <= 9e-243) {
tmp = z * (t * (y * -9.0));
} else if (x <= 0.00014) {
tmp = t_1;
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if x <= -1.28e+73: tmp = x * 2.0 elif x <= -4.3e-175: tmp = t_1 elif x <= 9e-243: tmp = z * (t * (y * -9.0)) elif x <= 0.00014: tmp = t_1 else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (x <= -1.28e+73) tmp = Float64(x * 2.0); elseif (x <= -4.3e-175) tmp = t_1; elseif (x <= 9e-243) tmp = Float64(z * Float64(t * Float64(y * -9.0))); elseif (x <= 0.00014) tmp = t_1; else tmp = Float64(x * 2.0); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (x <= -1.28e+73)
tmp = x * 2.0;
elseif (x <= -4.3e-175)
tmp = t_1;
elseif (x <= 9e-243)
tmp = z * (t * (y * -9.0));
elseif (x <= 0.00014)
tmp = t_1;
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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.28e+73], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -4.3e-175], t$95$1, If[LessEqual[x, 9e-243], N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.00014], t$95$1, N[(x * 2.0), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -1.28 \cdot 10^{+73}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -4.3 \cdot 10^{-175}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-243}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;x \leq 0.00014:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -1.2800000000000001e73 or 1.3999999999999999e-4 < x Initial program 94.8%
sub-neg94.8%
sub-neg94.8%
associate-*l*90.5%
associate-*l*90.5%
Simplified90.5%
Taylor expanded in x around inf 63.0%
if -1.2800000000000001e73 < x < -4.29999999999999998e-175 or 9.00000000000000035e-243 < x < 1.3999999999999999e-4Initial program 98.7%
sub-neg98.7%
sub-neg98.7%
associate-*l*95.8%
associate-*l*95.9%
Simplified95.9%
+-commutative95.9%
associate-+r-95.9%
associate-*l*95.9%
Applied egg-rr95.9%
Taylor expanded in a around inf 52.9%
if -4.29999999999999998e-175 < x < 9.00000000000000035e-243Initial program 92.9%
sub-neg92.9%
sub-neg92.9%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in a around 0 55.5%
Taylor expanded in x around 0 53.3%
*-commutative53.3%
associate-*r*53.3%
*-commutative53.3%
associate-*r*53.4%
*-commutative53.4%
associate-*l*55.0%
*-commutative55.0%
Simplified55.0%
Final simplification57.7%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= z -9.8e+33) (not (<= z 1.7e+90))) (* -9.0 (* z (* y t))) (+ (* x 2.0) (* 27.0 (* a b)))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -9.8e+33) || !(z <= 1.7e+90)) {
tmp = -9.0 * (z * (y * t));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
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 <= (-9.8d+33)) .or. (.not. (z <= 1.7d+90))) then
tmp = (-9.0d0) * (z * (y * t))
else
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -9.8e+33) || !(z <= 1.7e+90)) {
tmp = -9.0 * (z * (y * t));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if (z <= -9.8e+33) or not (z <= 1.7e+90): tmp = -9.0 * (z * (y * t)) else: tmp = (x * 2.0) + (27.0 * (a * b)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -9.8e+33) || !(z <= 1.7e+90)) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); else tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((z <= -9.8e+33) || ~((z <= 1.7e+90)))
tmp = -9.0 * (z * (y * t));
else
tmp = (x * 2.0) + (27.0 * (a * b));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -9.8e+33], N[Not[LessEqual[z, 1.7e+90]], $MachinePrecision]], N[(-9.0 * N[(z * N[(y * t), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{+33} \lor \neg \left(z \leq 1.7 \cdot 10^{+90}\right):\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -9.80000000000000027e33 or 1.70000000000000009e90 < z Initial program 92.0%
sub-neg92.0%
sub-neg92.0%
associate-*l*85.9%
associate-*l*85.9%
Simplified85.9%
Taylor expanded in y around inf 53.3%
*-commutative53.3%
associate-*r*55.5%
Simplified55.5%
if -9.80000000000000027e33 < z < 1.70000000000000009e90Initial program 98.5%
sub-neg98.5%
sub-neg98.5%
associate-*l*99.1%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in y around 0 80.7%
Final simplification71.1%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= x -8.8e+77)
(* x 2.0)
(if (<= x 6.5e-243)
(* -9.0 (* t (* y z)))
(if (<= x 1.3e-5) (* 27.0 (* a b)) (* x 2.0)))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -8.8e+77) {
tmp = x * 2.0;
} else if (x <= 6.5e-243) {
tmp = -9.0 * (t * (y * z));
} else if (x <= 1.3e-5) {
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.
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 <= (-8.8d+77)) then
tmp = x * 2.0d0
else if (x <= 6.5d-243) then
tmp = (-9.0d0) * (t * (y * z))
else if (x <= 1.3d-5) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -8.8e+77) {
tmp = x * 2.0;
} else if (x <= 6.5e-243) {
tmp = -9.0 * (t * (y * z));
} else if (x <= 1.3e-5) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if x <= -8.8e+77: tmp = x * 2.0 elif x <= 6.5e-243: tmp = -9.0 * (t * (y * z)) elif x <= 1.3e-5: tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -8.8e+77) tmp = Float64(x * 2.0); elseif (x <= 6.5e-243) tmp = Float64(-9.0 * Float64(t * Float64(y * z))); elseif (x <= 1.3e-5) 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (x <= -8.8e+77)
tmp = x * 2.0;
elseif (x <= 6.5e-243)
tmp = -9.0 * (t * (y * z));
elseif (x <= 1.3e-5)
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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -8.8e+77], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, 6.5e-243], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e-5], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.8 \cdot 10^{+77}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-243}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-5}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -8.8000000000000002e77 or 1.29999999999999992e-5 < x Initial program 94.7%
sub-neg94.7%
sub-neg94.7%
associate-*l*90.3%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in x around inf 64.1%
if -8.8000000000000002e77 < x < 6.50000000000000043e-243Initial program 95.4%
sub-neg95.4%
sub-neg95.4%
associate-*l*98.6%
associate-*l*98.6%
Simplified98.6%
Taylor expanded in y around inf 46.4%
if 6.50000000000000043e-243 < x < 1.29999999999999992e-5Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*94.5%
associate-*l*94.7%
Simplified94.7%
+-commutative94.7%
associate-+r-94.7%
associate-*l*94.6%
Applied egg-rr94.6%
Taylor expanded in a around inf 55.9%
Final simplification56.2%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= x -2.5e+78)
(* x 2.0)
(if (<= x 2e-242)
(* t (* (* y z) -9.0))
(if (<= x 0.00023) (* 27.0 (* a b)) (* x 2.0)))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.5e+78) {
tmp = x * 2.0;
} else if (x <= 2e-242) {
tmp = t * ((y * z) * -9.0);
} else if (x <= 0.00023) {
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.
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.5d+78)) then
tmp = x * 2.0d0
else if (x <= 2d-242) then
tmp = t * ((y * z) * (-9.0d0))
else if (x <= 0.00023d0) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.5e+78) {
tmp = x * 2.0;
} else if (x <= 2e-242) {
tmp = t * ((y * z) * -9.0);
} else if (x <= 0.00023) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if x <= -2.5e+78: tmp = x * 2.0 elif x <= 2e-242: tmp = t * ((y * z) * -9.0) elif x <= 0.00023: tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.5e+78) tmp = Float64(x * 2.0); elseif (x <= 2e-242) tmp = Float64(t * Float64(Float64(y * z) * -9.0)); elseif (x <= 0.00023) 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (x <= -2.5e+78)
tmp = x * 2.0;
elseif (x <= 2e-242)
tmp = t * ((y * z) * -9.0);
elseif (x <= 0.00023)
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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.5e+78], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, 2e-242], N[(t * N[(N[(y * z), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.00023], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+78}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-242}:\\
\;\;\;\;t \cdot \left(\left(y \cdot z\right) \cdot -9\right)\\
\mathbf{elif}\;x \leq 0.00023:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -2.49999999999999992e78 or 2.3000000000000001e-4 < x Initial program 94.7%
sub-neg94.7%
sub-neg94.7%
associate-*l*90.3%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in x around inf 64.1%
if -2.49999999999999992e78 < x < 2e-242Initial program 95.4%
sub-neg95.4%
sub-neg95.4%
associate-*l*98.6%
associate-*l*98.6%
Simplified98.6%
Taylor expanded in y around inf 46.4%
*-commutative46.4%
associate-*l*46.4%
associate-*r*46.3%
*-commutative46.3%
associate-*l*46.5%
*-commutative46.5%
Simplified46.5%
Taylor expanded in z around 0 46.4%
if 2e-242 < x < 2.3000000000000001e-4Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*94.5%
associate-*l*94.7%
Simplified94.7%
+-commutative94.7%
associate-+r-94.7%
associate-*l*94.6%
Applied egg-rr94.6%
Taylor expanded in a around inf 55.9%
Final simplification56.1%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= x -1.46e+71) (not (<= x 0.00017))) (* x 2.0) (* 27.0 (* a b))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -1.46e+71) || !(x <= 0.00017)) {
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.
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 <= (-1.46d+71)) .or. (.not. (x <= 0.00017d0))) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -1.46e+71) || !(x <= 0.00017)) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if (x <= -1.46e+71) or not (x <= 0.00017): tmp = x * 2.0 else: tmp = 27.0 * (a * b) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -1.46e+71) || !(x <= 0.00017)) 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((x <= -1.46e+71) || ~((x <= 0.00017)))
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. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -1.46e+71], N[Not[LessEqual[x, 0.00017]], $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])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.46 \cdot 10^{+71} \lor \neg \left(x \leq 0.00017\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if x < -1.4600000000000001e71 or 1.7e-4 < x Initial program 94.8%
sub-neg94.8%
sub-neg94.8%
associate-*l*90.5%
associate-*l*90.5%
Simplified90.5%
Taylor expanded in x around inf 63.0%
if -1.4600000000000001e71 < x < 1.7e-4Initial program 97.0%
sub-neg97.0%
sub-neg97.0%
associate-*l*96.9%
associate-*l*97.0%
Simplified97.0%
+-commutative97.0%
associate-+r-97.0%
associate-*l*97.0%
Applied egg-rr97.0%
Taylor expanded in a around inf 48.4%
Final simplification54.8%
NOTE: y, z, and t 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);
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.
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;
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]) def code(x, y, z, t, a, b): return x * 2.0
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
y, z, t = num2cell(sort([y, z, t])){:}
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. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
x \cdot 2
\end{array}
Initial program 96.0%
sub-neg96.0%
sub-neg96.0%
associate-*l*94.1%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in x around inf 34.7%
Final simplification34.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 2023310
(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)))