
(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 (+ x (* a (+ t (* z 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 = x + (a * (t + (z * b)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(z * a) * b)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(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[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $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}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 99.2%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
+-commutative0.0%
fma-define0.0%
associate-*l*13.3%
*-commutative13.3%
*-commutative13.3%
distribute-rgt-out66.7%
remove-double-neg66.7%
*-commutative66.7%
distribute-lft-neg-out66.7%
sub-neg66.7%
sub-neg66.7%
distribute-lft-neg-in66.7%
remove-double-neg66.7%
Simplified66.7%
Taylor expanded in y around 0 80.0%
Final simplification98.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -7.6e+156) (not (<= z 4.8e+136))) (* 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 <= -7.6e+156) || !(z <= 4.8e+136)) {
tmp = 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 <= (-7.6d+156)) .or. (.not. (z <= 4.8d+136))) then
tmp = 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 <= -7.6e+156) || !(z <= 4.8e+136)) {
tmp = 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 <= -7.6e+156) or not (z <= 4.8e+136): tmp = 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 <= -7.6e+156) || !(z <= 4.8e+136)) tmp = 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 <= -7.6e+156) || ~((z <= 4.8e+136))) tmp = 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, -7.6e+156], N[Not[LessEqual[z, 4.8e+136]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $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 -7.6 \cdot 10^{+156} \lor \neg \left(z \leq 4.8 \cdot 10^{+136}\right):\\
\;\;\;\;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 < -7.60000000000000048e156 or 4.8000000000000001e136 < z Initial program 86.3%
associate-+l+86.3%
associate-*l*72.0%
Simplified72.0%
Taylor expanded in z around inf 87.6%
if -7.60000000000000048e156 < z < 4.8000000000000001e136Initial program 96.2%
associate-+l+96.2%
associate-*l*96.2%
Simplified96.2%
Final simplification93.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (or (<= y -1.22e-108) (not (<= y 1.8e-111)))
(+ t_1 (* y (+ z (/ x y))))
(+ x 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 ((y <= -1.22e-108) || !(y <= 1.8e-111)) {
tmp = t_1 + (y * (z + (x / y)));
} else {
tmp = x + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (t + (z * b))
if ((y <= (-1.22d-108)) .or. (.not. (y <= 1.8d-111))) then
tmp = t_1 + (y * (z + (x / y)))
else
tmp = x + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if ((y <= -1.22e-108) || !(y <= 1.8e-111)) {
tmp = t_1 + (y * (z + (x / y)));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if (y <= -1.22e-108) or not (y <= 1.8e-111): tmp = t_1 + (y * (z + (x / y))) else: tmp = x + 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 ((y <= -1.22e-108) || !(y <= 1.8e-111)) tmp = Float64(t_1 + Float64(y * Float64(z + Float64(x / y)))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (t + (z * b)); tmp = 0.0; if ((y <= -1.22e-108) || ~((y <= 1.8e-111))) tmp = t_1 + (y * (z + (x / y))); else tmp = x + 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[Or[LessEqual[y, -1.22e-108], N[Not[LessEqual[y, 1.8e-111]], $MachinePrecision]], N[(t$95$1 + N[(y * N[(z + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;y \leq -1.22 \cdot 10^{-108} \lor \neg \left(y \leq 1.8 \cdot 10^{-111}\right):\\
\;\;\;\;t\_1 + y \cdot \left(z + \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if y < -1.2199999999999999e-108 or 1.80000000000000005e-111 < y Initial program 93.9%
associate-+l+93.9%
+-commutative93.9%
fma-define93.9%
associate-*l*91.2%
*-commutative91.2%
*-commutative91.2%
distribute-rgt-out92.9%
remove-double-neg92.9%
*-commutative92.9%
distribute-lft-neg-out92.9%
sub-neg92.9%
sub-neg92.9%
distribute-lft-neg-in92.9%
remove-double-neg92.9%
Simplified92.9%
Taylor expanded in y around inf 91.9%
if -1.2199999999999999e-108 < y < 1.80000000000000005e-111Initial program 92.0%
associate-+l+92.0%
+-commutative92.0%
fma-define92.0%
associate-*l*84.7%
*-commutative84.7%
*-commutative84.7%
distribute-rgt-out91.3%
remove-double-neg91.3%
*-commutative91.3%
distribute-lft-neg-out91.3%
sub-neg91.3%
sub-neg91.3%
distribute-lft-neg-in91.3%
remove-double-neg91.3%
Simplified91.3%
Taylor expanded in y around 0 90.1%
Final simplification91.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.8e+66)
(* y z)
(if (<= z -1.35e+20)
(* z (* a b))
(if (<= z -1.4e-289) (* t a) (if (<= z 1.28e-70) x (* y z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.8e+66) {
tmp = y * z;
} else if (z <= -1.35e+20) {
tmp = z * (a * b);
} else if (z <= -1.4e-289) {
tmp = t * a;
} else if (z <= 1.28e-70) {
tmp = x;
} else {
tmp = y * z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2.8d+66)) then
tmp = y * z
else if (z <= (-1.35d+20)) then
tmp = z * (a * b)
else if (z <= (-1.4d-289)) then
tmp = t * a
else if (z <= 1.28d-70) then
tmp = x
else
tmp = y * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.8e+66) {
tmp = y * z;
} else if (z <= -1.35e+20) {
tmp = z * (a * b);
} else if (z <= -1.4e-289) {
tmp = t * a;
} else if (z <= 1.28e-70) {
tmp = x;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.8e+66: tmp = y * z elif z <= -1.35e+20: tmp = z * (a * b) elif z <= -1.4e-289: tmp = t * a elif z <= 1.28e-70: tmp = x else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.8e+66) tmp = Float64(y * z); elseif (z <= -1.35e+20) tmp = Float64(z * Float64(a * b)); elseif (z <= -1.4e-289) tmp = Float64(t * a); elseif (z <= 1.28e-70) tmp = x; else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.8e+66) tmp = y * z; elseif (z <= -1.35e+20) tmp = z * (a * b); elseif (z <= -1.4e-289) tmp = t * a; elseif (z <= 1.28e-70) tmp = x; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.8e+66], N[(y * z), $MachinePrecision], If[LessEqual[z, -1.35e+20], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.4e-289], N[(t * a), $MachinePrecision], If[LessEqual[z, 1.28e-70], x, N[(y * z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+66}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{+20}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-289}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 1.28 \cdot 10^{-70}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if z < -2.8000000000000001e66 or 1.28e-70 < z Initial program 88.9%
associate-+l+88.9%
associate-*l*80.6%
Simplified80.6%
Taylor expanded in z around inf 75.5%
Taylor expanded in y around inf 49.4%
if -2.8000000000000001e66 < z < -1.35e20Initial program 92.9%
associate-+l+92.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around inf 75.7%
Taylor expanded in y around 0 63.0%
associate-*r*63.0%
*-commutative63.0%
Simplified63.0%
if -1.35e20 < z < -1.39999999999999993e-289Initial program 98.4%
associate-+l+98.4%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in z around 0 71.4%
Taylor expanded in x around 0 43.9%
if -1.39999999999999993e-289 < z < 1.28e-70Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
fma-define100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
distribute-rgt-out100.0%
remove-double-neg100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
sub-neg100.0%
sub-neg100.0%
distribute-lft-neg-in100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 93.3%
Taylor expanded in a around 0 59.1%
Taylor expanded in y around 0 60.0%
Final simplification50.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.95e+65)
(* y z)
(if (<= z -6e+14)
(* a (* z b))
(if (<= z -1.2e-288) (* t a) (if (<= z 4.4e-71) x (* y z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.95e+65) {
tmp = y * z;
} else if (z <= -6e+14) {
tmp = a * (z * b);
} else if (z <= -1.2e-288) {
tmp = t * a;
} else if (z <= 4.4e-71) {
tmp = x;
} else {
tmp = y * z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.95d+65)) then
tmp = y * z
else if (z <= (-6d+14)) then
tmp = a * (z * b)
else if (z <= (-1.2d-288)) then
tmp = t * a
else if (z <= 4.4d-71) then
tmp = x
else
tmp = y * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.95e+65) {
tmp = y * z;
} else if (z <= -6e+14) {
tmp = a * (z * b);
} else if (z <= -1.2e-288) {
tmp = t * a;
} else if (z <= 4.4e-71) {
tmp = x;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.95e+65: tmp = y * z elif z <= -6e+14: tmp = a * (z * b) elif z <= -1.2e-288: tmp = t * a elif z <= 4.4e-71: tmp = x else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.95e+65) tmp = Float64(y * z); elseif (z <= -6e+14) tmp = Float64(a * Float64(z * b)); elseif (z <= -1.2e-288) tmp = Float64(t * a); elseif (z <= 4.4e-71) tmp = x; else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.95e+65) tmp = y * z; elseif (z <= -6e+14) tmp = a * (z * b); elseif (z <= -1.2e-288) tmp = t * a; elseif (z <= 4.4e-71) tmp = x; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.95e+65], N[(y * z), $MachinePrecision], If[LessEqual[z, -6e+14], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.2e-288], N[(t * a), $MachinePrecision], If[LessEqual[z, 4.4e-71], x, N[(y * z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+65}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -6 \cdot 10^{+14}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-288}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-71}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if z < -1.9499999999999999e65 or 4.39999999999999995e-71 < z Initial program 88.9%
associate-+l+88.9%
associate-*l*80.6%
Simplified80.6%
Taylor expanded in z around inf 75.5%
Taylor expanded in y around inf 49.4%
if -1.9499999999999999e65 < z < -6e14Initial program 92.9%
associate-+l+92.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around inf 75.7%
Taylor expanded in y around 0 63.0%
if -6e14 < z < -1.1999999999999999e-288Initial program 98.4%
associate-+l+98.4%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in z around 0 71.4%
Taylor expanded in x around 0 43.9%
if -1.1999999999999999e-288 < z < 4.39999999999999995e-71Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
fma-define100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
distribute-rgt-out100.0%
remove-double-neg100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
sub-neg100.0%
sub-neg100.0%
distribute-lft-neg-in100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 93.3%
Taylor expanded in a around 0 59.1%
Taylor expanded in y around 0 60.0%
Final simplification50.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -5.4e+166)
(* z (+ y (* a b)))
(if (<= b 4.2e+131)
(+ x (+ (* t a) (* y z)))
(+ x (* b (* a (+ z (/ t b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -5.4e+166) {
tmp = z * (y + (a * b));
} else if (b <= 4.2e+131) {
tmp = x + ((t * a) + (y * z));
} else {
tmp = x + (b * (a * (z + (t / 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 <= (-5.4d+166)) then
tmp = z * (y + (a * b))
else if (b <= 4.2d+131) then
tmp = x + ((t * a) + (y * z))
else
tmp = x + (b * (a * (z + (t / 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 <= -5.4e+166) {
tmp = z * (y + (a * b));
} else if (b <= 4.2e+131) {
tmp = x + ((t * a) + (y * z));
} else {
tmp = x + (b * (a * (z + (t / b))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -5.4e+166: tmp = z * (y + (a * b)) elif b <= 4.2e+131: tmp = x + ((t * a) + (y * z)) else: tmp = x + (b * (a * (z + (t / b)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -5.4e+166) tmp = Float64(z * Float64(y + Float64(a * b))); elseif (b <= 4.2e+131) tmp = Float64(x + Float64(Float64(t * a) + Float64(y * z))); else tmp = Float64(x + Float64(b * Float64(a * Float64(z + Float64(t / b))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -5.4e+166) tmp = z * (y + (a * b)); elseif (b <= 4.2e+131) tmp = x + ((t * a) + (y * z)); else tmp = x + (b * (a * (z + (t / b)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -5.4e+166], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.2e+131], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(b * N[(a * N[(z + N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.4 \cdot 10^{+166}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;b \leq 4.2 \cdot 10^{+131}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + b \cdot \left(a \cdot \left(z + \frac{t}{b}\right)\right)\\
\end{array}
\end{array}
if b < -5.40000000000000023e166Initial program 85.7%
associate-+l+85.7%
associate-*l*72.3%
Simplified72.3%
Taylor expanded in z around inf 79.3%
if -5.40000000000000023e166 < b < 4.19999999999999971e131Initial program 94.2%
associate-+l+94.2%
associate-*l*94.8%
Simplified94.8%
Taylor expanded in b around 0 91.4%
if 4.19999999999999971e131 < b Initial program 94.7%
associate-+l+94.7%
+-commutative94.7%
fma-define94.7%
associate-*l*75.1%
*-commutative75.1%
*-commutative75.1%
distribute-rgt-out77.6%
remove-double-neg77.6%
*-commutative77.6%
distribute-lft-neg-out77.6%
sub-neg77.6%
sub-neg77.6%
distribute-lft-neg-in77.6%
remove-double-neg77.6%
Simplified77.6%
Taylor expanded in y around 0 72.6%
Taylor expanded in b around inf 82.0%
associate-/l*84.5%
distribute-lft-out84.5%
Simplified84.5%
Final simplification89.0%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.9e+65) (* y z) (if (<= z -5.8e+22) (* z (* a b)) (if (<= z 6e+92) (+ x (* t a)) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.9e+65) {
tmp = y * z;
} else if (z <= -5.8e+22) {
tmp = z * (a * b);
} else if (z <= 6e+92) {
tmp = x + (t * a);
} else {
tmp = y * z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.9d+65)) then
tmp = y * z
else if (z <= (-5.8d+22)) then
tmp = z * (a * b)
else if (z <= 6d+92) then
tmp = x + (t * a)
else
tmp = y * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.9e+65) {
tmp = y * z;
} else if (z <= -5.8e+22) {
tmp = z * (a * b);
} else if (z <= 6e+92) {
tmp = x + (t * a);
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.9e+65: tmp = y * z elif z <= -5.8e+22: tmp = z * (a * b) elif z <= 6e+92: tmp = x + (t * a) else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.9e+65) tmp = Float64(y * z); elseif (z <= -5.8e+22) tmp = Float64(z * Float64(a * b)); elseif (z <= 6e+92) tmp = Float64(x + Float64(t * a)); else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.9e+65) tmp = y * z; elseif (z <= -5.8e+22) tmp = z * (a * b); elseif (z <= 6e+92) tmp = x + (t * a); else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.9e+65], N[(y * z), $MachinePrecision], If[LessEqual[z, -5.8e+22], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+92], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], N[(y * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+65}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{+22}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+92}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if z < -1.90000000000000006e65 or 6.00000000000000026e92 < z Initial program 88.2%
associate-+l+88.2%
associate-*l*78.0%
Simplified78.0%
Taylor expanded in z around inf 82.9%
Taylor expanded in y around inf 55.3%
if -1.90000000000000006e65 < z < -5.8e22Initial program 92.9%
associate-+l+92.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around inf 75.7%
Taylor expanded in y around 0 63.0%
associate-*r*63.0%
*-commutative63.0%
Simplified63.0%
if -5.8e22 < z < 6.00000000000000026e92Initial program 97.1%
associate-+l+97.1%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in z around 0 70.7%
Final simplification64.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.7e+45) (not (<= a 1.2e+68))) (+ x (* a (+ t (* z b)))) (+ x (+ (* t a) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.7e+45) || !(a <= 1.2e+68)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-2.7d+45)) .or. (.not. (a <= 1.2d+68))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + ((t * a) + (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.7e+45) || !(a <= 1.2e+68)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.7e+45) or not (a <= 1.2e+68): tmp = x + (a * (t + (z * b))) else: tmp = x + ((t * a) + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.7e+45) || !(a <= 1.2e+68)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(Float64(t * a) + Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -2.7e+45) || ~((a <= 1.2e+68))) tmp = x + (a * (t + (z * b))); else tmp = x + ((t * a) + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.7e+45], N[Not[LessEqual[a, 1.2e+68]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{+45} \lor \neg \left(a \leq 1.2 \cdot 10^{+68}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\end{array}
\end{array}
if a < -2.69999999999999984e45 or 1.20000000000000004e68 < a Initial program 86.1%
associate-+l+86.1%
+-commutative86.1%
fma-define86.1%
associate-*l*89.9%
*-commutative89.9%
*-commutative89.9%
distribute-rgt-out97.9%
remove-double-neg97.9%
*-commutative97.9%
distribute-lft-neg-out97.9%
sub-neg97.9%
sub-neg97.9%
distribute-lft-neg-in97.9%
remove-double-neg97.9%
Simplified97.9%
Taylor expanded in y around 0 95.1%
if -2.69999999999999984e45 < a < 1.20000000000000004e68Initial program 98.0%
associate-+l+98.0%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in b around 0 84.6%
Final simplification88.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -4.3e-95) (not (<= a 5.5e-53))) (+ x (* 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 <= -4.3e-95) || !(a <= 5.5e-53)) {
tmp = x + (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 <= (-4.3d-95)) .or. (.not. (a <= 5.5d-53))) then
tmp = x + (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 <= -4.3e-95) || !(a <= 5.5e-53)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -4.3e-95) or not (a <= 5.5e-53): tmp = x + (a * (t + (z * b))) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -4.3e-95) || !(a <= 5.5e-53)) tmp = Float64(x + 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 <= -4.3e-95) || ~((a <= 5.5e-53))) tmp = x + (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, -4.3e-95], N[Not[LessEqual[a, 5.5e-53]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.3 \cdot 10^{-95} \lor \neg \left(a \leq 5.5 \cdot 10^{-53}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -4.29999999999999997e-95 or 5.50000000000000023e-53 < a Initial program 89.5%
associate-+l+89.5%
+-commutative89.5%
fma-define89.5%
associate-*l*91.6%
*-commutative91.6%
*-commutative91.6%
distribute-rgt-out97.2%
remove-double-neg97.2%
*-commutative97.2%
distribute-lft-neg-out97.2%
sub-neg97.2%
sub-neg97.2%
distribute-lft-neg-in97.2%
remove-double-neg97.2%
Simplified97.2%
Taylor expanded in y around 0 87.0%
if -4.29999999999999997e-95 < a < 5.50000000000000023e-53Initial program 98.2%
associate-+l+98.2%
+-commutative98.2%
fma-define98.2%
associate-*l*86.5%
*-commutative86.5%
*-commutative86.5%
distribute-rgt-out86.5%
remove-double-neg86.5%
*-commutative86.5%
distribute-lft-neg-out86.5%
sub-neg86.5%
sub-neg86.5%
distribute-lft-neg-in86.5%
remove-double-neg86.5%
Simplified86.5%
Taylor expanded in y around inf 79.1%
Taylor expanded in a around 0 69.2%
Taylor expanded in y around 0 77.3%
Final simplification82.7%
(FPCore (x y z t a b) :precision binary64 (if (<= z -5200000000000.0) (* y z) (if (<= z -1.1e-285) (* t a) (if (<= z 1.86e-69) x (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5200000000000.0) {
tmp = y * z;
} else if (z <= -1.1e-285) {
tmp = t * a;
} else if (z <= 1.86e-69) {
tmp = x;
} else {
tmp = y * z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-5200000000000.0d0)) then
tmp = y * z
else if (z <= (-1.1d-285)) then
tmp = t * a
else if (z <= 1.86d-69) then
tmp = x
else
tmp = y * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5200000000000.0) {
tmp = y * z;
} else if (z <= -1.1e-285) {
tmp = t * a;
} else if (z <= 1.86e-69) {
tmp = x;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -5200000000000.0: tmp = y * z elif z <= -1.1e-285: tmp = t * a elif z <= 1.86e-69: tmp = x else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5200000000000.0) tmp = Float64(y * z); elseif (z <= -1.1e-285) tmp = Float64(t * a); elseif (z <= 1.86e-69) tmp = x; else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -5200000000000.0) tmp = y * z; elseif (z <= -1.1e-285) tmp = t * a; elseif (z <= 1.86e-69) tmp = x; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5200000000000.0], N[(y * z), $MachinePrecision], If[LessEqual[z, -1.1e-285], N[(t * a), $MachinePrecision], If[LessEqual[z, 1.86e-69], x, N[(y * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5200000000000:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-285}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 1.86 \cdot 10^{-69}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if z < -5.2e12 or 1.86e-69 < z Initial program 89.3%
associate-+l+89.3%
associate-*l*82.4%
Simplified82.4%
Taylor expanded in z around inf 75.7%
Taylor expanded in y around inf 46.7%
if -5.2e12 < z < -1.1e-285Initial program 98.4%
associate-+l+98.4%
associate-*l*98.3%
Simplified98.3%
Taylor expanded in z around 0 72.4%
Taylor expanded in x around 0 44.4%
if -1.1e-285 < z < 1.86e-69Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
fma-define100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
distribute-rgt-out100.0%
remove-double-neg100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
sub-neg100.0%
sub-neg100.0%
distribute-lft-neg-in100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 93.3%
Taylor expanded in a around 0 59.1%
Taylor expanded in y around 0 60.0%
Final simplification48.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5200000000000.0) (not (<= z 2.1e-28))) (* z (+ y (* a b))) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5200000000000.0) || !(z <= 2.1e-28)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-5200000000000.0d0)) .or. (.not. (z <= 2.1d-28))) then
tmp = z * (y + (a * b))
else
tmp = x + (t * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5200000000000.0) || !(z <= 2.1e-28)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -5200000000000.0) or not (z <= 2.1e-28): tmp = z * (y + (a * b)) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -5200000000000.0) || !(z <= 2.1e-28)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -5200000000000.0) || ~((z <= 2.1e-28))) tmp = z * (y + (a * b)); else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -5200000000000.0], N[Not[LessEqual[z, 2.1e-28]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5200000000000 \lor \neg \left(z \leq 2.1 \cdot 10^{-28}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -5.2e12 or 2.10000000000000006e-28 < z Initial program 89.6%
associate-+l+89.6%
associate-*l*82.4%
Simplified82.4%
Taylor expanded in z around inf 77.4%
if -5.2e12 < z < 2.10000000000000006e-28Initial program 98.2%
associate-+l+98.2%
associate-*l*98.2%
Simplified98.2%
Taylor expanded in z around 0 77.8%
Final simplification77.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.5e+197) (not (<= t 8e+142))) (+ x (* t a)) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.5e+197) || !(t <= 8e+142)) {
tmp = x + (t * a);
} else {
tmp = x + (y * z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-1.5d+197)) .or. (.not. (t <= 8d+142))) then
tmp = x + (t * a)
else
tmp = x + (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.5e+197) || !(t <= 8e+142)) {
tmp = x + (t * a);
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.5e+197) or not (t <= 8e+142): tmp = x + (t * a) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.5e+197) || !(t <= 8e+142)) tmp = Float64(x + Float64(t * a)); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.5e+197) || ~((t <= 8e+142))) tmp = x + (t * a); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.5e+197], N[Not[LessEqual[t, 8e+142]], $MachinePrecision]], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{+197} \lor \neg \left(t \leq 8 \cdot 10^{+142}\right):\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if t < -1.5000000000000001e197 or 8.00000000000000041e142 < t Initial program 87.3%
associate-+l+87.3%
associate-*l*84.4%
Simplified84.4%
Taylor expanded in z around 0 77.3%
if -1.5000000000000001e197 < t < 8.00000000000000041e142Initial program 95.3%
associate-+l+95.3%
+-commutative95.3%
fma-define95.3%
associate-*l*90.9%
*-commutative90.9%
*-commutative90.9%
distribute-rgt-out92.5%
remove-double-neg92.5%
*-commutative92.5%
distribute-lft-neg-out92.5%
sub-neg92.5%
sub-neg92.5%
distribute-lft-neg-in92.5%
remove-double-neg92.5%
Simplified92.5%
Taylor expanded in y around inf 82.6%
Taylor expanded in a around 0 58.7%
Taylor expanded in y around 0 65.9%
Final simplification68.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -4.6e+111) (not (<= t 3.2e+113))) (* t a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4.6e+111) || !(t <= 3.2e+113)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-4.6d+111)) .or. (.not. (t <= 3.2d+113))) then
tmp = t * a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4.6e+111) || !(t <= 3.2e+113)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -4.6e+111) or not (t <= 3.2e+113): tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -4.6e+111) || !(t <= 3.2e+113)) tmp = Float64(t * a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -4.6e+111) || ~((t <= 3.2e+113))) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4.6e+111], N[Not[LessEqual[t, 3.2e+113]], $MachinePrecision]], N[(t * a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.6 \cdot 10^{+111} \lor \neg \left(t \leq 3.2 \cdot 10^{+113}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -4.60000000000000004e111 or 3.1999999999999998e113 < t Initial program 89.3%
associate-+l+89.3%
associate-*l*85.9%
Simplified85.9%
Taylor expanded in z around 0 68.2%
Taylor expanded in x around 0 56.7%
if -4.60000000000000004e111 < t < 3.1999999999999998e113Initial program 95.3%
associate-+l+95.3%
+-commutative95.3%
fma-define95.3%
associate-*l*91.0%
*-commutative91.0%
*-commutative91.0%
distribute-rgt-out92.1%
remove-double-neg92.1%
*-commutative92.1%
distribute-lft-neg-out92.1%
sub-neg92.1%
sub-neg92.1%
distribute-lft-neg-in92.1%
remove-double-neg92.1%
Simplified92.1%
Taylor expanded in y around inf 82.2%
Taylor expanded in a around 0 58.7%
Taylor expanded in y around 0 32.5%
Final simplification40.4%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.3%
associate-+l+93.3%
+-commutative93.3%
fma-define93.4%
associate-*l*89.3%
*-commutative89.3%
*-commutative89.3%
distribute-rgt-out92.4%
remove-double-neg92.4%
*-commutative92.4%
distribute-lft-neg-out92.4%
sub-neg92.4%
sub-neg92.4%
distribute-lft-neg-in92.4%
remove-double-neg92.4%
Simplified92.4%
Taylor expanded in y around inf 83.1%
Taylor expanded in a around 0 50.4%
Taylor expanded in y around 0 26.1%
(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 2024132
(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)))