
(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.0%
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%
associate-*l*30.8%
Simplified30.8%
Taylor expanded in z around inf 84.6%
Final simplification97.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))) (t_2 (* z (+ y (* a b)))))
(if (<= z -5.4e+42)
t_2
(if (<= z -8e-6)
t_1
(if (<= z -1.75e-40)
t_2
(if (<= z 5.5e-32)
t_1
(if (<= z 6e+19)
t_2
(if (<= z 9.6e+19)
x
(if (<= z 1.32e+123) (* a (+ t (* z b))) t_2)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = z * (y + (a * b));
double tmp;
if (z <= -5.4e+42) {
tmp = t_2;
} else if (z <= -8e-6) {
tmp = t_1;
} else if (z <= -1.75e-40) {
tmp = t_2;
} else if (z <= 5.5e-32) {
tmp = t_1;
} else if (z <= 6e+19) {
tmp = t_2;
} else if (z <= 9.6e+19) {
tmp = x;
} else if (z <= 1.32e+123) {
tmp = a * (t + (z * b));
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x + (t * a)
t_2 = z * (y + (a * b))
if (z <= (-5.4d+42)) then
tmp = t_2
else if (z <= (-8d-6)) then
tmp = t_1
else if (z <= (-1.75d-40)) then
tmp = t_2
else if (z <= 5.5d-32) then
tmp = t_1
else if (z <= 6d+19) then
tmp = t_2
else if (z <= 9.6d+19) then
tmp = x
else if (z <= 1.32d+123) then
tmp = a * (t + (z * b))
else
tmp = t_2
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 + (t * a);
double t_2 = z * (y + (a * b));
double tmp;
if (z <= -5.4e+42) {
tmp = t_2;
} else if (z <= -8e-6) {
tmp = t_1;
} else if (z <= -1.75e-40) {
tmp = t_2;
} else if (z <= 5.5e-32) {
tmp = t_1;
} else if (z <= 6e+19) {
tmp = t_2;
} else if (z <= 9.6e+19) {
tmp = x;
} else if (z <= 1.32e+123) {
tmp = a * (t + (z * b));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * a) t_2 = z * (y + (a * b)) tmp = 0 if z <= -5.4e+42: tmp = t_2 elif z <= -8e-6: tmp = t_1 elif z <= -1.75e-40: tmp = t_2 elif z <= 5.5e-32: tmp = t_1 elif z <= 6e+19: tmp = t_2 elif z <= 9.6e+19: tmp = x elif z <= 1.32e+123: tmp = a * (t + (z * b)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * a)) t_2 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -5.4e+42) tmp = t_2; elseif (z <= -8e-6) tmp = t_1; elseif (z <= -1.75e-40) tmp = t_2; elseif (z <= 5.5e-32) tmp = t_1; elseif (z <= 6e+19) tmp = t_2; elseif (z <= 9.6e+19) tmp = x; elseif (z <= 1.32e+123) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (t * a); t_2 = z * (y + (a * b)); tmp = 0.0; if (z <= -5.4e+42) tmp = t_2; elseif (z <= -8e-6) tmp = t_1; elseif (z <= -1.75e-40) tmp = t_2; elseif (z <= 5.5e-32) tmp = t_1; elseif (z <= 6e+19) tmp = t_2; elseif (z <= 9.6e+19) tmp = x; elseif (z <= 1.32e+123) tmp = a * (t + (z * b)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.4e+42], t$95$2, If[LessEqual[z, -8e-6], t$95$1, If[LessEqual[z, -1.75e-40], t$95$2, If[LessEqual[z, 5.5e-32], t$95$1, If[LessEqual[z, 6e+19], t$95$2, If[LessEqual[z, 9.6e+19], x, If[LessEqual[z, 1.32e+123], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot a\\
t_2 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -5.4 \cdot 10^{+42}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-6}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-40}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+19}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 9.6 \cdot 10^{+19}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{+123}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -5.4000000000000001e42 or -7.99999999999999964e-6 < z < -1.7500000000000001e-40 or 5.50000000000000024e-32 < z < 6e19 or 1.32e123 < z Initial program 86.6%
associate-+l+86.6%
*-commutative86.6%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in z around inf 88.2%
if -5.4000000000000001e42 < z < -7.99999999999999964e-6 or -1.7500000000000001e-40 < z < 5.50000000000000024e-32Initial program 98.4%
associate-+l+98.4%
*-commutative98.4%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in z around 0 76.6%
+-commutative76.6%
Simplified76.6%
if 6e19 < z < 9.6e19Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if 9.6e19 < z < 1.32e123Initial program 90.8%
associate-+l+90.8%
*-commutative90.8%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around inf 71.9%
Final simplification81.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= t -2.65e+110)
(* t a)
(if (<= t -1.75e-99)
x
(if (<= t -3.8e-185)
(* y z)
(if (<= t -8e-197)
x
(if (<= t 1.55e-200)
t_1
(if (<= t 2.3e-146)
(* y z)
(if (<= t 1.75e+80) t_1 (* t a))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (t <= -2.65e+110) {
tmp = t * a;
} else if (t <= -1.75e-99) {
tmp = x;
} else if (t <= -3.8e-185) {
tmp = y * z;
} else if (t <= -8e-197) {
tmp = x;
} else if (t <= 1.55e-200) {
tmp = t_1;
} else if (t <= 2.3e-146) {
tmp = y * z;
} else if (t <= 1.75e+80) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (t <= (-2.65d+110)) then
tmp = t * a
else if (t <= (-1.75d-99)) then
tmp = x
else if (t <= (-3.8d-185)) then
tmp = y * z
else if (t <= (-8d-197)) then
tmp = x
else if (t <= 1.55d-200) then
tmp = t_1
else if (t <= 2.3d-146) then
tmp = y * z
else if (t <= 1.75d+80) then
tmp = t_1
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 t_1 = a * (z * b);
double tmp;
if (t <= -2.65e+110) {
tmp = t * a;
} else if (t <= -1.75e-99) {
tmp = x;
} else if (t <= -3.8e-185) {
tmp = y * z;
} else if (t <= -8e-197) {
tmp = x;
} else if (t <= 1.55e-200) {
tmp = t_1;
} else if (t <= 2.3e-146) {
tmp = y * z;
} else if (t <= 1.75e+80) {
tmp = t_1;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if t <= -2.65e+110: tmp = t * a elif t <= -1.75e-99: tmp = x elif t <= -3.8e-185: tmp = y * z elif t <= -8e-197: tmp = x elif t <= 1.55e-200: tmp = t_1 elif t <= 2.3e-146: tmp = y * z elif t <= 1.75e+80: tmp = t_1 else: tmp = t * a return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (t <= -2.65e+110) tmp = Float64(t * a); elseif (t <= -1.75e-99) tmp = x; elseif (t <= -3.8e-185) tmp = Float64(y * z); elseif (t <= -8e-197) tmp = x; elseif (t <= 1.55e-200) tmp = t_1; elseif (t <= 2.3e-146) tmp = Float64(y * z); elseif (t <= 1.75e+80) tmp = t_1; else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (t <= -2.65e+110) tmp = t * a; elseif (t <= -1.75e-99) tmp = x; elseif (t <= -3.8e-185) tmp = y * z; elseif (t <= -8e-197) tmp = x; elseif (t <= 1.55e-200) tmp = t_1; elseif (t <= 2.3e-146) tmp = y * z; elseif (t <= 1.75e+80) tmp = t_1; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.65e+110], N[(t * a), $MachinePrecision], If[LessEqual[t, -1.75e-99], x, If[LessEqual[t, -3.8e-185], N[(y * z), $MachinePrecision], If[LessEqual[t, -8e-197], x, If[LessEqual[t, 1.55e-200], t$95$1, If[LessEqual[t, 2.3e-146], N[(y * z), $MachinePrecision], If[LessEqual[t, 1.75e+80], t$95$1, N[(t * a), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;t \leq -2.65 \cdot 10^{+110}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;t \leq -1.75 \cdot 10^{-99}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -3.8 \cdot 10^{-185}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;t \leq -8 \cdot 10^{-197}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-200}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{-146}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+80}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if t < -2.6499999999999999e110 or 1.74999999999999997e80 < t Initial program 91.7%
associate-+l+91.7%
*-commutative91.7%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in t around inf 63.5%
if -2.6499999999999999e110 < t < -1.7499999999999999e-99 or -3.7999999999999999e-185 < t < -7.9999999999999999e-197Initial program 94.8%
associate-+l+94.8%
*-commutative94.8%
associate-*l*97.4%
Simplified97.4%
Taylor expanded in x around inf 45.1%
if -1.7499999999999999e-99 < t < -3.7999999999999999e-185 or 1.5499999999999999e-200 < t < 2.3000000000000001e-146Initial program 90.1%
associate-+l+90.1%
*-commutative90.1%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in y around inf 54.6%
*-commutative54.6%
Simplified54.6%
if -7.9999999999999999e-197 < t < 1.5499999999999999e-200 or 2.3000000000000001e-146 < t < 1.74999999999999997e80Initial program 94.3%
associate-+l+94.3%
*-commutative94.3%
associate-*l*89.5%
Simplified89.5%
Taylor expanded in z around inf 61.2%
Taylor expanded in y around 0 45.8%
Final simplification52.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))) (t_2 (* z (+ y (* a b)))))
(if (<= z -1.25e+40)
t_2
(if (<= z -1.75e-5)
t_1
(if (<= z -2.5e-44)
t_2
(if (<= z 1.75e-63)
t_1
(if (<= z 4.2e+57)
(+ x (* a (* z b)))
(if (<= z 3.55e+112) (* a (+ t (* z b))) t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = z * (y + (a * b));
double tmp;
if (z <= -1.25e+40) {
tmp = t_2;
} else if (z <= -1.75e-5) {
tmp = t_1;
} else if (z <= -2.5e-44) {
tmp = t_2;
} else if (z <= 1.75e-63) {
tmp = t_1;
} else if (z <= 4.2e+57) {
tmp = x + (a * (z * b));
} else if (z <= 3.55e+112) {
tmp = a * (t + (z * b));
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x + (t * a)
t_2 = z * (y + (a * b))
if (z <= (-1.25d+40)) then
tmp = t_2
else if (z <= (-1.75d-5)) then
tmp = t_1
else if (z <= (-2.5d-44)) then
tmp = t_2
else if (z <= 1.75d-63) then
tmp = t_1
else if (z <= 4.2d+57) then
tmp = x + (a * (z * b))
else if (z <= 3.55d+112) then
tmp = a * (t + (z * b))
else
tmp = t_2
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 + (t * a);
double t_2 = z * (y + (a * b));
double tmp;
if (z <= -1.25e+40) {
tmp = t_2;
} else if (z <= -1.75e-5) {
tmp = t_1;
} else if (z <= -2.5e-44) {
tmp = t_2;
} else if (z <= 1.75e-63) {
tmp = t_1;
} else if (z <= 4.2e+57) {
tmp = x + (a * (z * b));
} else if (z <= 3.55e+112) {
tmp = a * (t + (z * b));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * a) t_2 = z * (y + (a * b)) tmp = 0 if z <= -1.25e+40: tmp = t_2 elif z <= -1.75e-5: tmp = t_1 elif z <= -2.5e-44: tmp = t_2 elif z <= 1.75e-63: tmp = t_1 elif z <= 4.2e+57: tmp = x + (a * (z * b)) elif z <= 3.55e+112: tmp = a * (t + (z * b)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * a)) t_2 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -1.25e+40) tmp = t_2; elseif (z <= -1.75e-5) tmp = t_1; elseif (z <= -2.5e-44) tmp = t_2; elseif (z <= 1.75e-63) tmp = t_1; elseif (z <= 4.2e+57) tmp = Float64(x + Float64(a * Float64(z * b))); elseif (z <= 3.55e+112) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (t * a); t_2 = z * (y + (a * b)); tmp = 0.0; if (z <= -1.25e+40) tmp = t_2; elseif (z <= -1.75e-5) tmp = t_1; elseif (z <= -2.5e-44) tmp = t_2; elseif (z <= 1.75e-63) tmp = t_1; elseif (z <= 4.2e+57) tmp = x + (a * (z * b)); elseif (z <= 3.55e+112) tmp = a * (t + (z * b)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.25e+40], t$95$2, If[LessEqual[z, -1.75e-5], t$95$1, If[LessEqual[z, -2.5e-44], t$95$2, If[LessEqual[z, 1.75e-63], t$95$1, If[LessEqual[z, 4.2e+57], N[(x + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.55e+112], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot a\\
t_2 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{+40}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-5}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-44}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-63}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+57}:\\
\;\;\;\;x + a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;z \leq 3.55 \cdot 10^{+112}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1.25000000000000001e40 or -1.7499999999999998e-5 < z < -2.50000000000000019e-44 or 3.55e112 < z Initial program 85.7%
associate-+l+85.7%
*-commutative85.7%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in z around inf 87.6%
if -1.25000000000000001e40 < z < -1.7499999999999998e-5 or -2.50000000000000019e-44 < z < 1.75000000000000002e-63Initial program 98.3%
associate-+l+98.3%
*-commutative98.3%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in z around 0 78.0%
+-commutative78.0%
Simplified78.0%
if 1.75000000000000002e-63 < z < 4.19999999999999982e57Initial program 99.9%
associate-+l+99.9%
*-commutative99.9%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in y around 0 75.2%
Taylor expanded in t around 0 67.4%
if 4.19999999999999982e57 < z < 3.55e112Initial program 86.6%
associate-+l+86.6%
*-commutative86.6%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in a around inf 72.0%
Final simplification80.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))) (t_2 (* a (+ t (* z b)))))
(if (<= a -6.3e+35)
t_2
(if (<= a -5.7e-21)
t_1
(if (<= a -1.42e-65)
t_2
(if (<= a -2.8e-176) (* y z) (if (<= a 3.7e-47) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = a * (t + (z * b));
double tmp;
if (a <= -6.3e+35) {
tmp = t_2;
} else if (a <= -5.7e-21) {
tmp = t_1;
} else if (a <= -1.42e-65) {
tmp = t_2;
} else if (a <= -2.8e-176) {
tmp = y * z;
} else if (a <= 3.7e-47) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x + (t * a)
t_2 = a * (t + (z * b))
if (a <= (-6.3d+35)) then
tmp = t_2
else if (a <= (-5.7d-21)) then
tmp = t_1
else if (a <= (-1.42d-65)) then
tmp = t_2
else if (a <= (-2.8d-176)) then
tmp = y * z
else if (a <= 3.7d-47) then
tmp = t_1
else
tmp = t_2
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 + (t * a);
double t_2 = a * (t + (z * b));
double tmp;
if (a <= -6.3e+35) {
tmp = t_2;
} else if (a <= -5.7e-21) {
tmp = t_1;
} else if (a <= -1.42e-65) {
tmp = t_2;
} else if (a <= -2.8e-176) {
tmp = y * z;
} else if (a <= 3.7e-47) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * a) t_2 = a * (t + (z * b)) tmp = 0 if a <= -6.3e+35: tmp = t_2 elif a <= -5.7e-21: tmp = t_1 elif a <= -1.42e-65: tmp = t_2 elif a <= -2.8e-176: tmp = y * z elif a <= 3.7e-47: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * a)) t_2 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -6.3e+35) tmp = t_2; elseif (a <= -5.7e-21) tmp = t_1; elseif (a <= -1.42e-65) tmp = t_2; elseif (a <= -2.8e-176) tmp = Float64(y * z); elseif (a <= 3.7e-47) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (t * a); t_2 = a * (t + (z * b)); tmp = 0.0; if (a <= -6.3e+35) tmp = t_2; elseif (a <= -5.7e-21) tmp = t_1; elseif (a <= -1.42e-65) tmp = t_2; elseif (a <= -2.8e-176) tmp = y * z; elseif (a <= 3.7e-47) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6.3e+35], t$95$2, If[LessEqual[a, -5.7e-21], t$95$1, If[LessEqual[a, -1.42e-65], t$95$2, If[LessEqual[a, -2.8e-176], N[(y * z), $MachinePrecision], If[LessEqual[a, 3.7e-47], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot a\\
t_2 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -6.3 \cdot 10^{+35}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -5.7 \cdot 10^{-21}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -1.42 \cdot 10^{-65}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -2.8 \cdot 10^{-176}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 3.7 \cdot 10^{-47}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -6.29999999999999969e35 or -5.6999999999999996e-21 < a < -1.41999999999999993e-65 or 3.7e-47 < a Initial program 88.9%
associate-+l+88.9%
*-commutative88.9%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in a around inf 83.1%
if -6.29999999999999969e35 < a < -5.6999999999999996e-21 or -2.8000000000000001e-176 < a < 3.7e-47Initial program 99.0%
associate-+l+99.0%
*-commutative99.0%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in z around 0 58.5%
+-commutative58.5%
Simplified58.5%
if -1.41999999999999993e-65 < a < -2.8000000000000001e-176Initial program 90.9%
associate-+l+90.9%
*-commutative90.9%
associate-*l*90.9%
Simplified90.9%
Taylor expanded in y around inf 64.8%
*-commutative64.8%
Simplified64.8%
Final simplification71.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ y (* a b)))))
(if (<= z -6.5e+39)
t_1
(if (<= z -4.8e-54)
(+ (* t a) (* y z))
(if (<= z 1.85e-63)
(+ x (* t a))
(if (<= z 8.5e+57)
(+ x (* a (* z b)))
(if (<= z 7.2e+115) (* a (+ t (* z b))) t_1)))))))
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 <= -6.5e+39) {
tmp = t_1;
} else if (z <= -4.8e-54) {
tmp = (t * a) + (y * z);
} else if (z <= 1.85e-63) {
tmp = x + (t * a);
} else if (z <= 8.5e+57) {
tmp = x + (a * (z * b));
} else if (z <= 7.2e+115) {
tmp = a * (t + (z * b));
} 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 * (y + (a * b))
if (z <= (-6.5d+39)) then
tmp = t_1
else if (z <= (-4.8d-54)) then
tmp = (t * a) + (y * z)
else if (z <= 1.85d-63) then
tmp = x + (t * a)
else if (z <= 8.5d+57) then
tmp = x + (a * (z * b))
else if (z <= 7.2d+115) then
tmp = a * (t + (z * b))
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 * (y + (a * b));
double tmp;
if (z <= -6.5e+39) {
tmp = t_1;
} else if (z <= -4.8e-54) {
tmp = (t * a) + (y * z);
} else if (z <= 1.85e-63) {
tmp = x + (t * a);
} else if (z <= 8.5e+57) {
tmp = x + (a * (z * b));
} else if (z <= 7.2e+115) {
tmp = a * (t + (z * b));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (y + (a * b)) tmp = 0 if z <= -6.5e+39: tmp = t_1 elif z <= -4.8e-54: tmp = (t * a) + (y * z) elif z <= 1.85e-63: tmp = x + (t * a) elif z <= 8.5e+57: tmp = x + (a * (z * b)) elif z <= 7.2e+115: tmp = a * (t + (z * b)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -6.5e+39) tmp = t_1; elseif (z <= -4.8e-54) tmp = Float64(Float64(t * a) + Float64(y * z)); elseif (z <= 1.85e-63) tmp = Float64(x + Float64(t * a)); elseif (z <= 8.5e+57) tmp = Float64(x + Float64(a * Float64(z * b))); elseif (z <= 7.2e+115) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = t_1; 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 <= -6.5e+39) tmp = t_1; elseif (z <= -4.8e-54) tmp = (t * a) + (y * z); elseif (z <= 1.85e-63) tmp = x + (t * a); elseif (z <= 8.5e+57) tmp = x + (a * (z * b)); elseif (z <= 7.2e+115) tmp = a * (t + (z * b)); else tmp = t_1; 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, -6.5e+39], t$95$1, If[LessEqual[z, -4.8e-54], N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e-63], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+57], N[(x + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e+115], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -6.5 \cdot 10^{+39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-54}:\\
\;\;\;\;t \cdot a + y \cdot z\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-63}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+57}:\\
\;\;\;\;x + a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{+115}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -6.5000000000000001e39 or 7.2000000000000001e115 < z Initial program 84.3%
associate-+l+84.3%
*-commutative84.3%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in z around inf 88.0%
if -6.5000000000000001e39 < z < -4.80000000000000026e-54Initial program 95.3%
associate-+l+95.3%
*-commutative95.3%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in b around 0 77.8%
Taylor expanded in x around 0 68.8%
if -4.80000000000000026e-54 < z < 1.85000000000000006e-63Initial program 99.1%
associate-+l+99.1%
*-commutative99.1%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in z around 0 78.7%
+-commutative78.7%
Simplified78.7%
if 1.85000000000000006e-63 < z < 8.5000000000000001e57Initial program 99.9%
associate-+l+99.9%
*-commutative99.9%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in y around 0 75.2%
Taylor expanded in t around 0 67.4%
if 8.5000000000000001e57 < z < 7.2000000000000001e115Initial program 86.6%
associate-+l+86.6%
*-commutative86.6%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in a around inf 72.0%
Final simplification79.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* t a) (* y z))))
(if (<= b -6.7e+100)
(+ x (* a (+ t (* z b))))
(if (<= b 5.5e+61) (+ x t_1) (+ (* (* z a) b) 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 (b <= -6.7e+100) {
tmp = x + (a * (t + (z * b)));
} else if (b <= 5.5e+61) {
tmp = x + t_1;
} else {
tmp = ((z * a) * b) + 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 (b <= (-6.7d+100)) then
tmp = x + (a * (t + (z * b)))
else if (b <= 5.5d+61) then
tmp = x + t_1
else
tmp = ((z * a) * b) + 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 (b <= -6.7e+100) {
tmp = x + (a * (t + (z * b)));
} else if (b <= 5.5e+61) {
tmp = x + t_1;
} else {
tmp = ((z * a) * b) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t * a) + (y * z) tmp = 0 if b <= -6.7e+100: tmp = x + (a * (t + (z * b))) elif b <= 5.5e+61: tmp = x + t_1 else: tmp = ((z * a) * b) + 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 (b <= -6.7e+100) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); elseif (b <= 5.5e+61) tmp = Float64(x + t_1); else tmp = Float64(Float64(Float64(z * a) * b) + 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 (b <= -6.7e+100) tmp = x + (a * (t + (z * b))); elseif (b <= 5.5e+61) tmp = x + t_1; else tmp = ((z * a) * b) + 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[b, -6.7e+100], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.5e+61], N[(x + t$95$1), $MachinePrecision], N[(N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot a + y \cdot z\\
\mathbf{if}\;b \leq -6.7 \cdot 10^{+100}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;b \leq 5.5 \cdot 10^{+61}:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b + t_1\\
\end{array}
\end{array}
if b < -6.6999999999999997e100Initial program 88.8%
associate-+l+88.8%
+-commutative88.8%
fma-def88.8%
associate-*l*86.9%
*-commutative86.9%
*-commutative86.9%
distribute-rgt-out90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in y around 0 94.6%
if -6.6999999999999997e100 < b < 5.50000000000000036e61Initial program 93.3%
associate-+l+93.3%
*-commutative93.3%
associate-*l*97.9%
Simplified97.9%
Taylor expanded in b around 0 91.8%
if 5.50000000000000036e61 < b Initial program 96.3%
Taylor expanded in x around 0 86.2%
Final simplification91.2%
(FPCore (x y z t a b) :precision binary64 (if (<= b -9.4e+126) (+ x (* a (+ t (* z b)))) (+ (+ x (* y z)) (+ (* z (* a b)) (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -9.4e+126) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (y * z)) + ((z * (a * b)) + (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 (b <= (-9.4d+126)) then
tmp = x + (a * (t + (z * b)))
else
tmp = (x + (y * z)) + ((z * (a * b)) + (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 (b <= -9.4e+126) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (y * z)) + ((z * (a * b)) + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -9.4e+126: tmp = x + (a * (t + (z * b))) else: tmp = (x + (y * z)) + ((z * (a * b)) + (t * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -9.4e+126) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(Float64(x + Float64(y * z)) + Float64(Float64(z * Float64(a * b)) + Float64(t * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -9.4e+126) tmp = x + (a * (t + (z * b))); else tmp = (x + (y * z)) + ((z * (a * b)) + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -9.4e+126], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.4 \cdot 10^{+126}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + \left(z \cdot \left(a \cdot b\right) + t \cdot a\right)\\
\end{array}
\end{array}
if b < -9.3999999999999997e126Initial program 86.8%
associate-+l+86.8%
+-commutative86.8%
fma-def86.8%
associate-*l*84.6%
*-commutative84.6%
*-commutative84.6%
distribute-rgt-out89.0%
*-commutative89.0%
Simplified89.0%
Taylor expanded in y around 0 93.6%
if -9.3999999999999997e126 < b Initial program 94.4%
associate-+l+94.4%
*-commutative94.4%
associate-*l*95.7%
Simplified95.7%
Final simplification95.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -4.8e+109)
(* t a)
(if (<= t -3.4e-99)
x
(if (<= t -1.4e-260)
(* y z)
(if (<= t 1.75e-186) x (if (<= t 2.3e-13) (* y z) (* t a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -4.8e+109) {
tmp = t * a;
} else if (t <= -3.4e-99) {
tmp = x;
} else if (t <= -1.4e-260) {
tmp = y * z;
} else if (t <= 1.75e-186) {
tmp = x;
} else if (t <= 2.3e-13) {
tmp = 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 (t <= (-4.8d+109)) then
tmp = t * a
else if (t <= (-3.4d-99)) then
tmp = x
else if (t <= (-1.4d-260)) then
tmp = y * z
else if (t <= 1.75d-186) then
tmp = x
else if (t <= 2.3d-13) then
tmp = 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 (t <= -4.8e+109) {
tmp = t * a;
} else if (t <= -3.4e-99) {
tmp = x;
} else if (t <= -1.4e-260) {
tmp = y * z;
} else if (t <= 1.75e-186) {
tmp = x;
} else if (t <= 2.3e-13) {
tmp = y * z;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -4.8e+109: tmp = t * a elif t <= -3.4e-99: tmp = x elif t <= -1.4e-260: tmp = y * z elif t <= 1.75e-186: tmp = x elif t <= 2.3e-13: tmp = y * z else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -4.8e+109) tmp = Float64(t * a); elseif (t <= -3.4e-99) tmp = x; elseif (t <= -1.4e-260) tmp = Float64(y * z); elseif (t <= 1.75e-186) tmp = x; elseif (t <= 2.3e-13) tmp = 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 (t <= -4.8e+109) tmp = t * a; elseif (t <= -3.4e-99) tmp = x; elseif (t <= -1.4e-260) tmp = y * z; elseif (t <= 1.75e-186) tmp = x; elseif (t <= 2.3e-13) tmp = y * z; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -4.8e+109], N[(t * a), $MachinePrecision], If[LessEqual[t, -3.4e-99], x, If[LessEqual[t, -1.4e-260], N[(y * z), $MachinePrecision], If[LessEqual[t, 1.75e-186], x, If[LessEqual[t, 2.3e-13], N[(y * z), $MachinePrecision], N[(t * a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+109}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;t \leq -3.4 \cdot 10^{-99}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -1.4 \cdot 10^{-260}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{-186}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{-13}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if t < -4.79999999999999975e109 or 2.29999999999999979e-13 < t Initial program 93.0%
associate-+l+93.0%
*-commutative93.0%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in t around inf 56.4%
if -4.79999999999999975e109 < t < -3.40000000000000007e-99 or -1.3999999999999999e-260 < t < 1.74999999999999995e-186Initial program 96.3%
associate-+l+96.3%
*-commutative96.3%
associate-*l*92.6%
Simplified92.6%
Taylor expanded in x around inf 39.8%
if -3.40000000000000007e-99 < t < -1.3999999999999999e-260 or 1.74999999999999995e-186 < t < 2.29999999999999979e-13Initial program 89.8%
associate-+l+89.8%
*-commutative89.8%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in y around inf 42.2%
*-commutative42.2%
Simplified42.2%
Final simplification47.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.25e+67) (not (<= z 1.65e+123))) (* 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 <= -2.25e+67) || !(z <= 1.65e+123)) {
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 <= (-2.25d+67)) .or. (.not. (z <= 1.65d+123))) 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 <= -2.25e+67) || !(z <= 1.65e+123)) {
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 <= -2.25e+67) or not (z <= 1.65e+123): 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 <= -2.25e+67) || !(z <= 1.65e+123)) 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 <= -2.25e+67) || ~((z <= 1.65e+123))) 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, -2.25e+67], N[Not[LessEqual[z, 1.65e+123]], $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 -2.25 \cdot 10^{+67} \lor \neg \left(z \leq 1.65 \cdot 10^{+123}\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 < -2.2499999999999999e67 or 1.65000000000000001e123 < z Initial program 83.5%
associate-+l+83.5%
*-commutative83.5%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in z around inf 89.6%
if -2.2499999999999999e67 < z < 1.65000000000000001e123Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
fma-def97.7%
associate-*l*98.2%
*-commutative98.2%
*-commutative98.2%
distribute-rgt-out98.8%
*-commutative98.8%
Simplified98.8%
Taylor expanded in y around 0 86.1%
Final simplification87.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.12e-63) (not (<= a 6e-54))) (+ 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.12e-63) || !(a <= 6e-54)) {
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.12d-63)) .or. (.not. (a <= 6d-54))) 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.12e-63) || !(a <= 6e-54)) {
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.12e-63) or not (a <= 6e-54): 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.12e-63) || !(a <= 6e-54)) 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.12e-63) || ~((a <= 6e-54))) 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.12e-63], N[Not[LessEqual[a, 6e-54]], $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.12 \cdot 10^{-63} \lor \neg \left(a \leq 6 \cdot 10^{-54}\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.12000000000000002e-63 or 6.00000000000000018e-54 < a Initial program 90.2%
associate-+l+90.2%
+-commutative90.2%
fma-def90.2%
associate-*l*95.3%
*-commutative95.3%
*-commutative95.3%
distribute-rgt-out96.6%
*-commutative96.6%
Simplified96.6%
Taylor expanded in y around 0 90.7%
if -1.12000000000000002e-63 < a < 6.00000000000000018e-54Initial program 97.1%
associate-+l+97.1%
*-commutative97.1%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in b around 0 90.7%
Final simplification90.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.85e+186)
(* y z)
(if (<= z -7.5e+58)
(* z (* a b))
(if (<= z 1.85e+129) (+ x (* t a)) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.85e+186) {
tmp = y * z;
} else if (z <= -7.5e+58) {
tmp = z * (a * b);
} else if (z <= 1.85e+129) {
tmp = x + (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 <= (-1.85d+186)) then
tmp = y * z
else if (z <= (-7.5d+58)) then
tmp = z * (a * b)
else if (z <= 1.85d+129) then
tmp = x + (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 <= -1.85e+186) {
tmp = y * z;
} else if (z <= -7.5e+58) {
tmp = z * (a * b);
} else if (z <= 1.85e+129) {
tmp = x + (t * a);
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.85e+186: tmp = y * z elif z <= -7.5e+58: tmp = z * (a * b) elif z <= 1.85e+129: tmp = x + (t * a) else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.85e+186) tmp = Float64(y * z); elseif (z <= -7.5e+58) tmp = Float64(z * Float64(a * b)); elseif (z <= 1.85e+129) tmp = Float64(x + 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 <= -1.85e+186) tmp = y * z; elseif (z <= -7.5e+58) tmp = z * (a * b); elseif (z <= 1.85e+129) tmp = x + (t * a); else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.85e+186], N[(y * z), $MachinePrecision], If[LessEqual[z, -7.5e+58], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e+129], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], N[(y * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+186}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{+58}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+129}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if z < -1.85e186 or 1.84999999999999989e129 < z Initial program 82.0%
associate-+l+82.0%
*-commutative82.0%
associate-*l*90.0%
Simplified90.0%
Taylor expanded in y around inf 65.8%
*-commutative65.8%
Simplified65.8%
if -1.85e186 < z < -7.5000000000000001e58Initial program 88.3%
associate-+l+88.3%
*-commutative88.3%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in z around inf 77.2%
Taylor expanded in y around 0 48.3%
if -7.5000000000000001e58 < z < 1.84999999999999989e129Initial program 97.6%
associate-+l+97.6%
*-commutative97.6%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in z around 0 67.6%
+-commutative67.6%
Simplified67.6%
Final simplification65.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -4.8e+109) (not (<= t 1.42e+78))) (* t a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4.8e+109) || !(t <= 1.42e+78)) {
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.8d+109)) .or. (.not. (t <= 1.42d+78))) 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.8e+109) || !(t <= 1.42e+78)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -4.8e+109) or not (t <= 1.42e+78): tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -4.8e+109) || !(t <= 1.42e+78)) 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.8e+109) || ~((t <= 1.42e+78))) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4.8e+109], N[Not[LessEqual[t, 1.42e+78]], $MachinePrecision]], N[(t * a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+109} \lor \neg \left(t \leq 1.42 \cdot 10^{+78}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -4.79999999999999975e109 or 1.42e78 < t Initial program 91.7%
associate-+l+91.7%
*-commutative91.7%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in t around inf 63.5%
if -4.79999999999999975e109 < t < 1.42e78Initial program 93.7%
associate-+l+93.7%
*-commutative93.7%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in x around inf 32.4%
Final simplification42.7%
(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.0%
associate-+l+93.0%
*-commutative93.0%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in x around inf 24.9%
Final simplification24.9%
(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 2023299
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:herbie-target
(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)))