
(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 18 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 (<= z -3e-85) (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);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3e-85) {
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]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3e-85) 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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3e-85], 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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-85}:\\
\;\;\;\;\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 < -3.00000000000000022e-85Initial program 84.5%
+-commutative84.5%
associate-*l*84.5%
fma-def87.0%
associate-*l*97.4%
*-commutative97.4%
associate-*l*97.4%
Simplified97.4%
if -3.00000000000000022e-85 < z Initial program 96.0%
associate-+l-96.0%
fma-neg96.0%
neg-sub096.0%
associate-+l-96.0%
neg-sub096.0%
*-commutative96.0%
distribute-rgt-neg-in96.0%
fma-def96.6%
*-commutative96.6%
associate-*r*96.6%
distribute-rgt-neg-in96.6%
*-commutative96.6%
metadata-eval96.6%
Simplified96.6%
Final simplification96.8%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 2e-139) (fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t))))) (+ (* x 2.0) (- (* a (* 27.0 b)) (* t (* y (* z 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 <= 2e-139) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
} else {
tmp = (x * 2.0) + ((a * (27.0 * b)) - (t * (y * (z * 9.0))));
}
return tmp;
}
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2e-139) tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))))); else tmp = Float64(Float64(x * 2.0) + Float64(Float64(a * Float64(27.0 * b)) - Float64(t * Float64(y * Float64(z * 9.0))))); 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[z, 2e-139], 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[(x * 2.0), $MachinePrecision] + N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] - N[(t * N[(y * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{-139}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) - t \cdot \left(y \cdot \left(z \cdot 9\right)\right)\right)\\
\end{array}
\end{array}
if z < 2.00000000000000006e-139Initial program 91.0%
+-commutative91.0%
associate-*l*90.6%
fma-def91.7%
associate-*l*98.1%
*-commutative98.1%
associate-*l*98.0%
Simplified98.0%
if 2.00000000000000006e-139 < z Initial program 95.1%
+-commutative95.1%
associate-*l*95.1%
fma-def95.1%
associate-*l*93.9%
*-commutative93.9%
associate-*l*93.8%
Simplified93.8%
associate-*r*93.9%
*-commutative93.9%
associate-*r*95.1%
cancel-sign-sub-inv95.1%
associate-*l*95.1%
Applied egg-rr95.1%
fma-udef95.1%
associate-*l*95.1%
*-commutative95.1%
associate-*l*95.1%
cancel-sign-sub-inv95.1%
+-commutative95.1%
associate-+l-95.1%
associate-*l*95.1%
*-commutative95.1%
associate-*l*95.1%
Applied egg-rr95.1%
Final simplification97.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 (<= z 2e-139) (fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t))))) (fma a (* 27.0 b) (- (* x 2.0) (* t (* y (* z 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 <= 2e-139) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
} else {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (t * (y * (z * 9.0)))));
}
return tmp;
}
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2e-139) tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))))); else tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(z * 9.0))))); 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[z, 2e-139], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{-139}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - t \cdot \left(y \cdot \left(z \cdot 9\right)\right)\right)\\
\end{array}
\end{array}
if z < 2.00000000000000006e-139Initial program 91.0%
+-commutative91.0%
associate-*l*90.6%
fma-def91.7%
associate-*l*98.1%
*-commutative98.1%
associate-*l*98.0%
Simplified98.0%
if 2.00000000000000006e-139 < z Initial program 95.1%
+-commutative95.1%
associate-*l*95.1%
fma-def95.1%
associate-*l*93.9%
*-commutative93.9%
associate-*l*93.8%
Simplified93.8%
associate-*r*93.9%
*-commutative93.9%
associate-*r*95.1%
cancel-sign-sub-inv95.1%
associate-*l*95.1%
Applied egg-rr95.1%
Final simplification97.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
(let* ((t_1 (* b (* a 27.0))))
(if (<= (* 9.0 y) -2e+33)
(+ t_1 (- (* x 2.0) (* y (* 9.0 (* z t)))))
(+ t_1 (- (* x 2.0) (* z (* t (* 9.0 y))))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if ((9.0 * y) <= -2e+33) {
tmp = t_1 + ((x * 2.0) - (y * (9.0 * (z * t))));
} else {
tmp = t_1 + ((x * 2.0) - (z * (t * (9.0 * y))));
}
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 = b * (a * 27.0d0)
if ((9.0d0 * y) <= (-2d+33)) then
tmp = t_1 + ((x * 2.0d0) - (y * (9.0d0 * (z * t))))
else
tmp = t_1 + ((x * 2.0d0) - (z * (t * (9.0d0 * y))))
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 = b * (a * 27.0);
double tmp;
if ((9.0 * y) <= -2e+33) {
tmp = t_1 + ((x * 2.0) - (y * (9.0 * (z * t))));
} else {
tmp = t_1 + ((x * 2.0) - (z * (t * (9.0 * y))));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = b * (a * 27.0) tmp = 0 if (9.0 * y) <= -2e+33: tmp = t_1 + ((x * 2.0) - (y * (9.0 * (z * t)))) else: tmp = t_1 + ((x * 2.0) - (z * (t * (9.0 * y)))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (Float64(9.0 * y) <= -2e+33) tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(y * Float64(9.0 * Float64(z * t))))); else tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(z * Float64(t * Float64(9.0 * y))))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a * 27.0);
tmp = 0.0;
if ((9.0 * y) <= -2e+33)
tmp = t_1 + ((x * 2.0) - (y * (9.0 * (z * t))));
else
tmp = t_1 + ((x * 2.0) - (z * (t * (9.0 * y))));
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[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(9.0 * y), $MachinePrecision], -2e+33], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(z * N[(t * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;9 \cdot y \leq -2 \cdot 10^{+33}:\\
\;\;\;\;t_1 + \left(x \cdot 2 - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(x \cdot 2 - z \cdot \left(t \cdot \left(9 \cdot y\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 y 9) < -1.9999999999999999e33Initial program 86.6%
Taylor expanded in y around 0 97.3%
*-commutative97.3%
associate-*r*97.4%
Simplified97.4%
if -1.9999999999999999e33 < (*.f64 y 9) Initial program 93.7%
Taylor expanded in y around 0 96.0%
associate-*r*96.0%
*-commutative96.0%
associate-*r*93.7%
Simplified93.7%
Final simplification94.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 (* b (* a 27.0))) (t_2 (* -9.0 (* y (* z t)))))
(if (<= z -7.2e-15)
t_2
(if (<= z -1.16e-238)
(* 27.0 (* a b))
(if (<= z 5.5e-139)
(* x 2.0)
(if (<= z 1.05e-20)
t_1
(if (<= z 3.2e+39) (* x 2.0) (if (<= z 2.05e+46) t_1 t_2))))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double t_2 = -9.0 * (y * (z * t));
double tmp;
if (z <= -7.2e-15) {
tmp = t_2;
} else if (z <= -1.16e-238) {
tmp = 27.0 * (a * b);
} else if (z <= 5.5e-139) {
tmp = x * 2.0;
} else if (z <= 1.05e-20) {
tmp = t_1;
} else if (z <= 3.2e+39) {
tmp = x * 2.0;
} else if (z <= 2.05e+46) {
tmp = t_1;
} 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 = b * (a * 27.0d0)
t_2 = (-9.0d0) * (y * (z * t))
if (z <= (-7.2d-15)) then
tmp = t_2
else if (z <= (-1.16d-238)) then
tmp = 27.0d0 * (a * b)
else if (z <= 5.5d-139) then
tmp = x * 2.0d0
else if (z <= 1.05d-20) then
tmp = t_1
else if (z <= 3.2d+39) then
tmp = x * 2.0d0
else if (z <= 2.05d+46) then
tmp = t_1
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 = b * (a * 27.0);
double t_2 = -9.0 * (y * (z * t));
double tmp;
if (z <= -7.2e-15) {
tmp = t_2;
} else if (z <= -1.16e-238) {
tmp = 27.0 * (a * b);
} else if (z <= 5.5e-139) {
tmp = x * 2.0;
} else if (z <= 1.05e-20) {
tmp = t_1;
} else if (z <= 3.2e+39) {
tmp = x * 2.0;
} else if (z <= 2.05e+46) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = b * (a * 27.0) t_2 = -9.0 * (y * (z * t)) tmp = 0 if z <= -7.2e-15: tmp = t_2 elif z <= -1.16e-238: tmp = 27.0 * (a * b) elif z <= 5.5e-139: tmp = x * 2.0 elif z <= 1.05e-20: tmp = t_1 elif z <= 3.2e+39: tmp = x * 2.0 elif z <= 2.05e+46: tmp = t_1 else: tmp = t_2 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) t_2 = Float64(-9.0 * Float64(y * Float64(z * t))) tmp = 0.0 if (z <= -7.2e-15) tmp = t_2; elseif (z <= -1.16e-238) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= 5.5e-139) tmp = Float64(x * 2.0); elseif (z <= 1.05e-20) tmp = t_1; elseif (z <= 3.2e+39) tmp = Float64(x * 2.0); elseif (z <= 2.05e+46) tmp = t_1; 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 = b * (a * 27.0);
t_2 = -9.0 * (y * (z * t));
tmp = 0.0;
if (z <= -7.2e-15)
tmp = t_2;
elseif (z <= -1.16e-238)
tmp = 27.0 * (a * b);
elseif (z <= 5.5e-139)
tmp = x * 2.0;
elseif (z <= 1.05e-20)
tmp = t_1;
elseif (z <= 3.2e+39)
tmp = x * 2.0;
elseif (z <= 2.05e+46)
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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.2e-15], t$95$2, If[LessEqual[z, -1.16e-238], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e-139], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.05e-20], t$95$1, If[LessEqual[z, 3.2e+39], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 2.05e+46], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
t_2 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{-15}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.16 \cdot 10^{-238}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-139}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+39}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{+46}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -7.2000000000000002e-15 or 2.05e46 < z Initial program 85.5%
Taylor expanded in x around 0 73.6%
Taylor expanded in a around 0 58.3%
if -7.2000000000000002e-15 < z < -1.1600000000000001e-238Initial program 98.2%
+-commutative98.2%
associate-*l*96.6%
fma-def96.5%
associate-*l*98.2%
*-commutative98.2%
associate-*l*98.1%
Simplified98.1%
associate-*r*98.2%
*-commutative98.2%
associate-*r*96.5%
cancel-sign-sub-inv96.5%
associate-*l*96.5%
Applied egg-rr96.5%
Taylor expanded in a around inf 50.2%
if -1.1600000000000001e-238 < z < 5.4999999999999997e-139 or 1.0499999999999999e-20 < z < 3.19999999999999993e39Initial program 96.6%
associate-+l-96.6%
fma-neg96.6%
neg-sub096.6%
associate-+l-96.6%
neg-sub096.6%
*-commutative96.6%
distribute-rgt-neg-in96.6%
fma-def96.6%
*-commutative96.6%
associate-*r*96.6%
distribute-rgt-neg-in96.6%
*-commutative96.6%
metadata-eval96.6%
Simplified96.6%
Taylor expanded in x around inf 39.9%
if 5.4999999999999997e-139 < z < 1.0499999999999999e-20 or 3.19999999999999993e39 < z < 2.05e46Initial program 99.7%
+-commutative99.7%
associate-*l*99.7%
fma-def99.7%
associate-*l*99.7%
*-commutative99.7%
associate-*l*99.7%
Simplified99.7%
associate-*r*99.7%
*-commutative99.7%
associate-*r*99.7%
cancel-sign-sub-inv99.7%
associate-*l*99.7%
Applied egg-rr99.7%
Taylor expanded in a around inf 59.9%
associate-*r*59.8%
*-commutative59.8%
*-commutative59.8%
*-commutative59.8%
Simplified59.8%
Final simplification52.2%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 7.8e+93) (+ (* b (* a 27.0)) (- (* x 2.0) (* y (* 9.0 (* z t))))) (- (* x 2.0) (* t (* y (* z 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 <= 7.8e+93) {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (y * (9.0 * (z * t))));
} else {
tmp = (x * 2.0) - (t * (y * (z * 9.0)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 7.8d+93) then
tmp = (b * (a * 27.0d0)) + ((x * 2.0d0) - (y * (9.0d0 * (z * t))))
else
tmp = (x * 2.0d0) - (t * (y * (z * 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 <= 7.8e+93) {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (y * (9.0 * (z * t))));
} else {
tmp = (x * 2.0) - (t * (y * (z * 9.0)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= 7.8e+93: tmp = (b * (a * 27.0)) + ((x * 2.0) - (y * (9.0 * (z * t)))) else: tmp = (x * 2.0) - (t * (y * (z * 9.0))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 7.8e+93) tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(y * Float64(9.0 * Float64(z * t))))); else tmp = Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(z * 9.0)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 7.8e+93)
tmp = (b * (a * 27.0)) + ((x * 2.0) - (y * (9.0 * (z * t))));
else
tmp = (x * 2.0) - (t * (y * (z * 9.0)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 7.8e+93], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 7.8 \cdot 10^{+93}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - t \cdot \left(y \cdot \left(z \cdot 9\right)\right)\\
\end{array}
\end{array}
if z < 7.8000000000000005e93Initial program 92.7%
Taylor expanded in y around 0 97.4%
*-commutative97.4%
associate-*r*97.4%
Simplified97.4%
if 7.8000000000000005e93 < z Initial program 90.0%
+-commutative90.0%
associate-*l*90.0%
fma-def89.9%
associate-*l*89.9%
*-commutative89.9%
associate-*l*89.8%
Simplified89.8%
associate-*r*89.9%
*-commutative89.9%
associate-*r*89.9%
cancel-sign-sub-inv89.9%
associate-*l*90.0%
Applied egg-rr90.0%
fma-udef90.0%
associate-*l*90.0%
*-commutative90.0%
associate-*l*90.0%
cancel-sign-sub-inv90.0%
+-commutative90.0%
associate-+l-90.0%
associate-*l*90.0%
*-commutative90.0%
associate-*l*90.0%
Applied egg-rr90.0%
add-sqr-sqrt47.4%
pow247.4%
Applied egg-rr47.4%
Taylor expanded in y around inf 73.5%
associate-*r*73.6%
*-commutative73.6%
associate-*l*72.0%
*-commutative72.0%
*-commutative72.0%
associate-*l*72.0%
*-commutative72.0%
Simplified72.0%
Final simplification93.7%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* a 27.0))))
(if (<= z 3.05e-139)
(+ t_1 (- (* x 2.0) (* y (* 9.0 (* z t)))))
(+ t_1 (- (* x 2.0) (* t (* z (* 9.0 y))))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if (z <= 3.05e-139) {
tmp = t_1 + ((x * 2.0) - (y * (9.0 * (z * t))));
} else {
tmp = t_1 + ((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.
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 = b * (a * 27.0d0)
if (z <= 3.05d-139) then
tmp = t_1 + ((x * 2.0d0) - (y * (9.0d0 * (z * t))))
else
tmp = t_1 + ((x * 2.0d0) - (t * (z * (9.0d0 * y))))
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 = b * (a * 27.0);
double tmp;
if (z <= 3.05e-139) {
tmp = t_1 + ((x * 2.0) - (y * (9.0 * (z * t))));
} else {
tmp = t_1 + ((x * 2.0) - (t * (z * (9.0 * y))));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = b * (a * 27.0) tmp = 0 if z <= 3.05e-139: tmp = t_1 + ((x * 2.0) - (y * (9.0 * (z * t)))) else: tmp = t_1 + ((x * 2.0) - (t * (z * (9.0 * y)))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (z <= 3.05e-139) tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(y * Float64(9.0 * Float64(z * t))))); else tmp = Float64(t_1 + 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a * 27.0);
tmp = 0.0;
if (z <= 3.05e-139)
tmp = t_1 + ((x * 2.0) - (y * (9.0 * (z * t))));
else
tmp = t_1 + ((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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 3.05e-139], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + 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])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;z \leq 3.05 \cdot 10^{-139}:\\
\;\;\;\;t_1 + \left(x \cdot 2 - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(x \cdot 2 - t \cdot \left(z \cdot \left(9 \cdot y\right)\right)\right)\\
\end{array}
\end{array}
if z < 3.0499999999999999e-139Initial program 91.0%
Taylor expanded in y around 0 97.4%
*-commutative97.4%
associate-*r*97.4%
Simplified97.4%
if 3.0499999999999999e-139 < z Initial program 95.1%
Final simplification96.7%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 3.05e-127) (+ (* b (* a 27.0)) (- (* x 2.0) (* y (* 9.0 (* z t))))) (+ (* x 2.0) (- (* a (* 27.0 b)) (* t (* y (* z 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 <= 3.05e-127) {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (y * (9.0 * (z * t))));
} else {
tmp = (x * 2.0) + ((a * (27.0 * b)) - (t * (y * (z * 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 <= 3.05d-127) then
tmp = (b * (a * 27.0d0)) + ((x * 2.0d0) - (y * (9.0d0 * (z * t))))
else
tmp = (x * 2.0d0) + ((a * (27.0d0 * b)) - (t * (y * (z * 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 <= 3.05e-127) {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (y * (9.0 * (z * t))));
} else {
tmp = (x * 2.0) + ((a * (27.0 * b)) - (t * (y * (z * 9.0))));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= 3.05e-127: tmp = (b * (a * 27.0)) + ((x * 2.0) - (y * (9.0 * (z * t)))) else: tmp = (x * 2.0) + ((a * (27.0 * b)) - (t * (y * (z * 9.0)))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 3.05e-127) tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(y * Float64(9.0 * Float64(z * t))))); else tmp = Float64(Float64(x * 2.0) + Float64(Float64(a * Float64(27.0 * b)) - Float64(t * Float64(y * Float64(z * 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 <= 3.05e-127)
tmp = (b * (a * 27.0)) + ((x * 2.0) - (y * (9.0 * (z * t))));
else
tmp = (x * 2.0) + ((a * (27.0 * b)) - (t * (y * (z * 9.0))));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 3.05e-127], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] - N[(t * N[(y * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.05 \cdot 10^{-127}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) - t \cdot \left(y \cdot \left(z \cdot 9\right)\right)\right)\\
\end{array}
\end{array}
if z < 3.0499999999999999e-127Initial program 91.0%
Taylor expanded in y around 0 97.4%
*-commutative97.4%
associate-*r*97.4%
Simplified97.4%
if 3.0499999999999999e-127 < z Initial program 95.1%
+-commutative95.1%
associate-*l*95.1%
fma-def95.1%
associate-*l*93.9%
*-commutative93.9%
associate-*l*93.8%
Simplified93.8%
associate-*r*93.9%
*-commutative93.9%
associate-*r*95.1%
cancel-sign-sub-inv95.1%
associate-*l*95.1%
Applied egg-rr95.1%
fma-udef95.1%
associate-*l*95.1%
*-commutative95.1%
associate-*l*95.1%
cancel-sign-sub-inv95.1%
+-commutative95.1%
associate-+l-95.1%
associate-*l*95.1%
*-commutative95.1%
associate-*l*95.1%
Applied egg-rr95.1%
Final simplification96.7%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= a -3.1e+77) (not (<= a 4.4e-96))) (- (* 27.0 (* a b)) (* 9.0 (* y (* z t)))) (- (* x 2.0) (* y (* t (* z 9.0))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.1e+77) || !(a <= 4.4e-96)) {
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
} else {
tmp = (x * 2.0) - (y * (t * (z * 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 ((a <= (-3.1d+77)) .or. (.not. (a <= 4.4d-96))) then
tmp = (27.0d0 * (a * b)) - (9.0d0 * (y * (z * t)))
else
tmp = (x * 2.0d0) - (y * (t * (z * 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 ((a <= -3.1e+77) || !(a <= 4.4e-96)) {
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
} else {
tmp = (x * 2.0) - (y * (t * (z * 9.0)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if (a <= -3.1e+77) or not (a <= 4.4e-96): tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t))) else: tmp = (x * 2.0) - (y * (t * (z * 9.0))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.1e+77) || !(a <= 4.4e-96)) tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * Float64(y * Float64(z * t)))); else tmp = Float64(Float64(x * 2.0) - Float64(y * Float64(t * Float64(z * 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 ((a <= -3.1e+77) || ~((a <= 4.4e-96)))
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
else
tmp = (x * 2.0) - (y * (t * (z * 9.0)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.1e+77], N[Not[LessEqual[a, 4.4e-96]], $MachinePrecision]], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(t * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.1 \cdot 10^{+77} \lor \neg \left(a \leq 4.4 \cdot 10^{-96}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - y \cdot \left(t \cdot \left(z \cdot 9\right)\right)\\
\end{array}
\end{array}
if a < -3.09999999999999999e77 or 4.39999999999999959e-96 < a Initial program 93.4%
Taylor expanded in x around 0 78.1%
if -3.09999999999999999e77 < a < 4.39999999999999959e-96Initial program 91.1%
Taylor expanded in a around 0 84.2%
*-commutative84.2%
*-commutative84.2%
associate-*r*84.3%
cancel-sign-sub-inv84.3%
associate-*l*83.5%
*-commutative83.5%
Applied egg-rr83.5%
Final simplification80.7%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.2e-37) (not (<= z 4e-15))) (+ (* x 2.0) (* -9.0 (* z (* y t)))) (- (* x 2.0) (* (* a b) -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 <= -1.2e-37) || !(z <= 4e-15)) {
tmp = (x * 2.0) + (-9.0 * (z * (y * 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.
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.2d-37)) .or. (.not. (z <= 4d-15))) then
tmp = (x * 2.0d0) + ((-9.0d0) * (z * (y * t)))
else
tmp = (x * 2.0d0) - ((a * b) * (-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 <= -1.2e-37) || !(z <= 4e-15)) {
tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
} else {
tmp = (x * 2.0) - ((a * b) * -27.0);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.2e-37) or not (z <= 4e-15): tmp = (x * 2.0) + (-9.0 * (z * (y * t))) else: tmp = (x * 2.0) - ((a * b) * -27.0) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.2e-37) || !(z <= 4e-15)) tmp = Float64(Float64(x * 2.0) + Float64(-9.0 * Float64(z * Float64(y * 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((z <= -1.2e-37) || ~((z <= 4e-15)))
tmp = (x * 2.0) + (-9.0 * (z * (y * 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. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.2e-37], N[Not[LessEqual[z, 4e-15]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(-9.0 * N[(z * N[(y * 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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-37} \lor \neg \left(z \leq 4 \cdot 10^{-15}\right):\\
\;\;\;\;x \cdot 2 + -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\end{array}
\end{array}
if z < -1.19999999999999995e-37 or 4.0000000000000003e-15 < z Initial program 87.3%
Taylor expanded in a around 0 74.7%
cancel-sign-sub-inv74.7%
*-commutative74.7%
metadata-eval74.7%
associate-*r*77.1%
Applied egg-rr77.1%
if -1.19999999999999995e-37 < z < 4.0000000000000003e-15Initial program 97.5%
associate-+l-97.5%
sub-neg97.5%
neg-mul-197.5%
metadata-eval97.5%
metadata-eval97.5%
cancel-sign-sub-inv97.5%
metadata-eval97.5%
*-lft-identity97.5%
associate-*l*99.6%
associate-*l*98.9%
Simplified98.9%
Taylor expanded in y around 0 81.2%
*-commutative81.2%
Simplified81.2%
Final simplification79.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 (<= z -4.1e-37)
(- (* x 2.0) (* 9.0 (* y (* z t))))
(if (<= z 5.4e-15)
(- (* x 2.0) (* (* a b) -27.0))
(+ (* x 2.0) (* -9.0 (* z (* 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 <= -4.1e-37) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if (z <= 5.4e-15) {
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.
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.1d-37)) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
else if (z <= 5.4d-15) 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;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.1e-37) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if (z <= 5.4e-15) {
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]) def code(x, y, z, t, a, b): tmp = 0 if z <= -4.1e-37: tmp = (x * 2.0) - (9.0 * (y * (z * t))) elif z <= 5.4e-15: 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]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.1e-37) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); elseif (z <= 5.4e-15) 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -4.1e-37)
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
elseif (z <= 5.4e-15)
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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.1e-37], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e-15], 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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{-37}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-15}:\\
\;\;\;\;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 z < -4.0999999999999998e-37Initial program 82.1%
Taylor expanded in a around 0 77.3%
if -4.0999999999999998e-37 < z < 5.40000000000000018e-15Initial program 97.5%
associate-+l-97.5%
sub-neg97.5%
neg-mul-197.5%
metadata-eval97.5%
metadata-eval97.5%
cancel-sign-sub-inv97.5%
metadata-eval97.5%
*-lft-identity97.5%
associate-*l*99.6%
associate-*l*98.9%
Simplified98.9%
Taylor expanded in y around 0 81.2%
*-commutative81.2%
Simplified81.2%
if 5.40000000000000018e-15 < z Initial program 93.5%
Taylor expanded in a around 0 71.7%
cancel-sign-sub-inv71.7%
*-commutative71.7%
metadata-eval71.7%
associate-*r*76.9%
Applied egg-rr76.9%
Final simplification79.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 (<= z -2.7e-37)
(- (* x 2.0) (* 9.0 (* y (* z t))))
(if (<= z 3.8e-15)
(- (* x 2.0) (* (* a b) -27.0))
(- (* x 2.0) (* t (* y (* z 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 <= -2.7e-37) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if (z <= 3.8e-15) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else {
tmp = (x * 2.0) - (t * (y * (z * 9.0)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
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.7d-37)) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
else if (z <= 3.8d-15) then
tmp = (x * 2.0d0) - ((a * b) * (-27.0d0))
else
tmp = (x * 2.0d0) - (t * (y * (z * 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 <= -2.7e-37) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if (z <= 3.8e-15) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else {
tmp = (x * 2.0) - (t * (y * (z * 9.0)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= -2.7e-37: tmp = (x * 2.0) - (9.0 * (y * (z * t))) elif z <= 3.8e-15: tmp = (x * 2.0) - ((a * b) * -27.0) else: tmp = (x * 2.0) - (t * (y * (z * 9.0))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.7e-37) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); elseif (z <= 3.8e-15) tmp = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -27.0)); else tmp = Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(z * 9.0)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -2.7e-37)
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
elseif (z <= 3.8e-15)
tmp = (x * 2.0) - ((a * b) * -27.0);
else
tmp = (x * 2.0) - (t * (y * (z * 9.0)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.7e-37], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e-15], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-37}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-15}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - t \cdot \left(y \cdot \left(z \cdot 9\right)\right)\\
\end{array}
\end{array}
if z < -2.70000000000000016e-37Initial program 82.1%
Taylor expanded in a around 0 77.3%
if -2.70000000000000016e-37 < z < 3.8000000000000002e-15Initial program 97.5%
associate-+l-97.5%
sub-neg97.5%
neg-mul-197.5%
metadata-eval97.5%
metadata-eval97.5%
cancel-sign-sub-inv97.5%
metadata-eval97.5%
*-lft-identity97.5%
associate-*l*99.6%
associate-*l*98.9%
Simplified98.9%
Taylor expanded in y around 0 81.2%
*-commutative81.2%
Simplified81.2%
if 3.8000000000000002e-15 < z Initial program 93.5%
+-commutative93.5%
associate-*l*93.5%
fma-def93.5%
associate-*l*91.8%
*-commutative91.8%
associate-*l*91.7%
Simplified91.7%
associate-*r*91.8%
*-commutative91.8%
associate-*r*93.5%
cancel-sign-sub-inv93.5%
associate-*l*93.5%
Applied egg-rr93.5%
fma-udef93.5%
associate-*l*93.5%
*-commutative93.5%
associate-*l*93.5%
cancel-sign-sub-inv93.5%
+-commutative93.5%
associate-+l-93.5%
associate-*l*93.5%
*-commutative93.5%
associate-*l*93.5%
Applied egg-rr93.5%
add-sqr-sqrt52.5%
pow252.5%
Applied egg-rr52.5%
Taylor expanded in y around inf 71.7%
associate-*r*71.8%
*-commutative71.8%
associate-*l*72.4%
*-commutative72.4%
*-commutative72.4%
associate-*l*72.4%
*-commutative72.4%
Simplified72.4%
Final simplification78.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 -8.6e-36)
(- (* x 2.0) (* (* z 9.0) (* y t)))
(if (<= z 5.8e-16)
(- (* x 2.0) (* (* a b) -27.0))
(- (* x 2.0) (* t (* y (* z 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 <= -8.6e-36) {
tmp = (x * 2.0) - ((z * 9.0) * (y * t));
} else if (z <= 5.8e-16) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else {
tmp = (x * 2.0) - (t * (y * (z * 9.0)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
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 <= (-8.6d-36)) then
tmp = (x * 2.0d0) - ((z * 9.0d0) * (y * t))
else if (z <= 5.8d-16) then
tmp = (x * 2.0d0) - ((a * b) * (-27.0d0))
else
tmp = (x * 2.0d0) - (t * (y * (z * 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 <= -8.6e-36) {
tmp = (x * 2.0) - ((z * 9.0) * (y * t));
} else if (z <= 5.8e-16) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else {
tmp = (x * 2.0) - (t * (y * (z * 9.0)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= -8.6e-36: tmp = (x * 2.0) - ((z * 9.0) * (y * t)) elif z <= 5.8e-16: tmp = (x * 2.0) - ((a * b) * -27.0) else: tmp = (x * 2.0) - (t * (y * (z * 9.0))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -8.6e-36) tmp = Float64(Float64(x * 2.0) - Float64(Float64(z * 9.0) * Float64(y * t))); elseif (z <= 5.8e-16) tmp = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -27.0)); else tmp = Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(z * 9.0)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -8.6e-36)
tmp = (x * 2.0) - ((z * 9.0) * (y * t));
elseif (z <= 5.8e-16)
tmp = (x * 2.0) - ((a * b) * -27.0);
else
tmp = (x * 2.0) - (t * (y * (z * 9.0)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -8.6e-36], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e-16], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{-36}:\\
\;\;\;\;x \cdot 2 - \left(z \cdot 9\right) \cdot \left(y \cdot t\right)\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-16}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - t \cdot \left(y \cdot \left(z \cdot 9\right)\right)\\
\end{array}
\end{array}
if z < -8.6000000000000004e-36Initial program 82.1%
+-commutative82.1%
associate-*l*82.1%
fma-def85.0%
associate-*l*97.1%
*-commutative97.1%
associate-*l*97.0%
Simplified97.0%
associate-*r*97.1%
*-commutative97.1%
associate-*r*85.0%
cancel-sign-sub-inv85.0%
associate-*l*83.6%
Applied egg-rr83.6%
fma-udef80.8%
associate-*l*80.8%
*-commutative80.8%
associate-*l*82.2%
cancel-sign-sub-inv82.2%
+-commutative82.2%
associate-+l-82.2%
associate-*l*80.8%
*-commutative80.8%
associate-*l*80.8%
Applied egg-rr80.8%
add-sqr-sqrt42.5%
pow242.5%
Applied egg-rr42.5%
Taylor expanded in y around inf 77.3%
associate-*r*77.3%
*-commutative77.3%
associate-*r*77.3%
*-commutative77.3%
*-commutative77.3%
*-commutative77.3%
associate-*l*76.0%
*-commutative76.0%
associate-*r*76.2%
*-commutative76.2%
Simplified76.2%
if -8.6000000000000004e-36 < z < 5.7999999999999996e-16Initial program 97.5%
associate-+l-97.5%
sub-neg97.5%
neg-mul-197.5%
metadata-eval97.5%
metadata-eval97.5%
cancel-sign-sub-inv97.5%
metadata-eval97.5%
*-lft-identity97.5%
associate-*l*99.6%
associate-*l*98.9%
Simplified98.9%
Taylor expanded in y around 0 81.2%
*-commutative81.2%
Simplified81.2%
if 5.7999999999999996e-16 < z Initial program 93.5%
+-commutative93.5%
associate-*l*93.5%
fma-def93.5%
associate-*l*91.8%
*-commutative91.8%
associate-*l*91.7%
Simplified91.7%
associate-*r*91.8%
*-commutative91.8%
associate-*r*93.5%
cancel-sign-sub-inv93.5%
associate-*l*93.5%
Applied egg-rr93.5%
fma-udef93.5%
associate-*l*93.5%
*-commutative93.5%
associate-*l*93.5%
cancel-sign-sub-inv93.5%
+-commutative93.5%
associate-+l-93.5%
associate-*l*93.5%
*-commutative93.5%
associate-*l*93.5%
Applied egg-rr93.5%
add-sqr-sqrt52.5%
pow252.5%
Applied egg-rr52.5%
Taylor expanded in y around inf 71.7%
associate-*r*71.8%
*-commutative71.8%
associate-*l*72.4%
*-commutative72.4%
*-commutative72.4%
associate-*l*72.4%
*-commutative72.4%
Simplified72.4%
Final simplification77.7%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= z -8.5e-15) (not (<= z 7.6e+97))) (* -9.0 (* y (* z t))) (+ (* x 2.0) (* a (* 27.0 b)))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.5e-15) || !(z <= 7.6e+97)) {
tmp = -9.0 * (y * (z * t));
} else {
tmp = (x * 2.0) + (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) :: tmp
if ((z <= (-8.5d-15)) .or. (.not. (z <= 7.6d+97))) then
tmp = (-9.0d0) * (y * (z * t))
else
tmp = (x * 2.0d0) + (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 tmp;
if ((z <= -8.5e-15) || !(z <= 7.6e+97)) {
tmp = -9.0 * (y * (z * t));
} else {
tmp = (x * 2.0) + (a * (27.0 * b));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if (z <= -8.5e-15) or not (z <= 7.6e+97): tmp = -9.0 * (y * (z * t)) else: tmp = (x * 2.0) + (a * (27.0 * b)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8.5e-15) || !(z <= 7.6e+97)) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); else tmp = Float64(Float64(x * 2.0) + 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)
tmp = 0.0;
if ((z <= -8.5e-15) || ~((z <= 7.6e+97)))
tmp = -9.0 * (y * (z * t));
else
tmp = (x * 2.0) + (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_] := If[Or[LessEqual[z, -8.5e-15], N[Not[LessEqual[z, 7.6e+97]], $MachinePrecision]], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-15} \lor \neg \left(z \leq 7.6 \cdot 10^{+97}\right):\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if z < -8.50000000000000007e-15 or 7.60000000000000071e97 < z Initial program 84.5%
Taylor expanded in x around 0 73.4%
Taylor expanded in a around 0 58.8%
if -8.50000000000000007e-15 < z < 7.60000000000000071e97Initial program 97.9%
associate-+l-97.9%
sub-neg97.9%
neg-mul-197.9%
metadata-eval97.9%
metadata-eval97.9%
cancel-sign-sub-inv97.9%
metadata-eval97.9%
*-lft-identity97.9%
associate-*l*99.0%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in y around 0 77.6%
*-commutative77.6%
Simplified77.6%
*-commutative77.6%
cancel-sign-sub-inv77.6%
metadata-eval77.6%
*-commutative77.6%
associate-*r*77.0%
*-commutative77.0%
Applied egg-rr77.0%
Final simplification69.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 (if (or (<= z -6.7e-15) (not (<= z 1.35e+95))) (* -9.0 (* y (* z t))) (- (* x 2.0) (* (* a b) -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 <= -6.7e-15) || !(z <= 1.35e+95)) {
tmp = -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.
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 <= (-6.7d-15)) .or. (.not. (z <= 1.35d+95))) then
tmp = (-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;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.7e-15) || !(z <= 1.35e+95)) {
tmp = -9.0 * (y * (z * t));
} else {
tmp = (x * 2.0) - ((a * b) * -27.0);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if (z <= -6.7e-15) or not (z <= 1.35e+95): tmp = -9.0 * (y * (z * t)) else: tmp = (x * 2.0) - ((a * b) * -27.0) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6.7e-15) || !(z <= 1.35e+95)) tmp = 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((z <= -6.7e-15) || ~((z <= 1.35e+95)))
tmp = -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. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6.7e-15], N[Not[LessEqual[z, 1.35e+95]], $MachinePrecision]], N[(-9.0 * N[(y * N[(z * t), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.7 \cdot 10^{-15} \lor \neg \left(z \leq 1.35 \cdot 10^{+95}\right):\\
\;\;\;\;-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 z < -6.70000000000000001e-15 or 1.35e95 < z Initial program 84.5%
Taylor expanded in x around 0 73.4%
Taylor expanded in a around 0 58.8%
if -6.70000000000000001e-15 < z < 1.35e95Initial program 97.9%
associate-+l-97.9%
sub-neg97.9%
neg-mul-197.9%
metadata-eval97.9%
metadata-eval97.9%
cancel-sign-sub-inv97.9%
metadata-eval97.9%
*-lft-identity97.9%
associate-*l*99.0%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in y around 0 77.6%
*-commutative77.6%
Simplified77.6%
Final simplification69.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 (or (<= a -9.2e+78) (not (<= a 7.2e-96))) (* 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 ((a <= -9.2e+78) || !(a <= 7.2e-96)) {
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 ((a <= (-9.2d+78)) .or. (.not. (a <= 7.2d-96))) 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 ((a <= -9.2e+78) || !(a <= 7.2e-96)) {
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 (a <= -9.2e+78) or not (a <= 7.2e-96): 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 ((a <= -9.2e+78) || !(a <= 7.2e-96)) 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 ((a <= -9.2e+78) || ~((a <= 7.2e-96)))
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[Or[LessEqual[a, -9.2e+78], N[Not[LessEqual[a, 7.2e-96]], $MachinePrecision]], 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}\;a \leq -9.2 \cdot 10^{+78} \lor \neg \left(a \leq 7.2 \cdot 10^{-96}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -9.2000000000000008e78 or 7.20000000000000016e-96 < a Initial program 93.3%
+-commutative93.3%
associate-*l*92.7%
fma-def94.1%
associate-*l*95.5%
*-commutative95.5%
associate-*l*95.5%
Simplified95.5%
associate-*r*95.5%
*-commutative95.5%
associate-*r*94.1%
cancel-sign-sub-inv94.1%
associate-*l*94.1%
Applied egg-rr94.1%
Taylor expanded in a around inf 56.9%
if -9.2000000000000008e78 < a < 7.20000000000000016e-96Initial program 91.2%
associate-+l-91.2%
fma-neg91.2%
neg-sub091.2%
associate-+l-91.2%
neg-sub091.2%
*-commutative91.2%
distribute-rgt-neg-in91.2%
fma-def91.2%
*-commutative91.2%
associate-*r*91.3%
distribute-rgt-neg-in91.3%
*-commutative91.3%
metadata-eval91.3%
Simplified91.3%
Taylor expanded in x around inf 37.2%
Final simplification47.6%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= a -4.4e+77) (* 27.0 (* a b)) (if (<= a 7.2e-96) (* 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 (a <= -4.4e+77) {
tmp = 27.0 * (a * b);
} else if (a <= 7.2e-96) {
tmp = x * 2.0;
} else {
tmp = 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 (a <= (-4.4d+77)) then
tmp = 27.0d0 * (a * b)
else if (a <= 7.2d-96) then
tmp = x * 2.0d0
else
tmp = 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 (a <= -4.4e+77) {
tmp = 27.0 * (a * b);
} else if (a <= 7.2e-96) {
tmp = x * 2.0;
} else {
tmp = b * (a * 27.0);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if a <= -4.4e+77: tmp = 27.0 * (a * b) elif a <= 7.2e-96: tmp = x * 2.0 else: tmp = 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 (a <= -4.4e+77) tmp = Float64(27.0 * Float64(a * b)); elseif (a <= 7.2e-96) tmp = Float64(x * 2.0); else tmp = 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 (a <= -4.4e+77)
tmp = 27.0 * (a * b);
elseif (a <= 7.2e-96)
tmp = x * 2.0;
else
tmp = 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[LessEqual[a, -4.4e+77], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.2e-96], N[(x * 2.0), $MachinePrecision], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.4 \cdot 10^{+77}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{-96}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if a < -4.4000000000000001e77Initial program 93.4%
+-commutative93.4%
associate-*l*93.4%
fma-def93.3%
associate-*l*96.5%
*-commutative96.5%
associate-*l*96.5%
Simplified96.5%
associate-*r*96.5%
*-commutative96.5%
associate-*r*93.3%
cancel-sign-sub-inv93.3%
associate-*l*93.3%
Applied egg-rr93.3%
Taylor expanded in a around inf 56.8%
if -4.4000000000000001e77 < a < 7.20000000000000016e-96Initial program 91.1%
associate-+l-91.1%
fma-neg91.1%
neg-sub091.1%
associate-+l-91.1%
neg-sub091.1%
*-commutative91.1%
distribute-rgt-neg-in91.1%
fma-def91.1%
*-commutative91.1%
associate-*r*91.2%
distribute-rgt-neg-in91.2%
*-commutative91.2%
metadata-eval91.2%
Simplified91.2%
Taylor expanded in x around inf 37.5%
if 7.20000000000000016e-96 < a Initial program 93.3%
+-commutative93.3%
associate-*l*92.2%
fma-def94.8%
associate-*l*94.8%
*-commutative94.8%
associate-*l*94.8%
Simplified94.8%
associate-*r*94.8%
*-commutative94.8%
associate-*r*94.8%
cancel-sign-sub-inv94.8%
associate-*l*94.9%
Applied egg-rr94.9%
Taylor expanded in a around inf 56.2%
associate-*r*56.2%
*-commutative56.2%
*-commutative56.2%
*-commutative56.2%
Simplified56.2%
Final simplification47.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 (* 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 92.3%
associate-+l-92.3%
fma-neg92.3%
neg-sub092.3%
associate-+l-92.3%
neg-sub092.3%
*-commutative92.3%
distribute-rgt-neg-in92.3%
fma-def93.1%
*-commutative93.1%
associate-*r*93.1%
distribute-rgt-neg-in93.1%
*-commutative93.1%
metadata-eval93.1%
Simplified93.1%
Taylor expanded in x around inf 27.4%
Final simplification27.4%
(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 2023229
(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)))