
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * 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 + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * 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 + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* (* z a) b)))) (if (<= t_1 INFINITY) t_1 (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(z * a) * b)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(y + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 98.4%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
associate-*l*15.4%
Simplified15.4%
Taylor expanded in z around inf 69.3%
Final simplification96.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.9e+239)
(* y z)
(if (<= z -1.02e+151)
(* a (* z b))
(if (<= z -0.00054)
(* y z)
(if (<= z -1.5e-35)
x
(if (<= z 7.2e+36)
(* t a)
(if (<= z 3.3e+249) (* y z) (* (* z a) b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.9e+239) {
tmp = y * z;
} else if (z <= -1.02e+151) {
tmp = a * (z * b);
} else if (z <= -0.00054) {
tmp = y * z;
} else if (z <= -1.5e-35) {
tmp = x;
} else if (z <= 7.2e+36) {
tmp = t * a;
} else if (z <= 3.3e+249) {
tmp = y * z;
} else {
tmp = (z * a) * 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 (z <= (-2.9d+239)) then
tmp = y * z
else if (z <= (-1.02d+151)) then
tmp = a * (z * b)
else if (z <= (-0.00054d0)) then
tmp = y * z
else if (z <= (-1.5d-35)) then
tmp = x
else if (z <= 7.2d+36) then
tmp = t * a
else if (z <= 3.3d+249) then
tmp = y * z
else
tmp = (z * a) * 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 (z <= -2.9e+239) {
tmp = y * z;
} else if (z <= -1.02e+151) {
tmp = a * (z * b);
} else if (z <= -0.00054) {
tmp = y * z;
} else if (z <= -1.5e-35) {
tmp = x;
} else if (z <= 7.2e+36) {
tmp = t * a;
} else if (z <= 3.3e+249) {
tmp = y * z;
} else {
tmp = (z * a) * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.9e+239: tmp = y * z elif z <= -1.02e+151: tmp = a * (z * b) elif z <= -0.00054: tmp = y * z elif z <= -1.5e-35: tmp = x elif z <= 7.2e+36: tmp = t * a elif z <= 3.3e+249: tmp = y * z else: tmp = (z * a) * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.9e+239) tmp = Float64(y * z); elseif (z <= -1.02e+151) tmp = Float64(a * Float64(z * b)); elseif (z <= -0.00054) tmp = Float64(y * z); elseif (z <= -1.5e-35) tmp = x; elseif (z <= 7.2e+36) tmp = Float64(t * a); elseif (z <= 3.3e+249) tmp = Float64(y * z); else tmp = Float64(Float64(z * a) * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.9e+239) tmp = y * z; elseif (z <= -1.02e+151) tmp = a * (z * b); elseif (z <= -0.00054) tmp = y * z; elseif (z <= -1.5e-35) tmp = x; elseif (z <= 7.2e+36) tmp = t * a; elseif (z <= 3.3e+249) tmp = y * z; else tmp = (z * a) * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.9e+239], N[(y * z), $MachinePrecision], If[LessEqual[z, -1.02e+151], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.00054], N[(y * z), $MachinePrecision], If[LessEqual[z, -1.5e-35], x, If[LessEqual[z, 7.2e+36], N[(t * a), $MachinePrecision], If[LessEqual[z, 3.3e+249], N[(y * z), $MachinePrecision], N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+239}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{+151}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;z \leq -0.00054:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-35}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{+36}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+249}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\
\end{array}
\end{array}
if z < -2.9000000000000002e239 or -1.02000000000000002e151 < z < -5.40000000000000007e-4 or 7.1999999999999995e36 < z < 3.30000000000000014e249Initial program 88.0%
associate-+l+88.0%
associate-*l*85.2%
Simplified85.2%
Taylor expanded in y around inf 50.8%
*-commutative50.8%
Simplified50.8%
if -2.9000000000000002e239 < z < -1.02000000000000002e151Initial program 89.9%
associate-+l+89.9%
associate-*l*80.7%
Simplified80.7%
Taylor expanded in z around inf 90.0%
Taylor expanded in y around 0 61.5%
if -5.40000000000000007e-4 < z < -1.49999999999999994e-35Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -1.49999999999999994e-35 < z < 7.1999999999999995e36Initial program 99.1%
associate-+l+99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in t around inf 50.5%
if 3.30000000000000014e249 < z Initial program 86.7%
associate-+l+86.7%
associate-*l*86.7%
Simplified86.7%
Taylor expanded in z around inf 80.6%
Taylor expanded in y around 0 48.2%
*-commutative48.2%
associate-*r*73.7%
Simplified73.7%
Final simplification53.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))))
(if (<= z -3.7e+239)
t_1
(if (<= z -1.75e+151)
(* a (* z b))
(if (<= z -0.64)
t_1
(if (<= z 1.04e+37)
(+ x (* t a))
(if (<= z 1.75e+249) t_1 (* (* z a) b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (z <= -3.7e+239) {
tmp = t_1;
} else if (z <= -1.75e+151) {
tmp = a * (z * b);
} else if (z <= -0.64) {
tmp = t_1;
} else if (z <= 1.04e+37) {
tmp = x + (t * a);
} else if (z <= 1.75e+249) {
tmp = t_1;
} else {
tmp = (z * a) * 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) :: t_1
real(8) :: tmp
t_1 = x + (y * z)
if (z <= (-3.7d+239)) then
tmp = t_1
else if (z <= (-1.75d+151)) then
tmp = a * (z * b)
else if (z <= (-0.64d0)) then
tmp = t_1
else if (z <= 1.04d+37) then
tmp = x + (t * a)
else if (z <= 1.75d+249) then
tmp = t_1
else
tmp = (z * a) * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (z <= -3.7e+239) {
tmp = t_1;
} else if (z <= -1.75e+151) {
tmp = a * (z * b);
} else if (z <= -0.64) {
tmp = t_1;
} else if (z <= 1.04e+37) {
tmp = x + (t * a);
} else if (z <= 1.75e+249) {
tmp = t_1;
} else {
tmp = (z * a) * b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) tmp = 0 if z <= -3.7e+239: tmp = t_1 elif z <= -1.75e+151: tmp = a * (z * b) elif z <= -0.64: tmp = t_1 elif z <= 1.04e+37: tmp = x + (t * a) elif z <= 1.75e+249: tmp = t_1 else: tmp = (z * a) * b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) tmp = 0.0 if (z <= -3.7e+239) tmp = t_1; elseif (z <= -1.75e+151) tmp = Float64(a * Float64(z * b)); elseif (z <= -0.64) tmp = t_1; elseif (z <= 1.04e+37) tmp = Float64(x + Float64(t * a)); elseif (z <= 1.75e+249) tmp = t_1; else tmp = Float64(Float64(z * a) * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); tmp = 0.0; if (z <= -3.7e+239) tmp = t_1; elseif (z <= -1.75e+151) tmp = a * (z * b); elseif (z <= -0.64) tmp = t_1; elseif (z <= 1.04e+37) tmp = x + (t * a); elseif (z <= 1.75e+249) tmp = t_1; else tmp = (z * a) * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.7e+239], t$95$1, If[LessEqual[z, -1.75e+151], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.64], t$95$1, If[LessEqual[z, 1.04e+37], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e+249], t$95$1, N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{+239}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{+151}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;z \leq -0.64:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.04 \cdot 10^{+37}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+249}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\
\end{array}
\end{array}
if z < -3.69999999999999998e239 or -1.7500000000000001e151 < z < -0.640000000000000013 or 1.0400000000000001e37 < z < 1.75000000000000006e249Initial program 88.0%
associate-+l+88.0%
associate-*l*85.2%
Simplified85.2%
Taylor expanded in a around 0 63.6%
if -3.69999999999999998e239 < z < -1.7500000000000001e151Initial program 89.9%
associate-+l+89.9%
associate-*l*80.7%
Simplified80.7%
Taylor expanded in z around inf 90.0%
Taylor expanded in y around 0 61.5%
if -0.640000000000000013 < z < 1.0400000000000001e37Initial program 99.2%
associate-+l+99.2%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in z around 0 85.2%
+-commutative85.2%
Simplified85.2%
if 1.75000000000000006e249 < z Initial program 86.7%
associate-+l+86.7%
associate-*l*86.7%
Simplified86.7%
Taylor expanded in z around inf 80.6%
Taylor expanded in y around 0 48.2%
*-commutative48.2%
associate-*r*73.7%
Simplified73.7%
Final simplification74.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -0.215)
(* y z)
(if (<= z -1.95e-35)
x
(if (<= z 1.45e-156)
(* t a)
(if (<= z 7.6e-75) x (if (<= z 1.1e+40) (* t a) (* y z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -0.215) {
tmp = y * z;
} else if (z <= -1.95e-35) {
tmp = x;
} else if (z <= 1.45e-156) {
tmp = t * a;
} else if (z <= 7.6e-75) {
tmp = x;
} else if (z <= 1.1e+40) {
tmp = t * a;
} else {
tmp = y * z;
}
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 (z <= (-0.215d0)) then
tmp = y * z
else if (z <= (-1.95d-35)) then
tmp = x
else if (z <= 1.45d-156) then
tmp = t * a
else if (z <= 7.6d-75) then
tmp = x
else if (z <= 1.1d+40) then
tmp = t * a
else
tmp = y * z
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 (z <= -0.215) {
tmp = y * z;
} else if (z <= -1.95e-35) {
tmp = x;
} else if (z <= 1.45e-156) {
tmp = t * a;
} else if (z <= 7.6e-75) {
tmp = x;
} else if (z <= 1.1e+40) {
tmp = t * a;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -0.215: tmp = y * z elif z <= -1.95e-35: tmp = x elif z <= 1.45e-156: tmp = t * a elif z <= 7.6e-75: tmp = x elif z <= 1.1e+40: tmp = t * a else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -0.215) tmp = Float64(y * z); elseif (z <= -1.95e-35) tmp = x; elseif (z <= 1.45e-156) tmp = Float64(t * a); elseif (z <= 7.6e-75) tmp = x; elseif (z <= 1.1e+40) tmp = Float64(t * a); else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -0.215) tmp = y * z; elseif (z <= -1.95e-35) tmp = x; elseif (z <= 1.45e-156) tmp = t * a; elseif (z <= 7.6e-75) tmp = x; elseif (z <= 1.1e+40) tmp = t * a; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -0.215], N[(y * z), $MachinePrecision], If[LessEqual[z, -1.95e-35], x, If[LessEqual[z, 1.45e-156], N[(t * a), $MachinePrecision], If[LessEqual[z, 7.6e-75], x, If[LessEqual[z, 1.1e+40], N[(t * a), $MachinePrecision], N[(y * z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.215:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-35}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-156}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-75}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+40}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if z < -0.214999999999999997 or 1.0999999999999999e40 < z Initial program 88.2%
associate-+l+88.2%
associate-*l*84.7%
Simplified84.7%
Taylor expanded in y around inf 47.6%
*-commutative47.6%
Simplified47.6%
if -0.214999999999999997 < z < -1.9499999999999999e-35 or 1.4500000000000001e-156 < z < 7.59999999999999987e-75Initial program 99.9%
associate-+l+99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 66.3%
if -1.9499999999999999e-35 < z < 1.4500000000000001e-156 or 7.59999999999999987e-75 < z < 1.0999999999999999e40Initial program 99.0%
associate-+l+99.0%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in t around inf 53.8%
Final simplification51.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -3.7e+239)
(* y z)
(if (<= z -1.28e+151)
(* a (* z b))
(if (<= z -2.6e-7)
(* y z)
(if (<= z -1.35e-35) x (if (<= z 6e+34) (* t a) (* y z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.7e+239) {
tmp = y * z;
} else if (z <= -1.28e+151) {
tmp = a * (z * b);
} else if (z <= -2.6e-7) {
tmp = y * z;
} else if (z <= -1.35e-35) {
tmp = x;
} else if (z <= 6e+34) {
tmp = t * a;
} else {
tmp = y * z;
}
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 (z <= (-3.7d+239)) then
tmp = y * z
else if (z <= (-1.28d+151)) then
tmp = a * (z * b)
else if (z <= (-2.6d-7)) then
tmp = y * z
else if (z <= (-1.35d-35)) then
tmp = x
else if (z <= 6d+34) then
tmp = t * a
else
tmp = y * z
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 (z <= -3.7e+239) {
tmp = y * z;
} else if (z <= -1.28e+151) {
tmp = a * (z * b);
} else if (z <= -2.6e-7) {
tmp = y * z;
} else if (z <= -1.35e-35) {
tmp = x;
} else if (z <= 6e+34) {
tmp = t * a;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.7e+239: tmp = y * z elif z <= -1.28e+151: tmp = a * (z * b) elif z <= -2.6e-7: tmp = y * z elif z <= -1.35e-35: tmp = x elif z <= 6e+34: tmp = t * a else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.7e+239) tmp = Float64(y * z); elseif (z <= -1.28e+151) tmp = Float64(a * Float64(z * b)); elseif (z <= -2.6e-7) tmp = Float64(y * z); elseif (z <= -1.35e-35) tmp = x; elseif (z <= 6e+34) tmp = Float64(t * a); else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -3.7e+239) tmp = y * z; elseif (z <= -1.28e+151) tmp = a * (z * b); elseif (z <= -2.6e-7) tmp = y * z; elseif (z <= -1.35e-35) tmp = x; elseif (z <= 6e+34) tmp = t * a; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.7e+239], N[(y * z), $MachinePrecision], If[LessEqual[z, -1.28e+151], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.6e-7], N[(y * z), $MachinePrecision], If[LessEqual[z, -1.35e-35], x, If[LessEqual[z, 6e+34], N[(t * a), $MachinePrecision], N[(y * z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+239}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -1.28 \cdot 10^{+151}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-7}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-35}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+34}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if z < -3.69999999999999998e239 or -1.28000000000000006e151 < z < -2.59999999999999999e-7 or 6.00000000000000037e34 < z Initial program 87.9%
associate-+l+87.9%
associate-*l*85.4%
Simplified85.4%
Taylor expanded in y around inf 49.5%
*-commutative49.5%
Simplified49.5%
if -3.69999999999999998e239 < z < -1.28000000000000006e151Initial program 89.9%
associate-+l+89.9%
associate-*l*80.7%
Simplified80.7%
Taylor expanded in z around inf 90.0%
Taylor expanded in y around 0 61.5%
if -2.59999999999999999e-7 < z < -1.3499999999999999e-35Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -1.3499999999999999e-35 < z < 6.00000000000000037e34Initial program 99.1%
associate-+l+99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in t around inf 50.5%
Final simplification51.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ y (* a b)))))
(if (<= z -4.8e+71)
t_1
(if (<= z -7e+16)
(+ x (* y z))
(if (or (<= z -3700000000.0) (not (<= z 2.3e+44)))
t_1
(+ x (* t a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y + (a * b));
double tmp;
if (z <= -4.8e+71) {
tmp = t_1;
} else if (z <= -7e+16) {
tmp = x + (y * z);
} else if ((z <= -3700000000.0) || !(z <= 2.3e+44)) {
tmp = t_1;
} else {
tmp = x + (t * a);
}
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) :: t_1
real(8) :: tmp
t_1 = z * (y + (a * b))
if (z <= (-4.8d+71)) then
tmp = t_1
else if (z <= (-7d+16)) then
tmp = x + (y * z)
else if ((z <= (-3700000000.0d0)) .or. (.not. (z <= 2.3d+44))) then
tmp = t_1
else
tmp = x + (t * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y + (a * b));
double tmp;
if (z <= -4.8e+71) {
tmp = t_1;
} else if (z <= -7e+16) {
tmp = x + (y * z);
} else if ((z <= -3700000000.0) || !(z <= 2.3e+44)) {
tmp = t_1;
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (y + (a * b)) tmp = 0 if z <= -4.8e+71: tmp = t_1 elif z <= -7e+16: tmp = x + (y * z) elif (z <= -3700000000.0) or not (z <= 2.3e+44): tmp = t_1 else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -4.8e+71) tmp = t_1; elseif (z <= -7e+16) tmp = Float64(x + Float64(y * z)); elseif ((z <= -3700000000.0) || !(z <= 2.3e+44)) tmp = t_1; else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (y + (a * b)); tmp = 0.0; if (z <= -4.8e+71) tmp = t_1; elseif (z <= -7e+16) tmp = x + (y * z); elseif ((z <= -3700000000.0) || ~((z <= 2.3e+44))) tmp = t_1; else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e+71], t$95$1, If[LessEqual[z, -7e+16], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -3700000000.0], N[Not[LessEqual[z, 2.3e+44]], $MachinePrecision]], t$95$1, N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7 \cdot 10^{+16}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;z \leq -3700000000 \lor \neg \left(z \leq 2.3 \cdot 10^{+44}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -4.79999999999999961e71 or -7e16 < z < -3.7e9 or 2.30000000000000004e44 < z Initial program 87.1%
associate-+l+87.1%
associate-*l*83.8%
Simplified83.8%
Taylor expanded in z around inf 85.2%
if -4.79999999999999961e71 < z < -7e16Initial program 92.9%
associate-+l+92.9%
associate-*l*86.2%
Simplified86.2%
Taylor expanded in a around 0 79.6%
if -3.7e9 < z < 2.30000000000000004e44Initial program 99.2%
associate-+l+99.2%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in z around 0 84.2%
+-commutative84.2%
Simplified84.2%
Final simplification84.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -1.2e+250)
(* a (* z b))
(if (<= a -3.4e+169)
(* t a)
(if (<= a -4.3e+105)
(* z (* a b))
(if (<= a 7.2e+45) (+ x (* y z)) (* t a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.2e+250) {
tmp = a * (z * b);
} else if (a <= -3.4e+169) {
tmp = t * a;
} else if (a <= -4.3e+105) {
tmp = z * (a * b);
} else if (a <= 7.2e+45) {
tmp = x + (y * z);
} else {
tmp = t * a;
}
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 (a <= (-1.2d+250)) then
tmp = a * (z * b)
else if (a <= (-3.4d+169)) then
tmp = t * a
else if (a <= (-4.3d+105)) then
tmp = z * (a * b)
else if (a <= 7.2d+45) then
tmp = x + (y * z)
else
tmp = t * a
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 (a <= -1.2e+250) {
tmp = a * (z * b);
} else if (a <= -3.4e+169) {
tmp = t * a;
} else if (a <= -4.3e+105) {
tmp = z * (a * b);
} else if (a <= 7.2e+45) {
tmp = x + (y * z);
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.2e+250: tmp = a * (z * b) elif a <= -3.4e+169: tmp = t * a elif a <= -4.3e+105: tmp = z * (a * b) elif a <= 7.2e+45: tmp = x + (y * z) else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.2e+250) tmp = Float64(a * Float64(z * b)); elseif (a <= -3.4e+169) tmp = Float64(t * a); elseif (a <= -4.3e+105) tmp = Float64(z * Float64(a * b)); elseif (a <= 7.2e+45) tmp = Float64(x + Float64(y * z)); else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.2e+250) tmp = a * (z * b); elseif (a <= -3.4e+169) tmp = t * a; elseif (a <= -4.3e+105) tmp = z * (a * b); elseif (a <= 7.2e+45) tmp = x + (y * z); else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.2e+250], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -3.4e+169], N[(t * a), $MachinePrecision], If[LessEqual[a, -4.3e+105], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.2e+45], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(t * a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.2 \cdot 10^{+250}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq -3.4 \cdot 10^{+169}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq -4.3 \cdot 10^{+105}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{+45}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if a < -1.20000000000000006e250Initial program 77.5%
associate-+l+77.5%
associate-*l*84.6%
Simplified84.6%
Taylor expanded in z around inf 69.5%
Taylor expanded in y around 0 62.3%
if -1.20000000000000006e250 < a < -3.40000000000000028e169 or 7.2e45 < a Initial program 89.0%
associate-+l+89.0%
associate-*l*94.4%
Simplified94.4%
Taylor expanded in t around inf 55.0%
if -3.40000000000000028e169 < a < -4.3000000000000002e105Initial program 100.0%
associate-+l+100.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around inf 68.4%
Taylor expanded in y around 0 67.7%
associate-*r*68.3%
Simplified68.3%
if -4.3000000000000002e105 < a < 7.2e45Initial program 96.2%
associate-+l+96.2%
associate-*l*90.2%
Simplified90.2%
Taylor expanded in a around 0 69.6%
Final simplification65.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4.5e+179) (* z (+ y (* a b))) (+ (+ x (* y z)) (+ (* t a) (* a (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.5e+179) {
tmp = z * (y + (a * b));
} else {
tmp = (x + (y * z)) + ((t * a) + (a * (z * 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 (z <= (-4.5d+179)) then
tmp = z * (y + (a * b))
else
tmp = (x + (y * z)) + ((t * a) + (a * (z * 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 (z <= -4.5e+179) {
tmp = z * (y + (a * b));
} else {
tmp = (x + (y * z)) + ((t * a) + (a * (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.5e+179: tmp = z * (y + (a * b)) else: tmp = (x + (y * z)) + ((t * a) + (a * (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.5e+179) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(Float64(x + Float64(y * z)) + Float64(Float64(t * a) + Float64(a * Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.5e+179) tmp = z * (y + (a * b)); else tmp = (x + (y * z)) + ((t * a) + (a * (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.5e+179], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+179}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -4.5000000000000003e179Initial program 87.5%
associate-+l+87.5%
associate-*l*75.8%
Simplified75.8%
Taylor expanded in z around inf 96.8%
if -4.5000000000000003e179 < z Initial program 94.3%
associate-+l+94.3%
associate-*l*93.8%
Simplified93.8%
Final simplification94.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -9e+44) (not (<= z 2.26e+67))) (* z (+ y (* a b))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -9e+44) || !(z <= 2.26e+67)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * 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 ((z <= (-9d+44)) .or. (.not. (z <= 2.26d+67))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * (t + (z * 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 ((z <= -9e+44) || !(z <= 2.26e+67)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -9e+44) or not (z <= 2.26e+67): tmp = z * (y + (a * b)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -9e+44) || !(z <= 2.26e+67)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -9e+44) || ~((z <= 2.26e+67))) tmp = z * (y + (a * b)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -9e+44], N[Not[LessEqual[z, 2.26e+67]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+44} \lor \neg \left(z \leq 2.26 \cdot 10^{+67}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -9e44 or 2.26000000000000009e67 < z Initial program 87.4%
associate-+l+87.4%
associate-*l*83.2%
Simplified83.2%
Taylor expanded in z around inf 84.5%
if -9e44 < z < 2.26000000000000009e67Initial program 97.9%
associate-+l+97.9%
+-commutative97.9%
fma-define97.9%
associate-*l*97.9%
*-commutative97.9%
*-commutative97.9%
distribute-rgt-out100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 91.7%
Final simplification88.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.5e+55) (not (<= y 1.12e-66))) (+ x (+ (* t a) (* y z))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.5e+55) || !(y <= 1.12e-66)) {
tmp = x + ((t * a) + (y * z));
} else {
tmp = x + (a * (t + (z * 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 <= (-2.5d+55)) .or. (.not. (y <= 1.12d-66))) then
tmp = x + ((t * a) + (y * z))
else
tmp = x + (a * (t + (z * 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 <= -2.5e+55) || !(y <= 1.12e-66)) {
tmp = x + ((t * a) + (y * z));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.5e+55) or not (y <= 1.12e-66): tmp = x + ((t * a) + (y * z)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.5e+55) || !(y <= 1.12e-66)) tmp = Float64(x + Float64(Float64(t * a) + Float64(y * z))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.5e+55) || ~((y <= 1.12e-66))) tmp = x + ((t * a) + (y * z)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.5e+55], N[Not[LessEqual[y, 1.12e-66]], $MachinePrecision]], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+55} \lor \neg \left(y \leq 1.12 \cdot 10^{-66}\right):\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if y < -2.50000000000000023e55 or 1.12000000000000004e-66 < y Initial program 90.4%
associate-+l+90.4%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in b around 0 87.8%
if -2.50000000000000023e55 < y < 1.12000000000000004e-66Initial program 96.8%
associate-+l+96.8%
+-commutative96.8%
fma-define96.8%
associate-*l*95.2%
*-commutative95.2%
*-commutative95.2%
distribute-rgt-out96.1%
*-commutative96.1%
Simplified96.1%
Taylor expanded in y around 0 91.4%
Final simplification89.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -3.9e+51) (not (<= a 2.5e+17))) (* a (+ t (* z b))) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.9e+51) || !(a <= 2.5e+17)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
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 ((a <= (-3.9d+51)) .or. (.not. (a <= 2.5d+17))) then
tmp = a * (t + (z * b))
else
tmp = x + (y * z)
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 ((a <= -3.9e+51) || !(a <= 2.5e+17)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -3.9e+51) or not (a <= 2.5e+17): tmp = a * (t + (z * b)) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.9e+51) || !(a <= 2.5e+17)) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -3.9e+51) || ~((a <= 2.5e+17))) tmp = a * (t + (z * b)); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.9e+51], N[Not[LessEqual[a, 2.5e+17]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.9 \cdot 10^{+51} \lor \neg \left(a \leq 2.5 \cdot 10^{+17}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -3.89999999999999984e51 or 2.5e17 < a Initial program 89.6%
associate-+l+89.6%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in a around inf 81.4%
if -3.89999999999999984e51 < a < 2.5e17Initial program 96.4%
associate-+l+96.4%
associate-*l*89.1%
Simplified89.1%
Taylor expanded in a around 0 72.3%
Final simplification76.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -4.3e+83) (not (<= t 7.6e+118))) (* t a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4.3e+83) || !(t <= 7.6e+118)) {
tmp = t * a;
} else {
tmp = x;
}
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 ((t <= (-4.3d+83)) .or. (.not. (t <= 7.6d+118))) then
tmp = t * a
else
tmp = x
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 ((t <= -4.3e+83) || !(t <= 7.6e+118)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -4.3e+83) or not (t <= 7.6e+118): tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -4.3e+83) || !(t <= 7.6e+118)) tmp = Float64(t * a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -4.3e+83) || ~((t <= 7.6e+118))) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4.3e+83], N[Not[LessEqual[t, 7.6e+118]], $MachinePrecision]], N[(t * a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.3 \cdot 10^{+83} \lor \neg \left(t \leq 7.6 \cdot 10^{+118}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -4.3e83 or 7.60000000000000033e118 < t Initial program 89.6%
associate-+l+89.6%
associate-*l*89.7%
Simplified89.7%
Taylor expanded in t around inf 59.3%
if -4.3e83 < t < 7.60000000000000033e118Initial program 95.7%
associate-+l+95.7%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in x around inf 33.8%
Final simplification43.3%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.4%
associate-+l+93.4%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in x around inf 25.1%
Final simplification25.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(if (< z -11820553527347888000.0)
t_1
(if (< z 4.7589743188364287e-122)
(+ (* (+ (* b z) t) a) (+ (* z y) x))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = (z * ((b * a) + y)) + (x + (t * a))
if (z < (-11820553527347888000.0d0)) then
tmp = t_1
else if (z < 4.7589743188364287d-122) then
tmp = (((b * z) + t) * a) + ((z * y) + x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * ((b * a) + y)) + (x + (t * a)) tmp = 0 if z < -11820553527347888000.0: tmp = t_1 elif z < 4.7589743188364287e-122: tmp = (((b * z) + t) * a) + ((z * y) + x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(Float64(b * a) + y)) + Float64(x + Float64(t * a))) tmp = 0.0 if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = Float64(Float64(Float64(Float64(b * z) + t) * a) + Float64(Float64(z * y) + x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * ((b * a) + y)) + (x + (t * a)); tmp = 0.0; if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = (((b * z) + t) * a) + ((z * y) + x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(N[(b * a), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -11820553527347888000.0], t$95$1, If[Less[z, 4.7589743188364287e-122], N[(N[(N[(N[(b * z), $MachinePrecision] + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\
\mathbf{if}\;z < -11820553527347888000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
\;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024077
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:alt
(if (< z -11820553527347888000.0) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))