
(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 (if (<= z -8e+240) (* z (+ y (* a b))) (+ (fma y z x) (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -8e+240) {
tmp = z * (y + (a * b));
} else {
tmp = fma(y, z, x) + (a * (t + (z * b)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -8e+240) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -8e+240], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+240}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -8.00000000000000011e240Initial program 83.8%
associate-+l+83.8%
associate-*l*73.1%
Simplified73.1%
Taylor expanded in z around inf 100.0%
if -8.00000000000000011e240 < z Initial program 94.6%
associate-+l+94.6%
+-commutative94.6%
fma-define94.6%
associate-*l*96.3%
*-commutative96.3%
*-commutative96.3%
distribute-rgt-out97.1%
*-commutative97.1%
Simplified97.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -4.8e-39)
(* a t)
(if (<= a -2.2e-118)
(* z y)
(if (<= a -1.85e-218)
x
(if (<= a 1.1e-45)
(* z y)
(if (or (<= a 2.8e+120) (not (<= a 1.4e+222)))
(* a t)
(* a (* z b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.8e-39) {
tmp = a * t;
} else if (a <= -2.2e-118) {
tmp = z * y;
} else if (a <= -1.85e-218) {
tmp = x;
} else if (a <= 1.1e-45) {
tmp = z * y;
} else if ((a <= 2.8e+120) || !(a <= 1.4e+222)) {
tmp = a * t;
} else {
tmp = 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 (a <= (-4.8d-39)) then
tmp = a * t
else if (a <= (-2.2d-118)) then
tmp = z * y
else if (a <= (-1.85d-218)) then
tmp = x
else if (a <= 1.1d-45) then
tmp = z * y
else if ((a <= 2.8d+120) .or. (.not. (a <= 1.4d+222))) then
tmp = a * t
else
tmp = 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 (a <= -4.8e-39) {
tmp = a * t;
} else if (a <= -2.2e-118) {
tmp = z * y;
} else if (a <= -1.85e-218) {
tmp = x;
} else if (a <= 1.1e-45) {
tmp = z * y;
} else if ((a <= 2.8e+120) || !(a <= 1.4e+222)) {
tmp = a * t;
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -4.8e-39: tmp = a * t elif a <= -2.2e-118: tmp = z * y elif a <= -1.85e-218: tmp = x elif a <= 1.1e-45: tmp = z * y elif (a <= 2.8e+120) or not (a <= 1.4e+222): tmp = a * t else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4.8e-39) tmp = Float64(a * t); elseif (a <= -2.2e-118) tmp = Float64(z * y); elseif (a <= -1.85e-218) tmp = x; elseif (a <= 1.1e-45) tmp = Float64(z * y); elseif ((a <= 2.8e+120) || !(a <= 1.4e+222)) tmp = Float64(a * t); else tmp = Float64(a * Float64(z * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -4.8e-39) tmp = a * t; elseif (a <= -2.2e-118) tmp = z * y; elseif (a <= -1.85e-218) tmp = x; elseif (a <= 1.1e-45) tmp = z * y; elseif ((a <= 2.8e+120) || ~((a <= 1.4e+222))) tmp = a * t; else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4.8e-39], N[(a * t), $MachinePrecision], If[LessEqual[a, -2.2e-118], N[(z * y), $MachinePrecision], If[LessEqual[a, -1.85e-218], x, If[LessEqual[a, 1.1e-45], N[(z * y), $MachinePrecision], If[Or[LessEqual[a, 2.8e+120], N[Not[LessEqual[a, 1.4e+222]], $MachinePrecision]], N[(a * t), $MachinePrecision], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.8 \cdot 10^{-39}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -2.2 \cdot 10^{-118}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq -1.85 \cdot 10^{-218}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{-45}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{+120} \lor \neg \left(a \leq 1.4 \cdot 10^{+222}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if a < -4.80000000000000031e-39 or 1.09999999999999997e-45 < a < 2.8000000000000001e120 or 1.4000000000000001e222 < a Initial program 90.1%
associate-+l+90.1%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in t around inf 49.0%
if -4.80000000000000031e-39 < a < -2.19999999999999984e-118 or -1.8500000000000001e-218 < a < 1.09999999999999997e-45Initial program 98.9%
associate-+l+98.9%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in y around inf 54.3%
*-commutative54.3%
Simplified54.3%
if -2.19999999999999984e-118 < a < -1.8500000000000001e-218Initial program 99.9%
associate-+l+99.9%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in x around inf 61.7%
if 2.8000000000000001e120 < a < 1.4000000000000001e222Initial program 89.7%
associate-+l+89.7%
associate-*l*96.3%
Simplified96.3%
Taylor expanded in z around inf 60.3%
Taylor expanded in y around 0 43.4%
Taylor expanded in z around 0 55.2%
*-commutative55.2%
Simplified55.2%
Final simplification52.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* z y)) (* a t)) (* b (* z a))))) (if (<= t_1 INFINITY) t_1 (+ x (* a (+ t (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(z * y)) + Float64(a * t)) + Float64(b * Float64(z * a))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; 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) t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + z \cdot y\right) + a \cdot t\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \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 97.6%
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%
+-commutative0.0%
fma-define0.0%
associate-*l*30.0%
*-commutative30.0%
*-commutative30.0%
distribute-rgt-out50.0%
*-commutative50.0%
Simplified50.0%
Taylor expanded in y around 0 80.5%
Final simplification96.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -3.1e-27)
(* z y)
(if (<= y -2.65e-127)
(* a t)
(if (<= y -6.9e-158)
x
(if (<= y 2.3e-174)
(* b (* z a))
(if (<= y 1.26e+103) (* a t) (* z y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.1e-27) {
tmp = z * y;
} else if (y <= -2.65e-127) {
tmp = a * t;
} else if (y <= -6.9e-158) {
tmp = x;
} else if (y <= 2.3e-174) {
tmp = b * (z * a);
} else if (y <= 1.26e+103) {
tmp = a * t;
} else {
tmp = z * y;
}
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 <= (-3.1d-27)) then
tmp = z * y
else if (y <= (-2.65d-127)) then
tmp = a * t
else if (y <= (-6.9d-158)) then
tmp = x
else if (y <= 2.3d-174) then
tmp = b * (z * a)
else if (y <= 1.26d+103) then
tmp = a * t
else
tmp = z * y
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 <= -3.1e-27) {
tmp = z * y;
} else if (y <= -2.65e-127) {
tmp = a * t;
} else if (y <= -6.9e-158) {
tmp = x;
} else if (y <= 2.3e-174) {
tmp = b * (z * a);
} else if (y <= 1.26e+103) {
tmp = a * t;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.1e-27: tmp = z * y elif y <= -2.65e-127: tmp = a * t elif y <= -6.9e-158: tmp = x elif y <= 2.3e-174: tmp = b * (z * a) elif y <= 1.26e+103: tmp = a * t else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.1e-27) tmp = Float64(z * y); elseif (y <= -2.65e-127) tmp = Float64(a * t); elseif (y <= -6.9e-158) tmp = x; elseif (y <= 2.3e-174) tmp = Float64(b * Float64(z * a)); elseif (y <= 1.26e+103) tmp = Float64(a * t); else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -3.1e-27) tmp = z * y; elseif (y <= -2.65e-127) tmp = a * t; elseif (y <= -6.9e-158) tmp = x; elseif (y <= 2.3e-174) tmp = b * (z * a); elseif (y <= 1.26e+103) tmp = a * t; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.1e-27], N[(z * y), $MachinePrecision], If[LessEqual[y, -2.65e-127], N[(a * t), $MachinePrecision], If[LessEqual[y, -6.9e-158], x, If[LessEqual[y, 2.3e-174], N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.26e+103], N[(a * t), $MachinePrecision], N[(z * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-27}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;y \leq -2.65 \cdot 10^{-127}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;y \leq -6.9 \cdot 10^{-158}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-174}:\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\mathbf{elif}\;y \leq 1.26 \cdot 10^{+103}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if y < -3.0999999999999998e-27 or 1.26000000000000006e103 < y Initial program 92.5%
associate-+l+92.5%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in y around inf 55.8%
*-commutative55.8%
Simplified55.8%
if -3.0999999999999998e-27 < y < -2.6500000000000001e-127 or 2.2999999999999999e-174 < y < 1.26000000000000006e103Initial program 92.7%
associate-+l+92.7%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in t around inf 45.3%
if -2.6500000000000001e-127 < y < -6.8999999999999997e-158Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 75.6%
if -6.8999999999999997e-158 < y < 2.2999999999999999e-174Initial program 96.6%
associate-+l+96.6%
associate-*l*95.1%
Simplified95.1%
Taylor expanded in t around 0 71.6%
+-commutative71.6%
+-commutative71.6%
associate-*r*68.2%
distribute-rgt-in68.2%
Simplified68.2%
Taylor expanded in y around 0 68.2%
Taylor expanded in b around inf 68.1%
Taylor expanded in a around inf 49.0%
Final simplification52.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a t))))
(if (<= a -1.65e-38)
t_1
(if (<= a 4.9e-34)
(+ x (* z y))
(if (or (<= a 4.1e+159) (not (<= a 1.2e+219))) t_1 (* b (* z a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * t);
double tmp;
if (a <= -1.65e-38) {
tmp = t_1;
} else if (a <= 4.9e-34) {
tmp = x + (z * y);
} else if ((a <= 4.1e+159) || !(a <= 1.2e+219)) {
tmp = t_1;
} else {
tmp = b * (z * 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 = x + (a * t)
if (a <= (-1.65d-38)) then
tmp = t_1
else if (a <= 4.9d-34) then
tmp = x + (z * y)
else if ((a <= 4.1d+159) .or. (.not. (a <= 1.2d+219))) then
tmp = t_1
else
tmp = b * (z * 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 = x + (a * t);
double tmp;
if (a <= -1.65e-38) {
tmp = t_1;
} else if (a <= 4.9e-34) {
tmp = x + (z * y);
} else if ((a <= 4.1e+159) || !(a <= 1.2e+219)) {
tmp = t_1;
} else {
tmp = b * (z * a);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * t) tmp = 0 if a <= -1.65e-38: tmp = t_1 elif a <= 4.9e-34: tmp = x + (z * y) elif (a <= 4.1e+159) or not (a <= 1.2e+219): tmp = t_1 else: tmp = b * (z * a) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * t)) tmp = 0.0 if (a <= -1.65e-38) tmp = t_1; elseif (a <= 4.9e-34) tmp = Float64(x + Float64(z * y)); elseif ((a <= 4.1e+159) || !(a <= 1.2e+219)) tmp = t_1; else tmp = Float64(b * Float64(z * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (a * t); tmp = 0.0; if (a <= -1.65e-38) tmp = t_1; elseif (a <= 4.9e-34) tmp = x + (z * y); elseif ((a <= 4.1e+159) || ~((a <= 1.2e+219))) tmp = t_1; else tmp = b * (z * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.65e-38], t$95$1, If[LessEqual[a, 4.9e-34], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 4.1e+159], N[Not[LessEqual[a, 1.2e+219]], $MachinePrecision]], t$95$1, N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot t\\
\mathbf{if}\;a \leq -1.65 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.9 \cdot 10^{-34}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{elif}\;a \leq 4.1 \cdot 10^{+159} \lor \neg \left(a \leq 1.2 \cdot 10^{+219}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\end{array}
\end{array}
if a < -1.6500000000000001e-38 or 4.89999999999999962e-34 < a < 4.10000000000000014e159 or 1.2e219 < a Initial program 89.2%
associate-+l+89.2%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in z around 0 60.8%
+-commutative60.8%
Simplified60.8%
if -1.6500000000000001e-38 < a < 4.89999999999999962e-34Initial program 99.1%
associate-+l+99.1%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in a around 0 84.0%
if 4.10000000000000014e159 < a < 1.2e219Initial program 94.5%
associate-+l+94.5%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in t around 0 88.5%
+-commutative88.5%
+-commutative88.5%
associate-*r*66.1%
distribute-rgt-in66.1%
Simplified66.1%
Taylor expanded in y around 0 65.5%
Taylor expanded in b around inf 71.4%
Taylor expanded in a around inf 60.5%
Final simplification70.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -2.3e+138)
(* a t)
(if (<= a 3e+39)
(+ x (* z y))
(if (or (<= a 4.8e+220) (not (<= a 1.8e+268))) (* b (* z a)) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.3e+138) {
tmp = a * t;
} else if (a <= 3e+39) {
tmp = x + (z * y);
} else if ((a <= 4.8e+220) || !(a <= 1.8e+268)) {
tmp = b * (z * a);
} else {
tmp = a * t;
}
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 <= (-2.3d+138)) then
tmp = a * t
else if (a <= 3d+39) then
tmp = x + (z * y)
else if ((a <= 4.8d+220) .or. (.not. (a <= 1.8d+268))) then
tmp = b * (z * a)
else
tmp = a * t
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 <= -2.3e+138) {
tmp = a * t;
} else if (a <= 3e+39) {
tmp = x + (z * y);
} else if ((a <= 4.8e+220) || !(a <= 1.8e+268)) {
tmp = b * (z * a);
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.3e+138: tmp = a * t elif a <= 3e+39: tmp = x + (z * y) elif (a <= 4.8e+220) or not (a <= 1.8e+268): tmp = b * (z * a) else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.3e+138) tmp = Float64(a * t); elseif (a <= 3e+39) tmp = Float64(x + Float64(z * y)); elseif ((a <= 4.8e+220) || !(a <= 1.8e+268)) tmp = Float64(b * Float64(z * a)); else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -2.3e+138) tmp = a * t; elseif (a <= 3e+39) tmp = x + (z * y); elseif ((a <= 4.8e+220) || ~((a <= 1.8e+268))) tmp = b * (z * a); else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.3e+138], N[(a * t), $MachinePrecision], If[LessEqual[a, 3e+39], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 4.8e+220], N[Not[LessEqual[a, 1.8e+268]], $MachinePrecision]], N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision], N[(a * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.3 \cdot 10^{+138}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 3 \cdot 10^{+39}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{elif}\;a \leq 4.8 \cdot 10^{+220} \lor \neg \left(a \leq 1.8 \cdot 10^{+268}\right):\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -2.30000000000000008e138 or 4.7999999999999996e220 < a < 1.79999999999999995e268Initial program 80.8%
associate-+l+80.8%
associate-*l*90.2%
Simplified90.2%
Taylor expanded in t around inf 64.4%
if -2.30000000000000008e138 < a < 3e39Initial program 98.7%
associate-+l+98.7%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in a around 0 69.4%
if 3e39 < a < 4.7999999999999996e220 or 1.79999999999999995e268 < a Initial program 88.6%
associate-+l+88.6%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in t around 0 74.0%
+-commutative74.0%
+-commutative74.0%
associate-*r*61.2%
distribute-rgt-in63.1%
Simplified63.1%
Taylor expanded in y around 0 64.7%
Taylor expanded in b around inf 62.8%
Taylor expanded in a around inf 57.0%
Final simplification66.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* a t) (* z y))))
(if (<= b -8.6e+135)
(+ t_1 (* b (* z a)))
(if (or (<= b -9.6e-23) (not (<= b 2.4e-37)))
(+ x (* a (+ t (* z b))))
(+ x t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a * t) + (z * y);
double tmp;
if (b <= -8.6e+135) {
tmp = t_1 + (b * (z * a));
} else if ((b <= -9.6e-23) || !(b <= 2.4e-37)) {
tmp = x + (a * (t + (z * b)));
} 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 = (a * t) + (z * y)
if (b <= (-8.6d+135)) then
tmp = t_1 + (b * (z * a))
else if ((b <= (-9.6d-23)) .or. (.not. (b <= 2.4d-37))) then
tmp = x + (a * (t + (z * b)))
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 = (a * t) + (z * y);
double tmp;
if (b <= -8.6e+135) {
tmp = t_1 + (b * (z * a));
} else if ((b <= -9.6e-23) || !(b <= 2.4e-37)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a * t) + (z * y) tmp = 0 if b <= -8.6e+135: tmp = t_1 + (b * (z * a)) elif (b <= -9.6e-23) or not (b <= 2.4e-37): tmp = x + (a * (t + (z * b))) else: tmp = x + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a * t) + Float64(z * y)) tmp = 0.0 if (b <= -8.6e+135) tmp = Float64(t_1 + Float64(b * Float64(z * a))); elseif ((b <= -9.6e-23) || !(b <= 2.4e-37)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a * t) + (z * y); tmp = 0.0; if (b <= -8.6e+135) tmp = t_1 + (b * (z * a)); elseif ((b <= -9.6e-23) || ~((b <= 2.4e-37))) tmp = x + (a * (t + (z * b))); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -8.6e+135], N[(t$95$1 + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[b, -9.6e-23], N[Not[LessEqual[b, 2.4e-37]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot t + z \cdot y\\
\mathbf{if}\;b \leq -8.6 \cdot 10^{+135}:\\
\;\;\;\;t\_1 + b \cdot \left(z \cdot a\right)\\
\mathbf{elif}\;b \leq -9.6 \cdot 10^{-23} \lor \neg \left(b \leq 2.4 \cdot 10^{-37}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if b < -8.59999999999999945e135Initial program 97.3%
Taylor expanded in x around 0 85.6%
if -8.59999999999999945e135 < b < -9.59999999999999986e-23 or 2.39999999999999991e-37 < b Initial program 93.4%
associate-+l+93.4%
+-commutative93.4%
fma-define93.4%
associate-*l*92.3%
*-commutative92.3%
*-commutative92.3%
distribute-rgt-out94.5%
*-commutative94.5%
Simplified94.5%
Taylor expanded in y around 0 89.6%
if -9.59999999999999986e-23 < b < 2.39999999999999991e-37Initial program 93.1%
associate-+l+93.1%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in b around 0 96.0%
Final simplification92.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -6e-39)
(* a t)
(if (<= a -6.7e-128)
(* z y)
(if (<= a -2.4e-218) x (if (<= a 3e-42) (* z y) (* a t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -6e-39) {
tmp = a * t;
} else if (a <= -6.7e-128) {
tmp = z * y;
} else if (a <= -2.4e-218) {
tmp = x;
} else if (a <= 3e-42) {
tmp = z * y;
} else {
tmp = a * t;
}
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 <= (-6d-39)) then
tmp = a * t
else if (a <= (-6.7d-128)) then
tmp = z * y
else if (a <= (-2.4d-218)) then
tmp = x
else if (a <= 3d-42) then
tmp = z * y
else
tmp = a * t
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 <= -6e-39) {
tmp = a * t;
} else if (a <= -6.7e-128) {
tmp = z * y;
} else if (a <= -2.4e-218) {
tmp = x;
} else if (a <= 3e-42) {
tmp = z * y;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -6e-39: tmp = a * t elif a <= -6.7e-128: tmp = z * y elif a <= -2.4e-218: tmp = x elif a <= 3e-42: tmp = z * y else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -6e-39) tmp = Float64(a * t); elseif (a <= -6.7e-128) tmp = Float64(z * y); elseif (a <= -2.4e-218) tmp = x; elseif (a <= 3e-42) tmp = Float64(z * y); else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -6e-39) tmp = a * t; elseif (a <= -6.7e-128) tmp = z * y; elseif (a <= -2.4e-218) tmp = x; elseif (a <= 3e-42) tmp = z * y; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -6e-39], N[(a * t), $MachinePrecision], If[LessEqual[a, -6.7e-128], N[(z * y), $MachinePrecision], If[LessEqual[a, -2.4e-218], x, If[LessEqual[a, 3e-42], N[(z * y), $MachinePrecision], N[(a * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{-39}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -6.7 \cdot 10^{-128}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq -2.4 \cdot 10^{-218}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3 \cdot 10^{-42}:\\
\;\;\;\;z \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -6.00000000000000055e-39 or 3.00000000000000027e-42 < a Initial program 90.0%
associate-+l+90.0%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in t around inf 44.3%
if -6.00000000000000055e-39 < a < -6.70000000000000027e-128 or -2.4000000000000001e-218 < a < 3.00000000000000027e-42Initial program 98.9%
associate-+l+98.9%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in y around inf 54.3%
*-commutative54.3%
Simplified54.3%
if -6.70000000000000027e-128 < a < -2.4000000000000001e-218Initial program 99.9%
associate-+l+99.9%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in x around inf 61.7%
(FPCore (x y z t a b) :precision binary64 (if (<= z -3.2e+165) (+ (* z (+ y (* a b))) x) (+ (+ x (* z y)) (+ (* a (* z b)) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.2e+165) {
tmp = (z * (y + (a * b))) + x;
} else {
tmp = (x + (z * y)) + ((a * (z * b)) + (a * t));
}
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.2d+165)) then
tmp = (z * (y + (a * b))) + x
else
tmp = (x + (z * y)) + ((a * (z * b)) + (a * t))
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.2e+165) {
tmp = (z * (y + (a * b))) + x;
} else {
tmp = (x + (z * y)) + ((a * (z * b)) + (a * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.2e+165: tmp = (z * (y + (a * b))) + x else: tmp = (x + (z * y)) + ((a * (z * b)) + (a * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.2e+165) tmp = Float64(Float64(z * Float64(y + Float64(a * b))) + x); else tmp = Float64(Float64(x + Float64(z * y)) + Float64(Float64(a * Float64(z * b)) + Float64(a * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -3.2e+165) tmp = (z * (y + (a * b))) + x; else tmp = (x + (z * y)) + ((a * (z * b)) + (a * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.2e+165], N[(N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+165}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right) + x\\
\mathbf{else}:\\
\;\;\;\;\left(x + z \cdot y\right) + \left(a \cdot \left(z \cdot b\right) + a \cdot t\right)\\
\end{array}
\end{array}
if z < -3.2e165Initial program 78.1%
associate-+l+78.1%
associate-*l*78.4%
Simplified78.4%
Taylor expanded in t around 0 82.3%
+-commutative82.3%
+-commutative82.3%
associate-*r*92.7%
distribute-rgt-in96.5%
Simplified96.5%
if -3.2e165 < z Initial program 95.7%
associate-+l+95.7%
associate-*l*96.5%
Simplified96.5%
Final simplification96.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -6.8e-38) (not (<= a 2.8e-63))) (+ x (* a (+ t (* z b)))) (+ x (+ (* a t) (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6.8e-38) || !(a <= 2.8e-63)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((a * t) + (z * y));
}
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 <= (-6.8d-38)) .or. (.not. (a <= 2.8d-63))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + ((a * t) + (z * y))
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 <= -6.8e-38) || !(a <= 2.8e-63)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((a * t) + (z * y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -6.8e-38) or not (a <= 2.8e-63): tmp = x + (a * (t + (z * b))) else: tmp = x + ((a * t) + (z * y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -6.8e-38) || !(a <= 2.8e-63)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(Float64(a * t) + Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -6.8e-38) || ~((a <= 2.8e-63))) tmp = x + (a * (t + (z * b))); else tmp = x + ((a * t) + (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -6.8e-38], N[Not[LessEqual[a, 2.8e-63]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.8 \cdot 10^{-38} \lor \neg \left(a \leq 2.8 \cdot 10^{-63}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\
\end{array}
\end{array}
if a < -6.8000000000000004e-38 or 2.8000000000000002e-63 < a Initial program 90.1%
associate-+l+90.1%
+-commutative90.1%
fma-define90.1%
associate-*l*95.2%
*-commutative95.2%
*-commutative95.2%
distribute-rgt-out96.6%
*-commutative96.6%
Simplified96.6%
Taylor expanded in y around 0 87.3%
if -6.8000000000000004e-38 < a < 2.8000000000000002e-63Initial program 99.0%
associate-+l+99.0%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in b around 0 93.4%
Final simplification89.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.02e-38) (not (<= a 2.3e-63))) (+ x (* a (+ t (* z b)))) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.02e-38) || !(a <= 2.3e-63)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (z * y);
}
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.02d-38)) .or. (.not. (a <= 2.3d-63))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + (z * y)
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.02e-38) || !(a <= 2.3e-63)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.02e-38) or not (a <= 2.3e-63): tmp = x + (a * (t + (z * b))) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.02e-38) || !(a <= 2.3e-63)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.02e-38) || ~((a <= 2.3e-63))) tmp = x + (a * (t + (z * b))); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.02e-38], N[Not[LessEqual[a, 2.3e-63]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.02 \cdot 10^{-38} \lor \neg \left(a \leq 2.3 \cdot 10^{-63}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -1.01999999999999998e-38 or 2.3e-63 < a Initial program 90.1%
associate-+l+90.1%
+-commutative90.1%
fma-define90.1%
associate-*l*95.2%
*-commutative95.2%
*-commutative95.2%
distribute-rgt-out96.6%
*-commutative96.6%
Simplified96.6%
Taylor expanded in y around 0 87.3%
if -1.01999999999999998e-38 < a < 2.3e-63Initial program 99.0%
associate-+l+99.0%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in a around 0 86.1%
Final simplification86.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.9e-37) (not (<= a 2.8e-63))) (* a (+ t (* z b))) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.9e-37) || !(a <= 2.8e-63)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (z * y);
}
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.9d-37)) .or. (.not. (a <= 2.8d-63))) then
tmp = a * (t + (z * b))
else
tmp = x + (z * y)
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.9e-37) || !(a <= 2.8e-63)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.9e-37) or not (a <= 2.8e-63): tmp = a * (t + (z * b)) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.9e-37) || !(a <= 2.8e-63)) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.9e-37) || ~((a <= 2.8e-63))) tmp = a * (t + (z * b)); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.9e-37], N[Not[LessEqual[a, 2.8e-63]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{-37} \lor \neg \left(a \leq 2.8 \cdot 10^{-63}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -1.9000000000000002e-37 or 2.8000000000000002e-63 < a Initial program 90.1%
associate-+l+90.1%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in a around inf 75.4%
if -1.9000000000000002e-37 < a < 2.8000000000000002e-63Initial program 99.0%
associate-+l+99.0%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in a around 0 86.1%
Final simplification79.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.7e-88) (not (<= a 3.2e-43))) (* a t) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.7e-88) || !(a <= 3.2e-43)) {
tmp = a * t;
} 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.7d-88)) .or. (.not. (a <= 3.2d-43))) then
tmp = a * t
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.7e-88) || !(a <= 3.2e-43)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.7e-88) or not (a <= 3.2e-43): tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.7e-88) || !(a <= 3.2e-43)) tmp = Float64(a * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.7e-88) || ~((a <= 3.2e-43))) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.7e-88], N[Not[LessEqual[a, 3.2e-43]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.7 \cdot 10^{-88} \lor \neg \left(a \leq 3.2 \cdot 10^{-43}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.69999999999999987e-88 or 3.19999999999999985e-43 < a Initial program 90.5%
associate-+l+90.5%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in t around inf 43.4%
if -1.69999999999999987e-88 < a < 3.19999999999999985e-43Initial program 99.0%
associate-+l+99.0%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in x around inf 37.3%
Final simplification41.0%
(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.8%
associate-+l+93.8%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in x around inf 22.7%
(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 2024089
(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)))