
(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 15 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 (fma a (+ t (* z b)) (fma y z x)))
double code(double x, double y, double z, double t, double a, double b) {
return fma(a, (t + (z * b)), fma(y, z, x));
}
function code(x, y, z, t, a, b) return fma(a, Float64(t + Float64(z * b)), fma(y, z, x)) end
code[x_, y_, z_, t_, a_, b_] := N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(y * z + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\right)
\end{array}
Initial program 94.3%
associate-+l+94.3%
+-commutative94.3%
*-commutative94.3%
associate-*l*95.4%
*-commutative95.4%
distribute-lft-out96.6%
fma-def97.0%
*-commutative97.0%
+-commutative97.0%
fma-def97.0%
Simplified97.0%
Final simplification97.0%
(FPCore (x y z t a b) :precision binary64 (+ (fma y z x) (* a (+ t (* z b)))))
double code(double x, double y, double z, double t, double a, double b) {
return fma(y, z, x) + (a * (t + (z * b)));
}
function code(x, y, z, t, a, b) return Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b)))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)
\end{array}
Initial program 94.3%
associate-+l+94.3%
+-commutative94.3%
fma-def94.3%
associate-*l*95.4%
*-commutative95.4%
*-commutative95.4%
distribute-rgt-out96.6%
*-commutative96.6%
Simplified96.6%
Final simplification96.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* z y)) (* a t)) (* b (* a z))))) (if (<= t_1 INFINITY) t_1 (+ (* z y) (* a (+ t (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (z * y)) + (a * t)) + (b * (a * z));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (z * y) + (a * (t + (z * b)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (z * y)) + (a * t)) + (b * (a * z));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (z * y) + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (z * y)) + (a * t)) + (b * (a * z)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (z * y) + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(z * y)) + Float64(a * t)) + Float64(b * Float64(a * z))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(z * y) + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (z * y)) + (a * t)) + (b * (a * z)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = (z * y) + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(z * y), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + z \cdot y\right) + a \cdot t\right) + b \cdot \left(a \cdot z\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot y + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 97.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%
+-commutative0.0%
fma-def0.0%
associate-*l*25.0%
*-commutative25.0%
*-commutative25.0%
distribute-rgt-out62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in x around 0 62.5%
Final simplification96.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* z y) (* a t))) (t_2 (* a (+ t (* z b)))))
(if (<= a -6e-52)
t_2
(if (<= a -9.8e-164)
t_1
(if (<= a -2.4e-233)
(+ x (* b (* a z)))
(if (<= a 1.2e-134) (+ x (* z y)) (if (<= a 250.0) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * y) + (a * t);
double t_2 = a * (t + (z * b));
double tmp;
if (a <= -6e-52) {
tmp = t_2;
} else if (a <= -9.8e-164) {
tmp = t_1;
} else if (a <= -2.4e-233) {
tmp = x + (b * (a * z));
} else if (a <= 1.2e-134) {
tmp = x + (z * y);
} else if (a <= 250.0) {
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) + (a * t)
t_2 = a * (t + (z * b))
if (a <= (-6d-52)) then
tmp = t_2
else if (a <= (-9.8d-164)) then
tmp = t_1
else if (a <= (-2.4d-233)) then
tmp = x + (b * (a * z))
else if (a <= 1.2d-134) then
tmp = x + (z * y)
else if (a <= 250.0d0) 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) + (a * t);
double t_2 = a * (t + (z * b));
double tmp;
if (a <= -6e-52) {
tmp = t_2;
} else if (a <= -9.8e-164) {
tmp = t_1;
} else if (a <= -2.4e-233) {
tmp = x + (b * (a * z));
} else if (a <= 1.2e-134) {
tmp = x + (z * y);
} else if (a <= 250.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * y) + (a * t) t_2 = a * (t + (z * b)) tmp = 0 if a <= -6e-52: tmp = t_2 elif a <= -9.8e-164: tmp = t_1 elif a <= -2.4e-233: tmp = x + (b * (a * z)) elif a <= 1.2e-134: tmp = x + (z * y) elif a <= 250.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * y) + Float64(a * t)) t_2 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -6e-52) tmp = t_2; elseif (a <= -9.8e-164) tmp = t_1; elseif (a <= -2.4e-233) tmp = Float64(x + Float64(b * Float64(a * z))); elseif (a <= 1.2e-134) tmp = Float64(x + Float64(z * y)); elseif (a <= 250.0) 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) + (a * t); t_2 = a * (t + (z * b)); tmp = 0.0; if (a <= -6e-52) tmp = t_2; elseif (a <= -9.8e-164) tmp = t_1; elseif (a <= -2.4e-233) tmp = x + (b * (a * z)); elseif (a <= 1.2e-134) tmp = x + (z * y); elseif (a <= 250.0) 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 * y), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6e-52], t$95$2, If[LessEqual[a, -9.8e-164], t$95$1, If[LessEqual[a, -2.4e-233], N[(x + N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.2e-134], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 250.0], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot y + a \cdot t\\
t_2 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -6 \cdot 10^{-52}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -9.8 \cdot 10^{-164}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -2.4 \cdot 10^{-233}:\\
\;\;\;\;x + b \cdot \left(a \cdot z\right)\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{-134}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{elif}\;a \leq 250:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -6e-52 or 250 < a Initial program 89.3%
associate-+l+89.3%
+-commutative89.3%
fma-def89.3%
associate-*l*95.6%
*-commutative95.6%
*-commutative95.6%
distribute-rgt-out97.8%
*-commutative97.8%
Simplified97.8%
Taylor expanded in y around 0 91.5%
Taylor expanded in x around 0 76.2%
if -6e-52 < a < -9.7999999999999993e-164 or 1.20000000000000005e-134 < a < 250Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around inf 87.5%
Taylor expanded in x around 0 76.4%
if -9.7999999999999993e-164 < a < -2.3999999999999999e-233Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
associate-*l*83.4%
*-commutative83.4%
*-commutative83.4%
distribute-rgt-out83.4%
*-commutative83.4%
Simplified83.4%
Taylor expanded in y around 0 77.8%
Taylor expanded in t around 0 66.3%
associate-*r*82.8%
*-commutative82.8%
associate-*l*82.8%
Simplified82.8%
if -2.3999999999999999e-233 < a < 1.20000000000000005e-134Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around 0 95.0%
Final simplification80.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a (+ t (* z b))))))
(if (<= a -3e-65)
t_1
(if (<= a -4.6e-163)
(+ (* z y) (* a t))
(if (or (<= a -3.1e-201) (not (<= a 1.75e-126))) t_1 (+ x (* z y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * (t + (z * b)));
double tmp;
if (a <= -3e-65) {
tmp = t_1;
} else if (a <= -4.6e-163) {
tmp = (z * y) + (a * t);
} else if ((a <= -3.1e-201) || !(a <= 1.75e-126)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (a * (t + (z * b)))
if (a <= (-3d-65)) then
tmp = t_1
else if (a <= (-4.6d-163)) then
tmp = (z * y) + (a * t)
else if ((a <= (-3.1d-201)) .or. (.not. (a <= 1.75d-126))) then
tmp = t_1
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 t_1 = x + (a * (t + (z * b)));
double tmp;
if (a <= -3e-65) {
tmp = t_1;
} else if (a <= -4.6e-163) {
tmp = (z * y) + (a * t);
} else if ((a <= -3.1e-201) || !(a <= 1.75e-126)) {
tmp = t_1;
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * (t + (z * b))) tmp = 0 if a <= -3e-65: tmp = t_1 elif a <= -4.6e-163: tmp = (z * y) + (a * t) elif (a <= -3.1e-201) or not (a <= 1.75e-126): tmp = t_1 else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * Float64(t + Float64(z * b)))) tmp = 0.0 if (a <= -3e-65) tmp = t_1; elseif (a <= -4.6e-163) tmp = Float64(Float64(z * y) + Float64(a * t)); elseif ((a <= -3.1e-201) || !(a <= 1.75e-126)) tmp = t_1; else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (a * (t + (z * b))); tmp = 0.0; if (a <= -3e-65) tmp = t_1; elseif (a <= -4.6e-163) tmp = (z * y) + (a * t); elseif ((a <= -3.1e-201) || ~((a <= 1.75e-126))) tmp = t_1; else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3e-65], t$95$1, If[LessEqual[a, -4.6e-163], N[(N[(z * y), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -3.1e-201], N[Not[LessEqual[a, 1.75e-126]], $MachinePrecision]], t$95$1, N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -3 \cdot 10^{-65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -4.6 \cdot 10^{-163}:\\
\;\;\;\;z \cdot y + a \cdot t\\
\mathbf{elif}\;a \leq -3.1 \cdot 10^{-201} \lor \neg \left(a \leq 1.75 \cdot 10^{-126}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -2.99999999999999998e-65 or -4.5999999999999999e-163 < a < -3.0999999999999999e-201 or 1.75e-126 < a Initial program 91.3%
associate-+l+91.3%
+-commutative91.3%
fma-def91.3%
associate-*l*94.7%
*-commutative94.7%
*-commutative94.7%
distribute-rgt-out96.5%
*-commutative96.5%
Simplified96.5%
Taylor expanded in y around 0 87.7%
if -2.99999999999999998e-65 < a < -4.5999999999999999e-163Initial program 99.9%
associate-+l+99.9%
*-commutative99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in t around inf 88.6%
Taylor expanded in x around 0 79.5%
if -3.0999999999999999e-201 < a < 1.75e-126Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around 0 94.1%
Final simplification88.6%
(FPCore (x y z t a b) :precision binary64 (if (<= a -6e+220) (+ x (* a (+ t (* z b)))) (+ (+ x (* z y)) (+ (* z (* a b)) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -6e+220) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (z * y)) + ((z * (a * b)) + (a * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-6d+220)) then
tmp = x + (a * (t + (z * b)))
else
tmp = (x + (z * y)) + ((z * (a * b)) + (a * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -6e+220) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (z * y)) + ((z * (a * b)) + (a * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -6e+220: tmp = x + (a * (t + (z * b))) else: tmp = (x + (z * y)) + ((z * (a * b)) + (a * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -6e+220) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(Float64(x + Float64(z * y)) + Float64(Float64(z * Float64(a * b)) + Float64(a * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -6e+220) tmp = x + (a * (t + (z * b))); else tmp = (x + (z * y)) + ((z * (a * b)) + (a * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -6e+220], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{+220}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + z \cdot y\right) + \left(z \cdot \left(a \cdot b\right) + a \cdot t\right)\\
\end{array}
\end{array}
if a < -6.00000000000000048e220Initial program 82.7%
associate-+l+82.7%
+-commutative82.7%
fma-def82.7%
associate-*l*88.1%
*-commutative88.1%
*-commutative88.1%
distribute-rgt-out99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 99.9%
if -6.00000000000000048e220 < a Initial program 95.1%
associate-+l+95.1%
*-commutative95.1%
associate-*l*96.3%
Simplified96.3%
Final simplification96.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -1.45e+78)
(+ x (* z (+ y (* a b))))
(if (<= x 2.3e+89)
(+ (* z y) (* a (+ t (* z b))))
(+ (+ x (* z y)) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.45e+78) {
tmp = x + (z * (y + (a * b)));
} else if (x <= 2.3e+89) {
tmp = (z * y) + (a * (t + (z * b)));
} else {
tmp = (x + (z * y)) + (a * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-1.45d+78)) then
tmp = x + (z * (y + (a * b)))
else if (x <= 2.3d+89) then
tmp = (z * y) + (a * (t + (z * b)))
else
tmp = (x + (z * y)) + (a * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.45e+78) {
tmp = x + (z * (y + (a * b)));
} else if (x <= 2.3e+89) {
tmp = (z * y) + (a * (t + (z * b)));
} else {
tmp = (x + (z * y)) + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.45e+78: tmp = x + (z * (y + (a * b))) elif x <= 2.3e+89: tmp = (z * y) + (a * (t + (z * b))) else: tmp = (x + (z * y)) + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.45e+78) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); elseif (x <= 2.3e+89) tmp = Float64(Float64(z * y) + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(Float64(x + Float64(z * y)) + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.45e+78) tmp = x + (z * (y + (a * b))); elseif (x <= 2.3e+89) tmp = (z * y) + (a * (t + (z * b))); else tmp = (x + (z * y)) + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.45e+78], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.3e+89], N[(N[(z * y), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{+78}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+89}:\\
\;\;\;\;z \cdot y + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + z \cdot y\right) + a \cdot t\\
\end{array}
\end{array}
if x < -1.45000000000000008e78Initial program 93.8%
associate-+l+93.8%
*-commutative93.8%
associate-*l*97.8%
Simplified97.8%
Taylor expanded in t around 0 87.6%
+-commutative87.6%
associate-*r*91.5%
distribute-rgt-in93.6%
+-commutative93.6%
Simplified93.6%
if -1.45000000000000008e78 < x < 2.2999999999999999e89Initial program 95.7%
associate-+l+95.7%
+-commutative95.7%
fma-def95.7%
associate-*l*97.5%
*-commutative97.5%
*-commutative97.5%
distribute-rgt-out98.8%
*-commutative98.8%
Simplified98.8%
Taylor expanded in x around 0 92.2%
if 2.2999999999999999e89 < x Initial program 90.5%
associate-+l+90.5%
*-commutative90.5%
associate-*l*87.1%
Simplified87.1%
Taylor expanded in t around inf 87.2%
Final simplification91.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -5.1e+109)
x
(if (<= x -6.5e+37)
(* z y)
(if (<= x -6e-98)
(* a t)
(if (<= x -2.4e-293) (* z y) (if (<= x 4.6e+91) (* a t) x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5.1e+109) {
tmp = x;
} else if (x <= -6.5e+37) {
tmp = z * y;
} else if (x <= -6e-98) {
tmp = a * t;
} else if (x <= -2.4e-293) {
tmp = z * y;
} else if (x <= 4.6e+91) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-5.1d+109)) then
tmp = x
else if (x <= (-6.5d+37)) then
tmp = z * y
else if (x <= (-6d-98)) then
tmp = a * t
else if (x <= (-2.4d-293)) then
tmp = z * y
else if (x <= 4.6d+91) then
tmp = a * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5.1e+109) {
tmp = x;
} else if (x <= -6.5e+37) {
tmp = z * y;
} else if (x <= -6e-98) {
tmp = a * t;
} else if (x <= -2.4e-293) {
tmp = z * y;
} else if (x <= 4.6e+91) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -5.1e+109: tmp = x elif x <= -6.5e+37: tmp = z * y elif x <= -6e-98: tmp = a * t elif x <= -2.4e-293: tmp = z * y elif x <= 4.6e+91: tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -5.1e+109) tmp = x; elseif (x <= -6.5e+37) tmp = Float64(z * y); elseif (x <= -6e-98) tmp = Float64(a * t); elseif (x <= -2.4e-293) tmp = Float64(z * y); elseif (x <= 4.6e+91) tmp = Float64(a * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -5.1e+109) tmp = x; elseif (x <= -6.5e+37) tmp = z * y; elseif (x <= -6e-98) tmp = a * t; elseif (x <= -2.4e-293) tmp = z * y; elseif (x <= 4.6e+91) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -5.1e+109], x, If[LessEqual[x, -6.5e+37], N[(z * y), $MachinePrecision], If[LessEqual[x, -6e-98], N[(a * t), $MachinePrecision], If[LessEqual[x, -2.4e-293], N[(z * y), $MachinePrecision], If[LessEqual[x, 4.6e+91], N[(a * t), $MachinePrecision], x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.1 \cdot 10^{+109}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -6.5 \cdot 10^{+37}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-98}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq -2.4 \cdot 10^{-293}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+91}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.0999999999999999e109 or 4.59999999999999982e91 < x Initial program 92.5%
associate-+l+92.5%
*-commutative92.5%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in x around inf 55.6%
if -5.0999999999999999e109 < x < -6.4999999999999998e37 or -6e-98 < x < -2.3999999999999999e-293Initial program 94.7%
associate-+l+94.7%
*-commutative94.7%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in y around inf 45.1%
*-commutative45.1%
Simplified45.1%
if -6.4999999999999998e37 < x < -6e-98 or -2.3999999999999999e-293 < x < 4.59999999999999982e91Initial program 95.5%
associate-+l+95.5%
*-commutative95.5%
associate-*l*97.3%
Simplified97.3%
Taylor expanded in t around inf 79.1%
Taylor expanded in a around inf 48.4%
Final simplification50.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -5.6e-37) (not (<= a 4.8e-27))) (+ 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 <= -5.6e-37) || !(a <= 4.8e-27)) {
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 <= (-5.6d-37)) .or. (.not. (a <= 4.8d-27))) 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 <= -5.6e-37) || !(a <= 4.8e-27)) {
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 <= -5.6e-37) or not (a <= 4.8e-27): 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 <= -5.6e-37) || !(a <= 4.8e-27)) 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 <= -5.6e-37) || ~((a <= 4.8e-27))) 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, -5.6e-37], N[Not[LessEqual[a, 4.8e-27]], $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 -5.6 \cdot 10^{-37} \lor \neg \left(a \leq 4.8 \cdot 10^{-27}\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 < -5.6000000000000002e-37 or 4.80000000000000004e-27 < a Initial program 89.8%
associate-+l+89.8%
+-commutative89.8%
fma-def89.8%
associate-*l*95.8%
*-commutative95.8%
*-commutative95.8%
distribute-rgt-out97.9%
*-commutative97.9%
Simplified97.9%
Taylor expanded in y around 0 89.8%
if -5.6000000000000002e-37 < a < 4.80000000000000004e-27Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around 0 85.6%
+-commutative85.6%
associate-*r*90.5%
distribute-rgt-in90.5%
+-commutative90.5%
Simplified90.5%
Final simplification90.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -3.5e-53) (not (<= a 400000.0))) (+ x (* a (+ t (* z b)))) (+ (+ x (* z y)) (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.5e-53) || !(a <= 400000.0)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (z * y)) + (a * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-3.5d-53)) .or. (.not. (a <= 400000.0d0))) then
tmp = x + (a * (t + (z * b)))
else
tmp = (x + (z * y)) + (a * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.5e-53) || !(a <= 400000.0)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (z * y)) + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -3.5e-53) or not (a <= 400000.0): tmp = x + (a * (t + (z * b))) else: tmp = (x + (z * y)) + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.5e-53) || !(a <= 400000.0)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(Float64(x + Float64(z * y)) + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -3.5e-53) || ~((a <= 400000.0))) tmp = x + (a * (t + (z * b))); else tmp = (x + (z * y)) + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.5e-53], N[Not[LessEqual[a, 400000.0]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.5 \cdot 10^{-53} \lor \neg \left(a \leq 400000\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + z \cdot y\right) + a \cdot t\\
\end{array}
\end{array}
if a < -3.49999999999999993e-53 or 4e5 < a Initial program 89.3%
associate-+l+89.3%
+-commutative89.3%
fma-def89.3%
associate-*l*95.6%
*-commutative95.6%
*-commutative95.6%
distribute-rgt-out97.8%
*-commutative97.8%
Simplified97.8%
Taylor expanded in y around 0 91.5%
if -3.49999999999999993e-53 < a < 4e5Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around inf 90.5%
Final simplification91.0%
(FPCore (x y z t a b) :precision binary64 (if (<= a -2.8e+243) (* a (* z b)) (if (or (<= a -2.55e+38) (not (<= a 9.5e-27))) (* a t) (+ x (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.8e+243) {
tmp = a * (z * b);
} else if ((a <= -2.55e+38) || !(a <= 9.5e-27)) {
tmp = a * t;
} 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 <= (-2.8d+243)) then
tmp = a * (z * b)
else if ((a <= (-2.55d+38)) .or. (.not. (a <= 9.5d-27))) then
tmp = a * t
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 <= -2.8e+243) {
tmp = a * (z * b);
} else if ((a <= -2.55e+38) || !(a <= 9.5e-27)) {
tmp = a * t;
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.8e+243: tmp = a * (z * b) elif (a <= -2.55e+38) or not (a <= 9.5e-27): tmp = a * t else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.8e+243) tmp = Float64(a * Float64(z * b)); elseif ((a <= -2.55e+38) || !(a <= 9.5e-27)) tmp = Float64(a * t); 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 <= -2.8e+243) tmp = a * (z * b); elseif ((a <= -2.55e+38) || ~((a <= 9.5e-27))) tmp = a * t; else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.8e+243], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -2.55e+38], N[Not[LessEqual[a, 9.5e-27]], $MachinePrecision]], N[(a * t), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.8 \cdot 10^{+243}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq -2.55 \cdot 10^{+38} \lor \neg \left(a \leq 9.5 \cdot 10^{-27}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -2.7999999999999999e243Initial program 77.4%
associate-+l+77.4%
+-commutative77.4%
fma-def77.4%
associate-*l*84.5%
*-commutative84.5%
*-commutative84.5%
distribute-rgt-out99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in x around 0 92.2%
Taylor expanded in t around 0 69.5%
*-commutative69.5%
Simplified69.5%
if -2.7999999999999999e243 < a < -2.5500000000000001e38 or 9.50000000000000037e-27 < a Initial program 90.3%
associate-+l+90.3%
*-commutative90.3%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in t around inf 76.0%
Taylor expanded in a around inf 50.7%
if -2.5500000000000001e38 < a < 9.50000000000000037e-27Initial program 99.9%
associate-+l+99.9%
*-commutative99.9%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around 0 75.4%
Final simplification63.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.75e-51) (not (<= a 1.85e-126))) (* a (+ t (* z b))) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.75e-51) || !(a <= 1.85e-126)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (z * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-1.75d-51)) .or. (.not. (a <= 1.85d-126))) then
tmp = a * (t + (z * b))
else
tmp = x + (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.75e-51) || !(a <= 1.85e-126)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.75e-51) or not (a <= 1.85e-126): tmp = a * (t + (z * b)) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.75e-51) || !(a <= 1.85e-126)) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.75e-51) || ~((a <= 1.85e-126))) tmp = a * (t + (z * b)); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.75e-51], N[Not[LessEqual[a, 1.85e-126]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.75 \cdot 10^{-51} \lor \neg \left(a \leq 1.85 \cdot 10^{-126}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -1.7499999999999999e-51 or 1.85e-126 < a Initial program 90.7%
associate-+l+90.7%
+-commutative90.7%
fma-def90.7%
associate-*l*95.6%
*-commutative95.6%
*-commutative95.6%
distribute-rgt-out97.5%
*-commutative97.5%
Simplified97.5%
Taylor expanded in y around 0 88.0%
Taylor expanded in x around 0 72.8%
if -1.7499999999999999e-51 < a < 1.85e-126Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around 0 84.8%
Final simplification77.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.5e-47) (not (<= a 1.85e-126))) (+ x (* a t)) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.5e-47) || !(a <= 1.85e-126)) {
tmp = x + (a * t);
} 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.5d-47)) .or. (.not. (a <= 1.85d-126))) then
tmp = x + (a * t)
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.5e-47) || !(a <= 1.85e-126)) {
tmp = x + (a * t);
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.5e-47) or not (a <= 1.85e-126): tmp = x + (a * t) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.5e-47) || !(a <= 1.85e-126)) tmp = Float64(x + Float64(a * t)); 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.5e-47) || ~((a <= 1.85e-126))) tmp = x + (a * t); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.5e-47], N[Not[LessEqual[a, 1.85e-126]], $MachinePrecision]], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.5 \cdot 10^{-47} \lor \neg \left(a \leq 1.85 \cdot 10^{-126}\right):\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -1.50000000000000008e-47 or 1.85e-126 < a Initial program 90.6%
associate-+l+90.6%
*-commutative90.6%
associate-*l*91.2%
Simplified91.2%
Taylor expanded in z around 0 60.5%
+-commutative60.5%
Simplified60.5%
if -1.50000000000000008e-47 < a < 1.85e-126Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around 0 84.0%
Final simplification69.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -7.5e+77) x (if (<= x 4.2e+91) (* a t) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -7.5e+77) {
tmp = x;
} else if (x <= 4.2e+91) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-7.5d+77)) then
tmp = x
else if (x <= 4.2d+91) then
tmp = a * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -7.5e+77) {
tmp = x;
} else if (x <= 4.2e+91) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -7.5e+77: tmp = x elif x <= 4.2e+91: tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -7.5e+77) tmp = x; elseif (x <= 4.2e+91) tmp = Float64(a * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -7.5e+77) tmp = x; elseif (x <= 4.2e+91) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -7.5e+77], x, If[LessEqual[x, 4.2e+91], N[(a * t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{+77}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+91}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -7.49999999999999955e77 or 4.20000000000000015e91 < x Initial program 91.0%
associate-+l+91.0%
*-commutative91.0%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in x around inf 53.4%
if -7.49999999999999955e77 < x < 4.20000000000000015e91Initial program 96.3%
associate-+l+96.3%
*-commutative96.3%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in t around inf 77.9%
Taylor expanded in a around inf 41.7%
Final simplification46.2%
(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 94.3%
associate-+l+94.3%
*-commutative94.3%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in x around inf 25.7%
Final simplification25.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 2023310
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:herbie-target
(if (< z -11820553527347888000.0) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))