
(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 5.6e-155) (fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t))))) (fma x 2.0 (fma t (* (* z y) -9.0) (* b (* a 27.0))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 5.6e-155) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
} else {
tmp = fma(x, 2.0, fma(t, ((z * y) * -9.0), (b * (a * 27.0))));
}
return tmp;
}
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 5.6e-155) tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))))); else tmp = fma(x, 2.0, fma(t, Float64(Float64(z * y) * -9.0), Float64(b * Float64(a * 27.0)))); end return tmp end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 5.6e-155], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * 2.0 + N[(t * N[(N[(z * y), $MachinePrecision] * -9.0), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5.6 \cdot 10^{-155}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(t, \left(z \cdot y\right) \cdot -9, b \cdot \left(a \cdot 27\right)\right)\right)\\
\end{array}
\end{array}
if z < 5.5999999999999999e-155Initial program 93.1%
+-commutative93.1%
associate-*l*93.1%
fma-def94.3%
associate-*l*96.9%
*-commutative96.9%
associate-*l*96.9%
Simplified96.9%
if 5.5999999999999999e-155 < z Initial program 88.5%
associate-+l-88.5%
fma-neg88.5%
neg-sub088.5%
associate-+l-88.5%
neg-sub088.5%
*-commutative88.5%
distribute-rgt-neg-in88.5%
fma-def88.5%
*-commutative88.5%
associate-*r*88.5%
distribute-rgt-neg-in88.5%
*-commutative88.5%
metadata-eval88.5%
Simplified88.5%
Final simplification93.7%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 5.6e-155) (fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t))))) (+ (* b (* a 27.0)) (- (* x 2.0) (* t (* z (* 9.0 y)))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 5.6e-155) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (z * (9.0 * y))));
}
return tmp;
}
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 5.6e-155) tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - 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(z * Float64(9.0 * y))))); end return tmp end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 5.6e-155], 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[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5.6 \cdot 10^{-155}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot \left(z \cdot \left(9 \cdot y\right)\right)\right)\\
\end{array}
\end{array}
if z < 5.5999999999999999e-155Initial program 93.1%
+-commutative93.1%
associate-*l*93.1%
fma-def94.3%
associate-*l*96.9%
*-commutative96.9%
associate-*l*96.9%
Simplified96.9%
if 5.5999999999999999e-155 < z Initial program 88.5%
Final simplification93.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 -5e-127)
(- (* x 2.0) (* t t_1))
(if (<= t_1 2e+44)
(- (* x 2.0) (* (* a b) -27.0))
(- (* x 2.0) (* 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 <= -5e-127) {
tmp = (x * 2.0) - (t * t_1);
} else if (t_1 <= 2e+44) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else {
tmp = (x * 2.0) - (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 <= (-5d-127)) then
tmp = (x * 2.0d0) - (t * t_1)
else if (t_1 <= 2d+44) then
tmp = (x * 2.0d0) - ((a * b) * (-27.0d0))
else
tmp = (x * 2.0d0) - (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 <= -5e-127) {
tmp = (x * 2.0) - (t * t_1);
} else if (t_1 <= 2e+44) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else {
tmp = (x * 2.0) - (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 <= -5e-127: tmp = (x * 2.0) - (t * t_1) elif t_1 <= 2e+44: tmp = (x * 2.0) - ((a * b) * -27.0) else: tmp = (x * 2.0) - (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 <= -5e-127) tmp = Float64(Float64(x * 2.0) - Float64(t * t_1)); elseif (t_1 <= 2e+44) tmp = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -27.0)); else tmp = Float64(Float64(x * 2.0) - 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 <= -5e-127)
tmp = (x * 2.0) - (t * t_1);
elseif (t_1 <= 2e+44)
tmp = (x * 2.0) - ((a * b) * -27.0);
else
tmp = (x * 2.0) - (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, -5e-127], N[(N[(x * 2.0), $MachinePrecision] - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+44], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $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 -5 \cdot 10^{-127}:\\
\;\;\;\;x \cdot 2 - t \cdot t_1\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+44}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < -4.9999999999999997e-127Initial program 84.4%
Taylor expanded in a around 0 72.8%
*-commutative72.8%
*-commutative72.8%
associate-*l*68.8%
*-commutative68.8%
*-commutative68.8%
associate-*r*68.9%
cancel-sign-sub-inv68.9%
Applied egg-rr68.9%
expm1-log1p-u15.8%
expm1-udef8.1%
Applied egg-rr8.1%
expm1-def15.8%
expm1-log1p68.9%
associate-*r*68.8%
*-commutative68.8%
associate-*l*68.8%
Simplified68.8%
distribute-lft-neg-out68.8%
add-sqr-sqrt0.0%
sqrt-unprod18.7%
sqr-neg18.7%
sqrt-unprod18.7%
add-sqr-sqrt18.7%
sub-neg18.7%
*-commutative18.7%
add-sqr-sqrt18.7%
sqrt-unprod18.7%
sqr-neg18.7%
sqrt-unprod0.0%
add-sqr-sqrt68.8%
associate-*r*68.8%
Applied egg-rr68.8%
if -4.9999999999999997e-127 < (*.f64 (*.f64 y 9) z) < 2.0000000000000002e44Initial program 98.0%
associate-+l-98.0%
sub-neg98.0%
neg-mul-198.0%
metadata-eval98.0%
metadata-eval98.0%
cancel-sign-sub-inv98.0%
metadata-eval98.0%
*-lft-identity98.0%
associate-*l*99.0%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in y around 0 87.3%
*-commutative87.3%
Simplified87.3%
if 2.0000000000000002e44 < (*.f64 (*.f64 y 9) z) Initial program 86.9%
Taylor expanded in a around 0 82.2%
Final simplification80.3%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* 9.0 y))))
(if (<= t_1 -5e-127)
(- (* x 2.0) (* t (* y (* z 9.0))))
(if (<= t_1 2e+44)
(- (* x 2.0) (* (* a b) -27.0))
(- (* x 2.0) (* 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 <= -5e-127) {
tmp = (x * 2.0) - (t * (y * (z * 9.0)));
} else if (t_1 <= 2e+44) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else {
tmp = (x * 2.0) - (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 <= (-5d-127)) then
tmp = (x * 2.0d0) - (t * (y * (z * 9.0d0)))
else if (t_1 <= 2d+44) then
tmp = (x * 2.0d0) - ((a * b) * (-27.0d0))
else
tmp = (x * 2.0d0) - (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 <= -5e-127) {
tmp = (x * 2.0) - (t * (y * (z * 9.0)));
} else if (t_1 <= 2e+44) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else {
tmp = (x * 2.0) - (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 <= -5e-127: tmp = (x * 2.0) - (t * (y * (z * 9.0))) elif t_1 <= 2e+44: tmp = (x * 2.0) - ((a * b) * -27.0) else: tmp = (x * 2.0) - (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 <= -5e-127) tmp = Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(z * 9.0)))); elseif (t_1 <= 2e+44) tmp = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -27.0)); else tmp = Float64(Float64(x * 2.0) - 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 <= -5e-127)
tmp = (x * 2.0) - (t * (y * (z * 9.0)));
elseif (t_1 <= 2e+44)
tmp = (x * 2.0) - ((a * b) * -27.0);
else
tmp = (x * 2.0) - (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, -5e-127], N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+44], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $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 -5 \cdot 10^{-127}:\\
\;\;\;\;x \cdot 2 - t \cdot \left(y \cdot \left(z \cdot 9\right)\right)\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+44}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < -4.9999999999999997e-127Initial program 84.4%
Taylor expanded in a around 0 72.8%
*-commutative72.8%
*-commutative72.8%
associate-*l*68.8%
*-commutative68.8%
*-commutative68.8%
associate-*r*68.9%
cancel-sign-sub-inv68.9%
Applied egg-rr68.9%
expm1-log1p-u15.8%
expm1-udef8.1%
Applied egg-rr8.1%
expm1-def15.8%
expm1-log1p68.9%
associate-*r*68.8%
*-commutative68.8%
associate-*l*68.8%
Simplified68.8%
if -4.9999999999999997e-127 < (*.f64 (*.f64 y 9) z) < 2.0000000000000002e44Initial program 98.0%
associate-+l-98.0%
sub-neg98.0%
neg-mul-198.0%
metadata-eval98.0%
metadata-eval98.0%
cancel-sign-sub-inv98.0%
metadata-eval98.0%
*-lft-identity98.0%
associate-*l*99.0%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in y around 0 87.3%
*-commutative87.3%
Simplified87.3%
if 2.0000000000000002e44 < (*.f64 (*.f64 y 9) z) Initial program 86.9%
Taylor expanded in a around 0 82.2%
Final simplification80.3%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (* z (* 9.0 y)) 1e+308) (+ (* b (* a 27.0)) (- (* x 2.0) (* t (* 9.0 (* z y))))) (- (* x 2.0) (* 9.0 (* y (* z t))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z * (9.0 * y)) <= 1e+308) {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (9.0 * (z * y))));
} else {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z * (9.0d0 * y)) <= 1d+308) then
tmp = (b * (a * 27.0d0)) + ((x * 2.0d0) - (t * (9.0d0 * (z * y))))
else
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z * (9.0 * y)) <= 1e+308) {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (9.0 * (z * y))));
} else {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if (z * (9.0 * y)) <= 1e+308: tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (9.0 * (z * y)))) else: tmp = (x * 2.0) - (9.0 * (y * (z * t))) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(z * Float64(9.0 * y)) <= 1e+308) tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(t * Float64(9.0 * Float64(z * y))))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((z * (9.0 * y)) <= 1e+308)
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (9.0 * (z * y))));
else
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision], 1e+308], 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], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot \left(9 \cdot y\right) \leq 10^{+308}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 1e308Initial program 93.2%
Taylor expanded in y around 0 93.3%
if 1e308 < (*.f64 (*.f64 y 9) z) Initial program 61.1%
Taylor expanded in a around 0 100.0%
Final simplification93.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 (* -9.0 (* y (* z t)))) (t_2 (* 27.0 (* a b))))
(if (<= x -8.8e+105)
(* x 2.0)
(if (<= x -6.5e+46)
t_2
(if (<= x -1.26e+29)
(* x 2.0)
(if (<= x -5.5e-56)
t_1
(if (<= x 1.15e-287) t_2 (if (<= x 1.4e+80) t_1 (* 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 t_1 = -9.0 * (y * (z * t));
double t_2 = 27.0 * (a * b);
double tmp;
if (x <= -8.8e+105) {
tmp = x * 2.0;
} else if (x <= -6.5e+46) {
tmp = t_2;
} else if (x <= -1.26e+29) {
tmp = x * 2.0;
} else if (x <= -5.5e-56) {
tmp = t_1;
} else if (x <= 1.15e-287) {
tmp = t_2;
} else if (x <= 1.4e+80) {
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.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-9.0d0) * (y * (z * t))
t_2 = 27.0d0 * (a * b)
if (x <= (-8.8d+105)) then
tmp = x * 2.0d0
else if (x <= (-6.5d+46)) then
tmp = t_2
else if (x <= (-1.26d+29)) then
tmp = x * 2.0d0
else if (x <= (-5.5d-56)) then
tmp = t_1
else if (x <= 1.15d-287) then
tmp = t_2
else if (x <= 1.4d+80) then
tmp = t_1
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 t_1 = -9.0 * (y * (z * t));
double t_2 = 27.0 * (a * b);
double tmp;
if (x <= -8.8e+105) {
tmp = x * 2.0;
} else if (x <= -6.5e+46) {
tmp = t_2;
} else if (x <= -1.26e+29) {
tmp = x * 2.0;
} else if (x <= -5.5e-56) {
tmp = t_1;
} else if (x <= 1.15e-287) {
tmp = t_2;
} else if (x <= 1.4e+80) {
tmp = t_1;
} 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): t_1 = -9.0 * (y * (z * t)) t_2 = 27.0 * (a * b) tmp = 0 if x <= -8.8e+105: tmp = x * 2.0 elif x <= -6.5e+46: tmp = t_2 elif x <= -1.26e+29: tmp = x * 2.0 elif x <= -5.5e-56: tmp = t_1 elif x <= 1.15e-287: tmp = t_2 elif x <= 1.4e+80: tmp = t_1 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) t_1 = Float64(-9.0 * Float64(y * Float64(z * t))) t_2 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (x <= -8.8e+105) tmp = Float64(x * 2.0); elseif (x <= -6.5e+46) tmp = t_2; elseif (x <= -1.26e+29) tmp = Float64(x * 2.0); elseif (x <= -5.5e-56) tmp = t_1; elseif (x <= 1.15e-287) tmp = t_2; elseif (x <= 1.4e+80) tmp = t_1; 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)
t_1 = -9.0 * (y * (z * t));
t_2 = 27.0 * (a * b);
tmp = 0.0;
if (x <= -8.8e+105)
tmp = x * 2.0;
elseif (x <= -6.5e+46)
tmp = t_2;
elseif (x <= -1.26e+29)
tmp = x * 2.0;
elseif (x <= -5.5e-56)
tmp = t_1;
elseif (x <= 1.15e-287)
tmp = t_2;
elseif (x <= 1.4e+80)
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.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.8e+105], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -6.5e+46], t$95$2, If[LessEqual[x, -1.26e+29], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -5.5e-56], t$95$1, If[LessEqual[x, 1.15e-287], t$95$2, If[LessEqual[x, 1.4e+80], t$95$1, 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}
t_1 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -8.8 \cdot 10^{+105}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -6.5 \cdot 10^{+46}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.26 \cdot 10^{+29}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-287}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+80}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -8.80000000000000027e105 or -6.50000000000000008e46 < x < -1.26e29 or 1.39999999999999992e80 < x Initial program 88.1%
Taylor expanded in x around inf 60.7%
if -8.80000000000000027e105 < x < -6.50000000000000008e46 or -5.4999999999999999e-56 < x < 1.14999999999999993e-287Initial program 90.6%
Taylor expanded in a around inf 54.6%
if -1.26e29 < x < -5.4999999999999999e-56 or 1.14999999999999993e-287 < x < 1.39999999999999992e80Initial program 95.2%
Taylor expanded in y around inf 53.6%
Final simplification56.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 -3e-257) (+ (* x 2.0) (- (* a (* 27.0 b)) (* (* z t) (* 9.0 y)))) (+ (* b (* a 27.0)) (- (* x 2.0) (* t (* z (* 9.0 y)))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3e-257) {
tmp = (x * 2.0) + ((a * (27.0 * b)) - ((z * t) * (9.0 * y)));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (z * (9.0 * y))));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-3d-257)) then
tmp = (x * 2.0d0) + ((a * (27.0d0 * b)) - ((z * t) * (9.0d0 * y)))
else
tmp = (b * (a * 27.0d0)) + ((x * 2.0d0) - (t * (z * (9.0d0 * y))))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3e-257) {
tmp = (x * 2.0) + ((a * (27.0 * b)) - ((z * t) * (9.0 * y)));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (z * (9.0 * y))));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -3e-257: tmp = (x * 2.0) + ((a * (27.0 * b)) - ((z * t) * (9.0 * y))) else: tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (z * (9.0 * y)))) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3e-257) 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(z * Float64(9.0 * y))))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -3e-257)
tmp = (x * 2.0) + ((a * (27.0 * b)) - ((z * t) * (9.0 * y)));
else
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (z * (9.0 * y))));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3e-257], 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[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-257}:\\
\;\;\;\;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(z \cdot \left(9 \cdot y\right)\right)\right)\\
\end{array}
\end{array}
if z < -2.9999999999999999e-257Initial program 92.6%
associate-+l-92.6%
sub-neg92.6%
neg-mul-192.6%
metadata-eval92.6%
metadata-eval92.6%
cancel-sign-sub-inv92.6%
metadata-eval92.6%
*-lft-identity92.6%
associate-*l*95.2%
associate-*l*95.2%
Simplified95.2%
if -2.9999999999999999e-257 < z Initial program 90.2%
Final simplification92.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 (* -9.0 (* z (* y t)))))
(if (<= z -15.2)
t_2
(if (<= z -2e-106)
(* x 2.0)
(if (<= z 1.4e-226)
t_1
(if (<= z 5.1e-194)
(* -9.0 (* y (* z t)))
(if (<= z 2.15e-54) t_1 t_2)))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (z * (y * t));
double tmp;
if (z <= -15.2) {
tmp = t_2;
} else if (z <= -2e-106) {
tmp = x * 2.0;
} else if (z <= 1.4e-226) {
tmp = t_1;
} else if (z <= 5.1e-194) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 2.15e-54) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = (-9.0d0) * (z * (y * t))
if (z <= (-15.2d0)) then
tmp = t_2
else if (z <= (-2d-106)) then
tmp = x * 2.0d0
else if (z <= 1.4d-226) then
tmp = t_1
else if (z <= 5.1d-194) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= 2.15d-54) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (z * (y * t));
double tmp;
if (z <= -15.2) {
tmp = t_2;
} else if (z <= -2e-106) {
tmp = x * 2.0;
} else if (z <= 1.4e-226) {
tmp = t_1;
} else if (z <= 5.1e-194) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 2.15e-54) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = -9.0 * (z * (y * t)) tmp = 0 if z <= -15.2: tmp = t_2 elif z <= -2e-106: tmp = x * 2.0 elif z <= 1.4e-226: tmp = t_1 elif z <= 5.1e-194: tmp = -9.0 * (y * (z * t)) elif z <= 2.15e-54: tmp = t_1 else: tmp = t_2 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(-9.0 * Float64(z * Float64(y * t))) tmp = 0.0 if (z <= -15.2) tmp = t_2; elseif (z <= -2e-106) tmp = Float64(x * 2.0); elseif (z <= 1.4e-226) tmp = t_1; elseif (z <= 5.1e-194) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= 2.15e-54) tmp = t_1; else tmp = t_2; end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = -9.0 * (z * (y * t));
tmp = 0.0;
if (z <= -15.2)
tmp = t_2;
elseif (z <= -2e-106)
tmp = x * 2.0;
elseif (z <= 1.4e-226)
tmp = t_1;
elseif (z <= 5.1e-194)
tmp = -9.0 * (y * (z * t));
elseif (z <= 2.15e-54)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -15.2], t$95$2, If[LessEqual[z, -2e-106], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.4e-226], t$95$1, If[LessEqual[z, 5.1e-194], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.15e-54], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{if}\;z \leq -15.2:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-106}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-226}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-194}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-54}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -15.199999999999999 or 2.15e-54 < z Initial program 86.5%
Taylor expanded in y around 0 86.5%
Taylor expanded in y around inf 48.6%
associate-*r*53.7%
Simplified53.7%
if -15.199999999999999 < z < -1.99999999999999988e-106Initial program 99.8%
Taylor expanded in x around inf 38.5%
if -1.99999999999999988e-106 < z < 1.40000000000000004e-226 or 5.0999999999999998e-194 < z < 2.15e-54Initial program 96.4%
Taylor expanded in a around inf 52.6%
if 1.40000000000000004e-226 < z < 5.0999999999999998e-194Initial program 99.7%
Taylor expanded in y around inf 50.5%
Final simplification51.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
(let* ((t_1 (* 27.0 (* a b))) (t_2 (* -9.0 (* z (* y t)))))
(if (<= z -15.2)
t_2
(if (<= z -1.85e-106)
(* x 2.0)
(if (<= z 1.4e-226)
t_1
(if (<= z 5.5e-194)
(* y (* t (* z -9.0)))
(if (<= z 4e-47) t_1 t_2)))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (z * (y * t));
double tmp;
if (z <= -15.2) {
tmp = t_2;
} else if (z <= -1.85e-106) {
tmp = x * 2.0;
} else if (z <= 1.4e-226) {
tmp = t_1;
} else if (z <= 5.5e-194) {
tmp = y * (t * (z * -9.0));
} else if (z <= 4e-47) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = (-9.0d0) * (z * (y * t))
if (z <= (-15.2d0)) then
tmp = t_2
else if (z <= (-1.85d-106)) then
tmp = x * 2.0d0
else if (z <= 1.4d-226) then
tmp = t_1
else if (z <= 5.5d-194) then
tmp = y * (t * (z * (-9.0d0)))
else if (z <= 4d-47) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (z * (y * t));
double tmp;
if (z <= -15.2) {
tmp = t_2;
} else if (z <= -1.85e-106) {
tmp = x * 2.0;
} else if (z <= 1.4e-226) {
tmp = t_1;
} else if (z <= 5.5e-194) {
tmp = y * (t * (z * -9.0));
} else if (z <= 4e-47) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = -9.0 * (z * (y * t)) tmp = 0 if z <= -15.2: tmp = t_2 elif z <= -1.85e-106: tmp = x * 2.0 elif z <= 1.4e-226: tmp = t_1 elif z <= 5.5e-194: tmp = y * (t * (z * -9.0)) elif z <= 4e-47: tmp = t_1 else: tmp = t_2 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(-9.0 * Float64(z * Float64(y * t))) tmp = 0.0 if (z <= -15.2) tmp = t_2; elseif (z <= -1.85e-106) tmp = Float64(x * 2.0); elseif (z <= 1.4e-226) tmp = t_1; elseif (z <= 5.5e-194) tmp = Float64(y * Float64(t * Float64(z * -9.0))); elseif (z <= 4e-47) tmp = t_1; else tmp = t_2; end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = -9.0 * (z * (y * t));
tmp = 0.0;
if (z <= -15.2)
tmp = t_2;
elseif (z <= -1.85e-106)
tmp = x * 2.0;
elseif (z <= 1.4e-226)
tmp = t_1;
elseif (z <= 5.5e-194)
tmp = y * (t * (z * -9.0));
elseif (z <= 4e-47)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -15.2], t$95$2, If[LessEqual[z, -1.85e-106], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.4e-226], t$95$1, If[LessEqual[z, 5.5e-194], N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e-47], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{if}\;z \leq -15.2:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.85 \cdot 10^{-106}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-226}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-194}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-47}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -15.199999999999999 or 3.9999999999999999e-47 < z Initial program 86.4%
Taylor expanded in y around 0 86.4%
Taylor expanded in y around inf 48.9%
associate-*r*54.1%
Simplified54.1%
if -15.199999999999999 < z < -1.8499999999999999e-106Initial program 99.8%
Taylor expanded in x around inf 38.5%
if -1.8499999999999999e-106 < z < 1.40000000000000004e-226 or 5.49999999999999941e-194 < z < 3.9999999999999999e-47Initial program 96.4%
Taylor expanded in a around inf 53.1%
if 1.40000000000000004e-226 < z < 5.49999999999999941e-194Initial program 99.7%
Taylor expanded in y around 0 99.7%
Taylor expanded in y around inf 50.5%
*-commutative50.5%
*-commutative50.5%
associate-*r*50.3%
*-commutative50.3%
associate-*l*50.3%
Simplified50.3%
Final simplification52.1%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.26e+80) (not (<= y 2.9e-149))) (- (* x 2.0) (* 9.0 (* y (* z t)))) (- (* x 2.0) (* (* a b) -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 ((y <= -2.26e+80) || !(y <= 2.9e-149)) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else {
tmp = (x * 2.0) - ((a * b) * -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 ((y <= (-2.26d+80)) .or. (.not. (y <= 2.9d-149))) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
else
tmp = (x * 2.0d0) - ((a * b) * (-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 ((y <= -2.26e+80) || !(y <= 2.9e-149)) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else {
tmp = (x * 2.0) - ((a * b) * -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 (y <= -2.26e+80) or not (y <= 2.9e-149): tmp = (x * 2.0) - (9.0 * (y * (z * t))) else: tmp = (x * 2.0) - ((a * b) * -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 ((y <= -2.26e+80) || !(y <= 2.9e-149)) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); else tmp = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -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 ((y <= -2.26e+80) || ~((y <= 2.9e-149)))
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
else
tmp = (x * 2.0) - ((a * b) * -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[Or[LessEqual[y, -2.26e+80], N[Not[LessEqual[y, 2.9e-149]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.26 \cdot 10^{+80} \lor \neg \left(y \leq 2.9 \cdot 10^{-149}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\end{array}
\end{array}
if y < -2.26e80 or 2.9e-149 < y Initial program 86.5%
Taylor expanded in a around 0 74.6%
if -2.26e80 < y < 2.9e-149Initial program 97.1%
associate-+l-97.1%
sub-neg97.1%
neg-mul-197.1%
metadata-eval97.1%
metadata-eval97.1%
cancel-sign-sub-inv97.1%
metadata-eval97.1%
*-lft-identity97.1%
associate-*l*94.1%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in y around 0 82.5%
*-commutative82.5%
Simplified82.5%
Final simplification78.2%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= y -5.9e+78)
(- (* x 2.0) (* 9.0 (* y (* z t))))
(if (<= y 3.2e-202)
(- (* x 2.0) (* (* a b) -27.0))
(- (* x 2.0) (* 9.0 (* z (* 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 tmp;
if (y <= -5.9e+78) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if (y <= 3.2e-202) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else {
tmp = (x * 2.0) - (9.0 * (z * (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) :: tmp
if (y <= (-5.9d+78)) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
else if (y <= 3.2d-202) then
tmp = (x * 2.0d0) - ((a * b) * (-27.0d0))
else
tmp = (x * 2.0d0) - (9.0d0 * (z * (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 tmp;
if (y <= -5.9e+78) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if (y <= 3.2e-202) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else {
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if y <= -5.9e+78: tmp = (x * 2.0) - (9.0 * (y * (z * t))) elif y <= 3.2e-202: tmp = (x * 2.0) - ((a * b) * -27.0) else: tmp = (x * 2.0) - (9.0 * (z * (y * 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 (y <= -5.9e+78) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); elseif (y <= 3.2e-202) tmp = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -27.0)); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * 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)
tmp = 0.0;
if (y <= -5.9e+78)
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
elseif (y <= 3.2e-202)
tmp = (x * 2.0) - ((a * b) * -27.0);
else
tmp = (x * 2.0) - (9.0 * (z * (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_] := If[LessEqual[y, -5.9e+78], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e-202], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * 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}\;y \leq -5.9 \cdot 10^{+78}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-202}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if y < -5.9e78Initial program 79.7%
Taylor expanded in a around 0 87.3%
if -5.9e78 < y < 3.2000000000000001e-202Initial program 97.7%
associate-+l-97.7%
sub-neg97.7%
neg-mul-197.7%
metadata-eval97.7%
metadata-eval97.7%
cancel-sign-sub-inv97.7%
metadata-eval97.7%
*-lft-identity97.7%
associate-*l*96.2%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in y around 0 84.2%
*-commutative84.2%
Simplified84.2%
if 3.2000000000000001e-202 < y Initial program 89.5%
Taylor expanded in a around 0 67.4%
*-commutative67.4%
*-commutative67.4%
associate-*l*66.2%
*-commutative66.2%
*-commutative66.2%
associate-*r*66.2%
cancel-sign-sub-inv66.2%
Applied egg-rr66.2%
distribute-lft-neg-out66.2%
associate-*r*66.2%
unsub-neg66.2%
*-commutative66.2%
associate-*r*68.9%
Applied egg-rr68.9%
Final simplification78.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 (<= z -420.0) (* -9.0 (* z (* y t))) (if (<= z 1.7e+73) (- (* x 2.0) (* a (* b -27.0))) (* z (* t (* y -9.0))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -420.0) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 1.7e+73) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = z * (t * (y * -9.0));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-420.0d0)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= 1.7d+73) then
tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
else
tmp = z * (t * (y * (-9.0d0)))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -420.0) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 1.7e+73) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = z * (t * (y * -9.0));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -420.0: tmp = -9.0 * (z * (y * t)) elif z <= 1.7e+73: tmp = (x * 2.0) - (a * (b * -27.0)) else: tmp = z * (t * (y * -9.0)) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -420.0) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= 1.7e+73) tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0))); else tmp = Float64(z * Float64(t * Float64(y * -9.0))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -420.0)
tmp = -9.0 * (z * (y * t));
elseif (z <= 1.7e+73)
tmp = (x * 2.0) - (a * (b * -27.0));
else
tmp = z * (t * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -420.0], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e+73], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -420:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+73}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -420Initial program 87.6%
Taylor expanded in y around 0 87.7%
Taylor expanded in y around inf 44.5%
associate-*r*50.1%
Simplified50.1%
if -420 < z < 1.7000000000000001e73Initial program 96.4%
associate-+l-96.4%
sub-neg96.4%
neg-mul-196.4%
metadata-eval96.4%
metadata-eval96.4%
cancel-sign-sub-inv96.4%
metadata-eval96.4%
*-lft-identity96.4%
associate-*l*99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in y around 0 75.5%
*-commutative75.5%
associate-*r*75.5%
Simplified75.5%
if 1.7000000000000001e73 < z Initial program 79.5%
Taylor expanded in y around 0 79.5%
Taylor expanded in y around inf 62.3%
*-commutative62.3%
*-commutative62.3%
associate-*r*62.3%
*-commutative62.3%
associate-*l*62.3%
Simplified62.3%
Taylor expanded in y around 0 62.3%
*-commutative62.3%
associate-*r*70.7%
*-commutative70.7%
*-commutative70.7%
associate-*l*70.5%
*-commutative70.5%
Simplified70.5%
Taylor expanded in y around 0 70.5%
*-commutative70.5%
associate-*r*70.6%
*-commutative70.6%
associate-*l*70.6%
Simplified70.6%
Final simplification68.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 -31.0)
(* -9.0 (* z (* y t)))
(if (<= z 1.45e+70)
(- (* x 2.0) (* b (* a -27.0)))
(* z (* t (* y -9.0))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -31.0) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 1.45e+70) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else {
tmp = z * (t * (y * -9.0));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-31.0d0)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= 1.45d+70) then
tmp = (x * 2.0d0) - (b * (a * (-27.0d0)))
else
tmp = z * (t * (y * (-9.0d0)))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -31.0) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 1.45e+70) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else {
tmp = z * (t * (y * -9.0));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -31.0: tmp = -9.0 * (z * (y * t)) elif z <= 1.45e+70: tmp = (x * 2.0) - (b * (a * -27.0)) else: tmp = z * (t * (y * -9.0)) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -31.0) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= 1.45e+70) tmp = Float64(Float64(x * 2.0) - Float64(b * Float64(a * -27.0))); else tmp = Float64(z * Float64(t * Float64(y * -9.0))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -31.0)
tmp = -9.0 * (z * (y * t));
elseif (z <= 1.45e+70)
tmp = (x * 2.0) - (b * (a * -27.0));
else
tmp = z * (t * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -31.0], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+70], N[(N[(x * 2.0), $MachinePrecision] - N[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -31:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+70}:\\
\;\;\;\;x \cdot 2 - b \cdot \left(a \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -31Initial program 87.6%
Taylor expanded in y around 0 87.7%
Taylor expanded in y around inf 44.5%
associate-*r*50.1%
Simplified50.1%
if -31 < z < 1.4499999999999999e70Initial program 96.4%
associate-+l-96.4%
sub-neg96.4%
neg-mul-196.4%
metadata-eval96.4%
metadata-eval96.4%
cancel-sign-sub-inv96.4%
metadata-eval96.4%
*-lft-identity96.4%
associate-*l*99.1%
associate-*l*99.1%
Simplified99.1%
sub-neg99.1%
*-commutative99.1%
associate-*r*99.1%
associate-*r*96.3%
distribute-rgt-neg-in96.3%
*-commutative96.3%
distribute-rgt-neg-in96.3%
metadata-eval96.3%
Applied egg-rr96.3%
Taylor expanded in y around 0 75.5%
associate-*r*75.5%
*-commutative75.5%
Simplified75.5%
if 1.4499999999999999e70 < z Initial program 79.5%
Taylor expanded in y around 0 79.5%
Taylor expanded in y around inf 62.3%
*-commutative62.3%
*-commutative62.3%
associate-*r*62.3%
*-commutative62.3%
associate-*l*62.3%
Simplified62.3%
Taylor expanded in y around 0 62.3%
*-commutative62.3%
associate-*r*70.7%
*-commutative70.7%
*-commutative70.7%
associate-*l*70.5%
*-commutative70.5%
Simplified70.5%
Taylor expanded in y around 0 70.5%
*-commutative70.5%
associate-*r*70.6%
*-commutative70.6%
associate-*l*70.6%
Simplified70.6%
Final simplification68.3%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -135.0)
(* -9.0 (* z (* y t)))
(if (<= z 1.36e+73)
(- (* x 2.0) (* (* a b) -27.0))
(* z (* t (* y -9.0))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -135.0) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 1.36e+73) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else {
tmp = z * (t * (y * -9.0));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-135.0d0)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= 1.36d+73) then
tmp = (x * 2.0d0) - ((a * b) * (-27.0d0))
else
tmp = z * (t * (y * (-9.0d0)))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -135.0) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 1.36e+73) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else {
tmp = z * (t * (y * -9.0));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -135.0: tmp = -9.0 * (z * (y * t)) elif z <= 1.36e+73: tmp = (x * 2.0) - ((a * b) * -27.0) else: tmp = z * (t * (y * -9.0)) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -135.0) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= 1.36e+73) tmp = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -27.0)); else tmp = Float64(z * Float64(t * Float64(y * -9.0))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -135.0)
tmp = -9.0 * (z * (y * t));
elseif (z <= 1.36e+73)
tmp = (x * 2.0) - ((a * b) * -27.0);
else
tmp = z * (t * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -135.0], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.36e+73], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -135:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.36 \cdot 10^{+73}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -135Initial program 87.6%
Taylor expanded in y around 0 87.7%
Taylor expanded in y around inf 44.5%
associate-*r*50.1%
Simplified50.1%
if -135 < z < 1.3599999999999999e73Initial program 96.4%
associate-+l-96.4%
sub-neg96.4%
neg-mul-196.4%
metadata-eval96.4%
metadata-eval96.4%
cancel-sign-sub-inv96.4%
metadata-eval96.4%
*-lft-identity96.4%
associate-*l*99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in y around 0 75.5%
*-commutative75.5%
Simplified75.5%
if 1.3599999999999999e73 < z Initial program 79.5%
Taylor expanded in y around 0 79.5%
Taylor expanded in y around inf 62.3%
*-commutative62.3%
*-commutative62.3%
associate-*r*62.3%
*-commutative62.3%
associate-*l*62.3%
Simplified62.3%
Taylor expanded in y around 0 62.3%
*-commutative62.3%
associate-*r*70.7%
*-commutative70.7%
*-commutative70.7%
associate-*l*70.5%
*-commutative70.5%
Simplified70.5%
Taylor expanded in y around 0 70.5%
*-commutative70.5%
associate-*r*70.6%
*-commutative70.6%
associate-*l*70.6%
Simplified70.6%
Final simplification68.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 (<= x -8.8e+105) (* x 2.0) (if (<= x 3e-112) (* 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 <= -8.8e+105) {
tmp = x * 2.0;
} else if (x <= 3e-112) {
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 <= (-8.8d+105)) then
tmp = x * 2.0d0
else if (x <= 3d-112) 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 <= -8.8e+105) {
tmp = x * 2.0;
} else if (x <= 3e-112) {
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 <= -8.8e+105: tmp = x * 2.0 elif x <= 3e-112: 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 <= -8.8e+105) tmp = Float64(x * 2.0); elseif (x <= 3e-112) 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 <= -8.8e+105)
tmp = x * 2.0;
elseif (x <= 3e-112)
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, -8.8e+105], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, 3e-112], 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 -8.8 \cdot 10^{+105}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-112}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -8.80000000000000027e105 or 3.0000000000000001e-112 < x Initial program 90.4%
Taylor expanded in x around inf 52.4%
if -8.80000000000000027e105 < x < 3.0000000000000001e-112Initial program 92.1%
Taylor expanded in a around inf 45.7%
Final simplification48.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 (* 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 91.3%
Taylor expanded in x around inf 30.3%
Final simplification30.3%
(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 2023182
(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)))