
(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 14 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.8%
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*14.3%
Simplified14.3%
Taylor expanded in z around inf 71.4%
Final simplification97.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* z a) b)))
(if (<= y -2.6e+48)
(* y z)
(if (<= y -1.1e-109)
t_1
(if (<= y -2.45e-179)
x
(if (<= y -7e-222)
t_1
(if (<= y -9e-282)
x
(if (<= y 1.8e-213)
(* t a)
(if (<= y 2.1e-171)
x
(if (<= y 2.05e+99) (* t a) (* y z)))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * a) * b;
double tmp;
if (y <= -2.6e+48) {
tmp = y * z;
} else if (y <= -1.1e-109) {
tmp = t_1;
} else if (y <= -2.45e-179) {
tmp = x;
} else if (y <= -7e-222) {
tmp = t_1;
} else if (y <= -9e-282) {
tmp = x;
} else if (y <= 1.8e-213) {
tmp = t * a;
} else if (y <= 2.1e-171) {
tmp = x;
} else if (y <= 2.05e+99) {
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) :: t_1
real(8) :: tmp
t_1 = (z * a) * b
if (y <= (-2.6d+48)) then
tmp = y * z
else if (y <= (-1.1d-109)) then
tmp = t_1
else if (y <= (-2.45d-179)) then
tmp = x
else if (y <= (-7d-222)) then
tmp = t_1
else if (y <= (-9d-282)) then
tmp = x
else if (y <= 1.8d-213) then
tmp = t * a
else if (y <= 2.1d-171) then
tmp = x
else if (y <= 2.05d+99) 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 t_1 = (z * a) * b;
double tmp;
if (y <= -2.6e+48) {
tmp = y * z;
} else if (y <= -1.1e-109) {
tmp = t_1;
} else if (y <= -2.45e-179) {
tmp = x;
} else if (y <= -7e-222) {
tmp = t_1;
} else if (y <= -9e-282) {
tmp = x;
} else if (y <= 1.8e-213) {
tmp = t * a;
} else if (y <= 2.1e-171) {
tmp = x;
} else if (y <= 2.05e+99) {
tmp = t * a;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * a) * b tmp = 0 if y <= -2.6e+48: tmp = y * z elif y <= -1.1e-109: tmp = t_1 elif y <= -2.45e-179: tmp = x elif y <= -7e-222: tmp = t_1 elif y <= -9e-282: tmp = x elif y <= 1.8e-213: tmp = t * a elif y <= 2.1e-171: tmp = x elif y <= 2.05e+99: tmp = t * a else: tmp = y * z return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * a) * b) tmp = 0.0 if (y <= -2.6e+48) tmp = Float64(y * z); elseif (y <= -1.1e-109) tmp = t_1; elseif (y <= -2.45e-179) tmp = x; elseif (y <= -7e-222) tmp = t_1; elseif (y <= -9e-282) tmp = x; elseif (y <= 1.8e-213) tmp = Float64(t * a); elseif (y <= 2.1e-171) tmp = x; elseif (y <= 2.05e+99) tmp = Float64(t * a); else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * a) * b; tmp = 0.0; if (y <= -2.6e+48) tmp = y * z; elseif (y <= -1.1e-109) tmp = t_1; elseif (y <= -2.45e-179) tmp = x; elseif (y <= -7e-222) tmp = t_1; elseif (y <= -9e-282) tmp = x; elseif (y <= 1.8e-213) tmp = t * a; elseif (y <= 2.1e-171) tmp = x; elseif (y <= 2.05e+99) tmp = t * a; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[y, -2.6e+48], N[(y * z), $MachinePrecision], If[LessEqual[y, -1.1e-109], t$95$1, If[LessEqual[y, -2.45e-179], x, If[LessEqual[y, -7e-222], t$95$1, If[LessEqual[y, -9e-282], x, If[LessEqual[y, 1.8e-213], N[(t * a), $MachinePrecision], If[LessEqual[y, 2.1e-171], x, If[LessEqual[y, 2.05e+99], N[(t * a), $MachinePrecision], N[(y * z), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;y \leq -2.6 \cdot 10^{+48}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{-109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.45 \cdot 10^{-179}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -7 \cdot 10^{-222}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -9 \cdot 10^{-282}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-213}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-171}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{+99}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -2.59999999999999995e48 or 2.0499999999999999e99 < y Initial program 86.7%
associate-+l+86.7%
associate-*l*85.8%
Simplified85.8%
Taylor expanded in y around inf 63.3%
*-commutative63.3%
Simplified63.3%
if -2.59999999999999995e48 < y < -1.1e-109 or -2.45e-179 < y < -7.00000000000000049e-222Initial program 97.3%
associate-+l+97.3%
associate-*l*88.8%
Simplified88.8%
Taylor expanded in z around inf 62.8%
Taylor expanded in b around inf 57.3%
Taylor expanded in a around inf 55.1%
if -1.1e-109 < y < -2.45e-179 or -7.00000000000000049e-222 < y < -9.00000000000000017e-282 or 1.8e-213 < y < 2.1e-171Initial program 97.7%
associate-+l+97.7%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in x around inf 53.6%
if -9.00000000000000017e-282 < y < 1.8e-213 or 2.1e-171 < y < 2.0499999999999999e99Initial program 97.5%
associate-+l+97.5%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in t around inf 53.9%
Final simplification57.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -33000000000000.0)
(* y z)
(if (<= y -2.5e-85)
(* t a)
(if (<= y -1.05e-282)
x
(if (<= y 5.5e-212)
(* t a)
(if (<= y 6e-170) x (if (<= y 3.3e+100) (* t a) (* y z))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -33000000000000.0) {
tmp = y * z;
} else if (y <= -2.5e-85) {
tmp = t * a;
} else if (y <= -1.05e-282) {
tmp = x;
} else if (y <= 5.5e-212) {
tmp = t * a;
} else if (y <= 6e-170) {
tmp = x;
} else if (y <= 3.3e+100) {
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 (y <= (-33000000000000.0d0)) then
tmp = y * z
else if (y <= (-2.5d-85)) then
tmp = t * a
else if (y <= (-1.05d-282)) then
tmp = x
else if (y <= 5.5d-212) then
tmp = t * a
else if (y <= 6d-170) then
tmp = x
else if (y <= 3.3d+100) 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 (y <= -33000000000000.0) {
tmp = y * z;
} else if (y <= -2.5e-85) {
tmp = t * a;
} else if (y <= -1.05e-282) {
tmp = x;
} else if (y <= 5.5e-212) {
tmp = t * a;
} else if (y <= 6e-170) {
tmp = x;
} else if (y <= 3.3e+100) {
tmp = t * a;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -33000000000000.0: tmp = y * z elif y <= -2.5e-85: tmp = t * a elif y <= -1.05e-282: tmp = x elif y <= 5.5e-212: tmp = t * a elif y <= 6e-170: tmp = x elif y <= 3.3e+100: tmp = t * a else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -33000000000000.0) tmp = Float64(y * z); elseif (y <= -2.5e-85) tmp = Float64(t * a); elseif (y <= -1.05e-282) tmp = x; elseif (y <= 5.5e-212) tmp = Float64(t * a); elseif (y <= 6e-170) tmp = x; elseif (y <= 3.3e+100) 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 (y <= -33000000000000.0) tmp = y * z; elseif (y <= -2.5e-85) tmp = t * a; elseif (y <= -1.05e-282) tmp = x; elseif (y <= 5.5e-212) tmp = t * a; elseif (y <= 6e-170) tmp = x; elseif (y <= 3.3e+100) tmp = t * a; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -33000000000000.0], N[(y * z), $MachinePrecision], If[LessEqual[y, -2.5e-85], N[(t * a), $MachinePrecision], If[LessEqual[y, -1.05e-282], x, If[LessEqual[y, 5.5e-212], N[(t * a), $MachinePrecision], If[LessEqual[y, 6e-170], x, If[LessEqual[y, 3.3e+100], N[(t * a), $MachinePrecision], N[(y * z), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -33000000000000:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-85}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{-282}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-212}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-170}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{+100}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -3.3e13 or 3.3000000000000001e100 < y Initial program 87.1%
associate-+l+87.1%
associate-*l*86.2%
Simplified86.2%
Taylor expanded in y around inf 62.4%
*-commutative62.4%
Simplified62.4%
if -3.3e13 < y < -2.5000000000000001e-85 or -1.05000000000000006e-282 < y < 5.49999999999999995e-212 or 6.00000000000000027e-170 < y < 3.3000000000000001e100Initial program 97.9%
associate-+l+97.9%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in t around inf 51.1%
if -2.5000000000000001e-85 < y < -1.05000000000000006e-282 or 5.49999999999999995e-212 < y < 6.00000000000000027e-170Initial program 96.8%
associate-+l+96.8%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in x around inf 45.0%
Final simplification54.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -9.5e+48)
(* y z)
(if (<= y -1.05e-108)
(* a (* z b))
(if (<= y -5e-282)
x
(if (<= y 6.5e-214)
(* t a)
(if (<= y 5.6e-170) x (if (<= y 1.7e+98) (* t a) (* y z))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -9.5e+48) {
tmp = y * z;
} else if (y <= -1.05e-108) {
tmp = a * (z * b);
} else if (y <= -5e-282) {
tmp = x;
} else if (y <= 6.5e-214) {
tmp = t * a;
} else if (y <= 5.6e-170) {
tmp = x;
} else if (y <= 1.7e+98) {
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 (y <= (-9.5d+48)) then
tmp = y * z
else if (y <= (-1.05d-108)) then
tmp = a * (z * b)
else if (y <= (-5d-282)) then
tmp = x
else if (y <= 6.5d-214) then
tmp = t * a
else if (y <= 5.6d-170) then
tmp = x
else if (y <= 1.7d+98) 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 (y <= -9.5e+48) {
tmp = y * z;
} else if (y <= -1.05e-108) {
tmp = a * (z * b);
} else if (y <= -5e-282) {
tmp = x;
} else if (y <= 6.5e-214) {
tmp = t * a;
} else if (y <= 5.6e-170) {
tmp = x;
} else if (y <= 1.7e+98) {
tmp = t * a;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -9.5e+48: tmp = y * z elif y <= -1.05e-108: tmp = a * (z * b) elif y <= -5e-282: tmp = x elif y <= 6.5e-214: tmp = t * a elif y <= 5.6e-170: tmp = x elif y <= 1.7e+98: tmp = t * a else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -9.5e+48) tmp = Float64(y * z); elseif (y <= -1.05e-108) tmp = Float64(a * Float64(z * b)); elseif (y <= -5e-282) tmp = x; elseif (y <= 6.5e-214) tmp = Float64(t * a); elseif (y <= 5.6e-170) tmp = x; elseif (y <= 1.7e+98) 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 (y <= -9.5e+48) tmp = y * z; elseif (y <= -1.05e-108) tmp = a * (z * b); elseif (y <= -5e-282) tmp = x; elseif (y <= 6.5e-214) tmp = t * a; elseif (y <= 5.6e-170) tmp = x; elseif (y <= 1.7e+98) tmp = t * a; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -9.5e+48], N[(y * z), $MachinePrecision], If[LessEqual[y, -1.05e-108], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5e-282], x, If[LessEqual[y, 6.5e-214], N[(t * a), $MachinePrecision], If[LessEqual[y, 5.6e-170], x, If[LessEqual[y, 1.7e+98], N[(t * a), $MachinePrecision], N[(y * z), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+48}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{-108}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;y \leq -5 \cdot 10^{-282}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-214}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{-170}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+98}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -9.4999999999999997e48 or 1.69999999999999986e98 < y Initial program 86.7%
associate-+l+86.7%
associate-*l*85.8%
Simplified85.8%
Taylor expanded in y around inf 63.3%
*-commutative63.3%
Simplified63.3%
if -9.4999999999999997e48 < y < -1.05e-108Initial program 99.9%
associate-+l+99.9%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in z around inf 59.5%
Taylor expanded in y around 0 40.5%
*-commutative40.5%
Simplified40.5%
if -1.05e-108 < y < -5.0000000000000001e-282 or 6.5000000000000004e-214 < y < 5.59999999999999991e-170Initial program 96.5%
associate-+l+96.5%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in x around inf 47.9%
if -5.0000000000000001e-282 < y < 6.5000000000000004e-214 or 5.59999999999999991e-170 < y < 1.69999999999999986e98Initial program 97.5%
associate-+l+97.5%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in t around inf 53.9%
Final simplification54.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* t a) (* y z))))
(if (<= x -9.5e+110)
(+ x (* a (+ t (* z b))))
(if (<= x 3350000.0) (+ (* (* z a) b) t_1) (+ x t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t * a) + (y * z);
double tmp;
if (x <= -9.5e+110) {
tmp = x + (a * (t + (z * b)));
} else if (x <= 3350000.0) {
tmp = ((z * a) * b) + t_1;
} else {
tmp = x + 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 = (t * a) + (y * z)
if (x <= (-9.5d+110)) then
tmp = x + (a * (t + (z * b)))
else if (x <= 3350000.0d0) then
tmp = ((z * a) * b) + t_1
else
tmp = x + 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 = (t * a) + (y * z);
double tmp;
if (x <= -9.5e+110) {
tmp = x + (a * (t + (z * b)));
} else if (x <= 3350000.0) {
tmp = ((z * a) * b) + t_1;
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t * a) + (y * z) tmp = 0 if x <= -9.5e+110: tmp = x + (a * (t + (z * b))) elif x <= 3350000.0: tmp = ((z * a) * b) + t_1 else: tmp = x + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t * a) + Float64(y * z)) tmp = 0.0 if (x <= -9.5e+110) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); elseif (x <= 3350000.0) tmp = Float64(Float64(Float64(z * a) * b) + t_1); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t * a) + (y * z); tmp = 0.0; if (x <= -9.5e+110) tmp = x + (a * (t + (z * b))); elseif (x <= 3350000.0) tmp = ((z * a) * b) + t_1; else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.5e+110], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3350000.0], N[(N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision] + t$95$1), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot a + y \cdot z\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{+110}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;x \leq 3350000:\\
\;\;\;\;\left(z \cdot a\right) \cdot b + t\_1\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if x < -9.49999999999999939e110Initial program 87.2%
associate-+l+87.2%
+-commutative87.2%
fma-define87.2%
associate-*l*92.1%
*-commutative92.1%
*-commutative92.1%
distribute-rgt-out94.7%
*-commutative94.7%
Simplified94.7%
Taylor expanded in y around 0 97.5%
if -9.49999999999999939e110 < x < 3.35e6Initial program 95.4%
Taylor expanded in x around 0 89.0%
if 3.35e6 < x Initial program 92.1%
associate-+l+92.1%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in b around 0 88.0%
Final simplification90.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -8.2e+82)
(+ x t_1)
(if (<= a 1.52e-120) (+ x (+ (* t a) (* y z))) (+ t_1 (* y z))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (a <= -8.2e+82) {
tmp = x + t_1;
} else if (a <= 1.52e-120) {
tmp = x + ((t * a) + (y * z));
} else {
tmp = t_1 + (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) :: t_1
real(8) :: tmp
t_1 = a * (t + (z * b))
if (a <= (-8.2d+82)) then
tmp = x + t_1
else if (a <= 1.52d-120) then
tmp = x + ((t * a) + (y * z))
else
tmp = t_1 + (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 t_1 = a * (t + (z * b));
double tmp;
if (a <= -8.2e+82) {
tmp = x + t_1;
} else if (a <= 1.52e-120) {
tmp = x + ((t * a) + (y * z));
} else {
tmp = t_1 + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -8.2e+82: tmp = x + t_1 elif a <= 1.52e-120: tmp = x + ((t * a) + (y * z)) else: tmp = t_1 + (y * z) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -8.2e+82) tmp = Float64(x + t_1); elseif (a <= 1.52e-120) tmp = Float64(x + Float64(Float64(t * a) + Float64(y * z))); else tmp = Float64(t_1 + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (t + (z * b)); tmp = 0.0; if (a <= -8.2e+82) tmp = x + t_1; elseif (a <= 1.52e-120) tmp = x + ((t * a) + (y * z)); else tmp = t_1 + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8.2e+82], N[(x + t$95$1), $MachinePrecision], If[LessEqual[a, 1.52e-120], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(y * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -8.2 \cdot 10^{+82}:\\
\;\;\;\;x + t\_1\\
\mathbf{elif}\;a \leq 1.52 \cdot 10^{-120}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + y \cdot z\\
\end{array}
\end{array}
if a < -8.1999999999999999e82Initial program 88.2%
associate-+l+88.2%
+-commutative88.2%
fma-define88.2%
associate-*l*88.2%
*-commutative88.2%
*-commutative88.2%
distribute-rgt-out94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in y around 0 97.2%
if -8.1999999999999999e82 < a < 1.52e-120Initial program 97.8%
associate-+l+97.8%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in b around 0 90.7%
if 1.52e-120 < a Initial program 88.4%
associate-+l+88.4%
+-commutative88.4%
fma-define88.4%
associate-*l*92.9%
*-commutative92.9%
*-commutative92.9%
distribute-rgt-out94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in x around 0 85.4%
Final simplification89.8%
(FPCore (x y z t a b) :precision binary64 (if (<= z 3.7e+180) (+ (+ x (* y z)) (+ (* a (* z b)) (* t a))) (* z (+ y (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 3.7e+180) {
tmp = (x + (y * z)) + ((a * (z * b)) + (t * a));
} else {
tmp = z * (y + (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 <= 3.7d+180) then
tmp = (x + (y * z)) + ((a * (z * b)) + (t * a))
else
tmp = z * (y + (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 <= 3.7e+180) {
tmp = (x + (y * z)) + ((a * (z * b)) + (t * a));
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 3.7e+180: tmp = (x + (y * z)) + ((a * (z * b)) + (t * a)) else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 3.7e+180) tmp = Float64(Float64(x + Float64(y * z)) + Float64(Float64(a * Float64(z * b)) + Float64(t * a))); else tmp = Float64(z * Float64(y + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= 3.7e+180) tmp = (x + (y * z)) + ((a * (z * b)) + (t * a)); else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 3.7e+180], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.7 \cdot 10^{+180}:\\
\;\;\;\;\left(x + y \cdot z\right) + \left(a \cdot \left(z \cdot b\right) + t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if z < 3.7000000000000002e180Initial program 94.9%
associate-+l+94.9%
associate-*l*94.1%
Simplified94.1%
if 3.7000000000000002e180 < z Initial program 78.5%
associate-+l+78.5%
associate-*l*70.1%
Simplified70.1%
Taylor expanded in z around inf 88.3%
Final simplification93.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4e+50) (not (<= y 1.85e+129))) (+ x (* 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 <= -4e+50) || !(y <= 1.85e+129)) {
tmp = x + (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 <= (-4d+50)) .or. (.not. (y <= 1.85d+129))) then
tmp = x + (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 <= -4e+50) || !(y <= 1.85e+129)) {
tmp = x + (y * z);
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -4e+50) or not (y <= 1.85e+129): tmp = x + (y * z) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -4e+50) || !(y <= 1.85e+129)) tmp = Float64(x + 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 <= -4e+50) || ~((y <= 1.85e+129))) tmp = x + (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, -4e+50], N[Not[LessEqual[y, 1.85e+129]], $MachinePrecision]], N[(x + N[(y * z), $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 -4 \cdot 10^{+50} \lor \neg \left(y \leq 1.85 \cdot 10^{+129}\right):\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if y < -4.0000000000000003e50 or 1.84999999999999989e129 < y Initial program 88.2%
associate-+l+88.2%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in a around 0 83.3%
if -4.0000000000000003e50 < y < 1.84999999999999989e129Initial program 96.4%
associate-+l+96.4%
+-commutative96.4%
fma-define96.4%
associate-*l*94.7%
*-commutative94.7%
*-commutative94.7%
distribute-rgt-out95.9%
*-commutative95.9%
Simplified95.9%
Taylor expanded in y around 0 87.3%
Final simplification85.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.1e+82) (not (<= a 1.35e+75))) (+ x (* a (+ t (* z b)))) (+ x (+ (* t a) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.1e+82) || !(a <= 1.35e+75)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((t * a) + (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 <= (-1.1d+82)) .or. (.not. (a <= 1.35d+75))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + ((t * a) + (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 <= -1.1e+82) || !(a <= 1.35e+75)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.1e+82) or not (a <= 1.35e+75): tmp = x + (a * (t + (z * b))) else: tmp = x + ((t * a) + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.1e+82) || !(a <= 1.35e+75)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(Float64(t * a) + Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.1e+82) || ~((a <= 1.35e+75))) tmp = x + (a * (t + (z * b))); else tmp = x + ((t * a) + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.1e+82], N[Not[LessEqual[a, 1.35e+75]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \cdot 10^{+82} \lor \neg \left(a \leq 1.35 \cdot 10^{+75}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\end{array}
\end{array}
if a < -1.1000000000000001e82 or 1.34999999999999999e75 < a Initial program 84.9%
associate-+l+84.9%
+-commutative84.9%
fma-define84.9%
associate-*l*90.1%
*-commutative90.1%
*-commutative90.1%
distribute-rgt-out93.4%
*-commutative93.4%
Simplified93.4%
Taylor expanded in y around 0 90.3%
if -1.1000000000000001e82 < a < 1.34999999999999999e75Initial program 98.2%
associate-+l+98.2%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in b around 0 89.3%
Final simplification89.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -7.2e-25) (not (<= a 5e-33))) (* 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 <= -7.2e-25) || !(a <= 5e-33)) {
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 <= (-7.2d-25)) .or. (.not. (a <= 5d-33))) 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 <= -7.2e-25) || !(a <= 5e-33)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -7.2e-25) or not (a <= 5e-33): 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 <= -7.2e-25) || !(a <= 5e-33)) 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 <= -7.2e-25) || ~((a <= 5e-33))) 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, -7.2e-25], N[Not[LessEqual[a, 5e-33]], $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 -7.2 \cdot 10^{-25} \lor \neg \left(a \leq 5 \cdot 10^{-33}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -7.1999999999999998e-25 or 5.00000000000000028e-33 < a Initial program 88.5%
associate-+l+88.5%
associate-*l*92.2%
Simplified92.2%
Taylor expanded in a around inf 74.3%
if -7.1999999999999998e-25 < a < 5.00000000000000028e-33Initial program 98.4%
associate-+l+98.4%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in a around 0 78.3%
Final simplification76.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.35e+65) (not (<= a 5.5e+140))) (* t a) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.35e+65) || !(a <= 5.5e+140)) {
tmp = t * a;
} 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 <= (-1.35d+65)) .or. (.not. (a <= 5.5d+140))) then
tmp = t * a
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 <= -1.35e+65) || !(a <= 5.5e+140)) {
tmp = t * a;
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.35e+65) or not (a <= 5.5e+140): tmp = t * a else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.35e+65) || !(a <= 5.5e+140)) tmp = Float64(t * a); 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 <= -1.35e+65) || ~((a <= 5.5e+140))) tmp = t * a; else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.35e+65], N[Not[LessEqual[a, 5.5e+140]], $MachinePrecision]], N[(t * a), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{+65} \lor \neg \left(a \leq 5.5 \cdot 10^{+140}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -1.35000000000000009e65 or 5.5e140 < a Initial program 85.7%
associate-+l+85.7%
associate-*l*89.1%
Simplified89.1%
Taylor expanded in t around inf 55.4%
if -1.35000000000000009e65 < a < 5.5e140Initial program 97.1%
associate-+l+97.1%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in a around 0 68.9%
Final simplification64.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -850000000000.0) (not (<= y 1.5e+98))) (+ x (* y z)) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -850000000000.0) || !(y <= 1.5e+98)) {
tmp = x + (y * z);
} 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) :: tmp
if ((y <= (-850000000000.0d0)) .or. (.not. (y <= 1.5d+98))) then
tmp = x + (y * z)
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 tmp;
if ((y <= -850000000000.0) || !(y <= 1.5e+98)) {
tmp = x + (y * z);
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -850000000000.0) or not (y <= 1.5e+98): tmp = x + (y * z) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -850000000000.0) || !(y <= 1.5e+98)) tmp = Float64(x + Float64(y * z)); else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -850000000000.0) || ~((y <= 1.5e+98))) tmp = x + (y * z); else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -850000000000.0], N[Not[LessEqual[y, 1.5e+98]], $MachinePrecision]], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -850000000000 \lor \neg \left(y \leq 1.5 \cdot 10^{+98}\right):\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if y < -8.5e11 or 1.5000000000000001e98 < y Initial program 87.1%
associate-+l+87.1%
associate-*l*86.2%
Simplified86.2%
Taylor expanded in a around 0 80.8%
if -8.5e11 < y < 1.5000000000000001e98Initial program 97.5%
associate-+l+97.5%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in z around 0 67.3%
+-commutative67.3%
Simplified67.3%
Final simplification72.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.3e-25) (not (<= a 4.6e-54))) (* t a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.3e-25) || !(a <= 4.6e-54)) {
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 ((a <= (-1.3d-25)) .or. (.not. (a <= 4.6d-54))) 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 ((a <= -1.3e-25) || !(a <= 4.6e-54)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.3e-25) or not (a <= 4.6e-54): tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.3e-25) || !(a <= 4.6e-54)) 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 ((a <= -1.3e-25) || ~((a <= 4.6e-54))) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.3e-25], N[Not[LessEqual[a, 4.6e-54]], $MachinePrecision]], N[(t * a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.3 \cdot 10^{-25} \lor \neg \left(a \leq 4.6 \cdot 10^{-54}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.3e-25 or 4.5999999999999998e-54 < a Initial program 88.8%
associate-+l+88.8%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in t around inf 48.2%
if -1.3e-25 < a < 4.5999999999999998e-54Initial program 98.3%
associate-+l+98.3%
associate-*l*91.4%
Simplified91.4%
Taylor expanded in x around inf 39.7%
Final simplification44.1%
(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*92.0%
Simplified92.0%
Taylor expanded in x around inf 25.3%
Final simplification25.3%
(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 2024057
(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)))