
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (if (<= z 3500000000.0) (+ (+ x (* z y)) (+ (* t a) (* a (* z b)))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 3500000000.0) {
tmp = (x + (z * y)) + ((t * a) + (a * (z * b)));
} else {
tmp = z * (y + ((x / z) + (a * (b + (t / 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 <= 3500000000.0d0) then
tmp = (x + (z * y)) + ((t * a) + (a * (z * b)))
else
tmp = z * (y + ((x / z) + (a * (b + (t / 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 <= 3500000000.0) {
tmp = (x + (z * y)) + ((t * a) + (a * (z * b)));
} else {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 3500000000.0: tmp = (x + (z * y)) + ((t * a) + (a * (z * b))) else: tmp = z * (y + ((x / z) + (a * (b + (t / z))))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 3500000000.0) tmp = Float64(Float64(x + Float64(z * y)) + Float64(Float64(t * a) + Float64(a * Float64(z * b)))); else tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= 3500000000.0) tmp = (x + (z * y)) + ((t * a) + (a * (z * b))); else tmp = z * (y + ((x / z) + (a * (b + (t / z))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 3500000000.0], N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3500000000:\\
\;\;\;\;\left(x + z \cdot y\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\end{array}
\end{array}
if z < 3.5e9Initial program 97.3%
associate-+l+97.3%
associate-*l*98.5%
Simplified98.5%
if 3.5e9 < z Initial program 89.5%
associate-+l+89.5%
associate-*l*85.7%
Simplified85.7%
Taylor expanded in z around inf 95.8%
+-commutative95.8%
associate-+l+95.8%
+-commutative95.8%
associate-/l*99.9%
distribute-lft-out99.9%
Simplified99.9%
Final simplification98.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))) (t_2 (* a (+ t (* z b)))))
(if (<= a -4e+76)
t_2
(if (<= a -6.2e-13)
t_1
(if (<= a -3.4e-80)
(+ x (* a (* z b)))
(if (<= a 2.45e-119) (+ x (* z y)) (if (<= a 6.5e+58) 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 <= -4e+76) {
tmp = t_2;
} else if (a <= -6.2e-13) {
tmp = t_1;
} else if (a <= -3.4e-80) {
tmp = x + (a * (z * b));
} else if (a <= 2.45e-119) {
tmp = x + (z * y);
} else if (a <= 6.5e+58) {
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 <= (-4d+76)) then
tmp = t_2
else if (a <= (-6.2d-13)) then
tmp = t_1
else if (a <= (-3.4d-80)) then
tmp = x + (a * (z * b))
else if (a <= 2.45d-119) then
tmp = x + (z * y)
else if (a <= 6.5d+58) 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 <= -4e+76) {
tmp = t_2;
} else if (a <= -6.2e-13) {
tmp = t_1;
} else if (a <= -3.4e-80) {
tmp = x + (a * (z * b));
} else if (a <= 2.45e-119) {
tmp = x + (z * y);
} else if (a <= 6.5e+58) {
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 <= -4e+76: tmp = t_2 elif a <= -6.2e-13: tmp = t_1 elif a <= -3.4e-80: tmp = x + (a * (z * b)) elif a <= 2.45e-119: tmp = x + (z * y) elif a <= 6.5e+58: 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 <= -4e+76) tmp = t_2; elseif (a <= -6.2e-13) tmp = t_1; elseif (a <= -3.4e-80) tmp = Float64(x + Float64(a * Float64(z * b))); elseif (a <= 2.45e-119) tmp = Float64(x + Float64(z * y)); elseif (a <= 6.5e+58) 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 <= -4e+76) tmp = t_2; elseif (a <= -6.2e-13) tmp = t_1; elseif (a <= -3.4e-80) tmp = x + (a * (z * b)); elseif (a <= 2.45e-119) tmp = x + (z * y); elseif (a <= 6.5e+58) 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, -4e+76], t$95$2, If[LessEqual[a, -6.2e-13], t$95$1, If[LessEqual[a, -3.4e-80], N[(x + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.45e-119], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.5e+58], 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 -4 \cdot 10^{+76}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -6.2 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -3.4 \cdot 10^{-80}:\\
\;\;\;\;x + a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq 2.45 \cdot 10^{-119}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -4.0000000000000002e76 or 6.49999999999999998e58 < a Initial program 90.6%
associate-+l+90.6%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in a around inf 83.6%
if -4.0000000000000002e76 < a < -6.1999999999999998e-13 or 2.45e-119 < a < 6.49999999999999998e58Initial program 98.7%
associate-+l+98.7%
associate-*l*97.5%
Simplified97.5%
Taylor expanded in z around 0 69.5%
+-commutative69.5%
Simplified69.5%
if -6.1999999999999998e-13 < a < -3.4000000000000001e-80Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in y around 0 78.9%
Taylor expanded in t around 0 73.6%
if -3.4000000000000001e-80 < a < 2.45e-119Initial program 97.7%
associate-+l+97.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in a around 0 82.9%
Final simplification78.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* z a))))
(if (<= a -4.4e+65)
t_1
(if (<= a 9e+68)
(+ x (* z y))
(if (or (<= a 4.8e+134) (not (<= a 5.8e+179))) (* t a) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (z * a);
double tmp;
if (a <= -4.4e+65) {
tmp = t_1;
} else if (a <= 9e+68) {
tmp = x + (z * y);
} else if ((a <= 4.8e+134) || !(a <= 5.8e+179)) {
tmp = t * a;
} 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 = b * (z * a)
if (a <= (-4.4d+65)) then
tmp = t_1
else if (a <= 9d+68) then
tmp = x + (z * y)
else if ((a <= 4.8d+134) .or. (.not. (a <= 5.8d+179))) then
tmp = t * a
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 = b * (z * a);
double tmp;
if (a <= -4.4e+65) {
tmp = t_1;
} else if (a <= 9e+68) {
tmp = x + (z * y);
} else if ((a <= 4.8e+134) || !(a <= 5.8e+179)) {
tmp = t * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (z * a) tmp = 0 if a <= -4.4e+65: tmp = t_1 elif a <= 9e+68: tmp = x + (z * y) elif (a <= 4.8e+134) or not (a <= 5.8e+179): tmp = t * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(z * a)) tmp = 0.0 if (a <= -4.4e+65) tmp = t_1; elseif (a <= 9e+68) tmp = Float64(x + Float64(z * y)); elseif ((a <= 4.8e+134) || !(a <= 5.8e+179)) tmp = Float64(t * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (z * a); tmp = 0.0; if (a <= -4.4e+65) tmp = t_1; elseif (a <= 9e+68) tmp = x + (z * y); elseif ((a <= 4.8e+134) || ~((a <= 5.8e+179))) tmp = t * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.4e+65], t$95$1, If[LessEqual[a, 9e+68], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 4.8e+134], N[Not[LessEqual[a, 5.8e+179]], $MachinePrecision]], N[(t * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(z \cdot a\right)\\
\mathbf{if}\;a \leq -4.4 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 9 \cdot 10^{+68}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{elif}\;a \leq 4.8 \cdot 10^{+134} \lor \neg \left(a \leq 5.8 \cdot 10^{+179}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.3999999999999997e65 or 4.80000000000000011e134 < a < 5.80000000000000038e179Initial program 89.9%
associate-+l+89.9%
+-commutative89.9%
fma-define89.9%
associate-*l*91.8%
*-commutative91.8%
*-commutative91.8%
distribute-rgt-out95.9%
*-commutative95.9%
Simplified95.9%
Taylor expanded in y around inf 86.2%
Taylor expanded in b around inf 63.0%
associate-*r*57.1%
*-commutative57.1%
associate-*r*66.8%
Simplified66.8%
if -4.3999999999999997e65 < a < 9.0000000000000007e68Initial program 98.4%
associate-+l+98.4%
associate-*l*96.6%
Simplified96.6%
Taylor expanded in a around 0 67.5%
if 9.0000000000000007e68 < a < 4.80000000000000011e134 or 5.80000000000000038e179 < a Initial program 91.3%
associate-+l+91.3%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around inf 68.2%
Final simplification67.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -3.95e+39)
x
(if (<= x -8.5e-90)
(* z y)
(if (<= x 3.9e-140) (* t a) (if (<= x 2.75e+19) (* a (* z b)) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.95e+39) {
tmp = x;
} else if (x <= -8.5e-90) {
tmp = z * y;
} else if (x <= 3.9e-140) {
tmp = t * a;
} else if (x <= 2.75e+19) {
tmp = a * (z * b);
} 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 (x <= (-3.95d+39)) then
tmp = x
else if (x <= (-8.5d-90)) then
tmp = z * y
else if (x <= 3.9d-140) then
tmp = t * a
else if (x <= 2.75d+19) then
tmp = a * (z * b)
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 (x <= -3.95e+39) {
tmp = x;
} else if (x <= -8.5e-90) {
tmp = z * y;
} else if (x <= 3.9e-140) {
tmp = t * a;
} else if (x <= 2.75e+19) {
tmp = a * (z * b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3.95e+39: tmp = x elif x <= -8.5e-90: tmp = z * y elif x <= 3.9e-140: tmp = t * a elif x <= 2.75e+19: tmp = a * (z * b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.95e+39) tmp = x; elseif (x <= -8.5e-90) tmp = Float64(z * y); elseif (x <= 3.9e-140) tmp = Float64(t * a); elseif (x <= 2.75e+19) tmp = Float64(a * Float64(z * b)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -3.95e+39) tmp = x; elseif (x <= -8.5e-90) tmp = z * y; elseif (x <= 3.9e-140) tmp = t * a; elseif (x <= 2.75e+19) tmp = a * (z * b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.95e+39], x, If[LessEqual[x, -8.5e-90], N[(z * y), $MachinePrecision], If[LessEqual[x, 3.9e-140], N[(t * a), $MachinePrecision], If[LessEqual[x, 2.75e+19], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.95 \cdot 10^{+39}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-90}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{-140}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 2.75 \cdot 10^{+19}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.95000000000000022e39 or 2.75e19 < x Initial program 99.2%
associate-+l+99.2%
associate-*l*97.4%
Simplified97.4%
Taylor expanded in x around inf 57.8%
if -3.95000000000000022e39 < x < -8.5000000000000001e-90Initial program 85.5%
associate-+l+85.5%
associate-*l*89.5%
Simplified89.5%
Taylor expanded in y around inf 46.4%
*-commutative46.4%
Simplified46.4%
if -8.5000000000000001e-90 < x < 3.90000000000000019e-140Initial program 95.3%
associate-+l+95.3%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in t around inf 46.7%
if 3.90000000000000019e-140 < x < 2.75e19Initial program 94.0%
associate-+l+94.0%
+-commutative94.0%
fma-define94.0%
associate-*l*96.8%
*-commutative96.8%
*-commutative96.8%
distribute-rgt-out96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in y around inf 79.9%
Taylor expanded in b around inf 45.3%
Final simplification51.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -9.5e+38)
x
(if (<= x -5e-93)
(* z y)
(if (<= x 7e-140) (* t a) (if (<= x 1.7e+19) (* b (* z a)) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -9.5e+38) {
tmp = x;
} else if (x <= -5e-93) {
tmp = z * y;
} else if (x <= 7e-140) {
tmp = t * a;
} else if (x <= 1.7e+19) {
tmp = b * (z * 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 (x <= (-9.5d+38)) then
tmp = x
else if (x <= (-5d-93)) then
tmp = z * y
else if (x <= 7d-140) then
tmp = t * a
else if (x <= 1.7d+19) then
tmp = b * (z * 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 (x <= -9.5e+38) {
tmp = x;
} else if (x <= -5e-93) {
tmp = z * y;
} else if (x <= 7e-140) {
tmp = t * a;
} else if (x <= 1.7e+19) {
tmp = b * (z * a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -9.5e+38: tmp = x elif x <= -5e-93: tmp = z * y elif x <= 7e-140: tmp = t * a elif x <= 1.7e+19: tmp = b * (z * a) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -9.5e+38) tmp = x; elseif (x <= -5e-93) tmp = Float64(z * y); elseif (x <= 7e-140) tmp = Float64(t * a); elseif (x <= 1.7e+19) tmp = Float64(b * Float64(z * a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -9.5e+38) tmp = x; elseif (x <= -5e-93) tmp = z * y; elseif (x <= 7e-140) tmp = t * a; elseif (x <= 1.7e+19) tmp = b * (z * a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -9.5e+38], x, If[LessEqual[x, -5e-93], N[(z * y), $MachinePrecision], If[LessEqual[x, 7e-140], N[(t * a), $MachinePrecision], If[LessEqual[x, 1.7e+19], N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+38}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-93}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-140}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{+19}:\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -9.4999999999999995e38 or 1.7e19 < x Initial program 99.2%
associate-+l+99.2%
associate-*l*97.4%
Simplified97.4%
Taylor expanded in x around inf 57.8%
if -9.4999999999999995e38 < x < -4.99999999999999994e-93Initial program 85.5%
associate-+l+85.5%
associate-*l*89.5%
Simplified89.5%
Taylor expanded in y around inf 46.4%
*-commutative46.4%
Simplified46.4%
if -4.99999999999999994e-93 < x < 6.9999999999999996e-140Initial program 95.3%
associate-+l+95.3%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in t around inf 46.7%
if 6.9999999999999996e-140 < x < 1.7e19Initial program 94.0%
associate-+l+94.0%
+-commutative94.0%
fma-define94.0%
associate-*l*96.8%
*-commutative96.8%
*-commutative96.8%
distribute-rgt-out96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in y around inf 79.9%
Taylor expanded in b around inf 45.3%
associate-*r*45.3%
*-commutative45.3%
associate-*r*48.2%
Simplified48.2%
Final simplification51.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2e-89) (not (<= z 2.3e-56))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ x (+ (* z y) (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2e-89) || !(z <= 2.3e-56)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = x + ((z * y) + (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 <= (-2d-89)) .or. (.not. (z <= 2.3d-56))) then
tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
else
tmp = x + ((z * y) + (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 <= -2e-89) || !(z <= 2.3e-56)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = x + ((z * y) + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2e-89) or not (z <= 2.3e-56): tmp = z * (y + ((x / z) + (a * (b + (t / z))))) else: tmp = x + ((z * y) + (t * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2e-89) || !(z <= 2.3e-56)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); else tmp = Float64(x + Float64(Float64(z * y) + Float64(t * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2e-89) || ~((z <= 2.3e-56))) tmp = z * (y + ((x / z) + (a * (b + (t / z))))); else tmp = x + ((z * y) + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2e-89], N[Not[LessEqual[z, 2.3e-56]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-89} \lor \neg \left(z \leq 2.3 \cdot 10^{-56}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot y + t \cdot a\right)\\
\end{array}
\end{array}
if z < -2.00000000000000008e-89 or 2.30000000000000002e-56 < z Initial program 93.1%
associate-+l+93.1%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in z around inf 97.1%
+-commutative97.1%
associate-+l+97.1%
+-commutative97.1%
associate-/l*97.1%
distribute-lft-out97.1%
Simplified97.1%
if -2.00000000000000008e-89 < z < 2.30000000000000002e-56Initial program 99.1%
associate-+l+99.1%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in b around 0 93.4%
Final simplification95.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -4.5e+34)
t_1
(if (<= a 5.9e-120) (+ x (* z y)) (if (<= a 8e+56) (+ x (* t a)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (a <= -4.5e+34) {
tmp = t_1;
} else if (a <= 5.9e-120) {
tmp = x + (z * y);
} else if (a <= 8e+56) {
tmp = x + (t * a);
} 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 = a * (t + (z * b))
if (a <= (-4.5d+34)) then
tmp = t_1
else if (a <= 5.9d-120) then
tmp = x + (z * y)
else if (a <= 8d+56) then
tmp = x + (t * a)
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 = a * (t + (z * b));
double tmp;
if (a <= -4.5e+34) {
tmp = t_1;
} else if (a <= 5.9e-120) {
tmp = x + (z * y);
} else if (a <= 8e+56) {
tmp = x + (t * a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -4.5e+34: tmp = t_1 elif a <= 5.9e-120: tmp = x + (z * y) elif a <= 8e+56: tmp = x + (t * a) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -4.5e+34) tmp = t_1; elseif (a <= 5.9e-120) tmp = Float64(x + Float64(z * y)); elseif (a <= 8e+56) tmp = Float64(x + Float64(t * a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (t + (z * b)); tmp = 0.0; if (a <= -4.5e+34) tmp = t_1; elseif (a <= 5.9e-120) tmp = x + (z * y); elseif (a <= 8e+56) tmp = x + (t * a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.5e+34], t$95$1, If[LessEqual[a, 5.9e-120], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8e+56], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -4.5 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.9 \cdot 10^{-120}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{elif}\;a \leq 8 \cdot 10^{+56}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.5e34 or 8.00000000000000074e56 < a Initial program 91.6%
associate-+l+91.6%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in a around inf 81.1%
if -4.5e34 < a < 5.89999999999999979e-120Initial program 98.4%
associate-+l+98.4%
associate-*l*96.3%
Simplified96.3%
Taylor expanded in a around 0 77.3%
if 5.89999999999999979e-120 < a < 8.00000000000000074e56Initial program 98.1%
associate-+l+98.1%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in z around 0 66.9%
+-commutative66.9%
Simplified66.9%
Final simplification76.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -27500.0)
(+ x (* a (+ t (* z b))))
(if (<= b 9e-39)
(+ x (+ (* z y) (* t a)))
(+ x (+ (* t a) (* a (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -27500.0) {
tmp = x + (a * (t + (z * b)));
} else if (b <= 9e-39) {
tmp = x + ((z * y) + (t * a));
} else {
tmp = x + ((t * a) + (a * (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-27500.0d0)) then
tmp = x + (a * (t + (z * b)))
else if (b <= 9d-39) then
tmp = x + ((z * y) + (t * a))
else
tmp = x + ((t * a) + (a * (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -27500.0) {
tmp = x + (a * (t + (z * b)));
} else if (b <= 9e-39) {
tmp = x + ((z * y) + (t * a));
} else {
tmp = x + ((t * a) + (a * (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -27500.0: tmp = x + (a * (t + (z * b))) elif b <= 9e-39: tmp = x + ((z * y) + (t * a)) else: tmp = x + ((t * a) + (a * (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -27500.0) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); elseif (b <= 9e-39) tmp = Float64(x + Float64(Float64(z * y) + Float64(t * a))); else tmp = Float64(x + Float64(Float64(t * a) + Float64(a * Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -27500.0) tmp = x + (a * (t + (z * b))); elseif (b <= 9e-39) tmp = x + ((z * y) + (t * a)); else tmp = x + ((t * a) + (a * (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -27500.0], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9e-39], N[(x + N[(N[(z * y), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * a), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -27500:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;b \leq 9 \cdot 10^{-39}:\\
\;\;\;\;x + \left(z \cdot y + t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)\\
\end{array}
\end{array}
if b < -27500Initial program 97.1%
associate-+l+97.1%
+-commutative97.1%
fma-define97.1%
associate-*l*95.8%
*-commutative95.8%
*-commutative95.8%
distribute-rgt-out98.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in y around 0 87.1%
if -27500 < b < 9.0000000000000002e-39Initial program 95.0%
associate-+l+95.0%
associate-*l*98.2%
Simplified98.2%
Taylor expanded in b around 0 95.1%
if 9.0000000000000002e-39 < b Initial program 95.8%
associate-+l+95.8%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in y around 0 86.9%
Final simplification90.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -1.7e+100)
(* b (* z a))
(if (or (<= a -2.65e-46) (not (<= a 1.12e-119)))
(+ x (* t a))
(+ x (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.7e+100) {
tmp = b * (z * a);
} else if ((a <= -2.65e-46) || !(a <= 1.12e-119)) {
tmp = x + (t * a);
} else {
tmp = x + (z * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-1.7d+100)) then
tmp = b * (z * a)
else if ((a <= (-2.65d-46)) .or. (.not. (a <= 1.12d-119))) then
tmp = x + (t * a)
else
tmp = x + (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.7e+100) {
tmp = b * (z * a);
} else if ((a <= -2.65e-46) || !(a <= 1.12e-119)) {
tmp = x + (t * a);
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.7e+100: tmp = b * (z * a) elif (a <= -2.65e-46) or not (a <= 1.12e-119): tmp = x + (t * a) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.7e+100) tmp = Float64(b * Float64(z * a)); elseif ((a <= -2.65e-46) || !(a <= 1.12e-119)) tmp = Float64(x + Float64(t * a)); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.7e+100) tmp = b * (z * a); elseif ((a <= -2.65e-46) || ~((a <= 1.12e-119))) tmp = x + (t * a); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.7e+100], N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -2.65e-46], N[Not[LessEqual[a, 1.12e-119]], $MachinePrecision]], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.7 \cdot 10^{+100}:\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\mathbf{elif}\;a \leq -2.65 \cdot 10^{-46} \lor \neg \left(a \leq 1.12 \cdot 10^{-119}\right):\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -1.69999999999999997e100Initial program 89.0%
associate-+l+89.0%
+-commutative89.0%
fma-define89.0%
associate-*l*89.1%
*-commutative89.1%
*-commutative89.1%
distribute-rgt-out94.5%
*-commutative94.5%
Simplified94.5%
Taylor expanded in y around inf 94.8%
Taylor expanded in b around inf 61.2%
associate-*r*55.9%
*-commutative55.9%
associate-*r*66.2%
Simplified66.2%
if -1.69999999999999997e100 < a < -2.65000000000000009e-46 or 1.11999999999999998e-119 < a Initial program 96.3%
associate-+l+96.3%
associate-*l*98.5%
Simplified98.5%
Taylor expanded in z around 0 66.7%
+-commutative66.7%
Simplified66.7%
if -2.65000000000000009e-46 < a < 1.11999999999999998e-119Initial program 98.0%
associate-+l+98.0%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around 0 83.0%
Final simplification72.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -3.9e-48) (not (<= a 5e-121))) (+ x (* a (+ t (* z b)))) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.9e-48) || !(a <= 5e-121)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (z * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-3.9d-48)) .or. (.not. (a <= 5d-121))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.9e-48) || !(a <= 5e-121)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -3.9e-48) or not (a <= 5e-121): tmp = x + (a * (t + (z * b))) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.9e-48) || !(a <= 5e-121)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -3.9e-48) || ~((a <= 5e-121))) tmp = x + (a * (t + (z * b))); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.9e-48], N[Not[LessEqual[a, 5e-121]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.9 \cdot 10^{-48} \lor \neg \left(a \leq 5 \cdot 10^{-121}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -3.9e-48 or 4.99999999999999989e-121 < a Initial program 94.7%
associate-+l+94.7%
+-commutative94.7%
fma-define94.7%
associate-*l*96.4%
*-commutative96.4%
*-commutative96.4%
distribute-rgt-out97.6%
*-commutative97.6%
Simplified97.6%
Taylor expanded in y around 0 88.1%
if -3.9e-48 < a < 4.99999999999999989e-121Initial program 98.0%
associate-+l+98.0%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around 0 83.0%
Final simplification86.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -300000.0) (not (<= b 8e-39))) (+ x (* a (+ t (* z b)))) (+ x (+ (* z y) (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -300000.0) || !(b <= 8e-39)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((z * y) + (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 <= (-300000.0d0)) .or. (.not. (b <= 8d-39))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + ((z * y) + (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 <= -300000.0) || !(b <= 8e-39)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((z * y) + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -300000.0) or not (b <= 8e-39): tmp = x + (a * (t + (z * b))) else: tmp = x + ((z * y) + (t * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -300000.0) || !(b <= 8e-39)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(Float64(z * y) + Float64(t * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -300000.0) || ~((b <= 8e-39))) tmp = x + (a * (t + (z * b))); else tmp = x + ((z * y) + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -300000.0], N[Not[LessEqual[b, 8e-39]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -300000 \lor \neg \left(b \leq 8 \cdot 10^{-39}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot y + t \cdot a\right)\\
\end{array}
\end{array}
if b < -3e5 or 7.99999999999999943e-39 < b Initial program 96.5%
associate-+l+96.5%
+-commutative96.5%
fma-define96.5%
associate-*l*94.2%
*-commutative94.2%
*-commutative94.2%
distribute-rgt-out95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in y around 0 87.0%
if -3e5 < b < 7.99999999999999943e-39Initial program 95.0%
associate-+l+95.0%
associate-*l*98.2%
Simplified98.2%
Taylor expanded in b around 0 95.1%
Final simplification90.8%
(FPCore (x y z t a b) :precision binary64 (if (<= x -3.2e+39) x (if (<= x -3.4e-88) (* z y) (if (<= x 9.6e-42) (* t a) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.2e+39) {
tmp = x;
} else if (x <= -3.4e-88) {
tmp = z * y;
} else if (x <= 9.6e-42) {
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 (x <= (-3.2d+39)) then
tmp = x
else if (x <= (-3.4d-88)) then
tmp = z * y
else if (x <= 9.6d-42) 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 (x <= -3.2e+39) {
tmp = x;
} else if (x <= -3.4e-88) {
tmp = z * y;
} else if (x <= 9.6e-42) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3.2e+39: tmp = x elif x <= -3.4e-88: tmp = z * y elif x <= 9.6e-42: tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.2e+39) tmp = x; elseif (x <= -3.4e-88) tmp = Float64(z * y); elseif (x <= 9.6e-42) 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 (x <= -3.2e+39) tmp = x; elseif (x <= -3.4e-88) tmp = z * y; elseif (x <= 9.6e-42) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.2e+39], x, If[LessEqual[x, -3.4e-88], N[(z * y), $MachinePrecision], If[LessEqual[x, 9.6e-42], N[(t * a), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{+39}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -3.4 \cdot 10^{-88}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{-42}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.19999999999999993e39 or 9.60000000000000011e-42 < x Initial program 99.2%
associate-+l+99.2%
associate-*l*97.6%
Simplified97.6%
Taylor expanded in x around inf 54.6%
if -3.19999999999999993e39 < x < -3.39999999999999975e-88Initial program 85.5%
associate-+l+85.5%
associate-*l*89.5%
Simplified89.5%
Taylor expanded in y around inf 46.4%
*-commutative46.4%
Simplified46.4%
if -3.39999999999999975e-88 < x < 9.60000000000000011e-42Initial program 94.5%
associate-+l+94.5%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in t around inf 42.3%
Final simplification48.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.1e-80) x (if (<= x 7.2e-42) (* t a) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.1e-80) {
tmp = x;
} else if (x <= 7.2e-42) {
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 (x <= (-1.1d-80)) then
tmp = x
else if (x <= 7.2d-42) 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 (x <= -1.1e-80) {
tmp = x;
} else if (x <= 7.2e-42) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.1e-80: tmp = x elif x <= 7.2e-42: tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.1e-80) tmp = x; elseif (x <= 7.2e-42) 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 (x <= -1.1e-80) tmp = x; elseif (x <= 7.2e-42) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.1e-80], x, If[LessEqual[x, 7.2e-42], N[(t * a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{-80}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{-42}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.10000000000000005e-80 or 7.2000000000000004e-42 < x Initial program 96.6%
associate-+l+96.6%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in x around inf 49.9%
if -1.10000000000000005e-80 < x < 7.2000000000000004e-42Initial program 94.6%
associate-+l+94.6%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in t around inf 42.1%
Final simplification46.6%
(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 95.8%
associate-+l+95.8%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in x around inf 31.9%
Final simplification31.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 2024082
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:alt
(if (< z -11820553527347888000.0) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))