
(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.3%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
associate-*l*19.0%
Simplified19.0%
Taylor expanded in z around inf 76.2%
Final simplification96.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* z (+ y (/ x z))) (* a (+ t (* z b)))))
(t_2 (+ x (* z (+ y (* a b))))))
(if (<= z -1.96e+155)
t_2
(if (<= z -1.6e-115)
t_1
(if (<= z 7.2e-132)
(+ x (+ (* t a) (* y z)))
(if (<= z 8.5e+170) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * (y + (x / z))) + (a * (t + (z * b)));
double t_2 = x + (z * (y + (a * b)));
double tmp;
if (z <= -1.96e+155) {
tmp = t_2;
} else if (z <= -1.6e-115) {
tmp = t_1;
} else if (z <= 7.2e-132) {
tmp = x + ((t * a) + (y * z));
} else if (z <= 8.5e+170) {
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 = (z * (y + (x / z))) + (a * (t + (z * b)))
t_2 = x + (z * (y + (a * b)))
if (z <= (-1.96d+155)) then
tmp = t_2
else if (z <= (-1.6d-115)) then
tmp = t_1
else if (z <= 7.2d-132) then
tmp = x + ((t * a) + (y * z))
else if (z <= 8.5d+170) 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 = (z * (y + (x / z))) + (a * (t + (z * b)));
double t_2 = x + (z * (y + (a * b)));
double tmp;
if (z <= -1.96e+155) {
tmp = t_2;
} else if (z <= -1.6e-115) {
tmp = t_1;
} else if (z <= 7.2e-132) {
tmp = x + ((t * a) + (y * z));
} else if (z <= 8.5e+170) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * (y + (x / z))) + (a * (t + (z * b))) t_2 = x + (z * (y + (a * b))) tmp = 0 if z <= -1.96e+155: tmp = t_2 elif z <= -1.6e-115: tmp = t_1 elif z <= 7.2e-132: tmp = x + ((t * a) + (y * z)) elif z <= 8.5e+170: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(y + Float64(x / z))) + Float64(a * Float64(t + Float64(z * b)))) t_2 = Float64(x + Float64(z * Float64(y + Float64(a * b)))) tmp = 0.0 if (z <= -1.96e+155) tmp = t_2; elseif (z <= -1.6e-115) tmp = t_1; elseif (z <= 7.2e-132) tmp = Float64(x + Float64(Float64(t * a) + Float64(y * z))); elseif (z <= 8.5e+170) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * (y + (x / z))) + (a * (t + (z * b))); t_2 = x + (z * (y + (a * b))); tmp = 0.0; if (z <= -1.96e+155) tmp = t_2; elseif (z <= -1.6e-115) tmp = t_1; elseif (z <= 7.2e-132) tmp = x + ((t * a) + (y * z)); elseif (z <= 8.5e+170) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.96e+155], t$95$2, If[LessEqual[z, -1.6e-115], t$95$1, If[LessEqual[z, 7.2e-132], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+170], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(y + \frac{x}{z}\right) + a \cdot \left(t + z \cdot b\right)\\
t_2 := x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -1.96 \cdot 10^{+155}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-115}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-132}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+170}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.9600000000000001e155 or 8.5000000000000004e170 < z Initial program 74.4%
associate-+l+74.4%
associate-*l*71.8%
Simplified71.8%
Taylor expanded in t around 0 68.9%
+-commutative68.9%
associate-*r*78.9%
distribute-rgt-in92.6%
Simplified92.6%
if -1.9600000000000001e155 < z < -1.6e-115 or 7.20000000000000015e-132 < z < 8.5000000000000004e170Initial program 93.4%
associate-+l+93.4%
+-commutative93.4%
fma-define93.4%
associate-*l*94.3%
*-commutative94.3%
*-commutative94.3%
distribute-rgt-out97.1%
remove-double-neg97.1%
*-commutative97.1%
distribute-lft-neg-out97.1%
sub-neg97.1%
sub-neg97.1%
distribute-lft-neg-out97.1%
*-commutative97.1%
remove-double-neg97.1%
*-commutative97.1%
Simplified97.1%
Taylor expanded in z around inf 94.5%
if -1.6e-115 < z < 7.20000000000000015e-132Initial program 98.9%
associate-+l+98.9%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in b around 0 96.6%
Final simplification94.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= a -2e+95)
(* t a)
(if (<= a -1.16e+57)
t_1
(if (<= a -2.06e-91)
(* y z)
(if (<= a 2.25e-181) x (if (<= a 2.9e+135) 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 (a <= -2e+95) {
tmp = t * a;
} else if (a <= -1.16e+57) {
tmp = t_1;
} else if (a <= -2.06e-91) {
tmp = y * z;
} else if (a <= 2.25e-181) {
tmp = x;
} else if (a <= 2.9e+135) {
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 (a <= (-2d+95)) then
tmp = t * a
else if (a <= (-1.16d+57)) then
tmp = t_1
else if (a <= (-2.06d-91)) then
tmp = y * z
else if (a <= 2.25d-181) then
tmp = x
else if (a <= 2.9d+135) 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 (a <= -2e+95) {
tmp = t * a;
} else if (a <= -1.16e+57) {
tmp = t_1;
} else if (a <= -2.06e-91) {
tmp = y * z;
} else if (a <= 2.25e-181) {
tmp = x;
} else if (a <= 2.9e+135) {
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 a <= -2e+95: tmp = t * a elif a <= -1.16e+57: tmp = t_1 elif a <= -2.06e-91: tmp = y * z elif a <= 2.25e-181: tmp = x elif a <= 2.9e+135: 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 (a <= -2e+95) tmp = Float64(t * a); elseif (a <= -1.16e+57) tmp = t_1; elseif (a <= -2.06e-91) tmp = Float64(y * z); elseif (a <= 2.25e-181) tmp = x; elseif (a <= 2.9e+135) 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 (a <= -2e+95) tmp = t * a; elseif (a <= -1.16e+57) tmp = t_1; elseif (a <= -2.06e-91) tmp = y * z; elseif (a <= 2.25e-181) tmp = x; elseif (a <= 2.9e+135) 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[a, -2e+95], N[(t * a), $MachinePrecision], If[LessEqual[a, -1.16e+57], t$95$1, If[LessEqual[a, -2.06e-91], N[(y * z), $MachinePrecision], If[LessEqual[a, 2.25e-181], x, If[LessEqual[a, 2.9e+135], t$95$1, N[(t * a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;a \leq -2 \cdot 10^{+95}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq -1.16 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.06 \cdot 10^{-91}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 2.25 \cdot 10^{-181}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.9 \cdot 10^{+135}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if a < -2.00000000000000004e95 or 2.8999999999999999e135 < a Initial program 77.5%
associate-+l+77.5%
associate-*l*84.5%
Simplified84.5%
Taylor expanded in z around 0 67.1%
Taylor expanded in x around 0 65.8%
if -2.00000000000000004e95 < a < -1.16000000000000003e57 or 2.2499999999999999e-181 < a < 2.8999999999999999e135Initial program 96.5%
associate-+l+96.5%
+-commutative96.5%
fma-define96.5%
associate-*l*93.3%
*-commutative93.3%
*-commutative93.3%
distribute-rgt-out93.3%
remove-double-neg93.3%
*-commutative93.3%
distribute-lft-neg-out93.3%
sub-neg93.3%
sub-neg93.3%
distribute-lft-neg-out93.3%
*-commutative93.3%
remove-double-neg93.3%
*-commutative93.3%
Simplified93.3%
Taylor expanded in y around 0 81.7%
Taylor expanded in z around inf 44.6%
*-commutative44.6%
Simplified44.6%
if -1.16000000000000003e57 < a < -2.0600000000000001e-91Initial program 94.3%
associate-+l+94.3%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in t around 0 66.4%
+-commutative66.4%
associate-*r*69.3%
distribute-rgt-in72.1%
Simplified72.1%
Taylor expanded in z around inf 72.1%
Taylor expanded in y around inf 41.2%
if -2.0600000000000001e-91 < a < 2.2499999999999999e-181Initial program 97.5%
associate-+l+97.5%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in t around 0 86.0%
+-commutative86.0%
associate-*r*90.7%
distribute-rgt-in92.0%
Simplified92.0%
Taylor expanded in x around inf 48.7%
Final simplification52.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5e+131) (not (<= z 2.3e+171))) (+ x (* z (+ y (* a b)))) (+ (+ x (* y z)) (+ (* a (* z b)) (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5e+131) || !(z <= 2.3e+171)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = (x + (y * z)) + ((a * (z * 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 ((z <= (-5d+131)) .or. (.not. (z <= 2.3d+171))) then
tmp = x + (z * (y + (a * b)))
else
tmp = (x + (y * z)) + ((a * (z * 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 ((z <= -5e+131) || !(z <= 2.3e+171)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = (x + (y * z)) + ((a * (z * b)) + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -5e+131) or not (z <= 2.3e+171): tmp = x + (z * (y + (a * b))) else: tmp = (x + (y * z)) + ((a * (z * b)) + (t * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -5e+131) || !(z <= 2.3e+171)) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); else tmp = Float64(Float64(x + Float64(y * z)) + Float64(Float64(a * Float64(z * b)) + Float64(t * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -5e+131) || ~((z <= 2.3e+171))) tmp = x + (z * (y + (a * b))); else tmp = (x + (y * z)) + ((a * (z * b)) + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -5e+131], N[Not[LessEqual[z, 2.3e+171]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+131} \lor \neg \left(z \leq 2.3 \cdot 10^{+171}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + \left(a \cdot \left(z \cdot b\right) + t \cdot a\right)\\
\end{array}
\end{array}
if z < -4.99999999999999995e131 or 2.30000000000000017e171 < z Initial program 75.1%
associate-+l+75.1%
associate-*l*72.7%
Simplified72.7%
Taylor expanded in t around 0 70.2%
+-commutative70.2%
associate-*r*79.4%
distribute-rgt-in91.9%
Simplified91.9%
if -4.99999999999999995e131 < z < 2.30000000000000017e171Initial program 96.2%
associate-+l+96.2%
associate-*l*97.2%
Simplified97.2%
Final simplification95.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))))
(if (<= a -7.4e+93)
t_1
(if (<= a -8.6e+64)
(* z (* a b))
(if (<= a 3.8e-127) (+ x (* y z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double tmp;
if (a <= -7.4e+93) {
tmp = t_1;
} else if (a <= -8.6e+64) {
tmp = z * (a * b);
} else if (a <= 3.8e-127) {
tmp = x + (y * z);
} 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 = x + (t * a)
if (a <= (-7.4d+93)) then
tmp = t_1
else if (a <= (-8.6d+64)) then
tmp = z * (a * b)
else if (a <= 3.8d-127) then
tmp = x + (y * z)
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 = x + (t * a);
double tmp;
if (a <= -7.4e+93) {
tmp = t_1;
} else if (a <= -8.6e+64) {
tmp = z * (a * b);
} else if (a <= 3.8e-127) {
tmp = x + (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * a) tmp = 0 if a <= -7.4e+93: tmp = t_1 elif a <= -8.6e+64: tmp = z * (a * b) elif a <= 3.8e-127: tmp = x + (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * a)) tmp = 0.0 if (a <= -7.4e+93) tmp = t_1; elseif (a <= -8.6e+64) tmp = Float64(z * Float64(a * b)); elseif (a <= 3.8e-127) tmp = Float64(x + Float64(y * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (t * a); tmp = 0.0; if (a <= -7.4e+93) tmp = t_1; elseif (a <= -8.6e+64) tmp = z * (a * b); elseif (a <= 3.8e-127) tmp = x + (y * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.4e+93], t$95$1, If[LessEqual[a, -8.6e+64], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.8e-127], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot a\\
\mathbf{if}\;a \leq -7.4 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -8.6 \cdot 10^{+64}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{-127}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -7.39999999999999974e93 or 3.80000000000000003e-127 < a Initial program 83.6%
associate-+l+83.6%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in z around 0 63.0%
if -7.39999999999999974e93 < a < -8.5999999999999995e64Initial program 84.1%
associate-+l+84.1%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in t around 0 99.7%
+-commutative99.7%
associate-*r*100.0%
distribute-rgt-in100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
Taylor expanded in a around inf 100.0%
if -8.5999999999999995e64 < a < 3.80000000000000003e-127Initial program 96.9%
associate-+l+96.9%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in t around 0 80.0%
+-commutative80.0%
associate-*r*85.8%
distribute-rgt-in87.4%
Simplified87.4%
Taylor expanded in y around inf 74.9%
*-commutative74.9%
Simplified74.9%
Final simplification69.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.26e+44)
(* (* z a) b)
(if (<= z 3.4e+42)
(+ x (* t a))
(if (<= z 2.1e+169) (* y z) (* a (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.26e+44) {
tmp = (z * a) * b;
} else if (z <= 3.4e+42) {
tmp = x + (t * a);
} else if (z <= 2.1e+169) {
tmp = y * z;
} 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 (z <= (-1.26d+44)) then
tmp = (z * a) * b
else if (z <= 3.4d+42) then
tmp = x + (t * a)
else if (z <= 2.1d+169) then
tmp = y * z
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 (z <= -1.26e+44) {
tmp = (z * a) * b;
} else if (z <= 3.4e+42) {
tmp = x + (t * a);
} else if (z <= 2.1e+169) {
tmp = y * z;
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.26e+44: tmp = (z * a) * b elif z <= 3.4e+42: tmp = x + (t * a) elif z <= 2.1e+169: tmp = y * z else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.26e+44) tmp = Float64(Float64(z * a) * b); elseif (z <= 3.4e+42) tmp = Float64(x + Float64(t * a)); elseif (z <= 2.1e+169) tmp = Float64(y * z); 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 (z <= -1.26e+44) tmp = (z * a) * b; elseif (z <= 3.4e+42) tmp = x + (t * a); elseif (z <= 2.1e+169) tmp = y * z; else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.26e+44], N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[z, 3.4e+42], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e+169], N[(y * z), $MachinePrecision], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.26 \cdot 10^{+44}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+42}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+169}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if z < -1.25999999999999996e44Initial program 82.6%
associate-+l+82.6%
associate-*l*77.6%
Simplified77.6%
Taylor expanded in a around inf 66.5%
Taylor expanded in z around inf 63.7%
associate-*r*76.1%
*-commutative76.1%
Simplified76.1%
Taylor expanded in b around inf 47.5%
if -1.25999999999999996e44 < z < 3.39999999999999975e42Initial program 98.0%
associate-+l+98.0%
associate-*l*98.6%
Simplified98.6%
Taylor expanded in z around 0 76.0%
if 3.39999999999999975e42 < z < 2.1000000000000001e169Initial program 86.3%
associate-+l+86.3%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in t around 0 86.2%
+-commutative86.2%
associate-*r*86.3%
distribute-rgt-in90.9%
Simplified90.9%
Taylor expanded in z around inf 90.9%
Taylor expanded in y around inf 61.0%
if 2.1000000000000001e169 < z Initial program 72.5%
associate-+l+72.5%
+-commutative72.5%
fma-define72.5%
associate-*l*75.1%
*-commutative75.1%
*-commutative75.1%
distribute-rgt-out80.7%
remove-double-neg80.7%
*-commutative80.7%
distribute-lft-neg-out80.7%
sub-neg80.7%
sub-neg80.7%
distribute-lft-neg-out80.7%
*-commutative80.7%
remove-double-neg80.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in y around 0 70.9%
Taylor expanded in z around inf 64.6%
*-commutative64.6%
Simplified64.6%
Final simplification67.3%
(FPCore (x y z t a b) :precision binary64 (if (<= b -2.7e+35) (* z (* a b)) (if (<= b -1.1e-196) (* y z) (if (<= b 2.4e+110) (* t a) (* a (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.7e+35) {
tmp = z * (a * b);
} else if (b <= -1.1e-196) {
tmp = y * z;
} else if (b <= 2.4e+110) {
tmp = t * a;
} 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 (b <= (-2.7d+35)) then
tmp = z * (a * b)
else if (b <= (-1.1d-196)) then
tmp = y * z
else if (b <= 2.4d+110) then
tmp = t * a
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 (b <= -2.7e+35) {
tmp = z * (a * b);
} else if (b <= -1.1e-196) {
tmp = y * z;
} else if (b <= 2.4e+110) {
tmp = t * a;
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -2.7e+35: tmp = z * (a * b) elif b <= -1.1e-196: tmp = y * z elif b <= 2.4e+110: tmp = t * a else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.7e+35) tmp = Float64(z * Float64(a * b)); elseif (b <= -1.1e-196) tmp = Float64(y * z); elseif (b <= 2.4e+110) tmp = Float64(t * a); 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 (b <= -2.7e+35) tmp = z * (a * b); elseif (b <= -1.1e-196) tmp = y * z; elseif (b <= 2.4e+110) tmp = t * a; else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.7e+35], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.1e-196], N[(y * z), $MachinePrecision], If[LessEqual[b, 2.4e+110], N[(t * a), $MachinePrecision], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.7 \cdot 10^{+35}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;b \leq -1.1 \cdot 10^{-196}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{+110}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if b < -2.70000000000000003e35Initial program 88.4%
associate-+l+88.4%
associate-*l*82.4%
Simplified82.4%
Taylor expanded in t around 0 69.8%
+-commutative69.8%
associate-*r*75.7%
distribute-rgt-in83.9%
Simplified83.9%
Taylor expanded in z around inf 74.6%
Taylor expanded in a around inf 65.0%
if -2.70000000000000003e35 < b < -1.10000000000000007e-196Initial program 95.5%
associate-+l+95.5%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in t around 0 74.1%
+-commutative74.1%
associate-*r*74.1%
distribute-rgt-in74.1%
Simplified74.1%
Taylor expanded in z around inf 61.6%
Taylor expanded in y around inf 44.2%
if -1.10000000000000007e-196 < b < 2.40000000000000012e110Initial program 89.7%
associate-+l+89.7%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in z around 0 67.4%
Taylor expanded in x around 0 45.2%
if 2.40000000000000012e110 < b Initial program 88.4%
associate-+l+88.4%
+-commutative88.4%
fma-define88.4%
associate-*l*82.7%
*-commutative82.7%
*-commutative82.7%
distribute-rgt-out82.7%
remove-double-neg82.7%
*-commutative82.7%
distribute-lft-neg-out82.7%
sub-neg82.7%
sub-neg82.7%
distribute-lft-neg-out82.7%
*-commutative82.7%
remove-double-neg82.7%
*-commutative82.7%
Simplified82.7%
Taylor expanded in y around 0 82.9%
Taylor expanded in z around inf 48.4%
*-commutative48.4%
Simplified48.4%
Final simplification50.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.95e+93) (not (<= a 1.25e-127))) (+ x (* a (+ t (* z b)))) (+ x (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.95e+93) || !(a <= 1.25e-127)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-1.95d+93)) .or. (.not. (a <= 1.25d-127))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + (z * (y + (a * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.95e+93) || !(a <= 1.25e-127)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.95e+93) or not (a <= 1.25e-127): tmp = x + (a * (t + (z * b))) else: tmp = x + (z * (y + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.95e+93) || !(a <= 1.25e-127)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.95e+93) || ~((a <= 1.25e-127))) tmp = x + (a * (t + (z * b))); else tmp = x + (z * (y + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.95e+93], N[Not[LessEqual[a, 1.25e-127]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95 \cdot 10^{+93} \lor \neg \left(a \leq 1.25 \cdot 10^{-127}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if a < -1.9500000000000001e93 or 1.2499999999999999e-127 < a Initial program 83.6%
associate-+l+83.6%
+-commutative83.6%
fma-define83.6%
associate-*l*88.5%
*-commutative88.5%
*-commutative88.5%
distribute-rgt-out92.6%
remove-double-neg92.6%
*-commutative92.6%
distribute-lft-neg-out92.6%
sub-neg92.6%
sub-neg92.6%
distribute-lft-neg-out92.6%
*-commutative92.6%
remove-double-neg92.6%
*-commutative92.6%
Simplified92.6%
Taylor expanded in y around 0 92.3%
if -1.9500000000000001e93 < a < 1.2499999999999999e-127Initial program 96.3%
associate-+l+96.3%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in t around 0 80.9%
+-commutative80.9%
associate-*r*86.5%
distribute-rgt-in88.0%
Simplified88.0%
Final simplification90.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -3.45e+44) (not (<= z 8.5e+42))) (* 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 <= -3.45e+44) || !(z <= 8.5e+42)) {
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 <= (-3.45d+44)) .or. (.not. (z <= 8.5d+42))) 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 <= -3.45e+44) || !(z <= 8.5e+42)) {
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 <= -3.45e+44) or not (z <= 8.5e+42): 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 <= -3.45e+44) || !(z <= 8.5e+42)) 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 <= -3.45e+44) || ~((z <= 8.5e+42))) 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, -3.45e+44], N[Not[LessEqual[z, 8.5e+42]], $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 -3.45 \cdot 10^{+44} \lor \neg \left(z \leq 8.5 \cdot 10^{+42}\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 < -3.4499999999999999e44 or 8.5000000000000003e42 < z Initial program 80.0%
associate-+l+80.0%
associate-*l*79.4%
Simplified79.4%
Taylor expanded in z around inf 81.9%
if -3.4499999999999999e44 < z < 8.5000000000000003e42Initial program 98.0%
associate-+l+98.0%
+-commutative98.0%
fma-define98.0%
associate-*l*98.6%
*-commutative98.6%
*-commutative98.6%
distribute-rgt-out99.3%
remove-double-neg99.3%
*-commutative99.3%
distribute-lft-neg-out99.3%
sub-neg99.3%
sub-neg99.3%
distribute-lft-neg-out99.3%
*-commutative99.3%
remove-double-neg99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in y around 0 89.2%
Final simplification86.1%
(FPCore (x y z t a b) :precision binary64 (if (<= b -8.5e+44) (+ x (* a (+ t (* z b)))) (if (<= b 3.8e+150) (+ x (+ (* t a) (* y z))) (+ x (* z (+ y (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -8.5e+44) {
tmp = x + (a * (t + (z * b)));
} else if (b <= 3.8e+150) {
tmp = x + ((t * a) + (y * z));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-8.5d+44)) then
tmp = x + (a * (t + (z * b)))
else if (b <= 3.8d+150) then
tmp = x + ((t * a) + (y * z))
else
tmp = x + (z * (y + (a * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -8.5e+44) {
tmp = x + (a * (t + (z * b)));
} else if (b <= 3.8e+150) {
tmp = x + ((t * a) + (y * z));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -8.5e+44: tmp = x + (a * (t + (z * b))) elif b <= 3.8e+150: tmp = x + ((t * a) + (y * z)) else: tmp = x + (z * (y + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -8.5e+44) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); elseif (b <= 3.8e+150) tmp = Float64(x + Float64(Float64(t * a) + Float64(y * z))); else tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -8.5e+44) tmp = x + (a * (t + (z * b))); elseif (b <= 3.8e+150) tmp = x + ((t * a) + (y * z)); else tmp = x + (z * (y + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -8.5e+44], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.8e+150], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.5 \cdot 10^{+44}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{+150}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if b < -8.5e44Initial program 88.3%
associate-+l+88.3%
+-commutative88.3%
fma-define88.3%
associate-*l*82.1%
*-commutative82.1%
*-commutative82.1%
distribute-rgt-out85.4%
remove-double-neg85.4%
*-commutative85.4%
distribute-lft-neg-out85.4%
sub-neg85.4%
sub-neg85.4%
distribute-lft-neg-out85.4%
*-commutative85.4%
remove-double-neg85.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in y around 0 88.9%
if -8.5e44 < b < 3.79999999999999989e150Initial program 91.8%
associate-+l+91.8%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in b around 0 92.2%
if 3.79999999999999989e150 < b Initial program 85.4%
associate-+l+85.4%
associate-*l*78.2%
Simplified78.2%
Taylor expanded in t around 0 74.7%
+-commutative74.7%
associate-*r*81.9%
distribute-rgt-in93.0%
Simplified93.0%
Final simplification91.5%
(FPCore (x y z t a b) :precision binary64 (if (<= a -5.8e+93) (* t a) (if (<= a -2.8e-100) (* y z) (if (<= a 1.75e-104) x (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.8e+93) {
tmp = t * a;
} else if (a <= -2.8e-100) {
tmp = y * z;
} else if (a <= 1.75e-104) {
tmp = x;
} else {
tmp = t * a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-5.8d+93)) then
tmp = t * a
else if (a <= (-2.8d-100)) then
tmp = y * z
else if (a <= 1.75d-104) then
tmp = x
else
tmp = t * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.8e+93) {
tmp = t * a;
} else if (a <= -2.8e-100) {
tmp = y * z;
} else if (a <= 1.75e-104) {
tmp = x;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -5.8e+93: tmp = t * a elif a <= -2.8e-100: tmp = y * z elif a <= 1.75e-104: tmp = x else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -5.8e+93) tmp = Float64(t * a); elseif (a <= -2.8e-100) tmp = Float64(y * z); elseif (a <= 1.75e-104) tmp = x; else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -5.8e+93) tmp = t * a; elseif (a <= -2.8e-100) tmp = y * z; elseif (a <= 1.75e-104) tmp = x; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -5.8e+93], N[(t * a), $MachinePrecision], If[LessEqual[a, -2.8e-100], N[(y * z), $MachinePrecision], If[LessEqual[a, 1.75e-104], x, N[(t * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.8 \cdot 10^{+93}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq -2.8 \cdot 10^{-100}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{-104}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if a < -5.7999999999999997e93 or 1.75000000000000014e-104 < a Initial program 83.1%
associate-+l+83.1%
associate-*l*88.1%
Simplified88.1%
Taylor expanded in z around 0 62.5%
Taylor expanded in x around 0 56.3%
if -5.7999999999999997e93 < a < -2.79999999999999995e-100Initial program 93.1%
associate-+l+93.1%
associate-*l*92.9%
Simplified92.9%
Taylor expanded in t around 0 72.6%
+-commutative72.6%
associate-*r*75.0%
distribute-rgt-in77.3%
Simplified77.3%
Taylor expanded in z around inf 75.2%
Taylor expanded in y around inf 36.2%
if -2.79999999999999995e-100 < a < 1.75000000000000014e-104Initial program 97.9%
associate-+l+97.9%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in t around 0 84.4%
+-commutative84.4%
associate-*r*91.2%
distribute-rgt-in92.3%
Simplified92.3%
Taylor expanded in x around inf 45.1%
Final simplification48.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.1e+64) (not (<= a 9.6e-148))) (* a (+ t (* z b))) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.1e+64) || !(a <= 9.6e-148)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-2.1d+64)) .or. (.not. (a <= 9.6d-148))) then
tmp = a * (t + (z * b))
else
tmp = x + (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.1e+64) || !(a <= 9.6e-148)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.1e+64) or not (a <= 9.6e-148): tmp = a * (t + (z * b)) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.1e+64) || !(a <= 9.6e-148)) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -2.1e+64) || ~((a <= 9.6e-148))) tmp = a * (t + (z * b)); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.1e+64], N[Not[LessEqual[a, 9.6e-148]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.1 \cdot 10^{+64} \lor \neg \left(a \leq 9.6 \cdot 10^{-148}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -2.1e64 or 9.6000000000000005e-148 < a Initial program 84.3%
associate-+l+84.3%
associate-*l*88.7%
Simplified88.7%
Taylor expanded in a around inf 91.1%
Taylor expanded in b around inf 84.5%
*-commutative84.5%
Simplified84.5%
if -2.1e64 < a < 9.6000000000000005e-148Initial program 96.8%
associate-+l+96.8%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in t around 0 79.9%
+-commutative79.9%
associate-*r*85.3%
distribute-rgt-in86.9%
Simplified86.9%
Taylor expanded in y around inf 76.2%
*-commutative76.2%
Simplified76.2%
Final simplification80.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -5.1e-86) (not (<= a 2.6e-102))) (* t a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -5.1e-86) || !(a <= 2.6e-102)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-5.1d-86)) .or. (.not. (a <= 2.6d-102))) then
tmp = t * a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -5.1e-86) || !(a <= 2.6e-102)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -5.1e-86) or not (a <= 2.6e-102): tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -5.1e-86) || !(a <= 2.6e-102)) tmp = Float64(t * a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -5.1e-86) || ~((a <= 2.6e-102))) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -5.1e-86], N[Not[LessEqual[a, 2.6e-102]], $MachinePrecision]], N[(t * a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.1 \cdot 10^{-86} \lor \neg \left(a \leq 2.6 \cdot 10^{-102}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -5.10000000000000006e-86 or 2.59999999999999986e-102 < a Initial program 85.8%
associate-+l+85.8%
associate-*l*89.4%
Simplified89.4%
Taylor expanded in z around 0 56.7%
Taylor expanded in x around 0 47.9%
if -5.10000000000000006e-86 < a < 2.59999999999999986e-102Initial program 97.9%
associate-+l+97.9%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in t around 0 84.4%
+-commutative84.4%
associate-*r*91.2%
distribute-rgt-in92.3%
Simplified92.3%
Taylor expanded in x around inf 45.1%
Final simplification46.8%
(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 90.3%
associate-+l+90.3%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in t around 0 65.0%
+-commutative65.0%
associate-*r*67.6%
distribute-rgt-in71.5%
Simplified71.5%
Taylor expanded in x around inf 23.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 2024178
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:alt
(! :herbie-platform default (if (< z -11820553527347888000) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 47589743188364287/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a))))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))