
(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) 5e+246) (fma x 2.0 (fma t (* (* y z) -9.0) (* (* a 27.0) b))) (fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* 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) <= 5e+246) {
tmp = fma(x, 2.0, fma(t, ((y * z) * -9.0), ((a * 27.0) * b)));
} else {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (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) <= 5e+246) tmp = fma(x, 2.0, fma(t, Float64(Float64(y * z) * -9.0), Float64(Float64(a * 27.0) * b))); else tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * 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], 5e+246], N[(x * 2.0 + N[(t * N[(N[(y * z), $MachinePrecision] * -9.0), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(y \cdot 9\right) \cdot z \leq 5 \cdot 10^{+246}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(t, \left(y \cdot z\right) \cdot -9, \left(a \cdot 27\right) \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 4.99999999999999976e246Initial program 95.9%
associate-+l-95.9%
fma-neg95.9%
neg-sub095.9%
associate-+l-95.9%
neg-sub095.9%
*-commutative95.9%
distribute-rgt-neg-in95.9%
fma-def97.2%
*-commutative97.2%
associate-*r*97.2%
distribute-rgt-neg-in97.2%
*-commutative97.2%
metadata-eval97.2%
Simplified97.2%
if 4.99999999999999976e246 < (*.f64 (*.f64 y 9) z) Initial program 77.1%
+-commutative77.1%
associate-*l*77.1%
fma-def77.1%
associate-*l*99.8%
*-commutative99.8%
associate-*l*99.9%
Simplified99.9%
Final simplification97.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 (* (* y 9.0) z)))
(if (<= t_1 5e+246)
(+ (* (* a 27.0) b) (- (* x 2.0) (* t_1 t)))
(fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t))))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * 9.0) * z;
double tmp;
if (t_1 <= 5e+246) {
tmp = ((a * 27.0) * b) + ((x * 2.0) - (t_1 * t));
} else {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
}
return tmp;
}
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * 9.0) * z) tmp = 0.0 if (t_1 <= 5e+246) tmp = Float64(Float64(Float64(a * 27.0) * b) + Float64(Float64(x * 2.0) - Float64(t_1 * t))); else tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * 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_] := Block[{t$95$1 = N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+246], N[(N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot 9\right) \cdot z\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+246}:\\
\;\;\;\;\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - t_1 \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 4.99999999999999976e246Initial program 95.9%
if 4.99999999999999976e246 < (*.f64 (*.f64 y 9) z) Initial program 77.1%
+-commutative77.1%
associate-*l*77.1%
fma-def77.1%
associate-*l*99.8%
*-commutative99.8%
associate-*l*99.9%
Simplified99.9%
Final simplification96.4%
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) 8.5e+74) (fma x 2.0 (+ (* t (* y (* z -9.0))) (* a (* 27.0 b)))) (fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* 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) <= 8.5e+74) {
tmp = fma(x, 2.0, ((t * (y * (z * -9.0))) + (a * (27.0 * b))));
} else {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (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) <= 8.5e+74) tmp = fma(x, 2.0, Float64(Float64(t * Float64(y * Float64(z * -9.0))) + Float64(a * Float64(27.0 * b)))); else tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * 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], 8.5e+74], N[(x * 2.0 + N[(N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(y \cdot 9\right) \cdot z \leq 8.5 \cdot 10^{+74}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right) + a \cdot \left(27 \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 8.50000000000000028e74Initial program 95.9%
associate-+l-95.9%
fma-neg95.9%
neg-sub095.9%
associate-+l-95.9%
neg-sub095.9%
*-commutative95.9%
distribute-rgt-neg-in95.9%
fma-def96.9%
*-commutative96.9%
associate-*r*96.8%
distribute-rgt-neg-in96.8%
*-commutative96.8%
metadata-eval96.8%
Simplified96.8%
fma-udef95.8%
associate-*l*95.9%
associate-*r*95.9%
Applied egg-rr95.9%
if 8.50000000000000028e74 < (*.f64 (*.f64 y 9) z) Initial program 86.0%
+-commutative86.0%
associate-*l*86.0%
fma-def86.0%
associate-*l*94.5%
*-commutative94.5%
associate-*l*94.6%
Simplified94.6%
Final simplification95.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 (* (* y 9.0) z)))
(if (<= t_1 1e+254)
(+ (* (* a 27.0) b) (- (* x 2.0) (* t_1 t)))
(- (* x 2.0) (* 9.0 (* y (* z t)))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * 9.0) * z;
double tmp;
if (t_1 <= 1e+254) {
tmp = ((a * 27.0) * b) + ((x * 2.0) - (t_1 * t));
} 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.
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 = (y * 9.0d0) * z
if (t_1 <= 1d+254) then
tmp = ((a * 27.0d0) * b) + ((x * 2.0d0) - (t_1 * t))
else
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
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 = (y * 9.0) * z;
double tmp;
if (t_1 <= 1e+254) {
tmp = ((a * 27.0) * b) + ((x * 2.0) - (t_1 * t));
} else {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = (y * 9.0) * z tmp = 0 if t_1 <= 1e+254: tmp = ((a * 27.0) * b) + ((x * 2.0) - (t_1 * t)) else: tmp = (x * 2.0) - (9.0 * (y * (z * t))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * 9.0) * z) tmp = 0.0 if (t_1 <= 1e+254) tmp = Float64(Float64(Float64(a * 27.0) * b) + Float64(Float64(x * 2.0) - Float64(t_1 * t))); 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (y * 9.0) * z;
tmp = 0.0;
if (t_1 <= 1e+254)
tmp = ((a * 27.0) * b) + ((x * 2.0) - (t_1 * t));
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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+254], N[(N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t$95$1 * t), $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])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot 9\right) \cdot z\\
\mathbf{if}\;t_1 \leq 10^{+254}:\\
\;\;\;\;\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - t_1 \cdot t\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) < 9.9999999999999994e253Initial program 95.9%
if 9.9999999999999994e253 < (*.f64 (*.f64 y 9) z) Initial program 75.4%
Taylor expanded in a around 0 89.1%
Final simplification95.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
(let* ((t_1 (* (* y 9.0) z)))
(if (<= t_1 5e+290)
(+ (* (* a 27.0) b) (- (* x 2.0) (* t_1 t)))
(- (* x 2.0) (- (* (* y 9.0) (* z t)) (* a (* 27.0 b)))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * 9.0) * z;
double tmp;
if (t_1 <= 5e+290) {
tmp = ((a * 27.0) * b) + ((x * 2.0) - (t_1 * t));
} else {
tmp = (x * 2.0) - (((y * 9.0) * (z * t)) - (a * (27.0 * 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) :: t_1
real(8) :: tmp
t_1 = (y * 9.0d0) * z
if (t_1 <= 5d+290) then
tmp = ((a * 27.0d0) * b) + ((x * 2.0d0) - (t_1 * t))
else
tmp = (x * 2.0d0) - (((y * 9.0d0) * (z * t)) - (a * (27.0d0 * 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 t_1 = (y * 9.0) * z;
double tmp;
if (t_1 <= 5e+290) {
tmp = ((a * 27.0) * b) + ((x * 2.0) - (t_1 * t));
} else {
tmp = (x * 2.0) - (((y * 9.0) * (z * t)) - (a * (27.0 * b)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = (y * 9.0) * z tmp = 0 if t_1 <= 5e+290: tmp = ((a * 27.0) * b) + ((x * 2.0) - (t_1 * t)) else: tmp = (x * 2.0) - (((y * 9.0) * (z * t)) - (a * (27.0 * b))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * 9.0) * z) tmp = 0.0 if (t_1 <= 5e+290) tmp = Float64(Float64(Float64(a * 27.0) * b) + Float64(Float64(x * 2.0) - Float64(t_1 * t))); else tmp = Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * Float64(z * t)) - Float64(a * Float64(27.0 * b)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (y * 9.0) * z;
tmp = 0.0;
if (t_1 <= 5e+290)
tmp = ((a * 27.0) * b) + ((x * 2.0) - (t_1 * t));
else
tmp = (x * 2.0) - (((y * 9.0) * (z * t)) - (a * (27.0 * 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_] := Block[{t$95$1 = N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+290], N[(N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot 9\right) \cdot z\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+290}:\\
\;\;\;\;\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - t_1 \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - \left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right) - a \cdot \left(27 \cdot b\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 4.9999999999999998e290Initial program 96.1%
if 4.9999999999999998e290 < (*.f64 (*.f64 y 9) z) Initial program 65.1%
associate-+l-65.1%
sub-neg65.1%
neg-mul-165.1%
metadata-eval65.1%
metadata-eval65.1%
cancel-sign-sub-inv65.1%
metadata-eval65.1%
*-lft-identity65.1%
associate-*l*94.8%
associate-*l*99.8%
Simplified99.8%
Final simplification96.4%
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 (* y (* z t)))))
(if (<= z -1.05e-77)
t_2
(if (<= z -1.25e-239)
(* x 2.0)
(if (<= z 9e-240)
t_1
(if (<= z 2.25e-132)
(* x 2.0)
(if (<= z 2.05e-107) t_1 (if (<= z 3.15e-90) (* x 2.0) t_2))))))))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 * (y * (z * t));
double tmp;
if (z <= -1.05e-77) {
tmp = t_2;
} else if (z <= -1.25e-239) {
tmp = x * 2.0;
} else if (z <= 9e-240) {
tmp = t_1;
} else if (z <= 2.25e-132) {
tmp = x * 2.0;
} else if (z <= 2.05e-107) {
tmp = t_1;
} else if (z <= 3.15e-90) {
tmp = x * 2.0;
} else {
tmp = t_2;
}
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) * (y * (z * t))
if (z <= (-1.05d-77)) then
tmp = t_2
else if (z <= (-1.25d-239)) then
tmp = x * 2.0d0
else if (z <= 9d-240) then
tmp = t_1
else if (z <= 2.25d-132) then
tmp = x * 2.0d0
else if (z <= 2.05d-107) then
tmp = t_1
else if (z <= 3.15d-90) then
tmp = x * 2.0d0
else
tmp = t_2
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 * (y * (z * t));
double tmp;
if (z <= -1.05e-77) {
tmp = t_2;
} else if (z <= -1.25e-239) {
tmp = x * 2.0;
} else if (z <= 9e-240) {
tmp = t_1;
} else if (z <= 2.25e-132) {
tmp = x * 2.0;
} else if (z <= 2.05e-107) {
tmp = t_1;
} else if (z <= 3.15e-90) {
tmp = x * 2.0;
} else {
tmp = t_2;
}
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 * (y * (z * t)) tmp = 0 if z <= -1.05e-77: tmp = t_2 elif z <= -1.25e-239: tmp = x * 2.0 elif z <= 9e-240: tmp = t_1 elif z <= 2.25e-132: tmp = x * 2.0 elif z <= 2.05e-107: tmp = t_1 elif z <= 3.15e-90: tmp = x * 2.0 else: tmp = t_2 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(y * Float64(z * t))) tmp = 0.0 if (z <= -1.05e-77) tmp = t_2; elseif (z <= -1.25e-239) tmp = Float64(x * 2.0); elseif (z <= 9e-240) tmp = t_1; elseif (z <= 2.25e-132) tmp = Float64(x * 2.0); elseif (z <= 2.05e-107) tmp = t_1; elseif (z <= 3.15e-90) tmp = Float64(x * 2.0); else tmp = t_2; 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 * (y * (z * t));
tmp = 0.0;
if (z <= -1.05e-77)
tmp = t_2;
elseif (z <= -1.25e-239)
tmp = x * 2.0;
elseif (z <= 9e-240)
tmp = t_1;
elseif (z <= 2.25e-132)
tmp = x * 2.0;
elseif (z <= 2.05e-107)
tmp = t_1;
elseif (z <= 3.15e-90)
tmp = x * 2.0;
else
tmp = t_2;
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[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e-77], t$95$2, If[LessEqual[z, -1.25e-239], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 9e-240], t$95$1, If[LessEqual[z, 2.25e-132], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 2.05e-107], t$95$1, If[LessEqual[z, 3.15e-90], N[(x * 2.0), $MachinePrecision], t$95$2]]]]]]]]
\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(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{-77}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-239}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-240}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{-132}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{-107}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.15 \cdot 10^{-90}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1.05000000000000008e-77 or 3.14999999999999989e-90 < z Initial program 90.2%
+-commutative90.2%
associate-*r*93.7%
*-commutative93.7%
associate-*r*93.7%
fma-def94.4%
cancel-sign-sub-inv94.4%
fma-def94.4%
metadata-eval94.4%
associate-*r*90.8%
Applied egg-rr90.8%
Taylor expanded in y around inf 54.3%
if -1.05000000000000008e-77 < z < -1.25e-239 or 9.0000000000000003e-240 < z < 2.25e-132 or 2.05e-107 < z < 3.14999999999999989e-90Initial program 99.5%
associate-+l-99.5%
fma-neg99.5%
neg-sub099.5%
associate-+l-99.5%
neg-sub099.5%
associate-*l*99.8%
associate-*l*99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 52.9%
if -1.25e-239 < z < 9.0000000000000003e-240 or 2.25e-132 < z < 2.05e-107Initial program 99.8%
+-commutative99.8%
associate-*r*99.8%
*-commutative99.8%
associate-*r*99.8%
fma-def99.9%
cancel-sign-sub-inv99.9%
fma-def99.9%
metadata-eval99.9%
associate-*r*99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 60.2%
Final simplification54.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 (* 27.0 (* a b))))
(if (<= z -4.8e-81)
(* -9.0 (* y (* z t)))
(if (<= z -2.4e-239)
(* x 2.0)
(if (<= z 6.5e-240)
t_1
(if (<= z 1.85e-131)
(* x 2.0)
(if (<= z 2.2e-111)
t_1
(if (<= z 9.5e-92) (* x 2.0) (* (* z -9.0) (* y t))))))))))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 (z <= -4.8e-81) {
tmp = -9.0 * (y * (z * t));
} else if (z <= -2.4e-239) {
tmp = x * 2.0;
} else if (z <= 6.5e-240) {
tmp = t_1;
} else if (z <= 1.85e-131) {
tmp = x * 2.0;
} else if (z <= 2.2e-111) {
tmp = t_1;
} else if (z <= 9.5e-92) {
tmp = x * 2.0;
} else {
tmp = (z * -9.0) * (y * t);
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (z <= (-4.8d-81)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= (-2.4d-239)) then
tmp = x * 2.0d0
else if (z <= 6.5d-240) then
tmp = t_1
else if (z <= 1.85d-131) then
tmp = x * 2.0d0
else if (z <= 2.2d-111) then
tmp = t_1
else if (z <= 9.5d-92) then
tmp = x * 2.0d0
else
tmp = (z * (-9.0d0)) * (y * t)
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 (z <= -4.8e-81) {
tmp = -9.0 * (y * (z * t));
} else if (z <= -2.4e-239) {
tmp = x * 2.0;
} else if (z <= 6.5e-240) {
tmp = t_1;
} else if (z <= 1.85e-131) {
tmp = x * 2.0;
} else if (z <= 2.2e-111) {
tmp = t_1;
} else if (z <= 9.5e-92) {
tmp = x * 2.0;
} else {
tmp = (z * -9.0) * (y * t);
}
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 z <= -4.8e-81: tmp = -9.0 * (y * (z * t)) elif z <= -2.4e-239: tmp = x * 2.0 elif z <= 6.5e-240: tmp = t_1 elif z <= 1.85e-131: tmp = x * 2.0 elif z <= 2.2e-111: tmp = t_1 elif z <= 9.5e-92: tmp = x * 2.0 else: tmp = (z * -9.0) * (y * t) 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 (z <= -4.8e-81) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= -2.4e-239) tmp = Float64(x * 2.0); elseif (z <= 6.5e-240) tmp = t_1; elseif (z <= 1.85e-131) tmp = Float64(x * 2.0); elseif (z <= 2.2e-111) tmp = t_1; elseif (z <= 9.5e-92) tmp = Float64(x * 2.0); else tmp = Float64(Float64(z * -9.0) * Float64(y * t)); 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 (z <= -4.8e-81)
tmp = -9.0 * (y * (z * t));
elseif (z <= -2.4e-239)
tmp = x * 2.0;
elseif (z <= 6.5e-240)
tmp = t_1;
elseif (z <= 1.85e-131)
tmp = x * 2.0;
elseif (z <= 2.2e-111)
tmp = t_1;
elseif (z <= 9.5e-92)
tmp = x * 2.0;
else
tmp = (z * -9.0) * (y * t);
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e-81], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.4e-239], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 6.5e-240], t$95$1, If[LessEqual[z, 1.85e-131], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 2.2e-111], t$95$1, If[LessEqual[z, 9.5e-92], N[(x * 2.0), $MachinePrecision], N[(N[(z * -9.0), $MachinePrecision] * N[(y * t), $MachinePrecision]), $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}\;z \leq -4.8 \cdot 10^{-81}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-239}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-240}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-131}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-111}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-92}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot -9\right) \cdot \left(y \cdot t\right)\\
\end{array}
\end{array}
if z < -4.7999999999999998e-81Initial program 88.1%
+-commutative88.1%
associate-*r*94.6%
*-commutative94.6%
associate-*r*94.6%
fma-def94.6%
cancel-sign-sub-inv94.6%
fma-def94.6%
metadata-eval94.6%
associate-*r*88.1%
Applied egg-rr88.1%
Taylor expanded in y around inf 59.2%
if -4.7999999999999998e-81 < z < -2.39999999999999993e-239 or 6.50000000000000007e-240 < z < 1.8500000000000001e-131 or 2.2e-111 < z < 9.49999999999999946e-92Initial program 99.5%
associate-+l-99.5%
fma-neg99.5%
neg-sub099.5%
associate-+l-99.5%
neg-sub099.5%
associate-*l*99.8%
associate-*l*99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 52.1%
if -2.39999999999999993e-239 < z < 6.50000000000000007e-240 or 1.8500000000000001e-131 < z < 2.2e-111Initial program 99.8%
+-commutative99.8%
associate-*r*99.8%
*-commutative99.8%
associate-*r*99.8%
fma-def99.9%
cancel-sign-sub-inv99.9%
fma-def99.9%
metadata-eval99.9%
associate-*r*99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 60.2%
if 9.49999999999999946e-92 < z Initial program 92.1%
+-commutative92.1%
associate-*r*93.0%
*-commutative93.0%
associate-*r*93.1%
fma-def94.2%
cancel-sign-sub-inv94.2%
fma-def94.2%
metadata-eval94.2%
associate-*r*93.3%
Applied egg-rr93.3%
Taylor expanded in y around inf 49.5%
*-commutative49.5%
associate-*r*51.6%
associate-*l*51.5%
Simplified51.5%
Final simplification55.3%
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 -2.15e+72) (- (* x 2.0) (* 9.0 (* y (* z t)))) (+ (* (* a 27.0) b) (- (* x 2.0) (* t (* 9.0 (* 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 <= -2.15e+72) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else {
tmp = ((a * 27.0) * b) + ((x * 2.0) - (t * (9.0 * (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 <= (-2.15d+72)) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
else
tmp = ((a * 27.0d0) * b) + ((x * 2.0d0) - (t * (9.0d0 * (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 <= -2.15e+72) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else {
tmp = ((a * 27.0) * b) + ((x * 2.0) - (t * (9.0 * (y * z))));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= -2.15e+72: tmp = (x * 2.0) - (9.0 * (y * (z * t))) else: tmp = ((a * 27.0) * b) + ((x * 2.0) - (t * (9.0 * (y * z)))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.15e+72) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); else tmp = Float64(Float64(Float64(a * 27.0) * b) + Float64(Float64(x * 2.0) - Float64(t * Float64(9.0 * 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 <= -2.15e+72)
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
else
tmp = ((a * 27.0) * b) + ((x * 2.0) - (t * (9.0 * (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, -2.15e+72], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+72}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - t \cdot \left(9 \cdot \left(y \cdot z\right)\right)\right)\\
\end{array}
\end{array}
if z < -2.1500000000000001e72Initial program 81.0%
Taylor expanded in a around 0 78.9%
if -2.1500000000000001e72 < z Initial program 96.6%
Taylor expanded in y around 0 96.5%
Final simplification93.3%
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 (- (* x 2.0) (* a (* b -27.0)))))
(if (<= z -156000.0)
(* -9.0 (* y (* z t)))
(if (<= z 2.8e-86)
t_1
(if (<= z 1.8e-21)
(* y (* z (* t -9.0)))
(if (<= z 2.9e+50) t_1 (* (* z -9.0) (* y t))))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * 2.0) - (a * (b * -27.0));
double tmp;
if (z <= -156000.0) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 2.8e-86) {
tmp = t_1;
} else if (z <= 1.8e-21) {
tmp = y * (z * (t * -9.0));
} else if (z <= 2.9e+50) {
tmp = t_1;
} else {
tmp = (z * -9.0) * (y * t);
}
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 = (x * 2.0d0) - (a * (b * (-27.0d0)))
if (z <= (-156000.0d0)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= 2.8d-86) then
tmp = t_1
else if (z <= 1.8d-21) then
tmp = y * (z * (t * (-9.0d0)))
else if (z <= 2.9d+50) then
tmp = t_1
else
tmp = (z * (-9.0d0)) * (y * t)
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 = (x * 2.0) - (a * (b * -27.0));
double tmp;
if (z <= -156000.0) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 2.8e-86) {
tmp = t_1;
} else if (z <= 1.8e-21) {
tmp = y * (z * (t * -9.0));
} else if (z <= 2.9e+50) {
tmp = t_1;
} else {
tmp = (z * -9.0) * (y * t);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = (x * 2.0) - (a * (b * -27.0)) tmp = 0 if z <= -156000.0: tmp = -9.0 * (y * (z * t)) elif z <= 2.8e-86: tmp = t_1 elif z <= 1.8e-21: tmp = y * (z * (t * -9.0)) elif z <= 2.9e+50: tmp = t_1 else: tmp = (z * -9.0) * (y * t) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0))) tmp = 0.0 if (z <= -156000.0) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= 2.8e-86) tmp = t_1; elseif (z <= 1.8e-21) tmp = Float64(y * Float64(z * Float64(t * -9.0))); elseif (z <= 2.9e+50) tmp = t_1; else tmp = Float64(Float64(z * -9.0) * Float64(y * t)); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (x * 2.0) - (a * (b * -27.0));
tmp = 0.0;
if (z <= -156000.0)
tmp = -9.0 * (y * (z * t));
elseif (z <= 2.8e-86)
tmp = t_1;
elseif (z <= 1.8e-21)
tmp = y * (z * (t * -9.0));
elseif (z <= 2.9e+50)
tmp = t_1;
else
tmp = (z * -9.0) * (y * t);
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -156000.0], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e-86], t$95$1, If[LessEqual[z, 1.8e-21], N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+50], t$95$1, N[(N[(z * -9.0), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{if}\;z \leq -156000:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-86}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-21}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+50}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot -9\right) \cdot \left(y \cdot t\right)\\
\end{array}
\end{array}
if z < -156000Initial program 85.8%
+-commutative85.8%
associate-*r*93.6%
*-commutative93.6%
associate-*r*93.6%
fma-def93.6%
cancel-sign-sub-inv93.6%
fma-def93.6%
metadata-eval93.6%
associate-*r*85.9%
Applied egg-rr85.9%
Taylor expanded in y around inf 63.7%
if -156000 < z < 2.80000000000000009e-86 or 1.79999999999999995e-21 < z < 2.9e50Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
neg-mul-199.7%
metadata-eval99.7%
metadata-eval99.7%
cancel-sign-sub-inv99.7%
metadata-eval99.7%
*-lft-identity99.7%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 86.4%
*-commutative86.4%
associate-*l*86.3%
Simplified86.3%
if 2.80000000000000009e-86 < z < 1.79999999999999995e-21Initial program 93.8%
+-commutative93.8%
associate-*r*93.8%
*-commutative93.8%
associate-*r*93.7%
fma-def93.7%
cancel-sign-sub-inv93.7%
fma-def93.7%
metadata-eval93.7%
associate-*r*93.7%
Applied egg-rr93.7%
Taylor expanded in y around inf 44.7%
*-commutative44.7%
*-commutative44.7%
associate-*l*44.7%
associate-*r*44.5%
Simplified44.5%
if 2.9e50 < z Initial program 89.1%
+-commutative89.1%
associate-*r*90.6%
*-commutative90.6%
associate-*r*90.7%
fma-def92.6%
cancel-sign-sub-inv92.6%
fma-def92.6%
metadata-eval92.6%
associate-*r*91.0%
Applied egg-rr91.0%
Taylor expanded in y around inf 60.7%
*-commutative60.7%
associate-*r*64.2%
associate-*l*64.2%
Simplified64.2%
Final simplification73.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 -850.0)
(* -9.0 (* y (* z t)))
(if (<= z 2.3e-86)
(- (* x 2.0) (* b (* a -27.0)))
(if (<= z 9.5e-22)
(* y (* z (* t -9.0)))
(if (<= z 2.6e+50)
(- (* x 2.0) (* a (* b -27.0)))
(* (* z -9.0) (* y t)))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -850.0) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 2.3e-86) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else if (z <= 9.5e-22) {
tmp = y * (z * (t * -9.0));
} else if (z <= 2.6e+50) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (z * -9.0) * (y * t);
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
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 <= (-850.0d0)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= 2.3d-86) then
tmp = (x * 2.0d0) - (b * (a * (-27.0d0)))
else if (z <= 9.5d-22) then
tmp = y * (z * (t * (-9.0d0)))
else if (z <= 2.6d+50) then
tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
else
tmp = (z * (-9.0d0)) * (y * t)
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 <= -850.0) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 2.3e-86) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else if (z <= 9.5e-22) {
tmp = y * (z * (t * -9.0));
} else if (z <= 2.6e+50) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (z * -9.0) * (y * t);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= -850.0: tmp = -9.0 * (y * (z * t)) elif z <= 2.3e-86: tmp = (x * 2.0) - (b * (a * -27.0)) elif z <= 9.5e-22: tmp = y * (z * (t * -9.0)) elif z <= 2.6e+50: tmp = (x * 2.0) - (a * (b * -27.0)) else: tmp = (z * -9.0) * (y * t) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -850.0) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= 2.3e-86) tmp = Float64(Float64(x * 2.0) - Float64(b * Float64(a * -27.0))); elseif (z <= 9.5e-22) tmp = Float64(y * Float64(z * Float64(t * -9.0))); elseif (z <= 2.6e+50) tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0))); else tmp = Float64(Float64(z * -9.0) * Float64(y * t)); 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 <= -850.0)
tmp = -9.0 * (y * (z * t));
elseif (z <= 2.3e-86)
tmp = (x * 2.0) - (b * (a * -27.0));
elseif (z <= 9.5e-22)
tmp = y * (z * (t * -9.0));
elseif (z <= 2.6e+50)
tmp = (x * 2.0) - (a * (b * -27.0));
else
tmp = (z * -9.0) * (y * t);
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -850.0], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e-86], N[(N[(x * 2.0), $MachinePrecision] - N[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-22], N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e+50], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * -9.0), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -850:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-86}:\\
\;\;\;\;x \cdot 2 - b \cdot \left(a \cdot -27\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-22}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+50}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot -9\right) \cdot \left(y \cdot t\right)\\
\end{array}
\end{array}
if z < -850Initial program 86.0%
+-commutative86.0%
associate-*r*93.7%
*-commutative93.7%
associate-*r*93.7%
fma-def93.7%
cancel-sign-sub-inv93.7%
fma-def93.7%
metadata-eval93.7%
associate-*r*86.1%
Applied egg-rr86.1%
Taylor expanded in y around inf 64.3%
if -850 < z < 2.29999999999999996e-86Initial program 99.6%
associate-+l-99.6%
sub-neg99.6%
neg-mul-199.6%
metadata-eval99.6%
metadata-eval99.6%
cancel-sign-sub-inv99.6%
metadata-eval99.6%
*-lft-identity99.6%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 87.7%
*-commutative87.7%
associate-*l*87.6%
Simplified87.6%
Taylor expanded in a around 0 87.7%
associate-*r*87.7%
*-commutative87.7%
*-commutative87.7%
Simplified87.7%
if 2.29999999999999996e-86 < z < 9.4999999999999994e-22Initial program 93.8%
+-commutative93.8%
associate-*r*93.8%
*-commutative93.8%
associate-*r*93.7%
fma-def93.7%
cancel-sign-sub-inv93.7%
fma-def93.7%
metadata-eval93.7%
associate-*r*93.7%
Applied egg-rr93.7%
Taylor expanded in y around inf 44.7%
*-commutative44.7%
*-commutative44.7%
associate-*l*44.7%
associate-*r*44.5%
Simplified44.5%
if 9.4999999999999994e-22 < z < 2.6000000000000002e50Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
neg-mul-199.7%
metadata-eval99.7%
metadata-eval99.7%
cancel-sign-sub-inv99.7%
metadata-eval99.7%
*-lft-identity99.7%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in y around 0 82.7%
*-commutative82.7%
associate-*l*82.7%
Simplified82.7%
if 2.6000000000000002e50 < z Initial program 89.1%
+-commutative89.1%
associate-*r*90.6%
*-commutative90.6%
associate-*r*90.7%
fma-def92.6%
cancel-sign-sub-inv92.6%
fma-def92.6%
metadata-eval92.6%
associate-*r*91.0%
Applied egg-rr91.0%
Taylor expanded in y around inf 60.7%
*-commutative60.7%
associate-*r*64.2%
associate-*l*64.2%
Simplified64.2%
Final simplification74.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 (<= z -4.4e-109) (not (<= z 1.15e-86))) (+ (* x 2.0) (* z (* y (* t -9.0)))) (- (* x 2.0) (* b (* a -27.0)))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.4e-109) || !(z <= 1.15e-86)) {
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
} else {
tmp = (x * 2.0) - (b * (a * -27.0));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-4.4d-109)) .or. (.not. (z <= 1.15d-86))) then
tmp = (x * 2.0d0) + (z * (y * (t * (-9.0d0))))
else
tmp = (x * 2.0d0) - (b * (a * (-27.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 ((z <= -4.4e-109) || !(z <= 1.15e-86)) {
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
} else {
tmp = (x * 2.0) - (b * (a * -27.0));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if (z <= -4.4e-109) or not (z <= 1.15e-86): tmp = (x * 2.0) + (z * (y * (t * -9.0))) else: tmp = (x * 2.0) - (b * (a * -27.0)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.4e-109) || !(z <= 1.15e-86)) tmp = Float64(Float64(x * 2.0) + Float64(z * Float64(y * Float64(t * -9.0)))); else tmp = Float64(Float64(x * 2.0) - Float64(b * Float64(a * -27.0))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((z <= -4.4e-109) || ~((z <= 1.15e-86)))
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
else
tmp = (x * 2.0) - (b * (a * -27.0));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.4e-109], N[Not[LessEqual[z, 1.15e-86]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{-109} \lor \neg \left(z \leq 1.15 \cdot 10^{-86}\right):\\
\;\;\;\;x \cdot 2 + z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - b \cdot \left(a \cdot -27\right)\\
\end{array}
\end{array}
if z < -4.3999999999999999e-109 or 1.14999999999999998e-86 < z Initial program 90.5%
+-commutative90.5%
associate-*r*94.0%
*-commutative94.0%
associate-*r*94.0%
fma-def94.6%
cancel-sign-sub-inv94.6%
fma-def94.6%
metadata-eval94.6%
associate-*r*91.1%
Applied egg-rr91.1%
Taylor expanded in a around 0 74.3%
+-commutative74.3%
*-commutative74.3%
*-commutative74.3%
associate-*r*70.9%
associate-*r*70.9%
*-commutative70.9%
fma-def70.9%
*-commutative70.9%
Simplified70.9%
fma-udef70.9%
*-commutative70.9%
associate-*l*74.8%
Applied egg-rr74.8%
if -4.3999999999999999e-109 < z < 1.14999999999999998e-86Initial program 99.6%
associate-+l-99.6%
sub-neg99.6%
neg-mul-199.6%
metadata-eval99.6%
metadata-eval99.6%
cancel-sign-sub-inv99.6%
metadata-eval99.6%
*-lft-identity99.6%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 89.4%
*-commutative89.4%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in a around 0 89.4%
associate-*r*89.4%
*-commutative89.4%
*-commutative89.4%
Simplified89.4%
Final simplification80.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
(if (<= z -5.8e-110)
(+ (* x 2.0) (* z (* y (* t -9.0))))
(if (<= z 1.15e-87)
(- (* x 2.0) (* b (* a -27.0)))
(+ (* 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 tmp;
if (z <= -5.8e-110) {
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
} else if (z <= 1.15e-87) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else {
tmp = (x * 2.0) + ((y * z) * (t * -9.0));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-5.8d-110)) then
tmp = (x * 2.0d0) + (z * (y * (t * (-9.0d0))))
else if (z <= 1.15d-87) then
tmp = (x * 2.0d0) - (b * (a * (-27.0d0)))
else
tmp = (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 tmp;
if (z <= -5.8e-110) {
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
} else if (z <= 1.15e-87) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else {
tmp = (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): tmp = 0 if z <= -5.8e-110: tmp = (x * 2.0) + (z * (y * (t * -9.0))) elif z <= 1.15e-87: tmp = (x * 2.0) - (b * (a * -27.0)) else: tmp = (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) tmp = 0.0 if (z <= -5.8e-110) tmp = Float64(Float64(x * 2.0) + Float64(z * Float64(y * Float64(t * -9.0)))); elseif (z <= 1.15e-87) tmp = Float64(Float64(x * 2.0) - Float64(b * Float64(a * -27.0))); else tmp = 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)
tmp = 0.0;
if (z <= -5.8e-110)
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
elseif (z <= 1.15e-87)
tmp = (x * 2.0) - (b * (a * -27.0));
else
tmp = (x * 2.0) + ((y * z) * (t * -9.0));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.8e-110], N[(N[(x * 2.0), $MachinePrecision] + N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e-87], N[(N[(x * 2.0), $MachinePrecision] - N[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(y * z), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-110}:\\
\;\;\;\;x \cdot 2 + z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-87}:\\
\;\;\;\;x \cdot 2 - b \cdot \left(a \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(y \cdot z\right) \cdot \left(t \cdot -9\right)\\
\end{array}
\end{array}
if z < -5.8000000000000005e-110Initial program 88.8%
+-commutative88.8%
associate-*r*95.0%
*-commutative95.0%
associate-*r*94.9%
fma-def94.9%
cancel-sign-sub-inv94.9%
fma-def94.9%
metadata-eval94.9%
associate-*r*88.9%
Applied egg-rr88.9%
Taylor expanded in a around 0 76.6%
+-commutative76.6%
*-commutative76.6%
*-commutative76.6%
associate-*r*70.7%
associate-*r*70.7%
*-commutative70.7%
fma-def70.7%
*-commutative70.7%
Simplified70.7%
fma-udef70.7%
*-commutative70.7%
associate-*l*75.4%
Applied egg-rr75.4%
if -5.8000000000000005e-110 < z < 1.1500000000000001e-87Initial program 99.6%
associate-+l-99.6%
sub-neg99.6%
neg-mul-199.6%
metadata-eval99.6%
metadata-eval99.6%
cancel-sign-sub-inv99.6%
metadata-eval99.6%
*-lft-identity99.6%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 89.4%
*-commutative89.4%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in a around 0 89.4%
associate-*r*89.4%
*-commutative89.4%
*-commutative89.4%
Simplified89.4%
if 1.1500000000000001e-87 < z Initial program 92.1%
+-commutative92.1%
associate-*r*93.0%
*-commutative93.0%
associate-*r*93.1%
fma-def94.2%
cancel-sign-sub-inv94.2%
fma-def94.2%
metadata-eval94.2%
associate-*r*93.3%
Applied egg-rr93.3%
Taylor expanded in a around 0 72.1%
+-commutative72.1%
*-commutative72.1%
*-commutative72.1%
associate-*r*71.1%
associate-*r*71.1%
*-commutative71.1%
fma-def71.1%
*-commutative71.1%
Simplified71.1%
fma-udef71.1%
*-commutative71.1%
associate-*l*74.2%
Applied egg-rr74.2%
Taylor expanded in z around 0 72.1%
*-commutative72.1%
associate-*r*71.1%
associate-*r*71.1%
*-commutative71.1%
Simplified71.1%
Final simplification79.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
(if (<= z -1.85e-110)
(- (* x 2.0) (* 9.0 (* y (* z t))))
(if (<= z 3.8e-87)
(- (* x 2.0) (* b (* a -27.0)))
(+ (* 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 tmp;
if (z <= -1.85e-110) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if (z <= 3.8e-87) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else {
tmp = (x * 2.0) + ((y * z) * (t * -9.0));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.85d-110)) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
else if (z <= 3.8d-87) then
tmp = (x * 2.0d0) - (b * (a * (-27.0d0)))
else
tmp = (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 tmp;
if (z <= -1.85e-110) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if (z <= 3.8e-87) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else {
tmp = (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): tmp = 0 if z <= -1.85e-110: tmp = (x * 2.0) - (9.0 * (y * (z * t))) elif z <= 3.8e-87: tmp = (x * 2.0) - (b * (a * -27.0)) else: tmp = (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) tmp = 0.0 if (z <= -1.85e-110) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); elseif (z <= 3.8e-87) tmp = Float64(Float64(x * 2.0) - Float64(b * Float64(a * -27.0))); else tmp = 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)
tmp = 0.0;
if (z <= -1.85e-110)
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
elseif (z <= 3.8e-87)
tmp = (x * 2.0) - (b * (a * -27.0));
else
tmp = (x * 2.0) + ((y * z) * (t * -9.0));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.85e-110], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e-87], N[(N[(x * 2.0), $MachinePrecision] - N[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(y * z), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{-110}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-87}:\\
\;\;\;\;x \cdot 2 - b \cdot \left(a \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(y \cdot z\right) \cdot \left(t \cdot -9\right)\\
\end{array}
\end{array}
if z < -1.85000000000000008e-110Initial program 88.8%
Taylor expanded in a around 0 76.6%
if -1.85000000000000008e-110 < z < 3.8e-87Initial program 99.6%
associate-+l-99.6%
sub-neg99.6%
neg-mul-199.6%
metadata-eval99.6%
metadata-eval99.6%
cancel-sign-sub-inv99.6%
metadata-eval99.6%
*-lft-identity99.6%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 89.4%
*-commutative89.4%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in a around 0 89.4%
associate-*r*89.4%
*-commutative89.4%
*-commutative89.4%
Simplified89.4%
if 3.8e-87 < z Initial program 92.1%
+-commutative92.1%
associate-*r*93.0%
*-commutative93.0%
associate-*r*93.1%
fma-def94.2%
cancel-sign-sub-inv94.2%
fma-def94.2%
metadata-eval94.2%
associate-*r*93.3%
Applied egg-rr93.3%
Taylor expanded in a around 0 72.1%
+-commutative72.1%
*-commutative72.1%
*-commutative72.1%
associate-*r*71.1%
associate-*r*71.1%
*-commutative71.1%
fma-def71.1%
*-commutative71.1%
Simplified71.1%
fma-udef71.1%
*-commutative71.1%
associate-*l*74.2%
Applied egg-rr74.2%
Taylor expanded in z around 0 72.1%
*-commutative72.1%
associate-*r*71.1%
associate-*r*71.1%
*-commutative71.1%
Simplified71.1%
Final simplification79.4%
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+106) (* x 2.0) (if (<= x 1.8e+19) (* 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+106) {
tmp = x * 2.0;
} else if (x <= 1.8e+19) {
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+106)) then
tmp = x * 2.0d0
else if (x <= 1.8d+19) 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+106) {
tmp = x * 2.0;
} else if (x <= 1.8e+19) {
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+106: tmp = x * 2.0 elif x <= 1.8e+19: 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+106) tmp = Float64(x * 2.0); elseif (x <= 1.8e+19) 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+106)
tmp = x * 2.0;
elseif (x <= 1.8e+19)
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+106], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, 1.8e+19], 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^{+106}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+19}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -2.4999999999999999e106 or 1.8e19 < x Initial program 94.1%
associate-+l-94.1%
fma-neg94.1%
neg-sub094.1%
associate-+l-94.1%
neg-sub094.1%
associate-*l*97.9%
associate-*l*97.9%
distribute-rgt-neg-in97.9%
fma-def97.9%
*-commutative97.9%
distribute-rgt-neg-in97.9%
metadata-eval97.9%
Simplified97.9%
Taylor expanded in x around inf 60.6%
if -2.4999999999999999e106 < x < 1.8e19Initial program 93.6%
+-commutative93.6%
associate-*r*94.9%
*-commutative94.9%
associate-*r*94.9%
fma-def94.9%
cancel-sign-sub-inv94.9%
fma-def94.9%
metadata-eval94.9%
associate-*r*93.5%
Applied egg-rr93.5%
Taylor expanded in a around inf 44.8%
Final simplification50.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 93.8%
associate-+l-93.8%
fma-neg93.8%
neg-sub093.8%
associate-+l-93.8%
neg-sub093.8%
associate-*l*96.1%
associate-*l*96.1%
distribute-rgt-neg-in96.1%
fma-def96.4%
*-commutative96.4%
distribute-rgt-neg-in96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in x around inf 31.7%
Final simplification31.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 2023224
(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)))