
(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 (<= z -5e-14) (fma a (* 27.0 b) (- (* x 2.0) (* y (* t (* z 9.0))))) (+ (- (* x 2.0) (* 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 <= -5e-14) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (y * (t * (z * 9.0)))));
} else {
tmp = ((x * 2.0) - (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 <= -5e-14) tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(y * Float64(t * Float64(z * 9.0))))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(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, -5e-14], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(t * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -5 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - y \cdot \left(t \cdot \left(z \cdot 9\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -5.0000000000000002e-14Initial program 93.4%
+-commutative93.4%
associate-*l*93.4%
fma-def94.7%
associate-*l*91.1%
*-commutative91.1%
associate-*l*91.2%
Simplified91.2%
Taylor expanded in y around 0 91.2%
*-commutative91.2%
*-commutative91.2%
associate-*l*91.1%
*-commutative91.1%
associate-*r*91.1%
*-commutative91.1%
*-commutative91.1%
Simplified91.1%
if -5.0000000000000002e-14 < z Initial program 97.1%
Final simplification95.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 -1e-122) (fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t))))) (+ (- (* x 2.0) (* 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 <= -1e-122) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
} else {
tmp = ((x * 2.0) - (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 <= -1e-122) tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(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, -1e-122], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -1 \cdot 10^{-122}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -1.00000000000000006e-122Initial program 94.9%
+-commutative94.9%
associate-*l*94.9%
fma-def95.9%
associate-*l*93.1%
*-commutative93.1%
associate-*l*93.2%
Simplified93.2%
if -1.00000000000000006e-122 < z Initial program 96.7%
Final simplification95.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 (* t (* z (* y 9.0)))))
(if (<= t_1 -2e+303)
(- (* x 2.0) (* 9.0 (* y (* z t))))
(+ (- (* x 2.0) t_1) (* b (* a 27.0))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (z * (y * 9.0));
double tmp;
if (t_1 <= -2e+303) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else {
tmp = ((x * 2.0) - t_1) + (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) :: t_1
real(8) :: tmp
t_1 = t * (z * (y * 9.0d0))
if (t_1 <= (-2d+303)) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
else
tmp = ((x * 2.0d0) - t_1) + (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 t_1 = t * (z * (y * 9.0));
double tmp;
if (t_1 <= -2e+303) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else {
tmp = ((x * 2.0) - t_1) + (b * (a * 27.0));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = t * (z * (y * 9.0)) tmp = 0 if t_1 <= -2e+303: tmp = (x * 2.0) - (9.0 * (y * (z * t))) else: tmp = ((x * 2.0) - t_1) + (b * (a * 27.0)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(z * Float64(y * 9.0))) tmp = 0.0 if (t_1 <= -2e+303) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); else tmp = Float64(Float64(Float64(x * 2.0) - t_1) + 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)
t_1 = t * (z * (y * 9.0));
tmp = 0.0;
if (t_1 <= -2e+303)
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
else
tmp = ((x * 2.0) - t_1) + (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_] := Block[{t$95$1 = N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+303], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+303}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t_1\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y 9) z) t) < -2e303Initial program 77.6%
+-commutative77.6%
associate-*l*77.6%
fma-def81.5%
associate-*l*96.5%
*-commutative96.5%
associate-*l*96.6%
Simplified96.6%
Taylor expanded in a around 0 96.6%
if -2e303 < (*.f64 (*.f64 (*.f64 y 9) z) t) Initial program 98.1%
Final simplification97.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 (* (* y (* z t)) -9.0)))
(if (<= b -4.2e-112)
(* b (* a 27.0))
(if (<= b -1.35e-290)
(* x 2.0)
(if (<= b 1.38e-158)
t_1
(if (<= b 1.32e-105)
(* x 2.0)
(if (<= b 5.5e-63)
t_1
(if (<= b 2.3e+20)
(* x 2.0)
(if (<= b 4.4e+79)
t_1
(if (<= b 3.95e+118) (* x 2.0) (* 27.0 (* a b))))))))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (z * t)) * -9.0;
double tmp;
if (b <= -4.2e-112) {
tmp = b * (a * 27.0);
} else if (b <= -1.35e-290) {
tmp = x * 2.0;
} else if (b <= 1.38e-158) {
tmp = t_1;
} else if (b <= 1.32e-105) {
tmp = x * 2.0;
} else if (b <= 5.5e-63) {
tmp = t_1;
} else if (b <= 2.3e+20) {
tmp = x * 2.0;
} else if (b <= 4.4e+79) {
tmp = t_1;
} else if (b <= 3.95e+118) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (y * (z * t)) * (-9.0d0)
if (b <= (-4.2d-112)) then
tmp = b * (a * 27.0d0)
else if (b <= (-1.35d-290)) then
tmp = x * 2.0d0
else if (b <= 1.38d-158) then
tmp = t_1
else if (b <= 1.32d-105) then
tmp = x * 2.0d0
else if (b <= 5.5d-63) then
tmp = t_1
else if (b <= 2.3d+20) then
tmp = x * 2.0d0
else if (b <= 4.4d+79) then
tmp = t_1
else if (b <= 3.95d+118) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (z * t)) * -9.0;
double tmp;
if (b <= -4.2e-112) {
tmp = b * (a * 27.0);
} else if (b <= -1.35e-290) {
tmp = x * 2.0;
} else if (b <= 1.38e-158) {
tmp = t_1;
} else if (b <= 1.32e-105) {
tmp = x * 2.0;
} else if (b <= 5.5e-63) {
tmp = t_1;
} else if (b <= 2.3e+20) {
tmp = x * 2.0;
} else if (b <= 4.4e+79) {
tmp = t_1;
} else if (b <= 3.95e+118) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = (y * (z * t)) * -9.0 tmp = 0 if b <= -4.2e-112: tmp = b * (a * 27.0) elif b <= -1.35e-290: tmp = x * 2.0 elif b <= 1.38e-158: tmp = t_1 elif b <= 1.32e-105: tmp = x * 2.0 elif b <= 5.5e-63: tmp = t_1 elif b <= 2.3e+20: tmp = x * 2.0 elif b <= 4.4e+79: tmp = t_1 elif b <= 3.95e+118: tmp = x * 2.0 else: tmp = 27.0 * (a * b) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * Float64(z * t)) * -9.0) tmp = 0.0 if (b <= -4.2e-112) tmp = Float64(b * Float64(a * 27.0)); elseif (b <= -1.35e-290) tmp = Float64(x * 2.0); elseif (b <= 1.38e-158) tmp = t_1; elseif (b <= 1.32e-105) tmp = Float64(x * 2.0); elseif (b <= 5.5e-63) tmp = t_1; elseif (b <= 2.3e+20) tmp = Float64(x * 2.0); elseif (b <= 4.4e+79) tmp = t_1; elseif (b <= 3.95e+118) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (y * (z * t)) * -9.0;
tmp = 0.0;
if (b <= -4.2e-112)
tmp = b * (a * 27.0);
elseif (b <= -1.35e-290)
tmp = x * 2.0;
elseif (b <= 1.38e-158)
tmp = t_1;
elseif (b <= 1.32e-105)
tmp = x * 2.0;
elseif (b <= 5.5e-63)
tmp = t_1;
elseif (b <= 2.3e+20)
tmp = x * 2.0;
elseif (b <= 4.4e+79)
tmp = t_1;
elseif (b <= 3.95e+118)
tmp = x * 2.0;
else
tmp = 27.0 * (a * b);
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision]}, If[LessEqual[b, -4.2e-112], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.35e-290], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 1.38e-158], t$95$1, If[LessEqual[b, 1.32e-105], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 5.5e-63], t$95$1, If[LessEqual[b, 2.3e+20], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 4.4e+79], t$95$1, If[LessEqual[b, 3.95e+118], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{if}\;b \leq -4.2 \cdot 10^{-112}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;b \leq -1.35 \cdot 10^{-290}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 1.38 \cdot 10^{-158}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 1.32 \cdot 10^{-105}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 5.5 \cdot 10^{-63}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{+20}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 4.4 \cdot 10^{+79}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 3.95 \cdot 10^{+118}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if b < -4.2000000000000001e-112Initial program 97.2%
+-commutative97.2%
associate-*l*97.2%
fma-def97.2%
associate-*l*93.5%
*-commutative93.5%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in a around inf 51.1%
associate-*r*51.2%
*-commutative51.2%
*-commutative51.2%
*-commutative51.2%
Simplified51.2%
if -4.2000000000000001e-112 < b < -1.34999999999999999e-290 or 1.37999999999999997e-158 < b < 1.32000000000000006e-105 or 5.50000000000000043e-63 < b < 2.3e20 or 4.3999999999999998e79 < b < 3.9500000000000002e118Initial program 94.6%
+-commutative94.6%
associate-*l*94.6%
fma-def94.6%
associate-*l*97.3%
*-commutative97.3%
associate-*l*97.4%
Simplified97.4%
Taylor expanded in x around inf 48.7%
if -1.34999999999999999e-290 < b < 1.37999999999999997e-158 or 1.32000000000000006e-105 < b < 5.50000000000000043e-63 or 2.3e20 < b < 4.3999999999999998e79Initial program 95.7%
+-commutative95.7%
associate-*l*95.7%
fma-def95.7%
associate-*l*94.6%
*-commutative94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in y around inf 49.0%
if 3.9500000000000002e118 < b Initial program 97.0%
+-commutative97.0%
associate-*l*97.1%
fma-def99.8%
associate-*l*94.6%
*-commutative94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in a around inf 61.2%
Final simplification51.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 (* (* y (* z t)) -9.0)))
(if (<= b -1.45e-111)
(* b (* a 27.0))
(if (<= b -1.9e-290)
(* x 2.0)
(if (<= b 4.3e-157)
(* y (* (* z t) -9.0))
(if (<= b 3.45e-105)
(* x 2.0)
(if (<= b 6.5e-62)
t_1
(if (<= b 1.95e+20)
(* x 2.0)
(if (<= b 1.35e+79)
t_1
(if (<= b 3.2e+118) (* x 2.0) (* 27.0 (* a b))))))))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (z * t)) * -9.0;
double tmp;
if (b <= -1.45e-111) {
tmp = b * (a * 27.0);
} else if (b <= -1.9e-290) {
tmp = x * 2.0;
} else if (b <= 4.3e-157) {
tmp = y * ((z * t) * -9.0);
} else if (b <= 3.45e-105) {
tmp = x * 2.0;
} else if (b <= 6.5e-62) {
tmp = t_1;
} else if (b <= 1.95e+20) {
tmp = x * 2.0;
} else if (b <= 1.35e+79) {
tmp = t_1;
} else if (b <= 3.2e+118) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (y * (z * t)) * (-9.0d0)
if (b <= (-1.45d-111)) then
tmp = b * (a * 27.0d0)
else if (b <= (-1.9d-290)) then
tmp = x * 2.0d0
else if (b <= 4.3d-157) then
tmp = y * ((z * t) * (-9.0d0))
else if (b <= 3.45d-105) then
tmp = x * 2.0d0
else if (b <= 6.5d-62) then
tmp = t_1
else if (b <= 1.95d+20) then
tmp = x * 2.0d0
else if (b <= 1.35d+79) then
tmp = t_1
else if (b <= 3.2d+118) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (z * t)) * -9.0;
double tmp;
if (b <= -1.45e-111) {
tmp = b * (a * 27.0);
} else if (b <= -1.9e-290) {
tmp = x * 2.0;
} else if (b <= 4.3e-157) {
tmp = y * ((z * t) * -9.0);
} else if (b <= 3.45e-105) {
tmp = x * 2.0;
} else if (b <= 6.5e-62) {
tmp = t_1;
} else if (b <= 1.95e+20) {
tmp = x * 2.0;
} else if (b <= 1.35e+79) {
tmp = t_1;
} else if (b <= 3.2e+118) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = (y * (z * t)) * -9.0 tmp = 0 if b <= -1.45e-111: tmp = b * (a * 27.0) elif b <= -1.9e-290: tmp = x * 2.0 elif b <= 4.3e-157: tmp = y * ((z * t) * -9.0) elif b <= 3.45e-105: tmp = x * 2.0 elif b <= 6.5e-62: tmp = t_1 elif b <= 1.95e+20: tmp = x * 2.0 elif b <= 1.35e+79: tmp = t_1 elif b <= 3.2e+118: tmp = x * 2.0 else: tmp = 27.0 * (a * b) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * Float64(z * t)) * -9.0) tmp = 0.0 if (b <= -1.45e-111) tmp = Float64(b * Float64(a * 27.0)); elseif (b <= -1.9e-290) tmp = Float64(x * 2.0); elseif (b <= 4.3e-157) tmp = Float64(y * Float64(Float64(z * t) * -9.0)); elseif (b <= 3.45e-105) tmp = Float64(x * 2.0); elseif (b <= 6.5e-62) tmp = t_1; elseif (b <= 1.95e+20) tmp = Float64(x * 2.0); elseif (b <= 1.35e+79) tmp = t_1; elseif (b <= 3.2e+118) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (y * (z * t)) * -9.0;
tmp = 0.0;
if (b <= -1.45e-111)
tmp = b * (a * 27.0);
elseif (b <= -1.9e-290)
tmp = x * 2.0;
elseif (b <= 4.3e-157)
tmp = y * ((z * t) * -9.0);
elseif (b <= 3.45e-105)
tmp = x * 2.0;
elseif (b <= 6.5e-62)
tmp = t_1;
elseif (b <= 1.95e+20)
tmp = x * 2.0;
elseif (b <= 1.35e+79)
tmp = t_1;
elseif (b <= 3.2e+118)
tmp = x * 2.0;
else
tmp = 27.0 * (a * b);
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision]}, If[LessEqual[b, -1.45e-111], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.9e-290], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 4.3e-157], N[(y * N[(N[(z * t), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.45e-105], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 6.5e-62], t$95$1, If[LessEqual[b, 1.95e+20], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 1.35e+79], t$95$1, If[LessEqual[b, 3.2e+118], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{if}\;b \leq -1.45 \cdot 10^{-111}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;b \leq -1.9 \cdot 10^{-290}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 4.3 \cdot 10^{-157}:\\
\;\;\;\;y \cdot \left(\left(z \cdot t\right) \cdot -9\right)\\
\mathbf{elif}\;b \leq 3.45 \cdot 10^{-105}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 6.5 \cdot 10^{-62}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 1.95 \cdot 10^{+20}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 1.35 \cdot 10^{+79}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 3.2 \cdot 10^{+118}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if b < -1.45000000000000001e-111Initial program 97.2%
+-commutative97.2%
associate-*l*97.2%
fma-def97.2%
associate-*l*93.5%
*-commutative93.5%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in a around inf 51.1%
associate-*r*51.2%
*-commutative51.2%
*-commutative51.2%
*-commutative51.2%
Simplified51.2%
if -1.45000000000000001e-111 < b < -1.89999999999999988e-290 or 4.2999999999999998e-157 < b < 3.45000000000000014e-105 or 6.50000000000000026e-62 < b < 1.95e20 or 1.35e79 < b < 3.20000000000000016e118Initial program 94.6%
+-commutative94.6%
associate-*l*94.6%
fma-def94.6%
associate-*l*97.3%
*-commutative97.3%
associate-*l*97.4%
Simplified97.4%
Taylor expanded in x around inf 48.7%
if -1.89999999999999988e-290 < b < 4.2999999999999998e-157Initial program 93.2%
+-commutative93.2%
associate-*l*93.2%
fma-def93.2%
associate-*l*91.6%
*-commutative91.6%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in y around inf 52.1%
*-commutative52.1%
*-commutative52.1%
associate-*l*52.0%
*-commutative52.0%
*-commutative52.0%
Simplified52.0%
if 3.45000000000000014e-105 < b < 6.50000000000000026e-62 or 1.95e20 < b < 1.35e79Initial program 99.9%
+-commutative99.9%
associate-*l*99.9%
fma-def99.9%
associate-*l*99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around inf 43.7%
if 3.20000000000000016e118 < b Initial program 97.0%
+-commutative97.0%
associate-*l*97.1%
fma-def99.8%
associate-*l*94.6%
*-commutative94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in a around inf 61.2%
Final simplification51.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 (* y (* z (* t -9.0)))))
(if (<= b -1.15e-112)
(* b (* a 27.0))
(if (<= b -2.3e-290)
(* x 2.0)
(if (<= b 8.5e-162)
t_1
(if (<= b 6.4e-99)
(* x 2.0)
(if (<= b 2.15e-61)
(* (* y (* z t)) -9.0)
(if (<= b 4.1e+20)
(* x 2.0)
(if (<= b 1.55e+80)
t_1
(if (<= b 3.2e+118) (* x 2.0) (* 27.0 (* a b))))))))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (z * (t * -9.0));
double tmp;
if (b <= -1.15e-112) {
tmp = b * (a * 27.0);
} else if (b <= -2.3e-290) {
tmp = x * 2.0;
} else if (b <= 8.5e-162) {
tmp = t_1;
} else if (b <= 6.4e-99) {
tmp = x * 2.0;
} else if (b <= 2.15e-61) {
tmp = (y * (z * t)) * -9.0;
} else if (b <= 4.1e+20) {
tmp = x * 2.0;
} else if (b <= 1.55e+80) {
tmp = t_1;
} else if (b <= 3.2e+118) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = y * (z * (t * (-9.0d0)))
if (b <= (-1.15d-112)) then
tmp = b * (a * 27.0d0)
else if (b <= (-2.3d-290)) then
tmp = x * 2.0d0
else if (b <= 8.5d-162) then
tmp = t_1
else if (b <= 6.4d-99) then
tmp = x * 2.0d0
else if (b <= 2.15d-61) then
tmp = (y * (z * t)) * (-9.0d0)
else if (b <= 4.1d+20) then
tmp = x * 2.0d0
else if (b <= 1.55d+80) then
tmp = t_1
else if (b <= 3.2d+118) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (z * (t * -9.0));
double tmp;
if (b <= -1.15e-112) {
tmp = b * (a * 27.0);
} else if (b <= -2.3e-290) {
tmp = x * 2.0;
} else if (b <= 8.5e-162) {
tmp = t_1;
} else if (b <= 6.4e-99) {
tmp = x * 2.0;
} else if (b <= 2.15e-61) {
tmp = (y * (z * t)) * -9.0;
} else if (b <= 4.1e+20) {
tmp = x * 2.0;
} else if (b <= 1.55e+80) {
tmp = t_1;
} else if (b <= 3.2e+118) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = y * (z * (t * -9.0)) tmp = 0 if b <= -1.15e-112: tmp = b * (a * 27.0) elif b <= -2.3e-290: tmp = x * 2.0 elif b <= 8.5e-162: tmp = t_1 elif b <= 6.4e-99: tmp = x * 2.0 elif b <= 2.15e-61: tmp = (y * (z * t)) * -9.0 elif b <= 4.1e+20: tmp = x * 2.0 elif b <= 1.55e+80: tmp = t_1 elif b <= 3.2e+118: tmp = x * 2.0 else: tmp = 27.0 * (a * b) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(z * Float64(t * -9.0))) tmp = 0.0 if (b <= -1.15e-112) tmp = Float64(b * Float64(a * 27.0)); elseif (b <= -2.3e-290) tmp = Float64(x * 2.0); elseif (b <= 8.5e-162) tmp = t_1; elseif (b <= 6.4e-99) tmp = Float64(x * 2.0); elseif (b <= 2.15e-61) tmp = Float64(Float64(y * Float64(z * t)) * -9.0); elseif (b <= 4.1e+20) tmp = Float64(x * 2.0); elseif (b <= 1.55e+80) tmp = t_1; elseif (b <= 3.2e+118) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = y * (z * (t * -9.0));
tmp = 0.0;
if (b <= -1.15e-112)
tmp = b * (a * 27.0);
elseif (b <= -2.3e-290)
tmp = x * 2.0;
elseif (b <= 8.5e-162)
tmp = t_1;
elseif (b <= 6.4e-99)
tmp = x * 2.0;
elseif (b <= 2.15e-61)
tmp = (y * (z * t)) * -9.0;
elseif (b <= 4.1e+20)
tmp = x * 2.0;
elseif (b <= 1.55e+80)
tmp = t_1;
elseif (b <= 3.2e+118)
tmp = x * 2.0;
else
tmp = 27.0 * (a * b);
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.15e-112], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -2.3e-290], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 8.5e-162], t$95$1, If[LessEqual[b, 6.4e-99], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 2.15e-61], N[(N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision], If[LessEqual[b, 4.1e+20], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 1.55e+80], t$95$1, If[LessEqual[b, 3.2e+118], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{if}\;b \leq -1.15 \cdot 10^{-112}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;b \leq -2.3 \cdot 10^{-290}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 8.5 \cdot 10^{-162}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 6.4 \cdot 10^{-99}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 2.15 \cdot 10^{-61}:\\
\;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{elif}\;b \leq 4.1 \cdot 10^{+20}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 1.55 \cdot 10^{+80}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 3.2 \cdot 10^{+118}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if b < -1.14999999999999995e-112Initial program 97.2%
+-commutative97.2%
associate-*l*97.2%
fma-def97.2%
associate-*l*93.5%
*-commutative93.5%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in a around inf 51.1%
associate-*r*51.2%
*-commutative51.2%
*-commutative51.2%
*-commutative51.2%
Simplified51.2%
if -1.14999999999999995e-112 < b < -2.3000000000000001e-290 or 8.49999999999999955e-162 < b < 6.4000000000000001e-99 or 2.1500000000000002e-61 < b < 4.1e20 or 1.54999999999999994e80 < b < 3.20000000000000016e118Initial program 94.7%
+-commutative94.7%
associate-*l*94.7%
fma-def94.7%
associate-*l*97.3%
*-commutative97.3%
associate-*l*97.4%
Simplified97.4%
Taylor expanded in x around inf 49.4%
if -2.3000000000000001e-290 < b < 8.49999999999999955e-162 or 4.1e20 < b < 1.54999999999999994e80Initial program 95.0%
+-commutative95.0%
associate-*l*95.1%
fma-def95.0%
associate-*l*93.8%
*-commutative93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in y around inf 49.5%
*-commutative49.5%
*-commutative49.5%
associate-*l*49.4%
associate-*r*49.5%
Simplified49.5%
if 6.4000000000000001e-99 < b < 2.1500000000000002e-61Initial program 100.0%
+-commutative100.0%
associate-*l*100.0%
fma-def100.0%
associate-*l*99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around inf 51.3%
if 3.20000000000000016e118 < b Initial program 97.0%
+-commutative97.0%
associate-*l*97.1%
fma-def99.8%
associate-*l*94.6%
*-commutative94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in a around inf 61.2%
Final simplification51.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 -4e-129) (+ (* x 2.0) (- (* a (* 27.0 b)) (* (* y 9.0) (* z t)))) (+ (- (* x 2.0) (* 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 <= -4e-129) {
tmp = (x * 2.0) + ((a * (27.0 * b)) - ((y * 9.0) * (z * t)));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.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 <= (-4d-129)) then
tmp = (x * 2.0d0) + ((a * (27.0d0 * b)) - ((y * 9.0d0) * (z * t)))
else
tmp = ((x * 2.0d0) - (t * (z * (y * 9.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 <= -4e-129) {
tmp = (x * 2.0) + ((a * (27.0 * b)) - ((y * 9.0) * (z * t)));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.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 <= -4e-129: tmp = (x * 2.0) + ((a * (27.0 * b)) - ((y * 9.0) * (z * t))) else: tmp = ((x * 2.0) - (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 <= -4e-129) tmp = Float64(Float64(x * 2.0) + Float64(Float64(a * Float64(27.0 * b)) - Float64(Float64(y * 9.0) * Float64(z * t)))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.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 <= -4e-129)
tmp = (x * 2.0) + ((a * (27.0 * b)) - ((y * 9.0) * (z * t)));
else
tmp = ((x * 2.0) - (t * (z * (y * 9.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[LessEqual[z, -4e-129], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 \cdot 10^{-129}:\\
\;\;\;\;x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -3.9999999999999997e-129Initial program 94.9%
associate-+l-94.9%
sub-neg94.9%
neg-mul-194.9%
metadata-eval94.9%
metadata-eval94.9%
cancel-sign-sub-inv94.9%
metadata-eval94.9%
*-lft-identity94.9%
associate-*l*92.1%
associate-*l*92.1%
Simplified92.1%
if -3.9999999999999997e-129 < z Initial program 96.7%
Final simplification95.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.02e-23)
(- (* x 2.0) (* 9.0 (* y (* z t))))
(if (<= z 5.8e-52)
(- (* x 2.0) (* a (* b -27.0)))
(+ (* -9.0 (* t (* z y))) (* 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 <= -1.02e-23) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if (z <= 5.8e-52) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (-9.0 * (t * (z * y))) + (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 <= (-1.02d-23)) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
else if (z <= 5.8d-52) then
tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
else
tmp = ((-9.0d0) * (t * (z * y))) + (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 <= -1.02e-23) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if (z <= 5.8e-52) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (-9.0 * (t * (z * y))) + (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 <= -1.02e-23: tmp = (x * 2.0) - (9.0 * (y * (z * t))) elif z <= 5.8e-52: tmp = (x * 2.0) - (a * (b * -27.0)) else: tmp = (-9.0 * (t * (z * y))) + (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 <= -1.02e-23) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); elseif (z <= 5.8e-52) tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0))); else tmp = Float64(Float64(-9.0 * Float64(t * Float64(z * y))) + 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 <= -1.02e-23)
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
elseif (z <= 5.8e-52)
tmp = (x * 2.0) - (a * (b * -27.0));
else
tmp = (-9.0 * (t * (z * y))) + (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[z, -1.02e-23], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e-52], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $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 -1.02 \cdot 10^{-23}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-52}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -1.02000000000000005e-23Initial program 93.4%
+-commutative93.4%
associate-*l*93.4%
fma-def94.7%
associate-*l*91.1%
*-commutative91.1%
associate-*l*91.2%
Simplified91.2%
Taylor expanded in a around 0 74.9%
if -1.02000000000000005e-23 < z < 5.8000000000000003e-52Initial program 97.3%
associate-+l-97.3%
sub-neg97.3%
neg-mul-197.3%
metadata-eval97.3%
metadata-eval97.3%
cancel-sign-sub-inv97.3%
metadata-eval97.3%
*-lft-identity97.3%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 81.9%
*-commutative81.9%
associate-*r*81.9%
Simplified81.9%
if 5.8000000000000003e-52 < z Initial program 96.7%
+-commutative96.7%
associate-*l*96.7%
fma-def96.7%
associate-*l*91.0%
*-commutative91.0%
associate-*l*91.1%
Simplified91.1%
Taylor expanded in x around 0 68.2%
cancel-sign-sub-inv68.2%
associate-*r*68.3%
metadata-eval68.3%
*-commutative68.3%
associate-*r*72.5%
Applied egg-rr72.5%
Final simplification77.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 (<= z -3.1e-24)
(- (* x 2.0) (* 9.0 (* y (* z t))))
(if (<= z 7.6e-47)
(- (* x 2.0) (* a (* b -27.0)))
(+ (* t (* y (* z -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 <= -3.1e-24) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if (z <= 7.6e-47) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (t * (y * (z * -9.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 <= (-3.1d-24)) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
else if (z <= 7.6d-47) then
tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
else
tmp = (t * (y * (z * (-9.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 <= -3.1e-24) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if (z <= 7.6e-47) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (t * (y * (z * -9.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 <= -3.1e-24: tmp = (x * 2.0) - (9.0 * (y * (z * t))) elif z <= 7.6e-47: tmp = (x * 2.0) - (a * (b * -27.0)) else: tmp = (t * (y * (z * -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 <= -3.1e-24) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); elseif (z <= 7.6e-47) tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0))); else tmp = Float64(Float64(t * Float64(y * Float64(z * -9.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 <= -3.1e-24)
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
elseif (z <= 7.6e-47)
tmp = (x * 2.0) - (a * (b * -27.0));
else
tmp = (t * (y * (z * -9.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[LessEqual[z, -3.1e-24], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.6e-47], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $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 -3.1 \cdot 10^{-24}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-47}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -3.1e-24Initial program 93.4%
+-commutative93.4%
associate-*l*93.4%
fma-def94.7%
associate-*l*91.1%
*-commutative91.1%
associate-*l*91.2%
Simplified91.2%
Taylor expanded in a around 0 74.9%
if -3.1e-24 < z < 7.60000000000000029e-47Initial program 97.4%
associate-+l-97.4%
sub-neg97.4%
neg-mul-197.4%
metadata-eval97.4%
metadata-eval97.4%
cancel-sign-sub-inv97.4%
metadata-eval97.4%
*-lft-identity97.4%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 81.4%
*-commutative81.4%
associate-*r*81.3%
Simplified81.3%
if 7.60000000000000029e-47 < z Initial program 96.6%
+-commutative96.6%
associate-*l*96.6%
fma-def96.6%
associate-*l*90.8%
*-commutative90.8%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in x around 0 67.2%
cancel-sign-sub-inv67.2%
associate-*r*67.3%
metadata-eval67.3%
*-commutative67.3%
associate-*r*71.6%
Applied egg-rr71.6%
Taylor expanded in y around 0 67.3%
associate-*r*67.2%
*-commutative67.2%
associate-*r*71.6%
associate-*r*71.6%
*-commutative71.6%
*-commutative71.6%
associate-*l*71.7%
Simplified71.7%
Final simplification77.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.3e-30)
(- (* 27.0 (* a b)) (* 9.0 (* y (* z t))))
(if (<= z 5e-51)
(- (* x 2.0) (* a (* b -27.0)))
(+ (* t (* y (* z -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 <= -4.3e-30) {
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
} else if (z <= 5e-51) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (t * (y * (z * -9.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.3d-30)) then
tmp = (27.0d0 * (a * b)) - (9.0d0 * (y * (z * t)))
else if (z <= 5d-51) then
tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
else
tmp = (t * (y * (z * (-9.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.3e-30) {
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
} else if (z <= 5e-51) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (t * (y * (z * -9.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.3e-30: tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t))) elif z <= 5e-51: tmp = (x * 2.0) - (a * (b * -27.0)) else: tmp = (t * (y * (z * -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 <= -4.3e-30) tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * Float64(y * Float64(z * t)))); elseif (z <= 5e-51) tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0))); else tmp = Float64(Float64(t * Float64(y * Float64(z * -9.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.3e-30)
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
elseif (z <= 5e-51)
tmp = (x * 2.0) - (a * (b * -27.0));
else
tmp = (t * (y * (z * -9.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[LessEqual[z, -4.3e-30], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e-51], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $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.3 \cdot 10^{-30}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-51}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -4.29999999999999966e-30Initial program 93.6%
+-commutative93.6%
associate-*l*93.6%
fma-def94.9%
associate-*l*91.4%
*-commutative91.4%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in x around 0 66.9%
if -4.29999999999999966e-30 < z < 5.00000000000000004e-51Initial program 97.2%
associate-+l-97.2%
sub-neg97.2%
neg-mul-197.2%
metadata-eval97.2%
metadata-eval97.2%
cancel-sign-sub-inv97.2%
metadata-eval97.2%
*-lft-identity97.2%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 81.6%
*-commutative81.6%
associate-*r*81.6%
Simplified81.6%
if 5.00000000000000004e-51 < z Initial program 96.7%
+-commutative96.7%
associate-*l*96.7%
fma-def96.7%
associate-*l*91.0%
*-commutative91.0%
associate-*l*91.1%
Simplified91.1%
Taylor expanded in x around 0 68.2%
cancel-sign-sub-inv68.2%
associate-*r*68.3%
metadata-eval68.3%
*-commutative68.3%
associate-*r*72.5%
Applied egg-rr72.5%
Taylor expanded in y around 0 68.3%
associate-*r*68.3%
*-commutative68.3%
associate-*r*72.5%
associate-*r*72.5%
*-commutative72.5%
*-commutative72.5%
associate-*l*72.6%
Simplified72.6%
Final simplification74.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 (if (<= z -1.7e-23) (* y (* (* z t) -9.0)) (if (<= z 1e-34) (- (* x 2.0) (* a (* b -27.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.7e-23) {
tmp = y * ((z * t) * -9.0);
} else if (z <= 1e-34) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (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.7d-23)) then
tmp = y * ((z * t) * (-9.0d0))
else if (z <= 1d-34) then
tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
else
tmp = (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.7e-23) {
tmp = y * ((z * t) * -9.0);
} else if (z <= 1e-34) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (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.7e-23: tmp = y * ((z * t) * -9.0) elif z <= 1e-34: tmp = (x * 2.0) - (a * (b * -27.0)) else: tmp = (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.7e-23) tmp = Float64(y * Float64(Float64(z * t) * -9.0)); elseif (z <= 1e-34) tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0))); else tmp = Float64(Float64(y * Float64(z * 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.7e-23)
tmp = y * ((z * t) * -9.0);
elseif (z <= 1e-34)
tmp = (x * 2.0) - (a * (b * -27.0));
else
tmp = (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.7e-23], N[(y * N[(N[(z * t), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e-34], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-23}:\\
\;\;\;\;y \cdot \left(\left(z \cdot t\right) \cdot -9\right)\\
\mathbf{elif}\;z \leq 10^{-34}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\end{array}
\end{array}
if z < -1.7e-23Initial program 93.4%
+-commutative93.4%
associate-*l*93.4%
fma-def94.7%
associate-*l*91.1%
*-commutative91.1%
associate-*l*91.2%
Simplified91.2%
Taylor expanded in y around inf 51.1%
*-commutative51.1%
*-commutative51.1%
associate-*l*51.1%
*-commutative51.1%
*-commutative51.1%
Simplified51.1%
if -1.7e-23 < z < 9.99999999999999928e-35Initial program 97.4%
associate-+l-97.4%
sub-neg97.4%
neg-mul-197.4%
metadata-eval97.4%
metadata-eval97.4%
cancel-sign-sub-inv97.4%
metadata-eval97.4%
*-lft-identity97.4%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 81.2%
*-commutative81.2%
associate-*r*81.2%
Simplified81.2%
if 9.99999999999999928e-35 < z Initial program 96.4%
+-commutative96.4%
associate-*l*96.4%
fma-def96.4%
associate-*l*90.2%
*-commutative90.2%
associate-*l*90.2%
Simplified90.2%
Taylor expanded in y around inf 39.8%
Final simplification63.0%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (* z t))))
(if (<= y -3.7e+76)
(- (* x 2.0) (* 9.0 t_1))
(if (<= y 1.5e-109) (- (* x 2.0) (* a (* b -27.0))) (* t_1 -9.0)))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (z * t);
double tmp;
if (y <= -3.7e+76) {
tmp = (x * 2.0) - (9.0 * t_1);
} else if (y <= 1.5e-109) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = t_1 * -9.0;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = y * (z * t)
if (y <= (-3.7d+76)) then
tmp = (x * 2.0d0) - (9.0d0 * t_1)
else if (y <= 1.5d-109) then
tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
else
tmp = t_1 * (-9.0d0)
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (z * t);
double tmp;
if (y <= -3.7e+76) {
tmp = (x * 2.0) - (9.0 * t_1);
} else if (y <= 1.5e-109) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = t_1 * -9.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = y * (z * t) tmp = 0 if y <= -3.7e+76: tmp = (x * 2.0) - (9.0 * t_1) elif y <= 1.5e-109: tmp = (x * 2.0) - (a * (b * -27.0)) else: tmp = t_1 * -9.0 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(z * t)) tmp = 0.0 if (y <= -3.7e+76) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * t_1)); elseif (y <= 1.5e-109) tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0))); else tmp = Float64(t_1 * -9.0); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = y * (z * t);
tmp = 0.0;
if (y <= -3.7e+76)
tmp = (x * 2.0) - (9.0 * t_1);
elseif (y <= 1.5e-109)
tmp = (x * 2.0) - (a * (b * -27.0));
else
tmp = t_1 * -9.0;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.7e+76], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e-109], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * -9.0), $MachinePrecision]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(z \cdot t\right)\\
\mathbf{if}\;y \leq -3.7 \cdot 10^{+76}:\\
\;\;\;\;x \cdot 2 - 9 \cdot t_1\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-109}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot -9\\
\end{array}
\end{array}
if y < -3.6999999999999999e76Initial program 99.7%
+-commutative99.7%
associate-*l*99.7%
fma-def99.7%
associate-*l*99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around 0 77.9%
if -3.6999999999999999e76 < y < 1.50000000000000011e-109Initial program 96.9%
associate-+l-96.9%
sub-neg96.9%
neg-mul-196.9%
metadata-eval96.9%
metadata-eval96.9%
cancel-sign-sub-inv96.9%
metadata-eval96.9%
*-lft-identity96.9%
associate-*l*91.4%
associate-*l*91.4%
Simplified91.4%
Taylor expanded in y around 0 77.7%
*-commutative77.7%
associate-*r*77.7%
Simplified77.7%
if 1.50000000000000011e-109 < y Initial program 92.7%
+-commutative92.7%
associate-*l*92.7%
fma-def92.7%
associate-*l*97.6%
*-commutative97.6%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in y around inf 50.5%
Final simplification69.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 (or (<= b -1.45e-111) (not (<= b 3.2e+118))) (* 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 ((b <= -1.45e-111) || !(b <= 3.2e+118)) {
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 ((b <= (-1.45d-111)) .or. (.not. (b <= 3.2d+118))) 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 ((b <= -1.45e-111) || !(b <= 3.2e+118)) {
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 (b <= -1.45e-111) or not (b <= 3.2e+118): 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 ((b <= -1.45e-111) || !(b <= 3.2e+118)) 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 ((b <= -1.45e-111) || ~((b <= 3.2e+118)))
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[b, -1.45e-111], N[Not[LessEqual[b, 3.2e+118]], $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}\;b \leq -1.45 \cdot 10^{-111} \lor \neg \left(b \leq 3.2 \cdot 10^{+118}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -1.45000000000000001e-111 or 3.20000000000000016e118 < b Initial program 97.1%
+-commutative97.1%
associate-*l*97.1%
fma-def98.0%
associate-*l*93.9%
*-commutative93.9%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in a around inf 54.5%
if -1.45000000000000001e-111 < b < 3.20000000000000016e118Initial program 95.1%
+-commutative95.1%
associate-*l*95.1%
fma-def95.1%
associate-*l*96.0%
*-commutative96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in x around inf 40.8%
Final simplification46.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 (<= b -1.45e-111) (* b (* a 27.0)) (if (<= b 6.3e+119) (* x 2.0) (* 27.0 (* a b)))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.45e-111) {
tmp = b * (a * 27.0);
} else if (b <= 6.3e+119) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-1.45d-111)) then
tmp = b * (a * 27.0d0)
else if (b <= 6.3d+119) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.45e-111) {
tmp = b * (a * 27.0);
} else if (b <= 6.3e+119) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if b <= -1.45e-111: tmp = b * (a * 27.0) elif b <= 6.3e+119: tmp = x * 2.0 else: tmp = 27.0 * (a * b) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.45e-111) tmp = Float64(b * Float64(a * 27.0)); elseif (b <= 6.3e+119) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -1.45e-111)
tmp = b * (a * 27.0);
elseif (b <= 6.3e+119)
tmp = x * 2.0;
else
tmp = 27.0 * (a * b);
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.45e-111], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.3e+119], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.45 \cdot 10^{-111}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;b \leq 6.3 \cdot 10^{+119}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if b < -1.45000000000000001e-111Initial program 97.2%
+-commutative97.2%
associate-*l*97.2%
fma-def97.2%
associate-*l*93.5%
*-commutative93.5%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in a around inf 51.1%
associate-*r*51.2%
*-commutative51.2%
*-commutative51.2%
*-commutative51.2%
Simplified51.2%
if -1.45000000000000001e-111 < b < 6.2999999999999998e119Initial program 95.1%
+-commutative95.1%
associate-*l*95.1%
fma-def95.1%
associate-*l*96.0%
*-commutative96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in x around inf 40.8%
if 6.2999999999999998e119 < b Initial program 97.0%
+-commutative97.0%
associate-*l*97.1%
fma-def99.8%
associate-*l*94.6%
*-commutative94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in a around inf 61.2%
Final simplification46.8%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* x 2.0))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * 2.0d0
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): return x * 2.0
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
x \cdot 2
\end{array}
Initial program 96.0%
+-commutative96.0%
associate-*l*96.0%
fma-def96.4%
associate-*l*95.1%
*-commutative95.1%
associate-*l*95.1%
Simplified95.1%
Taylor expanded in x around inf 33.2%
Final simplification33.2%
(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 2023221
(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)))